This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main: signal readiness by notifying systemd
This is useful if we want to be able to start some services depending on i3, notably some script using the socket or third-party bars like polybar. To make use of this change, user is expected to use the following stanza: ``` [Unit] Description=i3 window manager PartOf=graphical-session.target [Service] Type=notify ExecStart=/usr/bin/i3 ExecStopPost=/bin/systemctl --user stop graphical-session.target Restart=on-failure ``` Something similar is already possible using socket activation. For example, we could use: ``` [Unit] Description=i3 window manager socket PartOf=graphical-session.target [Socket] ListenStream=%t/i3.sock ExecStartPost=/bin/systemctl --user set-environment I3SOCK=%t/i3.sock ``` And other units could `Requires=i3.socket`. Unfortunately, not everything is using I3SOCK. Notably, `i3 --get-socketpath` does not and that's what i3ipcpp is doing. An alternative would be to patch `i3 --get-socketpath` to use I3SOCK if present, however, this may be a bit risky. Should we check the environment variable first or the root attribute? Another alternative not requiring any modification is to have a dedicated `i3-session.target`: ``` [Unit] Description=i3 session BindsTo=graphical-session.target Wants=wallpaper.service Wants=wallpaper.timer Wants=polybar.service Wants=i3-companion.service ``` And trigger it from i3: ``` exec_always --no-startup-id systemctl --user start --no-block i3-session.target ``` The proposed change being quite small, it seems harmless and low-maintenance. Signed-off-by: Vincent Bernat <vincent@bernat.ch>
- Loading branch information