diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 1b2c0eb..d8849e3 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -19,7 +19,6 @@ ./greetd.nix ./niri.nix ./qt.nix - ./screenshot.nix ./gtk/default.nix ./dms/default.nix ]; diff --git a/modules/desktop/screenshot.nix b/modules/desktop/screenshot.nix deleted file mode 100644 index 1b1a5b4..0000000 --- a/modules/desktop/screenshot.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - screenshotPkg = pkgs.writeShellScriptBin "screenshot" '' - AREA=$(${lib.getExe pkgs.slurp} -d) - ${lib.getExe pkgs.grim} -t ppm -g "$AREA" - | ${lib.getExe pkgs.satty} -f - --initial-tool=arrow --early-exit --copy-command=${pkgs.wl-clipboard}/bin/wl-copy --action-on-enter="save-to-clipboard" --disable-notifications - ''; -in { - config = lib.mkIf config.fireproof.desktop.enable { - environment.systemPackages = [ - screenshotPkg - ]; - }; -} diff --git a/modules/scripts/default.nix b/modules/scripts/default.nix index b22eea2..7fe8c71 100644 --- a/modules/scripts/default.nix +++ b/modules/scripts/default.nix @@ -1,6 +1,7 @@ { pkgs, lib, + config, ... }: let makeScript = { @@ -13,13 +14,23 @@ text = builtins.readFile path; }; in { - environment.systemPackages = [ - (makeScript { - path = ./reboot-windows.bash; + environment.systemPackages = + [ + (makeScript { + path = ./reboot-windows.bash; + runtimeInputs = with pkgs; [ + jq + systemd # for bootctl and systemctl + ]; + }) + ] + ++ lib.optional config.fireproof.desktop.enable (makeScript { + path = ./screenshot.bash; runtimeInputs = with pkgs; [ - jq - systemd # for bootctl and systemctl + slurp + grim + satty + wl-clipboard ]; - }) - ]; + }); } diff --git a/modules/scripts/screenshot.bash b/modules/scripts/screenshot.bash new file mode 100644 index 0000000..0851e08 --- /dev/null +++ b/modules/scripts/screenshot.bash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +AREA=$(slurp -d) +grim -t ppm -g "$AREA" - | satty -f - --initial-tool=arrow --early-exit --copy-command="wl-copy" --action-on-enter="save-to-clipboard" --disable-notifications