fix: prefer maim for screenshot

- Maim causes no errors and has region and window capabilities;
- Scrot region capture puts some weird borders when dragging the mouse;
- Spectacle allows editing but is too feature rich (complicated); and
- Xfce4-screenshooter does not allow selecting both region and window.

Fixes: https://github.com/ben-grande/qusal/issues/51
This commit is contained in:
Ben Grande 2024-05-24 22:56:32 +02:00
parent b09ecdceb9
commit 444672e999
No known key found for this signature in database
GPG Key ID: 00C64E14F51F9E56
2 changed files with 10 additions and 16 deletions

View File

@ -55,8 +55,8 @@ File outcome:
--move move file instead of copy --move move file instead of copy
Development mode: Development mode:
-D, --dialog-cmd dialog tool: kdialog, zenity -D, --dialog-cmd dialog tool: kdialog, zenity
-S, --screenshot-cmd screenshot tool: spectacle, xfce4-screenshooter, -S, --screenshot-cmd screenshot tool: maim, scrot, spectacle,
scrot, maim" xfce4-screenshooter"
exit 1 exit 1
} }
@ -156,26 +156,20 @@ if test -n "${screenshot_cmd_wanted}"; then
zenity) zenity --info --text "${msg}";; zenity) zenity --info --text "${msg}";;
kdialog) kdialog --msgbox "${msg}";; kdialog) kdialog --msgbox "${msg}";;
esac esac
msg="wanted screenshot program unsupported: ${screenshot_cmd_wanted}"
echo "[ERROR] ${msg}"
exit 1 exit 1
fi fi
case "${screenshot_cmd_wanted}" in
kdialog|zenity);;
*)
msg="wanted screenshot program unsupported: ${screenshot_cmd_wanted}"
echo "[ERROR] ${msg}"
exit 1
;;
esac
screenshot_cmd="${screenshot_cmd_wanted}" screenshot_cmd="${screenshot_cmd_wanted}"
else else
if command -v spectacle >/dev/null; then if command -v maim >/dev/null; then
screenshot_cmd="maim"
elif command -v scrot >/dev/null; then
screenshot_cmd="scrot"
elif command -v spectacle >/dev/null; then
screenshot_cmd="spectacle" screenshot_cmd="spectacle"
elif command -v xfce4-screenshooter >/dev/null; then elif command -v xfce4-screenshooter >/dev/null; then
screenshot_cmd="xfce4-screenshooter" screenshot_cmd="xfce4-screenshooter"
elif command -v scrot >/dev/null; then
screenshot_cmd="scrot"
elif command -v maim >/dev/null; then
screenshot_cmd="maim"
fi fi
if test -z "${screenshot_cmd}"; then if test -z "${screenshot_cmd}"; then
msg="screenshot programs not found: spectacle xfce4-screenshooter scrot maim" msg="screenshot programs not found: spectacle xfce4-screenshooter scrot maim"

View File

@ -19,7 +19,7 @@ include:
- skip_suggestions: True - skip_suggestions: True
- pkgs: - pkgs:
- zenity - zenity
- scrot - maim
"{{ slsdotpath }}-screenshot-script": "{{ slsdotpath }}-screenshot-script":
file.managed: file.managed: