diff --git a/.config/sway/config b/.config/sway/config index 79d0a37..92145c2 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -200,8 +200,9 @@ assign [class="vlc"] M bindsym { - print exec grim $(xdg-user-dir PICTURES)/grim-$(date +'%Y-%m-%dT%H-%M-%S').png + print exec grim $(xdg-user-dir PICTURES)/screenshots/grim-$(date +'%Y-%m-%dT%H-%M-%S').png Shift+print exec grim -g "$(slurp)" - | wl-copy + Control+print exec winprint.sh $mod+c exec gnome-calculator $mod+n exec nemo $mod+m exec QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_QPA_PLATFORMTHEME=wayland vlc diff --git a/bin/winprint.sh b/bin/winprint.sh new file mode 100755 index 0000000..debc294 --- /dev/null +++ b/bin/winprint.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# taken from https://github.com/swaywm/sway/blob/12e223e7973f7d7132d95c6302328067dec732ce/contrib/grimshot +FOCUSED=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)') +GEOM=$(echo "$FOCUSED" | jq -r '.rect | "\(.x),\(.y) \(.width)x\(.height)"') +grim -g "$GEOM" - | wl-copy