Even more elegant solution: /lib/systemd/systemd-xdg-autostart-condition
that is designed to be used in ExecCondition= of autogenerated XDG
Autostart units.
It takes two arguments: OnlyShowIn= and NotShowIn= sets, each colon
separated. So one can repurpose XDG Autostart filtering for user units
in general.
On 07/12/2023 22.18, Patrice Duroux wrote:
Hi Vladimir,
After going for your last proposal, it works at least considering the GNOME
session. Here is what log shows:
systemd[2671]: Listening on foot-server.socket.
systemd[2671]: Starting foot-server.service - Foot terminal server mode...
systemd[2671]: Starting waybar.service - Highly customizable Wayland bar for
Sway and Wlroots based compositors....
systemd[2671]: waybar.service: Skipped due to 'exec-condition'.
systemd[2671]: Condition check resulted in waybar.service - Highly customizable
Wayland bar for Sway and Wlroots based compositors. being skipped.
systemd[2671]: foot-server.service: Skipped due to 'exec-condition'.
systemd[2671]: Condition check resulted in foot-server.service - Foot terminal
server mode being skipped.
Many thanks,
Patrice