diff options
| author | Ja.KooLit <jimmielovejay@gmail.com> | 2024-01-17 05:40:49 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-17 05:40:49 +0900 |
| commit | a286a2adaab2b87d4212098bd4a174ec84f68fd6 (patch) | |
| tree | dd3f16b5efb2e9434c4e73799ae5933193859f93 /config | |
| parent | 75e2b0360ba5ab9735711469351029a414950ec4 (diff) | |
| parent | 82baf3e31dce375f32678117df1522f4cf9756fc (diff) | |
Merge pull request #130 from PostCyberPunk/clip
feat(clipboard manager enhancement) Ctl del to delete and entry. Alt del to carry out cliphist wipe
Diffstat (limited to 'config')
| -rwxr-xr-x | config/hypr/scripts/ClipManager.sh | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/config/hypr/scripts/ClipManager.sh b/config/hypr/scripts/ClipManager.sh index ee6b512f..682174fc 100755 --- a/config/hypr/scripts/ClipManager.sh +++ b/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 |
