From 64d2afbd67d1ea858e4f5690d6f2495767dd2d45 Mon Sep 17 00:00:00 2001 From: Asmir A Date: Tue, 13 Feb 2024 14:19:52 +0100 Subject: [PATCH] home/sway: add clipboard screenshot script --- home/sway.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home/sway.nix b/home/sway.nix index 60a7322..dc88a42 100644 --- a/home/sway.nix +++ b/home/sway.nix @@ -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";