feat: screenshot script

main
Ricard Illa 2023-08-02 13:07:07 +02:00
parent 0a938c80d4
commit be4d78b4f6
Signed by: rilla
GPG Key ID: 525307BD467E4205
2 changed files with 21 additions and 8 deletions

View File

@ -27,6 +27,7 @@
wl-clipboard
wtype
xdg-utils
(pks.callPackage ./screenshot.nix { inherit config pkgs; })
];
programs. zsh. loginExtra = ''

View File

@ -0,0 +1,12 @@
{ config, pkgs, ... }:
let
shell = "${pkgs.dash}/bin/dash";
grim = "${pkgs.grim}/bin/grim";
slurp = "${pkgs.slurp}/bin/slurp";
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
in
pkgs.writeScriptBin "screenshot" ''
#!${shell}
${grim} -g "$(${slurp} -d)" - | ${wl-copy} -t image/png
''