~mil/sxmo-utils

df41312cd5cd0e2f4e62e48e672d55deb69ac9af — Stacy Harper 29 days ago 8f413c1
Avoid superd issues with lisgd and bonsaid

Superd fail to manage correctly bonsai and lisgd daemons atm. It doesnt
stop/restart them correctly cause they start async process and their
pipes are used.

This is a superd issue but this break sxmo for a too long time. This
one could be reverted when superd is fixed.
M configs/default_hooks/one_button_e_reader/sxmo_hook_unlock.sh => configs/default_hooks/one_button_e_reader/sxmo_hook_unlock.sh +1 -1
@@ 16,7 16,7 @@ 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
sxmo_daemons.sh start sxmo_hook_lisgd sxmo_hook_lisgdstart.sh

# suspend after 30s
# the periodic mutex check is necessary to 'free' old mutex, I think.

M configs/default_hooks/sxmo_hook_contextmenu.sh => configs/default_hooks/sxmo_hook_contextmenu.sh +6 -2
@@ 14,10 14,14 @@
XPROPOUT="$(sxmo_wm.sh focusedwindow)"
WMCLASS="${1:-$(printf %s "$XPROPOUT" | grep app: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}"

service_isrunning() {
superd_service_isrunning() {
	superctl status "$1" | grep -q started
}

sxmo_service_isrunning() {
	sxmo_daemons.sh running "$1" > /dev/null
}

if [ -z "$XPROPOUT" ]; then
	sxmo_log "detected no active window, no problem, opening system menu"
else


@@ 67,7 71,7 @@ case "$WMCLASS" in
				printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent stylus on"
			)
			$icon_cfg Gestures $(
				service_isrunning "sxmo_hook_lisgd" &&
				sxmo_service_isrunning "sxmo_hook_lisgd" &&
				printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
			) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd'
			$icon_cfg Toggle Bar ^ 0 ^ sxmo_wm.sh togglebar

M configs/default_hooks/sxmo_hook_start.sh => configs/default_hooks/sxmo_hook_start.sh +1 -1
@@ 25,7 25,7 @@ case "$SXMO_WM" in
		superctl start mako
		superctl start sxmo_wob
		superctl start sxmo_menumode_toggler
		superctl start bonsaid
		rm -f "$XDG_RUNTIME_DIR/bonsai" && sxmo_daemons.sh start bonsaid bonsaid -t "$XDG_CONFIG_HOME/sxmo/bonsai_tree.json"
		;;
	dwm)
		superctl start dunst

M configs/default_hooks/three_button_touchscreen/sxmo_hook_screenoff.sh => configs/default_hooks/three_button_touchscreen/sxmo_hook_screenoff.sh +1 -1
@@ 17,7 17,7 @@ sxmo_hook_statusbar.sh state_change

sxmo_wm.sh dpms on
sxmo_wm.sh inputevent touchscreen off
superctl stop sxmo_hook_lisgd
sxmo_daemons.sh stop sxmo_hook_lisgd

wait "$LEDPID"


M configs/default_hooks/three_button_touchscreen/sxmo_hook_unlock.sh => configs/default_hooks/three_button_touchscreen/sxmo_hook_unlock.sh +1 -1
@@ 17,7 17,7 @@ sxmo_hook_statusbar.sh state_change

sxmo_wm.sh dpms off
sxmo_wm.sh inputevent touchscreen on
superctl start sxmo_hook_lisgd
sxmo_daemons.sh start sxmo_hook_lisgd sxmo_hook_lisgdstart.sh

wait "$LEDPID"


M scripts/core/sxmo_rotate.sh => scripts/core/sxmo_rotate.sh +8 -8
@@ 45,14 45,14 @@ xorgrotinvert() {
	sxmo_keyboard.sh close
	xrandr -o inverted
	applyptrmatrix -1 0 1 0 -1 1 0 0 1
	superctl restart sxmo_hook_lisgd
	sxmo_daemons.sh start sxmo_hook_lisgd sxmo_hook_lisgdstart.sh
	sxmo_hook_rotate.sh invert
	exit 0
}

swayrotinvert() {
	swaymsg -- output "-" transform 180
	superctl restart sxmo_hook_lisgd
	sxmo_daemons.sh start sxmo_hook_lisgd sxmo_hook_lisgdstart.sh
	sxmo_hook_rotate.sh invert
	exit 0
}


@@ 61,14 61,14 @@ xorgrotnormal() {
	sxmo_keyboard.sh close
	xrandr -o normal
	applyptrmatrix 0 0 0 0 0 0 0 0 0
	superctl restart sxmo_hook_lisgd
	sxmo_daemons.sh start sxmo_hook_lisgd sxmo_hook_lisgdstart.sh
	sxmo_hook_rotate.sh normal
	exit 0
}

swayrotnormal() {
	swaymsg -- output "-" transform 0
	superctl restart sxmo_hook_lisgd
	sxmo_daemons.sh start sxmo_hook_lisgd sxmo_hook_lisgdstart.sh
	sxmo_hook_rotate.sh normal
	exit 0
}


@@ 77,14 77,14 @@ xorgrotright() {
	sxmo_keyboard.sh close
	xrandr -o right
	applyptrmatrix 0 1 0 -1 0 1 0 0 1
	superctl restart sxmo_hook_lisgd
	sxmo_daemons.sh start sxmo_hook_lisgd sxmo_hook_lisgdstart.sh
	sxmo_hook_rotate.sh right
	exit 0
}

swayrotright() {
	swaymsg -- output "-" transform 90
	superctl restart sxmo_hook_lisgd
	sxmo_daemons.sh start sxmo_hook_lisgd sxmo_hook_lisgdstart.sh
	sxmo_hook_rotate.sh right
	exit 0
}


@@ 93,14 93,14 @@ xorgrotleft() {
	sxmo_keyboard.sh close
	xrandr -o left
	applyptrmatrix 0 -1 1 1 0 0 0 0 1
	superctl restart sxmo_hook_lisgd
	sxmo_daemons.sh start sxmo_hook_lisgd sxmo_hook_lisgdstart.sh
	sxmo_hook_rotate.sh left
	exit 0
}

swayrotleft() {
	swaymsg -- output "-" transform 270
	superctl restart sxmo_hook_lisgd
	sxmo_daemons.sh start sxmo_hook_lisgd sxmo_hook_lisgdstart.sh
	sxmo_hook_rotate.sh left
	exit 0
}