Migrate graphical-session services to systemd

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-07-07 11:29:18 +03:00
parent 5308735a40
commit c3d89af891
11 changed files with 125 additions and 61 deletions

View File

@@ -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"
];
};
}