Files
Nikolaos Karaolidis 184aa4da8f Update
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-07-13 23:33:27 +01:00

47 lines
1.5 KiB
Nix

{ user, home }:
{
config,
lib,
pkgs,
...
}:
{
home-manager.users.${user} = {
home = {
packages = with pkgs; [
hyprshot
swappy
];
sessionVariables.HYPRSHOT_DIR = "Pictures/screenshots";
};
wayland.windowManager.hyprland.settings.bind =
let
hyprshot = lib.meta.getExe pkgs.hyprshot;
date = "${pkgs.coreutils}/bin/date";
filename = "\"$(${date} +'%Y-%m-%d-%H%M%S.png')\"";
swappyWrapper = lib.meta.getExe (
pkgs.writeShellApplication {
name = "swappy-wrapper";
runtimeInputs = with pkgs; [ swappy ];
text = "exec swappy -f \"$1\"";
}
);
in
[
", Print, exec, uwsm app -- ${hyprshot} -m output -m active -f ${filename}"
"Ctrl, Print, exec, uwsm app -- ${hyprshot} -m output -m active -f ${filename} -- ${swappyWrapper}"
"$mod, s, exec, uwsm app -- ${hyprshot} -m output -m active -f ${filename}"
"$mod_Ctrl, s, exec, uwsm app -- ${hyprshot} -m output -m active -f ${filename} -- ${swappyWrapper}"
", XF86SelectiveScreenshot, exec, uwsm app -- ${hyprshot} -m region -z -f ${filename}"
"Ctrl, XF86SelectiveScreenshot, exec, uwsm app -- ${hyprshot} -m region -z -f ${filename} -- ${swappyWrapper}"
"$mod_Shift, S, exec, uwsm app -- ${hyprshot} -m region -z -f ${filename}"
"$mod_Shift_Ctrl, S, exec, uwsm app -- ${hyprshot} -m region -z -f ${filename} -- ${swappyWrapper}"
];
};
}