aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2024-02-06 18:59:31 +0100
committerPatrick Spek <p.spek@tyil.nl>2024-02-06 18:59:31 +0100
commitc73854c46d0c1c458d5c85aa450b8676f21673aa (patch)
tree6c54f66ff5a660671b6d6b7d57041ae3ec72cfe1
parent17d13e3153c27db6bc78514d737db7b92b22807e (diff)
Use service template for starting desktop applications
-rw-r--r--.config/systemd/user/chwp.service11
-rw-r--r--.config/systemd/user/desktop-app@.service19
-rw-r--r--.config/systemd/user/dunst.service11
-rw-r--r--.config/systemd/user/evolution.service11
-rw-r--r--.config/systemd/user/firefox.service11
-rw-r--r--.config/systemd/user/irc-client.service14
-rw-r--r--.config/systemd/user/keepassxc.service11
-rw-r--r--.config/systemd/user/mumble.service11
-rw-r--r--.config/systemd/user/nextcloud.service11
-rw-r--r--.config/systemd/user/nm-applet.service11
-rw-r--r--.config/systemd/user/redshift.service11
-rw-r--r--.config/systemd/user/sxhkd.service11
-rw-r--r--.config/systemd/user/xcompmgr.service11
-rw-r--r--.config/systemd/user/xss-lock.service11
l---------.local/bin/irc1
l---------.local/bin/redshift1
-rw-r--r--.local/etc/wrapper.d/irc.sh10
-rw-r--r--.local/etc/wrapper.d/redshift.sh10
-rw-r--r--.local/etc/x/xinitrc1
19 files changed, 42 insertions, 146 deletions
diff --git a/.config/systemd/user/chwp.service b/.config/systemd/user/chwp.service
deleted file mode 100644
index c9356f0..0000000
--- a/.config/systemd/user/chwp.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Change wallpaper on x11
-PartOf=graphical-session.target
-
-[Service]
-Type=oneshot
-ExecStart=/bin/sh -c "exec $HOME/.local/bin/chwp"
-Restart=on-failure
-
-[Install]
-WantedBy=desktop-x11.target
diff --git a/.config/systemd/user/desktop-app@.service b/.config/systemd/user/desktop-app@.service
new file mode 100644
index 0000000..4b818ae
--- /dev/null
+++ b/.config/systemd/user/desktop-app@.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Manage an x11 application
+PartOf=graphical-session.target
+
+[Service]
+Type=exec
+Restart=on-failure
+
+ExecSearchPath=%h/.local/bin
+ExecSearchPath=/usr/local/bin
+ExecSearchPath=/usr/bin
+Environment=PATH=/home/tyil/.local/bin:/home/tyil/.config/shell/wrappers.d:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
+WorkingDirectory=%h
+
+ExecStartPre=sleep 5
+ExecStart=%i
+
+[Install]
+WantedBy=desktop.target
diff --git a/.config/systemd/user/dunst.service b/.config/systemd/user/dunst.service
deleted file mode 100644
index 6301a41..0000000
--- a/.config/systemd/user/dunst.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start dunst
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/usr/bin/dunst
-Restart=on-failure
-
-[Install]
-WantedBy=desktop.target
diff --git a/.config/systemd/user/evolution.service b/.config/systemd/user/evolution.service
deleted file mode 100644
index c60bca7..0000000
--- a/.config/systemd/user/evolution.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start Evolution
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/usr/bin/evolution
-Restart=on-failure
-
-[Install]
-WantedBy=desktop.target
diff --git a/.config/systemd/user/firefox.service b/.config/systemd/user/firefox.service
deleted file mode 100644
index 869d1bd..0000000
--- a/.config/systemd/user/firefox.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start Firefox
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/bin/sh -c "exec $HOME/.local/bin/firefox"
-Restart=on-failure
-
-[Install]
-WantedBy=desktop.target
diff --git a/.config/systemd/user/irc-client.service b/.config/systemd/user/irc-client.service
deleted file mode 100644
index b1d0544..0000000
--- a/.config/systemd/user/irc-client.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=Start preferred IRC client
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecSearchPath=%h/.local/bin
-ExecSearchPath=/usr/local/bin
-ExecSearchPath=/usr/bin
-ExecStart=alacritty --class irc -e mosh oolah .local/bin/ta irc
-Restart=on-failure
-
-[Install]
-WantedBy=desktop.target
diff --git a/.config/systemd/user/keepassxc.service b/.config/systemd/user/keepassxc.service
deleted file mode 100644
index 75ac2b4..0000000
--- a/.config/systemd/user/keepassxc.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start KeePassXC
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/usr/bin/keepassxc
-Restart=on-failure
-
-[Install]
-WantedBy=desktop.target
diff --git a/.config/systemd/user/mumble.service b/.config/systemd/user/mumble.service
deleted file mode 100644
index ad127ca..0000000
--- a/.config/systemd/user/mumble.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start the Mumble
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/usr/bin/mumble
-Restart=on-failure
-
-[Install]
-WantedBy=desktop.target
diff --git a/.config/systemd/user/nextcloud.service b/.config/systemd/user/nextcloud.service
deleted file mode 100644
index 3dcf567..0000000
--- a/.config/systemd/user/nextcloud.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start Nextcloud
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/usr/bin/nextcloud
-Restart=on-failure
-
-[Install]
-WantedBy=desktop.target
diff --git a/.config/systemd/user/nm-applet.service b/.config/systemd/user/nm-applet.service
deleted file mode 100644
index a88498c..0000000
--- a/.config/systemd/user/nm-applet.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start the NetworkManager applet
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/usr/bin/nm-applet
-Restart=on-failure
-
-[Install]
-WantedBy=desktop.target
diff --git a/.config/systemd/user/redshift.service b/.config/systemd/user/redshift.service
deleted file mode 100644
index a63fa5d..0000000
--- a/.config/systemd/user/redshift.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start redshift
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/usr/bin/redshift -l 51.50:4.59 -t 6500:3500
-Restart=on-failure
-
-[Install]
-WantedBy=desktop-x11.target
diff --git a/.config/systemd/user/sxhkd.service b/.config/systemd/user/sxhkd.service
deleted file mode 100644
index b8a806f..0000000
--- a/.config/systemd/user/sxhkd.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start sxhkd
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/usr/bin/sxhkd
-Restart=on-failure
-
-[Install]
-WantedBy=desktop-x11.target
diff --git a/.config/systemd/user/xcompmgr.service b/.config/systemd/user/xcompmgr.service
deleted file mode 100644
index 2de0721..0000000
--- a/.config/systemd/user/xcompmgr.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start xcompmgr
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/usr/bin/xcompmgr
-Restart=on-failure
-
-[Install]
-WantedBy=desktop-x11.target
diff --git a/.config/systemd/user/xss-lock.service b/.config/systemd/user/xss-lock.service
deleted file mode 100644
index 072a268..0000000
--- a/.config/systemd/user/xss-lock.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Start xss-lock
-PartOf=graphical-session.target
-
-[Service]
-Type=exec
-ExecStart=/usr/bin/xss-lock -- i3lock -c '#000000' -n
-Restart=on-failure
-
-[Install]
-WantedBy=desktop-x11.target
diff --git a/.local/bin/irc b/.local/bin/irc
new file mode 120000
index 0000000..3da827c
--- /dev/null
+++ b/.local/bin/irc
@@ -0,0 +1 @@
+../share/wrapper.sh \ No newline at end of file
diff --git a/.local/bin/redshift b/.local/bin/redshift
new file mode 120000
index 0000000..3da827c
--- /dev/null
+++ b/.local/bin/redshift
@@ -0,0 +1 @@
+../share/wrapper.sh \ No newline at end of file
diff --git a/.local/etc/wrapper.d/irc.sh b/.local/etc/wrapper.d/irc.sh
new file mode 100644
index 0000000..27fcbc7
--- /dev/null
+++ b/.local/etc/wrapper.d/irc.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+WRAPPER_BINS="
+ alacritty
+"
+
+WRAPPER_OPTS="
+ --class irc
+ --command mosh oolah .local/bin/ta irc
+"
diff --git a/.local/etc/wrapper.d/redshift.sh b/.local/etc/wrapper.d/redshift.sh
new file mode 100644
index 0000000..9268ac8
--- /dev/null
+++ b/.local/etc/wrapper.d/redshift.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+WRAPPER_BINS="
+ /usr/bin/redshift
+"
+
+WRAPPER_OPTS="
+ -l 51.50:4.59
+ -t 6500:3500
+"
diff --git a/.local/etc/x/xinitrc b/.local/etc/x/xinitrc
index ccb21f3..1896830 100644
--- a/.local/etc/x/xinitrc
+++ b/.local/etc/x/xinitrc
@@ -30,5 +30,6 @@ export WINIT_X11_SCALE_FACTOR=1
# Import X11 environment for systemd
systemctl --user import-environment \
DISPLAY \
+ PATH \
WINIT_X11_SCALE_FACTOR \
XAUTHORITY