home/sway: use grimshot

This commit is contained in:
Guanran Wang 2024-07-08 17:50:26 +08:00
parent 708f1e60b7
commit 330ed148a4
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF
3 changed files with 1 additions and 28 deletions

View file

@ -95,7 +95,6 @@ in {
modifier = "Mod4";
keybindings = let
inherit (config.wayland.windowManager.sway.config) modifier;
screenshot = lib.getExe inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.scripts.screenshot;
in
{
### Sway itself
@ -129,9 +128,7 @@ in {
"${modifier}+Shift+Semicolon" = "exec loginctl lock-session";
# Screenshot
"${modifier}+Shift+s" = "exec ${screenshot} region";
"Print" = "exec ${screenshot} fullscreen";
"Print+Control" = "exec ${screenshot} swappy";
"Print" = "exec env XDG_SCREENSHOTS_DIR=$HOME/Pictures/Screenshots ${lib.getExe pkgs.sway-contrib.grimshot} --notify savecopy anything";
# Fn keys
"XF86MonBrightnessUp" = "exec ${lib.getExe pkgs.brightnessctl} set 5%+";

View file

@ -9,6 +9,5 @@ in {
# scripts
lofi = self.callPackage ./scripts/lofi.nix {};
screenshot = self.callPackage ./scripts/screenshot.nix {};
});
}

View file

@ -1,23 +0,0 @@
{
makeScript,
coreutils,
jq,
grim,
slurp,
swappy,
wl-clipboard,
libnotify,
fetchurl,
}:
makeScript {
name = "screenshot";
runtimeInputs = [coreutils jq grim slurp swappy wl-clipboard libnotify];
src = fetchurl {
url = "https://raw.githubusercontent.com/nwg-piotr/nwg-shell/c29e8eb4658a2613fb221ead0b101c75f457bcaf/scripts/screenshot";
hash = "sha256-w0zdCX6az0WNM0G4RrNuKbQ0O9aSIK6ssAMMaFlsjA0=";
postFetch = ''
substituteInPlace $out \
--replace-fail 'DIR=''${SCREENSHOT_DIR:=$HOME/Screenshots}' 'DIR=$HOME/Pictures/Screenshots'
'';
};
}