From a40e9e2c43547e1ec3382c5a2ddf88169112bd89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Pizarro?= Date: Sun, 12 Jul 2026 11:16:33 -0400 Subject: [PATCH] fix(script): When no item is selected from the clipboard history, the currently loaded item is no longer deleted. --- dotfiles/.config/ml4w/scripts/ml4w-cliphist | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dotfiles/.config/ml4w/scripts/ml4w-cliphist b/dotfiles/.config/ml4w/scripts/ml4w-cliphist index 55c0d5937..24274f705 100755 --- a/dotfiles/.config/ml4w/scripts/ml4w-cliphist +++ b/dotfiles/.config/ml4w/scripts/ml4w-cliphist @@ -6,7 +6,6 @@ # \____|_|_| .__/|_| |_|_|___/\__| # |_| # - # ----------------------------------------------------- # Load Launcher # ----------------------------------------------------- @@ -16,13 +15,17 @@ if [ "$launcher" == "walker" ]; then else case $1 in d) - cliphist list | rofi -dmenu -replace -config ~/.config/rofi/config-cliphist.rasi | cliphist delete + selected=$(cliphist list | rofi -dmenu -replace -config ~/.config/rofi/config-cliphist.rasi) + [ -z "$selected" ] && exit 0 + echo "$selected" | cliphist delete ;; - w) + w) cliphist wipe ;; *) - cliphist list | rofi -dmenu -replace -config ~/.config/rofi/config-cliphist.rasi | cliphist decode | wl-copy + selected=$(cliphist list | rofi -dmenu -replace -config ~/.config/rofi/config-cliphist.rasi) + [ -z "$selected" ] && exit 0 + echo "$selected" | cliphist decode | wl-copy ;; esac -fi +fi \ No newline at end of file