aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2024-02-16 10:57:51 +0100
committerPatrick Spek <p.spek@tyil.nl>2024-02-16 10:57:51 +0100
commit5200bb4e39193a500a86267c70d34aea98b2a653 (patch)
treea11d0ed5914b31ad456c4ca8561f97ab728d8e28
parent1972947a21fc85dc4c835c892ffdd3f5e97f3493 (diff)
Yet another rework of systemd-managed window management
-rw-r--r--.config/awesome/rc.lua8
-rw-r--r--.config/systemd/user/bscv-dunst.service19
-rw-r--r--.config/systemd/user/bscv-ntfy@.service (renamed from .config/systemd/user/ntfy@.service)4
-rw-r--r--.config/systemd/user/bscv-sxhkd.service19
-rw-r--r--.config/systemd/user/desktop-x11.target2
-rw-r--r--.config/systemd/user/desktop.target2
-rw-r--r--.config/systemd/user/fsvc-firefox.service18
-rw-r--r--.config/systemd/user/fsvc-irc.service (renamed from .config/systemd/user/desktop-app@.service)4
-rw-r--r--.config/systemd/user/fsvc-nm-applet.service18
-rw-r--r--.config/systemd/user/wman-awesome.service19
-rw-r--r--.config/systemd/user/wman.target2
-rw-r--r--.config/systemd/user/wsys-xorg.service25
-rw-r--r--.config/systemd/user/wsys-xorg.socket5
-rw-r--r--.config/systemd/user/wsys-xorg.target3
-rw-r--r--.config/systemd/user/wsys.target2
15 files changed, 134 insertions, 16 deletions
diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua
index ad20842..2c9eebc 100644
--- a/.config/awesome/rc.lua
+++ b/.config/awesome/rc.lua
@@ -46,14 +46,6 @@ do
end
-- }}}
--- Start the desktop.target to autostart applications through systemd
-awful.util.spawn_with_shell("systemctl --user import-environment DISPLAY")
-awful.util.spawn_with_shell("systemctl --user import-environment PATH")
-awful.util.spawn_with_shell("systemctl --user import-environment WINIT_X11_SCALE_FACTOR")
-awful.util.spawn_with_shell("systemctl --user import-environment XAUTHORITY")
-awful.util.spawn_with_shell("systemctl --user start desktop.target")
-awful.util.spawn_with_shell("systemctl --user start desktop-x11.target")
-
-- {{{ Variable definitions
beautiful.init(awful.util.getdir("config") .. "/theme.lua")
diff --git a/.config/systemd/user/bscv-dunst.service b/.config/systemd/user/bscv-dunst.service
new file mode 100644
index 0000000..ac64078
--- /dev/null
+++ b/.config/systemd/user/bscv-dunst.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Manage an x11 application
+PartOf=graphical-session.target
+After=wman.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
+
+ExecStart=/usr/bin/dunst
+
+[Install]
+WantedBy=wman.target
diff --git a/.config/systemd/user/ntfy@.service b/.config/systemd/user/bscv-ntfy@.service
index 6f2587b..0490ea1 100644
--- a/.config/systemd/user/ntfy@.service
+++ b/.config/systemd/user/bscv-ntfy@.service
@@ -1,7 +1,7 @@
[Unit]
Description=Start ntfy
-PartOf=graphical-session.target
After=network.target
+After=wman.target
[Service]
Type=exec
@@ -12,4 +12,4 @@ ExecStart=ntfy subscribe "%i" 'notify-send "$t" "$m"'
Restart=on-failure
[Install]
-WantedBy=desktop.target
+WantedBy=wman.target
diff --git a/.config/systemd/user/bscv-sxhkd.service b/.config/systemd/user/bscv-sxhkd.service
new file mode 100644
index 0000000..f1dde07
--- /dev/null
+++ b/.config/systemd/user/bscv-sxhkd.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Manage an x11 application
+PartOf=graphical-session.target
+After=wman.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
+
+ExecStart=/usr/bin/sxhkd
+
+[Install]
+WantedBy=wman.target
diff --git a/.config/systemd/user/desktop-x11.target b/.config/systemd/user/desktop-x11.target
deleted file mode 100644
index 5d7d771..0000000
--- a/.config/systemd/user/desktop-x11.target
+++ /dev/null
@@ -1,2 +0,0 @@
-[Unit]
-Description = Target to be reached when the graphical desktop environment has started
diff --git a/.config/systemd/user/desktop.target b/.config/systemd/user/desktop.target
deleted file mode 100644
index 5d7d771..0000000
--- a/.config/systemd/user/desktop.target
+++ /dev/null
@@ -1,2 +0,0 @@
-[Unit]
-Description = Target to be reached when the graphical desktop environment has started
diff --git a/.config/systemd/user/fsvc-firefox.service b/.config/systemd/user/fsvc-firefox.service
new file mode 100644
index 0000000..10e72a3
--- /dev/null
+++ b/.config/systemd/user/fsvc-firefox.service
@@ -0,0 +1,18 @@
+[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
+
+ExecStart=firefox
+
+[Install]
+WantedBy=wman.target
diff --git a/.config/systemd/user/desktop-app@.service b/.config/systemd/user/fsvc-irc.service
index e2f0281..efd4b81 100644
--- a/.config/systemd/user/desktop-app@.service
+++ b/.config/systemd/user/fsvc-irc.service
@@ -12,7 +12,7 @@ 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
-ExecStart=%i
+ExecStart=irc
[Install]
-WantedBy=desktop.target
+WantedBy=wman.target
diff --git a/.config/systemd/user/fsvc-nm-applet.service b/.config/systemd/user/fsvc-nm-applet.service
new file mode 100644
index 0000000..54cbd9e
--- /dev/null
+++ b/.config/systemd/user/fsvc-nm-applet.service
@@ -0,0 +1,18 @@
+[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
+
+ExecStart=nm-applet
+
+[Install]
+WantedBy=wman.target
diff --git a/.config/systemd/user/wman-awesome.service b/.config/systemd/user/wman-awesome.service
new file mode 100644
index 0000000..3b093c9
--- /dev/null
+++ b/.config/systemd/user/wman-awesome.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Awesome window manager
+Requires=wsys-xorg.service
+
+After=wsys-xorg.target
+Before=wman.target
+
+[Service]
+Environment=XAUTHORITY=%h/.Xauthority
+Environment=DISPLAY=:1
+Restart=always
+
+ExecStart=/usr/bin/awesome
+ExecStartPost=systemctl --user --no-block start wman.target
+
+ExecStopPre=systemctl --user --no-block stop wman.target
+
+[Install]
+WantedBy=wsys.target
diff --git a/.config/systemd/user/wman.target b/.config/systemd/user/wman.target
new file mode 100644
index 0000000..b7b343b
--- /dev/null
+++ b/.config/systemd/user/wman.target
@@ -0,0 +1,2 @@
+[Unit]
+Description = Window Manager
diff --git a/.config/systemd/user/wsys-xorg.service b/.config/systemd/user/wsys-xorg.service
new file mode 100644
index 0000000..a1784ed
--- /dev/null
+++ b/.config/systemd/user/wsys-xorg.service
@@ -0,0 +1,25 @@
+# Ensure you are allowed to run X.org as a regular non-console user!
+
+# /etc/X11/Xwrapper.conf
+# allowed_users=anybody
+# needs_root_rights=yes
+
+[Unit]
+Description=Xorg server at display :1
+
+Requires=wsys-xorg.socket
+After=wsys-xorg.socket
+Before=wsys.target
+
+[Service]
+Type=simple
+SuccessExitStatus=0 1
+
+ExecStart=/usr/bin/Xorg :1 -nolisten tcp -noreset -verbose 2 "vt1"
+ExecStartPost=systemctl --user import-environment DISPLAY
+ExecStartPost=systemctl --user import-environment XAUTHORITY
+ExecStartPost=systemctl --user --no-block start wsys-xorg.target
+ExecStartPost=systemctl --user --no-block start wsys.target
+
+ExecStopPre=systemctl --user stop wsys.target
+ExecStopPre=systemctl --user stop wsys-xorg.target
diff --git a/.config/systemd/user/wsys-xorg.socket b/.config/systemd/user/wsys-xorg.socket
new file mode 100644
index 0000000..f471dab
--- /dev/null
+++ b/.config/systemd/user/wsys-xorg.socket
@@ -0,0 +1,5 @@
+[Unit]
+Description=Socket for xorg at display :1
+
+[Socket]
+ListenStream=/tmp/.X11-unix/X1
diff --git a/.config/systemd/user/wsys-xorg.target b/.config/systemd/user/wsys-xorg.target
new file mode 100644
index 0000000..248722e
--- /dev/null
+++ b/.config/systemd/user/wsys-xorg.target
@@ -0,0 +1,3 @@
+[Unit]
+Before = wsys.target
+Description = Window System managed by X.org
diff --git a/.config/systemd/user/wsys.target b/.config/systemd/user/wsys.target
new file mode 100644
index 0000000..60a9c9f
--- /dev/null
+++ b/.config/systemd/user/wsys.target
@@ -0,0 +1,2 @@
+[Unit]
+Description = Window System