all repos — dotfiles @ 0b498183321bfc3b89ed050fb638ad5b7c9ae21f

my *nix dotfiles

bin/scr (view raw)

 1#!/usr/bin/env bash
 2
 3scr_path=~/pics/scrots
 4n=6; output=$(tr -cd '[:alnum:]' < /dev/urandom | head -c$n)
 5
 6if [ "$1" == "" ]; then
 7	import -window root "$scr_path/$output.png"
 8	notify-send 'screenshot taken!'
 9elif [ "$1" == "-w" ]; then
10	import -window "$(xdotool getwindowfocus)" "$scr_path/$output.png"
11	convert "$scr_path/$output.png" \( +clone -background transparent -shadow 60x40+0+15 \) \
12	+swap -background white -layers merge +repage "$scr_path/$output.png"
13	notify-send 'window screenshot taken!'
14elif [ "$1" == "-s" ]; then
15	g=$(slop --highlight --tolerance=0 --color=0.3,0.4,0.6,0.4)
16	sleep 1
17	import -window root -crop "$g" +repage "$scr_path/$output.png"
18	notify-send 'selection screenshot taken!'
19fi
20
21xclip -selection clipboard -t image/png -i "$scr_path/$output.png"