mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 10:49:48 +01:00
Add systemd target tray.target
(#2027)
This target is for systemd units that require a system tray to be running. This also fixes taffybar.service: previously, systemd would consider it to be active (running) before it was actually ready to accept tray icons.
This commit is contained in:
parent
82ab1ad467
commit
4f70f49cec
13 changed files with 48 additions and 45 deletions
|
@ -24,7 +24,8 @@ with lib;
|
||||||
systemd.user.services.blueman-applet = {
|
systemd.user.services.blueman-applet = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Blueman applet";
|
Description = "Blueman applet";
|
||||||
After = [ "graphical-session-pre.target" ];
|
Requires = [ "tray.target" ];
|
||||||
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,8 @@ in {
|
||||||
systemd.user.services.cbatticon = {
|
systemd.user.services.cbatticon = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "cbatticon system tray battery icon";
|
Description = "cbatticon system tray battery icon";
|
||||||
After = [ "graphical-session-pre.target" ];
|
Requires = [ "tray.target" ];
|
||||||
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,8 @@ in {
|
||||||
systemd.user.services.flameshot = {
|
systemd.user.services.flameshot = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Flameshot screenshot tool";
|
Description = "Flameshot screenshot tool";
|
||||||
After = [
|
Requires = [ "tray.target" ];
|
||||||
"graphical-session-pre.target"
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
||||||
"polybar.service"
|
|
||||||
"stalonetray.service"
|
|
||||||
"taffybar.service"
|
|
||||||
];
|
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,8 @@ in {
|
||||||
systemd.user.services.network-manager-applet = {
|
systemd.user.services.network-manager-applet = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Network Manager applet";
|
Description = "Network Manager applet";
|
||||||
After = [ "graphical-session-pre.target" ];
|
Requires = [ "tray.target" ];
|
||||||
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,8 @@ in {
|
||||||
systemd.user.services.parcellite = {
|
systemd.user.services.parcellite = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Lightweight GTK+ clipboard manager";
|
Description = "Lightweight GTK+ clipboard manager";
|
||||||
After = [ "graphical-session-pre.target" ];
|
Requires = [ "tray.target" ];
|
||||||
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,8 @@ with lib;
|
||||||
systemd.user.services.pasystray = {
|
systemd.user.services.pasystray = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "PulseAudio system tray";
|
Description = "PulseAudio system tray";
|
||||||
After = [ "graphical-session-pre.target" ];
|
Requires = [ "tray.target" ];
|
||||||
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -197,8 +197,7 @@ in {
|
||||||
systemd.user.services.polybar = {
|
systemd.user.services.polybar = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Polybar status bar";
|
Description = "Polybar status bar";
|
||||||
After = [ "graphical-session-pre.target" ];
|
PartOf = [ "tray.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
|
||||||
X-Restart-Triggers =
|
X-Restart-Triggers =
|
||||||
[ "${config.xdg.configFile."polybar/config".source}" ];
|
[ "${config.xdg.configFile."polybar/config".source}" ];
|
||||||
};
|
};
|
||||||
|
@ -212,7 +211,7 @@ in {
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
Install = { WantedBy = [ "tray.target" ]; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -56,11 +56,10 @@ in {
|
||||||
systemd.user.services.stalonetray = {
|
systemd.user.services.stalonetray = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Stalonetray system tray";
|
Description = "Stalonetray system tray";
|
||||||
After = [ "graphical-session-pre.target" ];
|
PartOf = [ "tray.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
Install = { WantedBy = [ "tray.target" ]; };
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${cfg.package}/bin/stalonetray";
|
ExecStart = "${cfg.package}/bin/stalonetray";
|
||||||
|
|
|
@ -29,16 +29,17 @@ in {
|
||||||
systemd.user.services.status-notifier-watcher = {
|
systemd.user.services.status-notifier-watcher = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "SNI watcher";
|
Description = "SNI watcher";
|
||||||
After = [ "graphical-session-pre.target" ];
|
PartOf = [ "tray.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
|
||||||
Before = [ "taffybar.service" ];
|
Before = [ "taffybar.service" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = { ExecStart = "${cfg.package}/bin/status-notifier-watcher"; };
|
Service = {
|
||||||
|
Type = "dbus";
|
||||||
Install = {
|
BusName = "org.kde.StatusNotifierWatcher";
|
||||||
WantedBy = [ "graphical-session.target" "taffybar.service" ];
|
ExecStart = "${cfg.package}/bin/status-notifier-watcher";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Install = { WantedBy = [ "tray.target" "taffybar.service" ]; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,12 +74,8 @@ with lib;
|
||||||
${config.services.syncthing.tray.package.pname} = {
|
${config.services.syncthing.tray.package.pname} = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = config.services.syncthing.tray.package.pname;
|
Description = config.services.syncthing.tray.package.pname;
|
||||||
After = [
|
Requires = [ "tray.target" ];
|
||||||
"graphical-session-pre.target"
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
||||||
"polybar.service"
|
|
||||||
"taffybar.service"
|
|
||||||
"stalonetray.service"
|
|
||||||
];
|
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -100,12 +96,8 @@ with lib;
|
||||||
"syncthingtray" = {
|
"syncthingtray" = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "syncthingtray";
|
Description = "syncthingtray";
|
||||||
After = [
|
Requires = [ "tray.target" ];
|
||||||
"graphical-session-pre.target"
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
||||||
"polybar.service"
|
|
||||||
"taffybar.service"
|
|
||||||
"stalonetray.service"
|
|
||||||
];
|
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -27,16 +27,17 @@ in {
|
||||||
systemd.user.services.taffybar = {
|
systemd.user.services.taffybar = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Taffybar desktop bar";
|
Description = "Taffybar desktop bar";
|
||||||
After = [ "graphical-session-pre.target" ];
|
PartOf = [ "tray.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
|
Type = "dbus";
|
||||||
|
BusName = "org.taffybar.Bar";
|
||||||
ExecStart = "${cfg.package}/bin/taffybar";
|
ExecStart = "${cfg.package}/bin/taffybar";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
Install = { WantedBy = [ "tray.target" ]; };
|
||||||
};
|
};
|
||||||
|
|
||||||
xsession.importedVariables = [ "GDK_PIXBUF_MODULE_FILE" ];
|
xsession.importedVariables = [ "GDK_PIXBUF_MODULE_FILE" ];
|
||||||
|
|
|
@ -77,7 +77,8 @@ in {
|
||||||
systemd.user.services.udiskie = {
|
systemd.user.services.udiskie = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "udiskie mount daemon";
|
Description = "udiskie mount daemon";
|
||||||
After = [ "graphical-session-pre.target" ];
|
Requires = [ "tray.target" ];
|
||||||
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -110,12 +110,21 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
targets = {
|
||||||
# A basic graphical session target for Home Manager.
|
# A basic graphical session target for Home Manager.
|
||||||
targets.hm-graphical-session = {
|
hm-graphical-session = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Home Manager X session";
|
Description = "Home Manager X session";
|
||||||
Requires = [ "graphical-session-pre.target" ];
|
Requires = [ "graphical-session-pre.target" ];
|
||||||
BindsTo = [ "graphical-session.target" ];
|
BindsTo = [ "graphical-session.target" "tray.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
tray = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Home Manager System Tray";
|
||||||
|
Requires = [ "graphical-session-pre.target" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue