~mil/sxmo-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
4 5

[PATCH sxmo-utils] Make config gesture toggle persistent

Details
Message ID
<20230721100513.20931-2-contact@willowbarraco.fr>
DKIM signature
missing
Download raw message
Patch: +22 -11
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
+++ b/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

[sxmo-utils/patches/test.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CU7RLJ8EGGID.19UW8CJQYX3DE@cirno2>
In-Reply-To
<20230721100513.20931-2-contact@willowbarraco.fr> (view parent)
DKIM signature
missing
Download raw message
sxmo-utils/patches/test.yml: SUCCESS in 46s

[Make config gesture toggle persistent][0] from [Willow Barraco][1]

[0]: https://lists.sr.ht/~mil/sxmo-devel/patches/42876
[1]: contact@willowbarraco.fr

✓ #1027588 SUCCESS sxmo-utils/patches/test.yml https://builds.sr.ht/~mil/job/1027588
Details
Message ID
<CU7TPHYDYHSB.3NRGYKSN5YFBA@oneplus-enchilada>
In-Reply-To
<20230721100513.20931-2-contact@willowbarraco.fr> (view parent)
DKIM signature
missing
Download raw message
> +			) ^ 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)
Details
Message ID
<CU7X8X0JGZRA.LEYCQY3E28OG@yellow-orcess>
In-Reply-To
<CU7TPHYDYHSB.3NRGYKSN5YFBA@oneplus-enchilada> (view parent)
DKIM signature
missing
Download raw message
Good idea, fixed on my tree!
Details
Message ID
<ZOyLav6_7TPShk20@durand.trilidun.org>
In-Reply-To
<CU7TPHYDYHSB.3NRGYKSN5YFBA@oneplus-enchilada> (view parent)
DKIM signature
missing
Download raw message
Applied!

--
sic dicit magister P
https://phartman.sites.luc.edu/
GPG keyID 0xE0DBD3D6 (CAE6 3A6F 755F 7BC3 36CA  330D B3E6 39C6 E0DB D3D6)
Reply to thread Export thread (mbox)