aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrumeet <yuuta@yuuta.moe>2022-02-17 23:51:47 -0800
committerTrumeet <yuuta@yuuta.moe>2022-02-17 23:51:47 -0800
commit4a413e25fdbb1c723ba2ccd7c352713853d2d189 (patch)
tree6a3d85377a86b70ca71d5043510b237898c799f7
parent0ea3ea67a7498b0e3ec7aa9ba9eef713755fa4d5 (diff)
downloadgists-4a413e25fdbb1c723ba2ccd7c352713853d2d189.tar
gists-4a413e25fdbb1c723ba2ccd7c352713853d2d189.tar.gz
gists-4a413e25fdbb1c723ba2ccd7c352713853d2d189.tar.bz2
gists-4a413e25fdbb1c723ba2ccd7c352713853d2d189.zip
Add SystemdGraphicalSession
-rw-r--r--SystemdGraphicalSession/README.md19
-rw-r--r--SystemdGraphicalSession/background.service12
-rw-r--r--SystemdGraphicalSession/deadd-notification-center.service9
l---------SystemdGraphicalSession/graphical-session.target.wants/background.service1
l---------SystemdGraphicalSession/graphical-session.target.wants/redshift.service1
-rw-r--r--SystemdGraphicalSession/i3-session.target8
-rw-r--r--SystemdGraphicalSession/i3.service11
-rw-r--r--SystemdGraphicalSession/i3lock.service11
-rw-r--r--SystemdGraphicalSession/redshift.service12
-rw-r--r--SystemdGraphicalSession/xcompmgr.service10
-rw-r--r--SystemdGraphicalSession/xrdb.service10
11 files changed, 104 insertions, 0 deletions
diff --git a/SystemdGraphicalSession/README.md b/SystemdGraphicalSession/README.md
new file mode 100644
index 0000000..405b373
--- /dev/null
+++ b/SystemdGraphicalSession/README.md
@@ -0,0 +1,19 @@
+# Systemd Graphical Session
+
+An experiment of using systemd/User to start and manage i3wm, xcompmgr, XDG Autostart and user programs.
+
+graphical-session.target
+ -> i3-session.target
+ -> i3.service # i3wm (slice: session)
+ -> xcompmgr.service # Compositor (slice: session)
+ -> xdg-desktop-autostart.target # XDG Autostart (slice: app. In fact daemons like blueman-applet should be in background slice)
+ -> xrdb.service # xrdb merge
+ -> deadd-notification-center.service # libnotify daemon (slice: app)
+
+User programs (e.g. xterm, rofi and their children) are started under separate scopes. I'm not sure if that's light enough.
+
+Environment variables are managed by `environment.d(5)`.
+
+To start: `systemctl --user start --wait i3-session.target` (put in your `.xinitrc`).
+
+To be continued. This configuration has flaws.
diff --git a/SystemdGraphicalSession/background.service b/SystemdGraphicalSession/background.service
new file mode 100644
index 0000000..14b6b67
--- /dev/null
+++ b/SystemdGraphicalSession/background.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Desktop Background
+Wants=graphical-session.target
+Documentation=man:feh(8)
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/feh --bg-fill $HOME/Pic/Pixiv/64633930.png
+
+[Install]
+WantedBy=graphical-session.target
diff --git a/SystemdGraphicalSession/deadd-notification-center.service b/SystemdGraphicalSession/deadd-notification-center.service
new file mode 100644
index 0000000..3dc8f24
--- /dev/null
+++ b/SystemdGraphicalSession/deadd-notification-center.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Deadd Notification Center
+After=graphical-session-pre.target
+PartOf=graphical-session.target
+Documentation=man:deadd-notification-center(8)
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/deadd-notification-center
diff --git a/SystemdGraphicalSession/graphical-session.target.wants/background.service b/SystemdGraphicalSession/graphical-session.target.wants/background.service
new file mode 120000
index 0000000..591c320
--- /dev/null
+++ b/SystemdGraphicalSession/graphical-session.target.wants/background.service
@@ -0,0 +1 @@
+/home/yuuta/.config/systemd/user/background.service \ No newline at end of file
diff --git a/SystemdGraphicalSession/graphical-session.target.wants/redshift.service b/SystemdGraphicalSession/graphical-session.target.wants/redshift.service
new file mode 120000
index 0000000..54ca1c4
--- /dev/null
+++ b/SystemdGraphicalSession/graphical-session.target.wants/redshift.service
@@ -0,0 +1 @@
+/home/yuuta/.config/systemd/user/redshift.service \ No newline at end of file
diff --git a/SystemdGraphicalSession/i3-session.target b/SystemdGraphicalSession/i3-session.target
new file mode 100644
index 0000000..1731056
--- /dev/null
+++ b/SystemdGraphicalSession/i3-session.target
@@ -0,0 +1,8 @@
+[Unit]
+Description=i3 Session
+BindsTo=graphical-session.target
+Wants=i3.service
+Wants=xdg-desktop-autostart.target
+Wants=xrdb.service
+Wants=deadd-notification-center.service
+Wants=xcompmgr.service
diff --git a/SystemdGraphicalSession/i3.service b/SystemdGraphicalSession/i3.service
new file mode 100644
index 0000000..1d2f7a2
--- /dev/null
+++ b/SystemdGraphicalSession/i3.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=X Window Manager
+After=graphical-session-pre.target
+PartOf=graphical-session.target
+Documentation=man:i3(8)
+
+[Service]
+Slice=session.slice
+Type=simple
+ExecStart=/usr/bin/i3
+ExecStop=/usr/bin/sh -c '/usr/bin/i3-msg exit || true'
diff --git a/SystemdGraphicalSession/i3lock.service b/SystemdGraphicalSession/i3lock.service
new file mode 100644
index 0000000..624ceed
--- /dev/null
+++ b/SystemdGraphicalSession/i3lock.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=i3 Screen Locker
+After=graphical-session-pre.target
+Documentation=man:i3lock(8)
+
+[Service]
+Slice=session.slice
+Type=simple
+ExecStart=/usr/bin/i3lock --nofork
+RestartSec=0s
+Restart=on-failure
diff --git a/SystemdGraphicalSession/redshift.service b/SystemdGraphicalSession/redshift.service
new file mode 100644
index 0000000..379efc7
--- /dev/null
+++ b/SystemdGraphicalSession/redshift.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=RedShift Color Temperature
+Wants=graphical-session.target
+Documentation=man:redshift(8)
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/redshift -P -O 4082
+
+[Install]
+WantedBy=graphical-session.target
diff --git a/SystemdGraphicalSession/xcompmgr.service b/SystemdGraphicalSession/xcompmgr.service
new file mode 100644
index 0000000..16cfbcb
--- /dev/null
+++ b/SystemdGraphicalSession/xcompmgr.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=X Compositor
+After=graphical-session-pre.target
+PartOf=graphical-session.target
+Documentation=man:xcompmgr(8)
+
+[Service]
+Slice=session.slice
+Type=simple
+ExecStart=/usr/bin/xcompmgr
diff --git a/SystemdGraphicalSession/xrdb.service b/SystemdGraphicalSession/xrdb.service
new file mode 100644
index 0000000..b49090e
--- /dev/null
+++ b/SystemdGraphicalSession/xrdb.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Merge Xresources
+Wants=graphical-session.target
+PartOf=graphical-session.target
+Documentation=man:xrdb(8)
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/xrdb -merge $HOME/.Xresources