diff options
| author | Ja.KooLit <jimmielovejay@gmail.com> | 2024-01-17 05:45:05 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-17 05:45:05 +0900 |
| commit | ffd8ce7793c0b6812f524f49aa10795aa467656d (patch) | |
| tree | 217e2b789a2463e8d4fbe7b95134b5cd9566acd0 /config/hypr/scripts | |
| parent | 870f5c7b7539744b626c713c95bc9983c8bde44d (diff) | |
| parent | f737762606a3169823240b2657f5430f09d1a11a (diff) | |
Merge pull request #133 from JaKooLit/development
Development
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/ClipManager.sh | 43 | ||||
| -rwxr-xr-x | config/hypr/scripts/WaybarCava.sh | 3 |
2 files changed, 40 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 diff --git a/config/hypr/scripts/WaybarCava.sh b/config/hypr/scripts/WaybarCava.sh index 77fce82a..711f4c62 100755 --- a/config/hypr/scripts/WaybarCava.sh +++ b/config/hypr/scripts/WaybarCava.sh @@ -28,5 +28,8 @@ data_format = ascii ascii_max_range = 7 EOF +# Kill cava if it's already running +pkill -f "cava -p $config_file" + # Read stdout from cava and perform substitution in a single sed command cava -p "$config_file" | sed -u "$dict" |
