From 326abc4339ad60799c02b4cc3fdd33a670dcd0f6 Mon Sep 17 00:00:00 2001 From: Trumeet Date: Sat, 19 Feb 2022 15:13:50 -0800 Subject: Use Alias for services so I can replace them --- SystemdGraphicalSession/README.md | 10 +++++----- SystemdGraphicalSession/deadd-notification-center.service | 3 +++ SystemdGraphicalSession/gui-session.target | 9 +++++++++ SystemdGraphicalSession/i3-session.target | 9 --------- SystemdGraphicalSession/i3.service | 3 +++ SystemdGraphicalSession/xcompmgr.service | 3 +++ SystemdGraphicalSession/xinitrc | 2 +- 7 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 SystemdGraphicalSession/gui-session.target delete mode 100644 SystemdGraphicalSession/i3-session.target (limited to 'SystemdGraphicalSession') diff --git a/SystemdGraphicalSession/README.md b/SystemdGraphicalSession/README.md index 405b373..b82668f 100644 --- a/SystemdGraphicalSession/README.md +++ b/SystemdGraphicalSession/README.md @@ -3,17 +3,17 @@ 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) + -> gui-session.target + -> window-manager.service # Window Manager (alias: i3.service, slice: session) + -> compositor.service # Compositor (alias: xcompmgr, 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) + -> notification-daemon.service # libnotify daemon (alias: deadd-notification-center, 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 start: `systemctl --user start --wait gui-session.target` (put in your `.xinitrc`). To be continued. This configuration has flaws. diff --git a/SystemdGraphicalSession/deadd-notification-center.service b/SystemdGraphicalSession/deadd-notification-center.service index 3dc8f24..bae16cb 100644 --- a/SystemdGraphicalSession/deadd-notification-center.service +++ b/SystemdGraphicalSession/deadd-notification-center.service @@ -7,3 +7,6 @@ Documentation=man:deadd-notification-center(8) [Service] Type=simple ExecStart=/usr/bin/deadd-notification-center + +[Install] +Alias=notification-daemon.service diff --git a/SystemdGraphicalSession/gui-session.target b/SystemdGraphicalSession/gui-session.target new file mode 100644 index 0000000..b66cf0b --- /dev/null +++ b/SystemdGraphicalSession/gui-session.target @@ -0,0 +1,9 @@ +[Unit] +Description=i3 Session +BindsTo=graphical-session.target +Wants=window-manager.service +Wants=xdg-desktop-autostart.target +Wants=xrdb.service +Wants=notification-daemon.service +Wants=compositor.service +Wants=xbindkeys.service diff --git a/SystemdGraphicalSession/i3-session.target b/SystemdGraphicalSession/i3-session.target deleted file mode 100644 index 5de5136..0000000 --- a/SystemdGraphicalSession/i3-session.target +++ /dev/null @@ -1,9 +0,0 @@ -[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 -Wants=xbindkeys.service diff --git a/SystemdGraphicalSession/i3.service b/SystemdGraphicalSession/i3.service index 1d2f7a2..4277558 100644 --- a/SystemdGraphicalSession/i3.service +++ b/SystemdGraphicalSession/i3.service @@ -9,3 +9,6 @@ Slice=session.slice Type=simple ExecStart=/usr/bin/i3 ExecStop=/usr/bin/sh -c '/usr/bin/i3-msg exit || true' + +[Install] +Alias=window-manager.service diff --git a/SystemdGraphicalSession/xcompmgr.service b/SystemdGraphicalSession/xcompmgr.service index 16cfbcb..dd9394e 100644 --- a/SystemdGraphicalSession/xcompmgr.service +++ b/SystemdGraphicalSession/xcompmgr.service @@ -8,3 +8,6 @@ Documentation=man:xcompmgr(8) Slice=session.slice Type=simple ExecStart=/usr/bin/xcompmgr + +[Install] +Alias=compositor.service diff --git a/SystemdGraphicalSession/xinitrc b/SystemdGraphicalSession/xinitrc index 5443329..c5e8d71 100755 --- a/SystemdGraphicalSession/xinitrc +++ b/SystemdGraphicalSession/xinitrc @@ -1,2 +1,2 @@ #!/bin/sh -exec systemctl --user start --wait i3-session.target +exec systemctl --user start --wait gui-session.target -- cgit v1.2.3-70-g09d2