Files
hyprland/config/hypr/scripts/ClipManager.sh
T
2024-01-18 14:36:22 +05:45

41 lines
909 B
Bash
Executable File

#!/bin/bash
# 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" \
-p "CTRL Del - Cliphist del || Alt Del - cliphist wipe" \
-config ~/.config/rofi/config-long.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