From 6d13dec3e3cd7b1e058e8c414f42fd4d1bbad5b6 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 18 Jan 2022 14:43:20 +0300 Subject: [PATCH] Add some systemd user units Mostly for systemd integration of sway stuff. See: https://github.com/swaywm/sway/wiki/Systemd-integration --- systemd/kanshi.service | 11 +++++++++++ systemd/sway-session.target | 7 +++++++ systemd/swayidle.service | 17 +++++++++++++++++ systemd/wob.service | 12 ++++++++++++ systemd/wob.socket | 6 ++++++ 5 files changed, 53 insertions(+) create mode 100644 systemd/kanshi.service create mode 100644 systemd/sway-session.target create mode 100644 systemd/swayidle.service create mode 100644 systemd/wob.service create mode 100644 systemd/wob.socket diff --git a/systemd/kanshi.service b/systemd/kanshi.service new file mode 100644 index 0000000..2ddabce --- /dev/null +++ b/systemd/kanshi.service @@ -0,0 +1,11 @@ +[Unit] +Description=Dynamic output configuration for Wayland compositors +Documentation=https://github.com/emersion/kanshi +BindsTo=sway-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/kanshi + +[Install] +WantedBy=sway-session.target diff --git a/systemd/sway-session.target b/systemd/sway-session.target new file mode 100644 index 0000000..45b381a --- /dev/null +++ b/systemd/sway-session.target @@ -0,0 +1,7 @@ +# See: https://github.com/swaywm/sway/wiki/Systemd-integration +[Unit] +Description=sway compositor session +Documentation=man:systemd.special(7) +BindsTo=graphical-session.target +Wants=graphical-session-pre.target +After=graphical-session-pre.target diff --git a/systemd/swayidle.service b/systemd/swayidle.service new file mode 100644 index 0000000..42a53ba --- /dev/null +++ b/systemd/swayidle.service @@ -0,0 +1,17 @@ +[Unit] +Description=Idle manager for Wayland +Documentation=man:swayidle(1) +BindsTo=sway-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/swayidle -w \ + timeout 300 'swaylock -f -c 000000 \ + -i /home/aorth/Downloads/3121px-Jerusalem-2013-Temple_Mount-Dome_of_the_Rock-Detail_01.jpg' \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f -c 000000 \ + -i /home/aorth/Downloads/3121px-Jerusalem-2013-Temple_Mount-Dome_of_the_Rock-Detail_01.jpg' + +[Install] +WantedBy=sway-session.target diff --git a/systemd/wob.service b/systemd/wob.service new file mode 100644 index 0000000..ab1c78c --- /dev/null +++ b/systemd/wob.service @@ -0,0 +1,12 @@ +[Unit] +Description=A lightweight overlay volume/backlight/progress/anything bar for Wayland +Documentation=man:wob(1) +BindsTo=sway-session.target +ConditionEnvironment=WAYLAND_DISPLAY + +[Service] +StandardInput=socket +ExecStart=/usr/bin/wob + +[Install] +WantedBy=sway-session.target diff --git a/systemd/wob.socket b/systemd/wob.socket new file mode 100644 index 0000000..4946505 --- /dev/null +++ b/systemd/wob.socket @@ -0,0 +1,6 @@ +[Socket] +ListenFIFO=%t/wob.sock +SocketMode=0600 + +[Install] +WantedBy=sockets.target