From ec389b13c93440616aef45520614d4a8250515d1 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Mon, 8 Jul 2024 17:50:26 +0800 Subject: [PATCH] home/sway: use grimshot --- home/applications/sway/default.nix | 5 +---- pkgs/default.nix | 1 - pkgs/scripts/screenshot.nix | 23 ----------------------- 3 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 pkgs/scripts/screenshot.nix diff --git a/home/applications/sway/default.nix b/home/applications/sway/default.nix index bb348f9..adf66e8 100644 --- a/home/applications/sway/default.nix +++ b/home/applications/sway/default.nix @@ -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%+"; diff --git a/pkgs/default.nix b/pkgs/default.nix index 938e460..59bcb8b 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -9,6 +9,5 @@ in { # scripts lofi = self.callPackage ./scripts/lofi.nix {}; - screenshot = self.callPackage ./scripts/screenshot.nix {}; }); } diff --git a/pkgs/scripts/screenshot.nix b/pkgs/scripts/screenshot.nix deleted file mode 100644 index fcbb0f9..0000000 --- a/pkgs/scripts/screenshot.nix +++ /dev/null @@ -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' - ''; - }; -}