all repos — dotfiles @ f7712f82ec2a7cf22789e1eef4cafe9b34841d6a

my *nix dotfiles

Window screenshots with a drop shadow

Signed-off-by: Anirudh <icyph0x@pm.me>
Anirudh icyph0x@pm.me
Wed, 17 Jul 2019 22:33:39 +0530
commit

f7712f82ec2a7cf22789e1eef4cafe9b34841d6a

parent

39165f5c4bb0a00ded43fe700cf8ba1162a817a4

1 files changed, 11 insertions(+), 2 deletions(-)

jump to
M bin/scrbin/scr

@@ -2,6 +2,15 @@ #!/usr/bin/env bash

scr_path=~/pics/scrots n=6; output=$(tr -cd '[:alnum:]' < /dev/urandom | head -c$n) -import -window root "$scr_path/$output.png" -notify-send 'screenshot taken!' + +if [ "$1" == "" ]; then + import -window root "$scr_path/$output.png" + notify-send 'screenshot taken!' +elif [ "$1" == "-w" ]; then + import -window "$(xdotool getwindowfocus)" "$scr_path/$output.png" + convert "$scr_path/$output.png" \( +clone -background black -shadow 60x60+0+0 \) \ + +swap -background transparent -layers merge +repage "$scr_path/$output.png" + notify-send 'window screenshot taken!' +fi + xclip -selection clipboard -t image/png -i "$scr_path/$output.png"