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"
8elif [ "$1" == "-w" ]; then
9 import -window "$(xdotool getwindowfocus)" "$scr_path/$output.png"
10 convert "$scr_path/$output.png" \( +clone -background transparent -shadow 60x40+0+15 \) \
11 +swap -background white -layers merge +repage "$scr_path/$output.png"
12elif [ "$1" == "-s" ]; then
13 g=$(slop --highlight --tolerance=0 --color=0.3,0.4,0.6,0.4)
14 sleep 1
15 import -window root -crop "$g" +repage "$scr_path/$output.png"
16fi
17
18xclip -selection clipboard -t image/png -i "$scr_path/$output.png"