diff --git a/system/.local/bin/screenshot b/system/.local/bin/screenshot index bdc55f0..a27c444 100755 --- a/system/.local/bin/screenshot +++ b/system/.local/bin/screenshot @@ -7,6 +7,8 @@ PROMPT="Screenshot" ACTIONS=( "1: Fullscreen" "2: Selection" + "3: Window" + "4: Delayed" ) FILENAME="$(xdg-user-dir PICTURES)/screenshots/$(date +"%Y-%m-%dT%H%M%S").png" @@ -19,4 +21,10 @@ case "${SELECTION}" in "2") grim -g "$(slurp)" - | tee "${FILENAME}" | wl-copy ;; + "3") + grim -g "$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)" - | tee "${FILENAME}" | wl-copy + ;; + "4") + sleep 3 && grim - | tee "${FILENAME}" | wl-copy + ;; esac