aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorPostCyberPunk <lyhguest2@outlook.com>2024-01-07 20:07:07 +0800
committerPostCyberPunk <lyhguest2@outlook.com>2024-01-07 20:07:07 +0800
commit5c56957b8728d6b5fc513b331d8f1fb7f06f8688 (patch)
treeddc055d03b348a8faf4bb08f02265b638642c86b /config
parent870f5c7b7539744b626c713c95bc9983c8bde44d (diff)
feat(clipboard):Control+Delete to remove entry
Diffstat (limited to 'config')
-rwxr-xr-xconfig/hypr/scripts/ClipManager.sh31
1 files changed, 22 insertions, 9 deletions
diff --git a/config/hypr/scripts/ClipManager.sh b/config/hypr/scripts/ClipManager.sh
index ee6b512f..aebf87ef 100755
--- a/config/hypr/scripts/ClipManager.sh
+++ b/config/hypr/scripts/ClipManager.sh
@@ -1,9 +1,22 @@
-#!/bin/bash
-## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
-# Clipboard Manager. This needed cliphist & wl-copy and of course rofi
-
-if [[ ! $(pidof rofi) ]]; then
- cliphist list | rofi -dmenu -config ~/.config/rofi/config-long.rasi | cliphist decode | wl-copy
-else
- pkill rofi
-fi
+#!/usr/bin/env bash
+#
+while [[ true ]]; do
+ result=$(
+ cliphist list | rofi -dmenu \
+ -kb-custom-1 "Control-Delete" \
+ -config ~/.config/rofi/config-long.rasi
+ )
+ exit_state=$?
+ if [[ $exit_state -eq 1 ]]; then
+ exit
+ fi
+ case "$exit_state" in
+ 0)
+ cliphist decode <<<$result | wl-copy
+ exit
+ ;;
+ 10)
+ cliphist delete <<<$result
+ ;;
+ esac
+done
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage