zsh and rc file abstract
[dotfiles.git] / Scripts / screenshot
1 #!/bin/sh
2
3 [ -z "$1" ] && printf "screenshot =-=-=-=-=\n-f for fullscreen screenshot\n-w for windowed screenshot\n" && exit 1
4
5 screen_dir="$HOME/Downloads/screenshots" # no ending slash
6
7 screen_name="$(printf "" | dmenu -p 'Screenshot name:')" # dmenu problem where it doesnt show up unless an input is given
8 [ -z "$screen_name" ] && screen_name="screen_$(date +'%m%d%H%M')"
9
10 screen_name="$screen_dir/$screen_name.png"
11
12 sleep 0.3
13
14 case $1 in
15     -f|--full) scrot "$screen_name" && notify-send "Fullscreen screenshot taken - $screen_name" -i "";;
16     -b|--box) scrot -s "$screen_name" && notify-send "Windowed screenshot taken - $screen_name" -i "";;
17 esac