Browse Source

Merge pull request #130 from PostCyberPunk/clip

feat(clipboard manager enhancement) Ctl del to delete and entry. Alt del to carry out cliphist wipe
pull/133/head
Ja.KooLit 2 years ago committed by GitHub
parent
commit
a286a2adaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 43
      config/hypr/scripts/ClipManager.sh

43
config/hypr/scripts/ClipManager.sh

@ -1,9 +1,40 @@
#!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Clipboard Manager. This needed cliphist & wl-copy and of course rofi
# Clipboard Manager. This script uses cliphist, rofi, and wl-copy.
# Actions:
# CTRL Del to delete an entry
# ALT Del to wipe clipboard contents
while true; do
result=$(
rofi -dmenu \
-kb-custom-1 "Control-Delete" \
-kb-custom-2 "Alt-Delete" \
-config ~/.config/rofi/config-clipboard.rasi < <(cliphist list)
)
case "$?" in
1)
exit
;;
0)
case "$result" in
"")
continue
;;
*)
cliphist decode <<<"$result" | wl-copy
exit
;;
esac
;;
10)
cliphist delete <<<"$result"
;;
11)
cliphist wipe
;;
esac
done
if [[ ! $(pidof rofi) ]]; then
cliphist list | rofi -dmenu -config ~/.config/rofi/config-long.rasi | cliphist decode | wl-copy
else
pkill rofi
fi

Loading…
Cancel
Save