chore(sway): screenshot stuff updates

This commit is contained in:
surtur 2021-05-20 20:11:02 +02:00
parent 4dce835f1c
commit 29ad53d3a1
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 8 additions and 1 deletions

View File

@ -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

6
bin/winprint.sh Executable file
View File

@ -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