From: Christophe-Marie Duquesne Date: Sun, 3 Nov 2019 22:59:29 +0000 (+0100) Subject: Adding a systemd script to monitor lid changes X-Git-Tag: 1.9~3^2~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5366a5dc3748524ab8b892cdd1b2e5bd07c009e0;p=deb_pkgs%2Fautorandr.git Adding a systemd script to monitor lid changes --- diff --git a/contrib/systemd/autorandr-lid-listener.service b/contrib/systemd/autorandr-lid-listener.service new file mode 100644 index 0000000..7e45438 --- /dev/null +++ b/contrib/systemd/autorandr-lid-listener.service @@ -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