From 5c56957b8728d6b5fc513b331d8f1fb7f06f8688 Mon Sep 17 00:00:00 2001 From: PostCyberPunk Date: Sun, 7 Jan 2024 20:07:07 +0800 Subject: feat(clipboard):Control+Delete to remove entry --- config/hypr/scripts/ClipManager.sh | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'config/hypr/scripts') 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 -- cgit v1.2.3 From ded28ab85a197efbdea865d250593cc402e01f19 Mon Sep 17 00:00:00 2001 From: Luka Momčilović Date: Mon, 8 Jan 2024 21:35:34 +0100 Subject: fix(waybar): fix cava creating multiple instances WaybarCava was creating a new instance of cava every time it was executed. This happens when waybar is restarted/wallpaper is changed Fixed by killing cava process referencing the same config Fix: #131 --- config/hypr/scripts/WaybarCava.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config/hypr/scripts') 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" -- cgit v1.2.3 From 82baf3e31dce375f32678117df1522f4cf9756fc Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" Date: Wed, 17 Jan 2024 05:39:46 +0900 Subject: Update ClipManager.sh --- config/hypr/scripts/ClipManager.sh | 60 +++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 21 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/ClipManager.sh b/config/hypr/scripts/ClipManager.sh index aebf87ef..682174fc 100755 --- a/config/hypr/scripts/ClipManager.sh +++ b/config/hypr/scripts/ClipManager.sh @@ -1,22 +1,40 @@ -#!/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 +#!/bin/bash +## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# 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 + -- cgit v1.2.3