better systemd user services

This commit is contained in:
Alexander Bantyev 2021-09-23 20:13:38 +03:00
parent a7cea64f06
commit 47e7ac5479
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
4 changed files with 15 additions and 4 deletions

View File

@ -91,8 +91,10 @@ in {
Service = { Service = {
Environment = Environment =
"PATH=/run/current-system/sw/bin:/etc/profiles/per-user/balsoft/bin"; "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/balsoft/bin";
After = "sway-session.target"; };
WantedBy = "sway-session.target"; Install = {
After = [ "sway-session.target" ];
WantedBy = lib.mkForce [ "sway-session.target" ];
}; };
}; };

View File

@ -1,6 +1,7 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
with pkgs.my-lib; { with pkgs.my-lib; {
xdg.portal.enable = true; xdg.portal.enable = true;
services.dbus.packages = services.dbus.packages =
[ pkgs.firefox pkgs.systemd pkgs.papirus-icon-theme ]; [ pkgs.firefox pkgs.systemd pkgs.papirus-icon-theme ];
services.udev.packages = [ pkgs.libmtp pkgs.media-player-info ]; services.udev.packages = [ pkgs.libmtp pkgs.media-player-info ];

View File

@ -1,6 +1,14 @@
{ pkgs, config, ... }: { { pkgs, config, ... }: {
home-manager.users.balsoft = { home-manager.users.balsoft = {
wayland.windowManager.sway.config.startup = [{ command = "mako"; }]; systemd.user.services.mako = {
Service = {
ExecStart = "${pkgs.mako}/bin/mako";
};
Install = {
After = [ "sway-session.target" ];
WantedBy = [ "sway-session.target" ];
};
};
programs.mako = with pkgs.my-lib.thmHash; { programs.mako = with pkgs.my-lib.thmHash; {
enable = true; enable = true;
layer = "overlay"; layer = "overlay";

View File

@ -82,7 +82,7 @@
else else
cmdstat="" cmdstat=""
fi fi
if [ ! -z "$cmd" ]; then if [ ! -z "$cmd" ] && [[ $cmd_time -gt 3 ]]; then
${pkgs.libnotify}/bin/notify-send -i utilities-terminal -u low "$cmdstat $cmd" "in `date -u -d @$cmd_time +'%T'`" ${pkgs.libnotify}/bin/notify-send -i utilities-terminal -u low "$cmdstat $cmd" "in `date -u -d @$cmd_time +'%T'`"
fi fi
unset cmd unset cmd