Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
---
.../one_button_e_reader/sxmo_hook_unlock.sh | 5 ++++-
.../default_hooks/sxmo_hook_contextmenu.sh | 2 +-
configs/default_hooks/sxmo_hook_start.sh | 4 +++-
scripts/core/sxmo_rotate.sh | 22 ++++++++++++-------
4 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/configs/default_hooks/one_button_e_reader/sxmo_hook_unlock.sh b/configs/default_hooks/one_button_e_reader/sxmo_hook_unlock.sh
index 6fff2e6..ab19a50 100755
--- a/configs/default_hooks/one_button_e_reader/sxmo_hook_unlock.sh
+++ b/configs/default_hooks/one_button_e_reader/sxmo_hook_unlock.sh
@@ -18,7 +18,10 @@ sxmo_hook_statusbar.sh state_change &
sxmo_wm.sh dpms off
sxmo_wm.sh inputevent touchscreen on
sxmo_wm.sh inputevent stylus on
-superctl start sxmo_hook_lisgd
+
+if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
+ superctl start sxmo_hook_lisgd
+fi
# suspend after if no activity after 120s
sxmo_daemons.sh start idle_locker sxmo_idle.sh -w \
diff --git a/configs/default_hooks/sxmo_hook_contextmenu.sh b/configs/default_hooks/sxmo_hook_contextmenu.sh
index 2ee8ab5..6a0a09c 100755
--- a/configs/default_hooks/sxmo_hook_contextmenu.sh
@@ -74,7 +74,7 @@ case "$WMCLASS" in
$icon_cfg Gestures $(
superd_service_isrunning "sxmo_hook_lisgd" &&
printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
- ) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd'
+ ) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd' && (rm $XDG_CACHE_HOME/sxmo/sxmo.nogesture || touch $XDG_CACHE_HOME/sxmo/sxmo.nogesture)
$icon_cfg Toggle Bar ^ 0 ^ sxmo_wm.sh togglebar
$icon_bth Bluetooth $(
rfkill list bluetooth | grep -q "yes" &&
diff --git a/configs/default_hooks/sxmo_hook_start.sh b/configs/default_hooks/sxmo_hook_start.sh
index e0fa6d9..70b72ff 100755
--- a/configs/default_hooks/sxmo_hook_start.sh
+++ b/configs/default_hooks/sxmo_hook_start.sh
@@ -70,7 +70,9 @@ if [ -w "/sys/power/wakeup_count" ] && [ -f "/sys/power/wake_lock" ]; then
fi
# Turn on lisgd
-superctl start sxmo_hook_lisgd
+if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
+ superctl start sxmo_hook_lisgd
+fi
if [ "$(command -v ModemManager)" ]; then
# Turn on the dbus-monitors for modem-related tasks
diff --git a/scripts/core/sxmo_rotate.sh b/scripts/core/sxmo_rotate.sh
index 159236f..9f8fcb6 100755
--- a/scripts/core/sxmo_rotate.sh
+++ b/scripts/core/sxmo_rotate.sh
@@ -19,6 +19,12 @@ swayfocusedname() {
swaymsg -t get_outputs | jq -r '.[] | select(.focused == true) | .name'
}
+restart_sxmo_hook_lisgd() {
+ if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
+ superctl restart sxmo_hook_lisgd
+ fi
+}
+
xorgisrotated() {
rotation="$(
xrandr | grep primary | cut -d' ' -f 5 | sed s/\(//
@@ -45,14 +51,14 @@ xorgrotinvert() {
sxmo_keyboard.sh close
xrandr -o inverted
applyptrmatrix -1 0 1 0 -1 1 0 0 1
- superctl restart sxmo_hook_lisgd
+ restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh invert
exit 0
}
swayrotinvert() {
swaymsg -- output "-" transform 180
- superctl restart sxmo_hook_lisgd
+ restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh invert
exit 0
}
@@ -61,14 +67,14 @@ xorgrotnormal() {
sxmo_keyboard.sh close
xrandr -o normal
applyptrmatrix 0 0 0 0 0 0 0 0 0
- superctl restart sxmo_hook_lisgd
+ restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh normal
exit 0
}
swayrotnormal() {
swaymsg -- output "-" transform 0
- superctl restart sxmo_hook_lisgd
+ restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh normal
exit 0
}
@@ -77,14 +83,14 @@ xorgrotright() {
sxmo_keyboard.sh close
xrandr -o right
applyptrmatrix 0 1 0 -1 0 1 0 0 1
- superctl restart sxmo_hook_lisgd
+ restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh right
exit 0
}
swayrotright() {
swaymsg -- output "-" transform 90
- superctl restart sxmo_hook_lisgd
+ restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh right
exit 0
}
@@ -93,14 +99,14 @@ xorgrotleft() {
sxmo_keyboard.sh close
xrandr -o left
applyptrmatrix 0 -1 1 1 0 0 0 0 1
- superctl restart sxmo_hook_lisgd
+ restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh left
exit 0
}
swayrotleft() {
swaymsg -- output "-" transform 270
- superctl restart sxmo_hook_lisgd
+ restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh left
exit 0
}
--
2.41.0
> + ) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd' && (rm $XDG_CACHE_HOME/sxmo/sxmo.nogesture || touch $XDG_CACHE_HOME/sxmo/sxmo.nogesture)
When you do a `rm "$FILE" || touch "$FILE"`,
please add 2>/dev/null so we don't get noise in our logs every time we hit the 'or' condition.
e.g.
(rm "$XDG_CACHE_HOME/sxmo/sxmo.nogesture" 2>/dev/null || touch "$XDG_CACHE_HOME/sxmo/sxmo.nogesture")
(I have a patch to fix this in a couple places, going to send in now)