aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2024-01-17 05:40:49 +0900
committerGitHub <noreply@github.com>2024-01-17 05:40:49 +0900
commita286a2adaab2b87d4212098bd4a174ec84f68fd6 (patch)
treedd3f16b5efb2e9434c4e73799ae5933193859f93 /config/hypr
parent75e2b0360ba5ab9735711469351029a414950ec4 (diff)
parent82baf3e31dce375f32678117df1522f4cf9756fc (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/hypr')
-rwxr-xr-xconfig/hypr/scripts/ClipManager.sh43
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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage