]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Adding a systemd script to monitor lid changes
authorChristophe-Marie Duquesne <chmd@chmd.fr>
Sun, 3 Nov 2019 22:59:29 +0000 (23:59 +0100)
committerChristophe-Marie Duquesne <chmd@chmd.fr>
Sun, 3 Nov 2019 22:59:29 +0000 (23:59 +0100)
contrib/systemd/autorandr-lid-listener.service [new file with mode: 0644]

diff --git a/contrib/systemd/autorandr-lid-listener.service b/contrib/systemd/autorandr-lid-listener.service
new file mode 100644 (file)
index 0000000..7e45438
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=Runs autorandr whenever the lid state changes
+
+[Service]
+Type=simple
+ExecStart=bash -c "stdbuf -oL libinput debug-events | grep --line-buffered SWITCH_TOGGLE | while read line; do autorandr --batch --change --default default; done"
+Restart=always
+RestartSec=30
+SyslogIdentifier=autorandr
+
+[Install]
+WantedBy=multi-user.target