From b89f42a3ac8d42da4c5ce4340c33a759dc703a4a Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Thu, 5 Sep 2024 11:47:27 +0200 Subject: some tweaks to make copying better --- mut/bin/maimpick | 20 ++++++++++++-------- mut/bin/passmenu | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'mut/bin') diff --git a/mut/bin/maimpick b/mut/bin/maimpick index 5de26c1..00a0c98 100755 --- a/mut/bin/maimpick +++ b/mut/bin/maimpick @@ -6,13 +6,17 @@ # variables output="$(date '+%y%m%d-%H%M-%S').png" -xclip_cmd="xclip -sel clip -t image/png" +clip() { + xclip -f -t image/png | xclip -sel c -t image/png +} -case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in - "a selected area") maim -u -s pic-selected-"${output}" ;; - "current window") maim -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;; - "full screen") maim -q -d 0.2 pic-full-"${output}" ;; - "a selected area (copy)") maim -u -s | ${xclip_cmd} ;; - "current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;; - "full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;; +case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (save)\\ncurrent window (save)\\nfull screen (save)" | dmenu -l 6 -i -p "Screenshot which area?")" in + "a selected area") maim -u -s | clip ;; + "current window") + echo "$(xdotool getactivewindow)" + maim -q -d 0.2 -i "$(xdotool getactivewindow)" | clip ;; + "full screen") maim -q -d 0.2 | clip ;; + "a selected area (save)") maim -u -s pic-selected-"${output}" ;; + "current window (save)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;; + "full screen (save)") maim -q -d 0.2 pic-full-"${output}" ;; esac diff --git a/mut/bin/passmenu b/mut/bin/passmenu index 1af4a02..345c0ae 100755 --- a/mut/bin/passmenu +++ b/mut/bin/passmenu @@ -20,6 +20,6 @@ fi [[ -n $password ]] || exit - pass show -c "$password" + pass show "$password" | head -n1 | xclip -f | xclip -f -sel c ) >/tmp/debug 2>&1 -- cgit v1.2.3