Files
dotfiles/dotfiles/.config/hypr/scripts/ClipManager.sh
2026-10-22 08:17:13 +01:00

52 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# HyprFlux — https://github.com/ahmad9059/HyprFlux
# Clipboard Manager. This script uses cliphist, rofi, and wl-copy.
# Variables
rofi_theme="$HOME/.config/rofi/launchers/type-4/style-4.rasi"
msg='👀 **note** CTRL DEL = cliphist del (entry) or ALT DEL - cliphist wipe (all)'
# Actions:
# CTRL Del to delete an entry
# ALT Del to wipe clipboard contents
# Check if rofi is already running
if pidof rofi > /dev/null; then
pkill rofi
fi
while true; do
result=$(
rofi -i -dmenu \
-kb-custom-1 "Control-Delete" \
-kb-custom-2 "Alt-Delete" \
-theme "$rofi_theme" \
-theme-str 'mainbox { children: [ "inputbar", "message", "listview" ]; }' \
< <(cliphist list) \
-mesg "$msg"
)
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