sxmo_dmenu.sh: do not set menu mode if the state isn't unlock

If a call is incomming and the proximity doesn't unlock the screen,
cause near initial state, or because it is bugged, then we was setting
the "menu" mode while screenoff. Which means the power button was
picking the dmenu entry instead of unlocking the device.

We disable the "menu" mode if the proximity lock turns the screen off,
so we should not set this mode if the initial state is screenoff.
This commit is contained in:
Willow Barraco
2023-09-18 09:25:23 +02:00
parent 598058494b
commit 37b50b6798

View File

@@ -43,11 +43,13 @@ case "$1" in
esac
if [ -n "$WAYLAND_DISPLAY" ]; then
swaymsg mode menu -q # disable default button inputs
cleanmode() {
swaymsg mode default -q
}
trap 'cleanmode' TERM INT
if grep -q unlock "$SXMO_STATE"; then
swaymsg mode menu -q # disable default button inputs
cleanmode() {
swaymsg mode default -q
}
trap 'cleanmode' TERM INT
fi
bemenu -l "$(sxmo_rotate.sh isrotated > /dev/null && \
printf %s "${SXMO_BEMENU_LANDSCAPE_LINES:-8}" || \