Move some (all) files around
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
44
hosts/common/user/configs/gui/hyprshot/default.nix
Normal file
44
hosts/common/user/configs/gui/hyprshot/default.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user.name};
|
||||
in
|
||||
{
|
||||
home-manager.users.${user.name} = {
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
hyprshot
|
||||
swappy
|
||||
];
|
||||
sessionVariables.HYPRSHOT_DIR = "${hmConfig.xdg.userDirs.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, ${hyprshot} -m output -m active -f ${filename}"
|
||||
"SHIFT, Print, exec, ${hyprshot} -m output -m active -f ${filename} -- ${swappyWrapper}"
|
||||
", XF86SelectiveScreenshot, exec, ${hyprshot} -m region -z -f ${filename}"
|
||||
"SHIFT, XF86SelectiveScreenshot, exec, ${hyprshot} -m region -z -f ${filename} -- ${swappyWrapper}"
|
||||
];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user