aboutsummaryrefslogtreecommitdiff
path: root/dot_config/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'dot_config/systemd')
-rw-r--r--dot_config/systemd/user/borgmatic@.service1
-rw-r--r--dot_config/systemd/user/kanshi.service14
-rw-r--r--dot_config/systemd/user/mbsync@.service (renamed from dot_config/systemd/user/mbsync.service)3
-rw-r--r--dot_config/systemd/user/mbsync@.timer (renamed from dot_config/systemd/user/mbsync.timer)1
-rw-r--r--dot_config/systemd/user/notify-unit-failure@.service5
-rw-r--r--dot_config/systemd/user/plocate-updatedb.service28
-rw-r--r--dot_config/systemd/user/plocate-updatedb.timer11
-rw-r--r--dot_config/systemd/user/sbuild-update.service11
-rw-r--r--dot_config/systemd/user/sbuild-update.timer11
-rw-r--r--dot_config/systemd/user/ssh-agent.service.d/override.conf3
-rw-r--r--dot_config/systemd/user/sway-session-pre.target18
-rw-r--r--dot_config/systemd/user/sway-session.target20
-rw-r--r--dot_config/systemd/user/swaybg-random.service7
-rw-r--r--dot_config/systemd/user/swayidle.service14
-rw-r--r--dot_config/systemd/user/symlink_gcr-ssh-agent.socket1
-rw-r--r--dot_config/systemd/user/timers.target.wants/symlink_mbsync.timer1
-rw-r--r--dot_config/systemd/user/timers.target.wants/symlink_plocate-updatedb.timer1
-rw-r--r--dot_config/systemd/user/timers.target.wants/symlink_sbuild-update.timer1
-rw-r--r--dot_config/systemd/user/wayland-session-pre.target18
-rw-r--r--dot_config/systemd/user/wayland-session.target18
-rw-r--r--dot_config/systemd/user/wayland-session.target.wants/symlink_kanshi.service1
-rw-r--r--dot_config/systemd/user/wayland-session.target.wants/symlink_swaybg-random.service (renamed from dot_config/systemd/user/default.target.wants/symlink_swaybg-random.service)0
-rw-r--r--dot_config/systemd/user/wayland-session.target.wants/symlink_swayidle.service1
23 files changed, 175 insertions, 14 deletions
diff --git a/dot_config/systemd/user/borgmatic@.service b/dot_config/systemd/user/borgmatic@.service
index a4ad31e..be1cb96 100644
--- a/dot_config/systemd/user/borgmatic@.service
+++ b/dot_config/systemd/user/borgmatic@.service
@@ -7,6 +7,7 @@ After=network-online.target
ConditionACPower=true
ConditionFileNotEmpty=/home/rak/.config/borgmatic/%I.yaml
Documentation=https://torsion.org/borgmatic/
+OnFailure=notify-unit-failure@%n.service
[Service]
Type=oneshot
diff --git a/dot_config/systemd/user/kanshi.service b/dot_config/systemd/user/kanshi.service
new file mode 100644
index 0000000..381b9e4
--- /dev/null
+++ b/dot_config/systemd/user/kanshi.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Dynamic output configuration
+Documentation=man:kanshi(1)
+PartOf=wayland-session.target
+Requires=wayland-session.target
+After=wayland-session.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/kanshi
+Restart=always
+
+[Install]
+WantedBy=wayland-session.target
diff --git a/dot_config/systemd/user/mbsync.service b/dot_config/systemd/user/mbsync@.service
index da0f146..f8c23b7 100644
--- a/dot_config/systemd/user/mbsync.service
+++ b/dot_config/systemd/user/mbsync@.service
@@ -1,9 +1,10 @@
[Unit]
Description=Mailbox synchronization service
+OnFailure=notify-unit-failure@%n.service
[Service]
Type=oneshot
-ExecStart=/usr/bin/mbsync -a
+ExecStart=/usr/bin/mbsync %i
[Install]
WantedBy=default.target
diff --git a/dot_config/systemd/user/mbsync.timer b/dot_config/systemd/user/mbsync@.timer
index b613c7f..26580a4 100644
--- a/dot_config/systemd/user/mbsync.timer
+++ b/dot_config/systemd/user/mbsync@.timer
@@ -4,7 +4,6 @@ Description=Mailbox synchronization timer
[Timer]
OnBootSec=2m
OnUnitActiveSec=15m
-Unit=mbsync.service
[Install]
WantedBy=timers.target
diff --git a/dot_config/systemd/user/notify-unit-failure@.service b/dot_config/systemd/user/notify-unit-failure@.service
new file mode 100644
index 0000000..f339470
--- /dev/null
+++ b/dot_config/systemd/user/notify-unit-failure@.service
@@ -0,0 +1,5 @@
+[Unit]
+Description=Failure Notification
+
+[Service]
+ExecStart=notify-send --icon /usr/share/icons/Adwaita/symbolic/status/task-past-due-symbolic.svg "systemd unit failure" "systemd unit %I failed"
diff --git a/dot_config/systemd/user/plocate-updatedb.service b/dot_config/systemd/user/plocate-updatedb.service
new file mode 100644
index 0000000..55620c5
--- /dev/null
+++ b/dot_config/systemd/user/plocate-updatedb.service
@@ -0,0 +1,28 @@
+[Unit]
+Description=Update the plocate database
+ConditionACPower=true
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/updatedb.plocate -l 0 -o "${XDG_STATE_HOME}/plocate/home.db" -U "${HOME}"
+LimitNOFILE=131072
+IOSchedulingClass=idle
+Nice=19
+
+CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_CHOWN
+IPAddressDeny=any
+LockPersonality=true
+MemoryDenyWriteExecute=true
+NoNewPrivileges=true
+PrivateTmp=true
+PrivateDevices=true
+PrivateNetwork=true
+ProtectClock=true
+ProtectControlGroups=true
+ProtectHostname=true
+RestrictAddressFamilies=AF_UNIX
+RestrictNamespaces=true
+RestrictRealtime=true
+RestrictSUIDSGID=true
+SystemCallArchitectures=native
+SystemCallFilter=@system-service @chown
diff --git a/dot_config/systemd/user/plocate-updatedb.timer b/dot_config/systemd/user/plocate-updatedb.timer
new file mode 100644
index 0000000..1d25abb
--- /dev/null
+++ b/dot_config/systemd/user/plocate-updatedb.timer
@@ -0,0 +1,11 @@
+[Unit]
+Description=Update the plocate database daily
+
+[Timer]
+OnCalendar=daily
+RandomizedDelaySec=1h
+AccuracySec=6h
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/dot_config/systemd/user/sbuild-update.service b/dot_config/systemd/user/sbuild-update.service
new file mode 100644
index 0000000..2d93232
--- /dev/null
+++ b/dot_config/systemd/user/sbuild-update.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Update sbuild unshare chroot tarballs
+ConditionACPower=true
+Wants=network-online.target
+
+[Service]
+Type=oneshot
+ExecStart=%h/.local/lib/sbuild/update-chroots.sh
+LimitNOFILE=131072
+IOSchedulingClass=idle
+Nice=19
diff --git a/dot_config/systemd/user/sbuild-update.timer b/dot_config/systemd/user/sbuild-update.timer
new file mode 100644
index 0000000..2576e16
--- /dev/null
+++ b/dot_config/systemd/user/sbuild-update.timer
@@ -0,0 +1,11 @@
+[Unit]
+Description=Update sbuild unshare chroot tarballs
+
+[Timer]
+OnCalendar=daily
+RandomizedDelaySec=1h
+AccuracySec=6h
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/dot_config/systemd/user/ssh-agent.service.d/override.conf b/dot_config/systemd/user/ssh-agent.service.d/override.conf
deleted file mode 100644
index acb0fb7..0000000
--- a/dot_config/systemd/user/ssh-agent.service.d/override.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-[Service]
-ExecStart=
-ExecStart=/home/rak/.local/lib/openssh/agent-launch start
diff --git a/dot_config/systemd/user/sway-session-pre.target b/dot_config/systemd/user/sway-session-pre.target
new file mode 100644
index 0000000..3215544
--- /dev/null
+++ b/dot_config/systemd/user/sway-session-pre.target
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: LGPL-2.1+
+#
+# This file is inspired from systemd's `graphical-session-pre.target`
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Session services which should run early before the sway session is brought up
+Documentation=man:systemd.special(7)
+Requires=basic.target
+Before=sway-session.target
+RefuseManualStart=yes
+StopWhenUnneeded=yes
+BindsTo=wayland-session-pre.target
+After=wayland-session-pre.target
diff --git a/dot_config/systemd/user/sway-session.target b/dot_config/systemd/user/sway-session.target
index 56029b8..4637f0f 100644
--- a/dot_config/systemd/user/sway-session.target
+++ b/dot_config/systemd/user/sway-session.target
@@ -1,6 +1,18 @@
+# SPDX-License-Identifier: LGPL-2.1+
+#
+# This file is inspired from systemd's `graphical-session.target`
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
[Unit]
-Description=Sway session
+Description=Current sway user session
Documentation=man:systemd.special(7)
-BindsTo=graphical-session.target
-Wants=graphical-session-pre.target
-After=graphical-session-pre.target
+Requires=basic.target
+#RefuseManualStart=yes
+StopWhenUnneeded=yes
+BindsTo=wayland-session.target
+Wants=wayland-session-pre.target
+After=wayland-session-pre.target
diff --git a/dot_config/systemd/user/swaybg-random.service b/dot_config/systemd/user/swaybg-random.service
index 37cd49d..f35fd77 100644
--- a/dot_config/systemd/user/swaybg-random.service
+++ b/dot_config/systemd/user/swaybg-random.service
@@ -1,12 +1,11 @@
[Unit]
-Description=randomize background
+Description=Randomize Wayland background
[Service]
Type=exec
Restart=always
RuntimeMaxSec=1h
-
-ExecStart=/home/rak/bin/swaybg-random
+ExecStart=%h/.local/bin/swaybg-random
[Install]
-WantedBy=default.target
+WantedBy=wayland-session.target
diff --git a/dot_config/systemd/user/swayidle.service b/dot_config/systemd/user/swayidle.service
new file mode 100644
index 0000000..536eaf9
--- /dev/null
+++ b/dot_config/systemd/user/swayidle.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Idle manager for Wayland
+Documentation=man:swayidle(1)
+PartOf=wayland-session.target
+Requires=wayland-session.target
+After=wayland-session.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/swayidle -w
+Restart=always
+
+[Install]
+WantedBy=wayland-session.target
diff --git a/dot_config/systemd/user/symlink_gcr-ssh-agent.socket b/dot_config/systemd/user/symlink_gcr-ssh-agent.socket
new file mode 100644
index 0000000..dc1dc0c
--- /dev/null
+++ b/dot_config/systemd/user/symlink_gcr-ssh-agent.socket
@@ -0,0 +1 @@
+/dev/null \ No newline at end of file
diff --git a/dot_config/systemd/user/timers.target.wants/symlink_mbsync.timer b/dot_config/systemd/user/timers.target.wants/symlink_mbsync.timer
deleted file mode 100644
index adba734..0000000
--- a/dot_config/systemd/user/timers.target.wants/symlink_mbsync.timer
+++ /dev/null
@@ -1 +0,0 @@
-/home/rak/.config/systemd/user/mbsync.timer
diff --git a/dot_config/systemd/user/timers.target.wants/symlink_plocate-updatedb.timer b/dot_config/systemd/user/timers.target.wants/symlink_plocate-updatedb.timer
new file mode 100644
index 0000000..28d405c
--- /dev/null
+++ b/dot_config/systemd/user/timers.target.wants/symlink_plocate-updatedb.timer
@@ -0,0 +1 @@
+/home/rak/.config/systemd/user/plocate-updatedb.timer
diff --git a/dot_config/systemd/user/timers.target.wants/symlink_sbuild-update.timer b/dot_config/systemd/user/timers.target.wants/symlink_sbuild-update.timer
new file mode 100644
index 0000000..24c026e
--- /dev/null
+++ b/dot_config/systemd/user/timers.target.wants/symlink_sbuild-update.timer
@@ -0,0 +1 @@
+/home/rak/.config/systemd/user/sbuild-update.timer \ No newline at end of file
diff --git a/dot_config/systemd/user/wayland-session-pre.target b/dot_config/systemd/user/wayland-session-pre.target
new file mode 100644
index 0000000..e4057ed
--- /dev/null
+++ b/dot_config/systemd/user/wayland-session-pre.target
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: LGPL-2.1+
+#
+# This file is inspired from systemd's `graphical-session-pre.target`
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Session services which should run early before the wayland session is brought up
+Documentation=man:systemd.special(7)
+Requires=basic.target
+Before=wayland-session.target
+RefuseManualStart=yes
+StopWhenUnneeded=yes
+BindsTo=graphical-session-pre.target
+After=graphical-session-pre.target
diff --git a/dot_config/systemd/user/wayland-session.target b/dot_config/systemd/user/wayland-session.target
new file mode 100644
index 0000000..f4cc2b7
--- /dev/null
+++ b/dot_config/systemd/user/wayland-session.target
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: LGPL-2.1+
+#
+# This file is inspired from systemd's `graphical-session.target`
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Current wayland user session
+Documentation=man:systemd.special(7)
+Requires=basic.target
+RefuseManualStart=yes
+StopWhenUnneeded=yes
+BindsTo=graphical-session.target
+Wants=graphical-session-pre.target
+After=graphical-session-pre.target
diff --git a/dot_config/systemd/user/wayland-session.target.wants/symlink_kanshi.service b/dot_config/systemd/user/wayland-session.target.wants/symlink_kanshi.service
new file mode 100644
index 0000000..7d5903e
--- /dev/null
+++ b/dot_config/systemd/user/wayland-session.target.wants/symlink_kanshi.service
@@ -0,0 +1 @@
+/home/rak/.config/systemd/user/kanshi.service
diff --git a/dot_config/systemd/user/default.target.wants/symlink_swaybg-random.service b/dot_config/systemd/user/wayland-session.target.wants/symlink_swaybg-random.service
index 2ebb1f9..2ebb1f9 100644
--- a/dot_config/systemd/user/default.target.wants/symlink_swaybg-random.service
+++ b/dot_config/systemd/user/wayland-session.target.wants/symlink_swaybg-random.service
diff --git a/dot_config/systemd/user/wayland-session.target.wants/symlink_swayidle.service b/dot_config/systemd/user/wayland-session.target.wants/symlink_swayidle.service
new file mode 100644
index 0000000..a53991f
--- /dev/null
+++ b/dot_config/systemd/user/wayland-session.target.wants/symlink_swayidle.service
@@ -0,0 +1 @@
+/home/rak/.config/systemd/user/swayidle.service