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