systemd: create our own graphical-session@.target

graphical-session.target is an existing target for the system. While I
don't use several X sessions, I prefer to have each service bound to
the right display and therefore, I create my own
graphical-session@.target for this purpose.

Also, I don't like having to use `systemctl --user enable`, so I
enable everything directly in graphical-session@.target. Other
dependencies are ordered from awesome@.service. This seems good
enough.
This commit is contained in:
Vincent Bernat 2020-01-19 20:28:04 +01:00
parent ae691bb025
commit 2e9fa46f2f
13 changed files with 30 additions and 15 deletions

View file

@ -1,12 +1,13 @@
[Unit]
Description=Awesome window manager
Description=Awesome window manager for %I
PartOf=graphical-session@%i.target
After=autorandr@%i.service
After=compton@%i.service
After=xsettingsd@%i.service
Before=nm-applet@%i.service
[Service]
Environment=DISPLAY=%I
ExecStart=/usr/bin/awesome
ExecStopPost=/bin/systemctl --user stop graphical-session@%i.target
Restart=on-failure
[Install]
RequiredBy=xsession@%i.target