Enable DELAYED_MODE for scrot

This commit is contained in:
gardouille 2020-12-01 17:20:44 +01:00
parent 4a04e746dd
commit c80f2b30b7
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 21 additions and 4 deletions

View File

@ -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
## }}}