diff --git a/users/configs/ags/config/src/index.ts b/users/configs/ags/config/src/index.ts index 467bab6..a4b613b 100644 --- a/users/configs/ags/config/src/index.ts +++ b/users/configs/ags/config/src/index.ts @@ -15,3 +15,5 @@ App.config({ ...forMonitors(bar), ] }); + +Utils.execAsync('systemd-notify --ready') diff --git a/users/configs/ags/default.nix b/users/configs/ags/default.nix index b2d5818..fc15bee 100644 --- a/users/configs/ags/default.nix +++ b/users/configs/ags/default.nix @@ -20,19 +20,41 @@ in output_path = "${hmConfig.xdg.configHome}/ags/theme.sass"; }; - wayland.windowManager.hyprland.initExtraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { - name = "init-ags"; - runtimeInputs = with pkgs; [ - inputs.ags.packages.${stdenv.hostPlatform.system}.default - sassc - hyprland - nixos-icons - rofi-wayland - wl-clipboard - cliphist - libdbusmenu-gtk3 - ]; - text = "ags &> /tmp/ags.log"; - })} &"; + systemd.user = { + targets.tray.Unit = { + BindsTo = [ "ags.service" ]; + After = [ "graphical-session.target" "ags.service" ]; + }; + + services.ags = { + Unit = { + Description = "Desktop widget shell"; + BindsTo = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service = { + Type = "notify"; + NotifyAccess = "all"; + + ExecStart = lib.meta.getExe (pkgs.writeShellApplication { + name = "init-ags"; + runtimeInputs = with pkgs; [ + inputs.ags.packages.${stdenv.hostPlatform.system}.default + sassc + hyprland + nixos-icons + rofi-wayland + wl-clipboard + cliphist + libdbusmenu-gtk3 + ]; + text = "exec ags"; + }); + }; + + Install.WantedBy = [ "graphical-session.target" ]; + }; + }; }; } diff --git a/users/configs/blueman/default.nix b/users/configs/blueman/default.nix index 6559797..84e1703 100644 --- a/users/configs/blueman/default.nix +++ b/users/configs/blueman/default.nix @@ -6,15 +6,19 @@ home-manager.users.${user.name} = { services.blueman-applet.enable = true; - systemd.user.services.mpris-proxy = { - Unit = { - Description = "MPRIS proxy"; - Requires = [ "sound.target" ]; - After = [ "network.target" "sound.target" ]; - }; + systemd.user.services = { + blueman-applet.Unit.After = [ "graphical-session.target" ]; - Service.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; - Intall.WantedBy = [ "default.target" ]; + mpris-proxy = { + Unit = { + Description = "MPRIS proxy"; + Requires = [ "sound.target" ]; + After = [ "network.target" "sound.target" ]; + }; + + Service.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; + Install.WantedBy = [ "default.target" ]; + }; }; }; } diff --git a/users/configs/btop/default.nix b/users/configs/btop/default.nix index 2b1834a..ea6770d 100644 --- a/users/configs/btop/default.nix +++ b/users/configs/btop/default.nix @@ -30,7 +30,7 @@ in theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { name = "reload-btop"; runtimeInputs = with pkgs; [ procps ]; - text = "pkill btop -SIGUSR2"; + text = "exec pkill btop -SIGUSR2"; })} &"; }; } diff --git a/users/configs/cliphist/default.nix b/users/configs/cliphist/default.nix index e4509e0..8241443 100644 --- a/users/configs/cliphist/default.nix +++ b/users/configs/cliphist/default.nix @@ -10,26 +10,44 @@ in persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/cliphist" ]; }; - wayland.windowManager.hyprland = { - initExtraConfig = '' - ${lib.meta.getExe (pkgs.writeShellApplication { + systemd.user.services = { + cliphist-text = { + Unit = { + Description = "Clipboard manager (text)"; + BindsTo = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service.ExecStart = lib.meta.getExe (pkgs.writeShellApplication { name = "init-cliphist-text"; runtimeInputs = with pkgs; [ wl-clipboard cliphist ]; - text = "wl-paste --type text --watch cliphist store"; - })} & + text = "exec wl-paste --type text --watch cliphist store"; + }); - ${lib.meta.getExe (pkgs.writeShellApplication { + Install.WantedBy = [ "graphical-session.target" ]; + }; + + cliphist-image = { + Unit = { + Description = "Clipboard manager (images)"; + BindsTo = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service.ExecStart = lib.meta.getExe (pkgs.writeShellApplication { name = "init-cliphist-image"; runtimeInputs = with pkgs; [ wl-clipboard cliphist ]; - text = "wl-paste --type image --watch cliphist store"; - })} & - ''; + text = "exec wl-paste --type image --watch cliphist store"; + }); - settings.bind = [ - "$mod, v, exec, cliphist list | ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -dmenu -display-columns 2 | cliphist decode | wl-copy" - "$mod_CTRL, v, exec, cliphist list | ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -dmenu -display-columns 2 | cliphist delete" - "$mod_CTRL_SHIFT, v, exec, cliphist wipe" - ]; + Install.WantedBy = [ "graphical-session.target" ]; + }; }; + + wayland.windowManager.hyprland.settings.bind = [ + "$mod, v, exec, cliphist list | ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -dmenu -display-columns 2 | cliphist decode | wl-copy" + "$mod_CTRL, v, exec, cliphist list | ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -dmenu -display-columns 2 | cliphist delete" + "$mod_CTRL_SHIFT, v, exec, cliphist wipe" + ]; }; } diff --git a/users/configs/hyprland/default.nix b/users/configs/hyprland/default.nix index 9953ce1..1d70cd7 100644 --- a/users/configs/hyprland/default.nix +++ b/users/configs/hyprland/default.nix @@ -136,7 +136,7 @@ in theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { name = "reload-hyprland"; runtimeInputs = with pkgs; [ hyprland ]; - text = "hyprctl reload"; + text = "exec hyprctl reload"; })} &"; home.sessionVariables.NIXOS_OZONE_WL = "1"; diff --git a/users/configs/hyprshot/default.nix b/users/configs/hyprshot/default.nix index 2821ee1..a2a9e07 100644 --- a/users/configs/hyprshot/default.nix +++ b/users/configs/hyprshot/default.nix @@ -19,7 +19,7 @@ in swappyWrapper = lib.meta.getExe (pkgs.writeShellApplication { name = "swappy-wrapper"; runtimeInputs = with pkgs; [ swappy ]; - text = "swappy -f \"$1\""; + text = "exec swappy -f \"$1\""; }); in [ diff --git a/users/configs/kitty/default.nix b/users/configs/kitty/default.nix index 46e8979..db83416 100644 --- a/users/configs/kitty/default.nix +++ b/users/configs/kitty/default.nix @@ -30,7 +30,7 @@ in theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { name = "reload-kitty"; runtimeInputs = with pkgs; [ procps ]; - text = "pkill kitty -SIGUSR1"; + text = "exec pkill kitty -SIGUSR1"; })} &"; home.persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/kitty" ]; diff --git a/users/configs/matugen/default.nix b/users/configs/matugen/default.nix index bac3a7f..249dd15 100644 --- a/users/configs/matugen/default.nix +++ b/users/configs/matugen/default.nix @@ -76,7 +76,7 @@ in name = "theme-matugen"; runtimeInputs = with pkgs; [ matugen ]; text = '' - matugen image "${hmConfig.theme.configDir}/wallpaper" \ + exec matugen image "${hmConfig.theme.configDir}/wallpaper" \ --type scheme-${hmConfig.theme.flavour} \ --mode "$(cat "${hmConfig.theme.configDir}/mode")" \ --contrast ${builtins.toString hmConfig.theme.contrast} diff --git a/users/configs/networkmanager/default.nix b/users/configs/networkmanager/default.nix index e8190b2..9b2167c 100644 --- a/users/configs/networkmanager/default.nix +++ b/users/configs/networkmanager/default.nix @@ -1,5 +1,8 @@ { user ? throw "user argument is required" }: { ... }: { - home-manager.users.${user.name}.services.network-manager-applet.enable = true; + home-manager.users.${user.name} = { + services.network-manager-applet.enable = true; + systemd.user.services.network-manager-applet.Unit.After = [ "graphical-session.target" ]; + }; } diff --git a/users/configs/swww/default.nix b/users/configs/swww/default.nix index 342fcfb..561f424 100644 --- a/users/configs/swww/default.nix +++ b/users/configs/swww/default.nix @@ -2,6 +2,14 @@ let hmConfig = config.home-manager.users.${user.name}; + themeSwww = lib.meta.getExe (pkgs.writeShellApplication { + name = "theme-swww"; + runtimeInputs = with pkgs; [ + coreutils-full + swww + ]; + text = "exec swww img \"${hmConfig.theme.configDir}/wallpaper\""; + }); in { home-manager.users.${user.name} = { @@ -10,27 +18,34 @@ in persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/swww" ]; }; - wayland.windowManager.hyprland.initExtraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { - name = "init-swww"; - runtimeInputs = with pkgs; [ - coreutils-full - swww - ]; - text = '' - swww-daemon &> /tmp/swww.log + systemd.user.services.swww = { + Unit = { + Description = "Wallpaper daemon"; + BindsTo = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; - while ! swww query &> /dev/null; do - sleep 0.1 - done + Service = { + Type = "forking"; - swww img "${hmConfig.theme.configDir}/wallpaper" - ''; - })} &"; + ExecStart = lib.meta.getExe (pkgs.writeShellApplication { + name = "init-swww"; + runtimeInputs = with pkgs; [ swww ]; + text = "exec swww init"; + }); - theme.extraConfig = lib.mkAfter "${lib.meta.getExe (pkgs.writeShellApplication { - name = "theme-swww"; - runtimeInputs = with pkgs; [ swww ]; - text = "swww img \"${hmConfig.theme.configDir}/wallpaper\""; - })} &"; + ExecStartPost = themeSwww; + + ExecStop = lib.meta.getExe (pkgs.writeShellApplication { + name = "kill-swww"; + runtimeInputs = with pkgs; [ swww ]; + text = "exec swww kill"; + }); + }; + + Install.WantedBy = [ "graphical-session.target" ]; + }; + + theme.extraConfig = lib.mkAfter "${themeSwww} &"; }; }