From a10e31257a8237ec0d5521b01690174c01967510 Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 16 Jul 2023 12:55:34 +0000 Subject: [PATCH] sxmo-utils: sxmo_rotate: don't restart lisgd on sway --- .../sxmo-utils/0106-no-restart-lisgd.patch | 48 +++++++++++++++++++ pkgs/additional/sxmo-utils/default.nix | 1 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/additional/sxmo-utils/0106-no-restart-lisgd.patch diff --git a/pkgs/additional/sxmo-utils/0106-no-restart-lisgd.patch b/pkgs/additional/sxmo-utils/0106-no-restart-lisgd.patch new file mode 100644 index 00000000..8d2af013 --- /dev/null +++ b/pkgs/additional/sxmo-utils/0106-no-restart-lisgd.patch @@ -0,0 +1,48 @@ +commit 0b3ce90e74f4d063432170239f6a3aea0c2ad665 (HEAD -> dev/sane) +Author: Colin +Date: 2023-07-16 12:45:49 +0000 + + sxmo_rotate: don't restart lisgd on sway + + AFAICT we restart lisgd because it learns the orientation via its + `-o ` CLI argument. but we only pass that flag on dwm/x11, + not sway. restarting it on sway is wasteful, and potentially racy (i'm + able to get multiple lisgd's running just by enabling autorotate and + flipping the phone rapidly), so don't do that. + +diff --git a/scripts/core/sxmo_rotate.sh b/scripts/core/sxmo_rotate.sh +index 159236f..3a95657 100755 +--- a/scripts/core/sxmo_rotate.sh ++++ b/scripts/core/sxmo_rotate.sh +@@ -52,7 +52,6 @@ xorgrotinvert() { + + swayrotinvert() { + swaymsg -- output "-" transform 180 +- superctl restart sxmo_hook_lisgd + sxmo_hook_rotate.sh invert + exit 0 + } +@@ -68,7 +67,6 @@ xorgrotnormal() { + + swayrotnormal() { + swaymsg -- output "-" transform 0 +- superctl restart sxmo_hook_lisgd + sxmo_hook_rotate.sh normal + exit 0 + } +@@ -84,7 +82,6 @@ xorgrotright() { + + swayrotright() { + swaymsg -- output "-" transform 90 +- superctl restart sxmo_hook_lisgd + sxmo_hook_rotate.sh right + exit 0 + } +@@ -100,7 +97,6 @@ xorgrotleft() { + + swayrotleft() { + swaymsg -- output "-" transform 270 +- superctl restart sxmo_hook_lisgd + sxmo_hook_rotate.sh left + exit 0 + } diff --git a/pkgs/additional/sxmo-utils/default.nix b/pkgs/additional/sxmo-utils/default.nix index 07c7712e..f5a30ed3 100644 --- a/pkgs/additional/sxmo-utils/default.nix +++ b/pkgs/additional/sxmo-utils/default.nix @@ -110,6 +110,7 @@ stdenv.mkDerivation rec { }) ./0104-full-auto-rotate.patch ./0105-more-apps.patch + ./0106-no-restart-lisgd.patch ]; postPatch = ''