From 67a23c01e9c826e4cb2aec64b74e05b8937a1b63 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 24 May 2023 09:00:36 +0000 Subject: [PATCH] sxmo: allow full 180 rotation --- .../sxmo-utils/0004-full-auto-rotate.patch | 13 +++++++++++++ pkgs/additional/sxmo-utils/default.nix | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 pkgs/additional/sxmo-utils/0004-full-auto-rotate.patch diff --git a/pkgs/additional/sxmo-utils/0004-full-auto-rotate.patch b/pkgs/additional/sxmo-utils/0004-full-auto-rotate.patch new file mode 100644 index 00000000..c2045512 --- /dev/null +++ b/pkgs/additional/sxmo-utils/0004-full-auto-rotate.patch @@ -0,0 +1,13 @@ +diff --git a/scripts/core/sxmo_autorotate.sh b/scripts/core/sxmo_autorotate.sh +index 58e3f4b..cbf0163 100755 +--- a/scripts/core/sxmo_autorotate.sh ++++ b/scripts/core/sxmo_autorotate.sh +@@ -18,6 +18,8 @@ while true; do + x_raw="$(cat "$FILE_X")" + if [ "$x_raw" -ge "$RIGHT_SIDE_UP" ] && sxmo_rotate.sh isrotated ; then + sxmo_rotate.sh rotnormal ++ elif [ "$x_raw" -le "$UPSIDE_DOWN" ] && [ "$(sxmo_rotate.sh isrotated)" != "invert" ]; then ++ sxmo_rotate.sh rotinvert + elif [ "$y_raw" -le "$UPSIDE_DOWN" ] && [ "$(sxmo_rotate.sh isrotated)" != "right" ]; then + sxmo_rotate.sh rotright + elif [ "$y_raw" -ge "$RIGHT_SIDE_UP" ] && [ "$(sxmo_rotate.sh isrotated)" != "left" ]; then diff --git a/pkgs/additional/sxmo-utils/default.nix b/pkgs/additional/sxmo-utils/default.nix index cf5c2266..c28f6c7b 100644 --- a/pkgs/additional/sxmo-utils/default.nix +++ b/pkgs/additional/sxmo-utils/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { }; patches = [ + # needed for basic use: ./0001-group-differs-from-user.patch ./0002-ensure-log-dir.patch ./0003-fix-xkb-paths.patch + + # personal preferences: + ./0004-full-auto-rotate.patch ]; postPatch = ''