compatibility with megapixels 0.16: power button takes a picture instead of toggling the keyboard, only when megapixels is active

This commit is contained in:
Maarten van Gompel 2021-03-28 22:15:25 +02:00
parent c4caf932ff
commit e0cff05b0c

View file

@ -7,5 +7,11 @@
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/powerbutton" ]; then if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/powerbutton" ]; then
"$XDG_CONFIG_HOME/sxmo/hooks/powerbutton" "$XDG_CONFIG_HOME/sxmo/hooks/powerbutton"
else else
sxmo_keyboard.sh toggle XPROPOUT="$(xprop -id "$(xdotool getactivewindow)")"
WMCLASS="${1:-$(echo "$XPROPOUT" | grep WM_CLASS | cut -d ' ' -f3-)}"
if echo "$WMCLASS" | grep -i "megapixels"; then
xdotool key --clearmodifiers "space"
else
sxmo_keyboard.sh toggle
fi
fi fi