Adding a systemd script to monitor lid changes

This commit is contained in:
Christophe-Marie Duquesne 2019-11-03 23:59:29 +01:00
parent 17aacb0185
commit 5366a5dc37
1 changed files with 12 additions and 0 deletions

View File

@ -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