mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-25 05:31:55 -05:00
home/wayland: simplify screenshooter
This commit is contained in:
parent
f401d0e7bd
commit
8b88138f03
|
@ -17,22 +17,24 @@
|
||||||
prev = "${bin} previous";
|
prev = "${bin} previous";
|
||||||
};
|
};
|
||||||
|
|
||||||
screenshot = {
|
screenshot = rec {
|
||||||
region = pkgs.writeShellScript "screenshot-region" ''
|
bin = pkgs.writeShellScript "screenshooter" ''
|
||||||
FILENAME=$HOME/pics/screenshots/$(date +'%Y-%m-%d-%H:%M_grim.png')
|
FILENAME=$HOME/pics/screenshots/$(date +'%Y-%m-%d-%H:%M_grim.png')
|
||||||
|
|
||||||
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp})" "$FILENAME"
|
if [ "$1" == "region" ]; then
|
||||||
|
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp})" "$FILENAME"
|
||||||
|
elif [ "$1" == "screen" ]; then
|
||||||
|
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp} -o)" "$FILENAME"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
${lib.getExe' pkgs.wl-clipboard-rs "wl-copy"} $FILENAME
|
${lib.getExe' pkgs.wl-clipboard-rs "wl-copy"} $FILENAME
|
||||||
${lib.getExe' pkgs.libnotify "notify-send"} "Screenshot saved" "$FILENAME" -i "$FILENAME"
|
${lib.getExe' pkgs.libnotify "notify-send"} "Screenshot saved" "$FILENAME" -i "$FILENAME"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
screen = pkgs.writeShellScript "screenshot-screen" ''
|
region = "${bin} region";
|
||||||
FILENAME=$HOME/pics/screenshots/$(date +'%Y-%m-%d-%H:%M_grim.png')
|
screen = "${bin} screen";
|
||||||
|
|
||||||
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp} -o)" "$FILENAME"
|
|
||||||
${lib.getExe' pkgs.wl-clipboard-rs "wl-copy"} $FILENAME
|
|
||||||
${lib.getExe' pkgs.libnotify "notify-send"} "Screenshot saved" "$FILENAME" -i "$FILENAME"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
volume = rec {
|
volume = rec {
|
||||||
|
|
Loading…
Reference in a new issue