Enable DELAYED_MODE for scrot

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

View File

@ -87,20 +87,37 @@ fi
## Use Flameshot if available {{{ ## Use Flameshot if available {{{
if [ "$(command -v flameshot)" ]; then if [ "$(command -v flameshot)" ]; then
if [ "${DELAYED_MODE}" -eq "0" ]; then if [ "${DELAYED_MODE}" -eq "0" ]; then
debug_message "Flameshot tool \
DELAYED_MODE enabled."
## Convert delay screenshot to milliseconds ## Convert delay screenshot to milliseconds
delay_screenshot="$(( ${delay_screenshot} * 1000 ))" delay_screenshot="$(( ${delay_screenshot} * 1000 ))"
## Open flameshot after "${delay_screenshot}" seconds ## Open flameshot after "${delay_screenshot}" seconds
flameshot gui --path /tmp --delay "${delay_screenshot}" flameshot gui --path /tmp --delay "${delay_screenshot}"
else else
debug_message "Flameshot tool \
Capture with gui."
## Open flameshot ## Open flameshot
flameshot gui --path /tmp --delay 50 flameshot gui --path /tmp --delay 50
fi fi
## }}} ## }}}
else ## Use Scrot {{{ else ## Use Scrot {{{
# -s: Interactively select a window or rectangle with the mouse. debug_message "Scrot tool \
# -e: Directly open the screenshot with Gimp then delete it You might consider installing `flameshot`."
## --delay: Wait NUM seconds before taking a shot.
scrot -s -m -e 'gimp $f ; mv $f /tmp/' ## --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 fi
## }}} ## }}}