summarylogtreecommitdiffstats
path: root/display-switch.service
diff options
context:
space:
mode:
authorTriss Healy2022-08-22 15:19:42 +1000
committerTriss Healy2022-08-22 15:19:42 +1000
commit6e1ed103c33b6c20b17132c00daf245defdf3f90 (patch)
treefbbf8cc2b4f658845c34525ebb55df1f46ffb125 /display-switch.service
downloadaur-6e1ed103c33b6c20b17132c00daf245defdf3f90.tar.gz
Initial commit
Diffstat (limited to 'display-switch.service')
-rw-r--r--display-switch.service26
1 files changed, 26 insertions, 0 deletions
diff --git a/display-switch.service b/display-switch.service
new file mode 100644
index 000000000000..1ac642dfbf16
--- /dev/null
+++ b/display-switch.service
@@ -0,0 +1,26 @@
+[Unit]
+Description=display-switch automatic DDC display switcher
+After=graphical.target
+
+[Service]
+Type=simple
+StandardOutput=journal
+Restart=always
+
+DynamicUser=yes
+SupplementaryGroups=i2c
+
+LogsDirectory=display-switch
+StateDirectory=display-switch
+
+# There's a lot of finagling to get display_switch to put the files in a normal place.
+Environment=HOME=/var/lib/display-switch
+
+ExecStartPre=mkdir -p /var/lib/display-switch/.config/display-switch
+ExecStartPre=ln -sf /etc/display-switch/display-switch.ini /var/lib/display-switch/.config/display-switch
+ExecStartPre=mkdir -p /var/lib/display-switch/.local/share/
+ExecStartPre=ln -sf /var/log/display-switch /var/lib/display-switch/.local/share/display-switch
+ExecStart=/usr/bin/display_switch
+
+[Install]
+WantedBy=multi-user.target