all repos — dotfiles @ 24933cc180bc252ae661247cc2a6d80b771aacae

my *nix dotfiles

bin/scr (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
#!/usr/bin/env bash

scr_path=~/pics/scrots
n=6; output=$(tr -cd '[:alnum:]' < /dev/urandom | head -c$n)

if [ "$1" == "" ]; then
    notify-send "screenshot taken!"
	import -window root "$scr_path/$output.png"
elif [ "$1" == "-w" ]; then
    notify-send "window screenshot taken!"
	import -window "$(xdotool getwindowfocus)" "$scr_path/$output.png"
	convert "$scr_path/$output.png" \( +clone -background transparent -shadow 60x40+0+15 \) \
	+swap -background white -layers merge +repage "$scr_path/$output.png"
elif [ "$1" == "-s" ]; then
    notify-send "selection screenshot taken!"
	g=$(slop --highlight --tolerance=0 --color=0.3,0.4,0.6,0.4)
	sleep 1
	import -window root -crop "$g" +repage "$scr_path/$output.png"
fi

xclip -selection clipboard -t image/png -i "$scr_path/$output.png"