diff options
| author | Lukasz Kasprzak <lukasz.kasprzak@pm.me> | 2026-01-23 12:48:30 +0100 |
|---|---|---|
| committer | Lukasz Kasprzak <lukasz.kasprzak@pm.me> | 2026-01-23 12:48:30 +0100 |
| commit | 97f968a30e7dc28f6d99bfbaae8a4aeefb6ad525 (patch) | |
| tree | 5a250224ab69a04f05be2f757af86bfee9a7fec0 /rofi-vim-power | |
| parent | a00f92fdb6062af011d98ba8af6ddf0713fa7b3e (diff) | |
| download | bin-97f968a30e7dc28f6d99bfbaae8a4aeefb6ad525.tar.gz bin-97f968a30e7dc28f6d99bfbaae8a4aeefb6ad525.zip | |
added all of my scripts
Diffstat (limited to 'rofi-vim-power')
| -rwxr-xr-x | rofi-vim-power | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/rofi-vim-power b/rofi-vim-power new file mode 100755 index 0000000..3673119 --- /dev/null +++ b/rofi-vim-power @@ -0,0 +1,26 @@ +#!/bin/sh +set -eu + +DB="$HOME/.local/share/cheat-sheets/vim-power.tsv" + +[ -f "$DB" ] || exit 1 + +choice="$( + cat "$DB" | + rofi -dmenu -i -p 'Vim power ›' +)" + +[ -n "${choice:-}" ] || exit 0 + +# First column = keystrokes +keys="$(printf '%s' "$choice" | cut -f1)" + +# Clipboard (Wayland/X11) +if command -v wl-copy >/dev/null 2>&1; then + printf '%s' "$keys" | wl-copy +elif command -v xclip >/dev/null 2>&1; then + printf '%s' "$keys" | xclip -selection clipboard +else + printf '%s\n' "$keys" +fi + |
