From 65ee159e94ff69bec981a64c0c62f8cd4403bef9 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Tue, 9 Apr 2024 14:23:08 +0200 Subject: [PATCH] make screenshots hyprshot --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 5 +++++ modules/hyprland.nix | 7 +++---- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index c8f18d3..3d6b6cc 100644 --- a/flake.lock +++ b/flake.lock @@ -527,6 +527,26 @@ "type": "github" } }, + "hyprpicker": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1711283076, + "narHash": "sha256-Cda+XbHpvyz3HhdJ7FlXFoaazOWtdBoOWmEaj4ZFwRM=", + "owner": "hyprwm", + "repo": "hyprpicker", + "rev": "0eb49192a5cdd5e6e8e6c2c82c33857d78d6cd56", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprpicker", + "type": "github" + } + }, "lanzaboote": { "inputs": { "crane": "crane", @@ -859,6 +879,7 @@ "disko": "disko", "home-manager": "home-manager", "hyprland": "hyprland", + "hyprpicker": "hyprpicker", "lazy": "lazy", "nix-colors": "nix-colors", "nixpkgs": "nixpkgs_4", diff --git a/flake.nix b/flake.nix index cc24339..266ba00 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + hyprpicker = { + url = "github:hyprwm/hyprpicker"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + disko = { url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/hyprland.nix b/modules/hyprland.nix index 2f4b93d..c2696a2 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -41,8 +41,8 @@ in libnotify # to enable the notify-send command wl-clipboard - slurp - grim + inputs.hyprpicker + hyprshot hypridle # TODO: remove when fixed with config playerctl @@ -123,8 +123,7 @@ in "$mod,F,togglefloating" "$mod,X,togglespecialworkspace" "SUPERSHIFT,X,movetoworkspace,special" - "$mod,Print,exec,grim - | wl-copy && notify-send 'Screenshot Copied to Clipboard'" - "SUPERSHIFT,S,exec,slurp | grim -g - /tmp/photo && wl-copy < /tmp/photo && notify-send 'Screenshot Copied to Clipboard'" + "SUPERSHIFT,S,exec,hyprshot -m region --clipboard-only" "$mod,f11,fullscreen,0" ",XF86AudioLowerVolume,exec,wpctl set-volume @DEFAULT_SINK@ 1%-" ",XF86AudioRaiseVolume,exec,wpctl set-volume @DEFAULT_SINK@ 1%+"