You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
832 B
36 lines
832 B
#!/bin/bash |
|
|
|
# A simple wrapper around maim |
|
# |
|
# When run, the screenshot will be added to she clipboard |
|
|
|
path='/tmp' |
|
command -v maim > /dev/null && screenshooter="maim" || screenshooter="scrot" |
|
|
|
#If a project is set we will put screenshots in the project's folder |
|
project=$(project current --path) |
|
if [ -n "$project" ]; then |
|
path="$project/screenshots" |
|
#Make the directory if it doesn't exist |
|
mkdir "$path" 2> /dev/null |
|
fi |
|
|
|
filename="$(date +"%Y-%m-%dT%H-%M-%SZ").png" |
|
file="${path}/${filename}" |
|
|
|
case $1 in |
|
"window") |
|
maim -i $(xdotool getactivewindow) "$file" |
|
;; |
|
"select") |
|
#maim -s -r crosshair "$file" |
|
maim -s -c 0.41,0.62,0.42,0.2 -l -u "$file" |
|
;; |
|
*) |
|
maim "$file" |
|
;; |
|
esac |
|
|
|
xclip -selection clipboard -target image/png -i "$file" |
|
echo -n "$file" | xclip -selection primary |
|
notify-send "New Screenshot" "$file"
|
|
|