sway: only open current monitor for satty screenshot editor

This commit is contained in:
Leonardo Eugênio 2025-09-04 00:28:29 -03:00
parent e72e9a2688
commit 2f7572839f
2 changed files with 10 additions and 3 deletions

View file

@ -46,4 +46,13 @@ case $1 in
$screenshot -o "$cur_output" - | $copy || $screenshot -o "$cur_output" - | $copy ||
$screenshot - | $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 esac

View file

@ -173,9 +173,7 @@ let
"${mod}+c" = "exec ${pkgs.color_picker}/bin/color_picker"; "${mod}+c" = "exec ${pkgs.color_picker}/bin/color_picker";
"${mod}+Return" = "exec ${terminal}"; "${mod}+Return" = "exec ${terminal}";
"${mod}+Ctrl+Return" = "exec thunar"; "${mod}+Ctrl+Return" = "exec thunar";
"${mod}+Shift+s" = '' "${mod}+Shift+s" = "exec ${pkgs.screenshotsh}/bin/screenshotsh edit";
exec grim - | satty --filename - --output-filename "$(xdg-user-dir PICTURES)"/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png
'';
"${mod}+Ctrl+v" = "exec wl-paste | tesseract -l por - - | wl-copy"; "${mod}+Ctrl+v" = "exec wl-paste | tesseract -l por - - | wl-copy";
"${mod}+k" = "exec showkeys"; "${mod}+k" = "exec showkeys";
"${mod}+Alt+x" = "exec pkill wl-crosshair || exec wl-crosshair"; "${mod}+Alt+x" = "exec pkill wl-crosshair || exec wl-crosshair";