dotfiles/home/bin/executable_screenshot-monitor

28 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

2023-02-25 16:18:35 +00:00
#!/bin/sh -e
# Get the picture from maim
# flameshot gui -r > $HOME/.cache/src.png &
grim -g "$(slurp -or)" $HOME/ramdisk/src.png &
wait $!
# add shadow, round corner, border and watermark
convert $HOME/ramdisk/src.png \
\( +clone -alpha extract \
-draw 'fill black polygon 0,0 0,8 8,0 fill white circle 8,8 8,0' \
\( +clone -flip \) -compose Multiply -composite \
\( +clone -flop \) -compose Multiply -composite \
\) -alpha off -compose CopyOpacity -composite $HOME/ramdisk/output.png
convert $HOME/ramdisk/output.png -bordercolor none -border 20 \( +clone -background black -shadow 80x8+15+15 \) \
+swap -background transparent -layers merge +repage $HOME/ramdisk/des.png
# composite -gravity South ~/.local/bin/watermark.png $HOME/ramdisk/des.png $HOME/ramdisk/des.png
# Send the Picture to clipboard
# xclip -selection clipboard -t image/png -i $HOME/ramdisk/des.png
wl-copy -t image/png < $HOME/ramdisk/des.png
# remove the other pictures
rm $HOME/ramdisk/src.png $HOME/ramdisk/output.png
2023-10-27 14:56:05 +00:00
notify-send "screenshot success"