diff --git a/scripts/screenshotsh b/scripts/screenshotsh index 98aa17e..439d132 100755 --- a/scripts/screenshotsh +++ b/scripts/screenshotsh @@ -46,4 +46,13 @@ case $1 in $screenshot -o "$cur_output" - | $copy || $screenshot - | $copy ;; + edit) + # Focused monitor to clipboard + cur_output=$(swaymsg -t get_outputs | + jq -r '.[] | select(.focused) | .name') + + test -n "$cur_output" && + $screenshot -o "$cur_output" - | satty --filename - --output-filename "$DESTFILE" || + $screenshot - | satty --filename - --output-filename "$DESTFILE" + ;; esac diff --git a/user/sway/sway-binds.nix b/user/sway/sway-binds.nix index 74cd842..a68a31b 100644 --- a/user/sway/sway-binds.nix +++ b/user/sway/sway-binds.nix @@ -173,9 +173,7 @@ let "${mod}+c" = "exec ${pkgs.color_picker}/bin/color_picker"; "${mod}+Return" = "exec ${terminal}"; "${mod}+Ctrl+Return" = "exec thunar"; - "${mod}+Shift+s" = '' - exec grim - | satty --filename - --output-filename "$(xdg-user-dir PICTURES)"/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png - ''; + "${mod}+Shift+s" = "exec ${pkgs.screenshotsh}/bin/screenshotsh edit"; "${mod}+Ctrl+v" = "exec wl-paste | tesseract -l por - - | wl-copy"; "${mod}+k" = "exec showkeys"; "${mod}+Alt+x" = "exec pkill wl-crosshair || exec wl-crosshair";