configs/desktop/bin/print-window.sh

10 lines
392 B
Bash
Raw Normal View History

2023-10-09 17:55:47 -03:00
#!/bin/bash
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -i $(xdotool getactivewindow) | xclip -sel clip -t image/png
fi
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" ~/tmp/jabuxas.png
xclip -sel clip ~/tmp/jabuxas.png
wl-copy < ~/tmp/jabuxas.png
fi