add screenshit script for mango

This commit is contained in:
lucy 2026-09-02 00:30:16 +02:00
commit 2533dcdee6
4 changed files with 257 additions and 5 deletions

15
modules/home/screenshot Normal file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
case "${1:-fullscreen}" in
region)
g=$(slurp -d); [ -z "$g" ] && exit 1
grim -g "$g" - | wl-copy ;;
window)
g=$(mmsg get focusing-client | jq -r '"\(.x),\(.y) \(.width)x\(.height)"')
[ -z "$g" ] && exit 1
grim -g "$g" - | wl-copy ;;
output)
grim -o "$(mmsg get cursorpos | jq -r .monitor)" - | wl-copy;;
*) grim - | wl-copy;;
esac