home/sway: add clipboard screenshot script

This commit is contained in:
Asmir A 2024-02-13 14:19:52 +01:00
parent 2233cd378a
commit 64d2afbd67
Signed by: asmir
GPG Key ID: 020C42B7A9ABA3E2

View File

@ -12,6 +12,10 @@
${pkgs.cliphist}/bin/cliphist decode | \
${pkgs.wl-clipboard}/bin/wl-copy
'';
screenshot_clip = pkgs.writeShellScriptBin "screenshot_clip" ''
GEOM="$(${pkgs.slurp}/bin/slurp -d)"
${pkgs.grim}/bin/grim -g "$GEOM" - | ${pkgs.wl-clipboard}/bin/wl-copy
'';
swaysw = inputs.swaysw.packages.${system}.swaysw;
zapzap = pkgs.callPackage ../packages/zapzap/default.nix {};
viber = pkgs.callPackage ../packages/viber/default.nix {};
@ -80,6 +84,7 @@ in {
"Alt+Shift+Return" = "exec ${term}";
"Alt+p" = "exec ${pkgs.dmenu-wayland}/bin/dmenu-wl_run -fn \"mono 14\"";
"Alt+c" = "exec ${pkgs.moreutils}/bin/lckdo cliphist_sway ${cliphist_sway}/bin/cliphist_sway";
"Print" = "exec ${pkgs.moreutils}/bin/lckdo screenshot_clip ${screenshot_clip}/bin/screenshot_clip";
"Alt+Shift+space" = "floating toggle";
"Alt+space" = "focus mode_toggle";