even BETTER screenshotting

This commit is contained in:
Reid 2024-06-09 03:10:25 -07:00
parent 290b006209
commit e52bd4c9b7
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD

View file

@ -76,8 +76,29 @@ in {
"SUPER, Super_L, exec, ${lib.getExe pkgs.nwg-drawer}" "SUPER, Super_L, exec, ${lib.getExe pkgs.nwg-drawer}"
]; ];
bind = let bind = let
# screenshotScript = pkgs.writeScript "screenshot" ''
# ${lib.getExe pkgs.grimblast} --freeze --notify copy area
# '';
screenshotScript = pkgs.writeScript "screenshot" '' screenshotScript = pkgs.writeScript "screenshot" ''
${lib.getExe pkgs.grimblast} --freeze --notify copy area temp_file=$(mktemp)
trap 'rm -f "$temp_file"' EXIT
${lib.getExe pkgs.grimblast} --freeze save area - > "$temp_file" || exit 1
cat "$temp_file" | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard -t image/png
action=$(${pkgs.libnotify}/bin/notify-send "Screenshot Captured" \
--app-name="Screenshot" \
--urgency=normal \
--action="default=Edit Image" \
--icon "$temp_file" \
"Click to open in Swappy")
case "$action" in
default)
${lib.getExe pkgs.swappy} -f "$temp_file"
;;
esac
''; '';
in [ in [
"$mod, R, exec, ${lib.getExe pkgs.rofi-wayland} -show run" "$mod, R, exec, ${lib.getExe pkgs.rofi-wayland} -show run"