From c80f2b30b723f31d29079fc0ab44b247fd260286 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 1 Dec 2020 17:20:44 +0100 Subject: [PATCH] Enable DELAYED_MODE for scrot --- printscreen | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/printscreen b/printscreen index ccfa962..bc20b01 100755 --- a/printscreen +++ b/printscreen @@ -87,20 +87,37 @@ fi ## Use Flameshot if available {{{ if [ "$(command -v flameshot)" ]; then if [ "${DELAYED_MODE}" -eq "0" ]; then + debug_message "Flameshot tool − \ +DELAYED_MODE enabled." ## Convert delay screenshot to milliseconds delay_screenshot="$(( ${delay_screenshot} * 1000 ))" ## Open flameshot after "${delay_screenshot}" seconds flameshot gui --path /tmp --delay "${delay_screenshot}" else + debug_message "Flameshot tool − \ +Capture with gui." ## Open flameshot flameshot gui --path /tmp --delay 50 fi ## }}} else ## Use Scrot {{{ - # -s : Interactively select a window or rectangle with the mouse. - # -e : Directly open the screenshot with Gimp then delete it - - scrot -s -m -e 'gimp $f ; mv $f /tmp/' + debug_message "Scrot tool − \ +You might consider installing `flameshot`." + ## --delay : Wait NUM seconds before taking a shot. + ## --select : Interactively select a window or rectangle with the mouse. + ## --multidisp : For multiple heads, grab shot from each and join them together. + ## --exec : Directly open the screenshot with Gimp then delete it + if [ "${DELAYED_MODE}" -eq "0" ]; then + debug_message "Scrot tool − \ +DELAYED_MODE enabled." + ## Take a full screenshot because + ### mouse couldn't be grab if already used in another app + scrot --delay "${delay_screenshot}" --multidisp --exec 'gimp $f ; mv $f /tmp/' + else + debug_message "Scrot tool − \ +Capture with select." + scrot --select --multidisp --exec 'gimp $f ; mv $f /tmp/' + fi fi ## }}}