Fix X11 screenshotting

This commit is contained in:
Jacob 2023-09-13 20:40:33 +02:00
parent 9b9456a8ac
commit 78113baeaa

View file

@ -24,10 +24,10 @@ screenshot_take() {
[ "$2" = "true" ] && [ "$x11" != "true" ] && POS="$(slurp)"
if [ "$x11" = "true" ] && [ -x "$(command -v maim)" ]; then
[ "$2" = "true" ] && sel_arg="-s"
[ "$2" = "true" ] && sel_arg=s
[ "$3" = "true" ] && [ "$2" != "true" ] && cursor_arg=u
maim -"${sel_arg}""${cursor_arg}"B > "$1" || exit 1
maim -${sel_arg}${cursor_arg}B > "$1" || exit 1
elif [ -x "$(command -v slurp)" ] && [ -x "$(command -v grim)" ] && [ "$PREFER_WAYSHOT" != "true" ]; then
if [ "$2" = "true" ]; then
grim -g "$POS" - > "$1" || exit 1