#!/bin/sh geom=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp -b 303030AA -B 303030AA) file=$(date "+$HOME/multimedia/screenshots/%Y%m%d-%H%M%S.png") grim -g "$geom" - | tee $file | wl-copy