Migrate graphical-session services to systemd
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -15,3 +15,5 @@ App.config({
|
||||
...forMonitors(bar),
|
||||
]
|
||||
});
|
||||
|
||||
Utils.execAsync('systemd-notify --ready')
|
||||
|
@@ -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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -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";
|
||||
})} &";
|
||||
};
|
||||
}
|
||||
|
@@ -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"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
@@ -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";
|
||||
|
@@ -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
|
||||
[
|
||||
|
@@ -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" ];
|
||||
|
@@ -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}
|
||||
|
@@ -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" ];
|
||||
};
|
||||
}
|
||||
|
@@ -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} &";
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user