1
1
Fork 0
nixos/options/custom/scripts/screenshot.sh
Myned 9a4377d6a8
screenshot: disable rounding and freezing
Signed-off-by: Myned <dev@bjork.tech>
2024-09-12 19:41:21 -05:00

23 lines
709 B
Bash

#! /usr/bin/env bash
# Screenshot region or display with rounded corners
r=20 # Radius
function round() {
magick - \
\( +clone -alpha extract -draw "fill black polygon 0,0 0,$r $r,0 fill white circle $r,$r $r,0" \
\( +clone -flip \) -compose Multiply -composite \
\( +clone -flop \) -compose Multiply -composite \) \
-alpha off -compose CopyOpacity -composite -
}
# TODO: Use proper flags
# TODO: Add clipboard support
if [[ "${1-}" == '-e' ]]; then
grimblast save area - | swappy --file -
elif [[ "${1-}" == '-d' ]]; then
grimblast save output - > "$XDG_SCREENSHOTS_DIR/$(date +'%F %H-%M-%S').png"
else
grimblast save area - > "$XDG_SCREENSHOTS_DIR/$(date +'%F %H-%M-%S').png"
fi