From 5dea1ed7051a558bd9dba60ead2d706b0c675582 Mon Sep 17 00:00:00 2001 From: panotaka Date: Sun, 31 Dec 2023 16:18:21 -0400 Subject: [PATCH] Add auto-rotation support and sensor configuration This commit adds support for auto-rotation by enabling the hardware sensor and configuring the sensor.hwdb file. --- hosts/Blackbird/default.nix | 4 ++++ hosts/Blackbird/sensor.hwdb | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 hosts/Blackbird/sensor.hwdb diff --git a/hosts/Blackbird/default.nix b/hosts/Blackbird/default.nix index 72ceb5d..0747446 100644 --- a/hosts/Blackbird/default.nix +++ b/hosts/Blackbird/default.nix @@ -49,4 +49,8 @@ in { # Setup bluetooth hardware.bluetooth.enable = true; + + # Setup auto-rotaion + hardware.sensor.iio.enable = true; + environment.etc."/etc/udev/hwdb.d/61-gpd-pocket3-sensor-local.hwdb".source = ./sensor.hwdb; } diff --git a/hosts/Blackbird/sensor.hwdb b/hosts/Blackbird/sensor.hwdb new file mode 100644 index 0000000..e006db7 --- /dev/null +++ b/hosts/Blackbird/sensor.hwdb @@ -0,0 +1,2 @@ +sensor:modalias:* + ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 1, 0, 0 \ No newline at end of file