all repos — dotfiles @ 6adedbc9156ac1ee3b97441b6b3045aa2d536de6

linux dotfiles

bin/scripts/notes_scrot (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
#!/usr/bin/bash
# Wrote this to be able to take a selective-area screenshot for my note-taking
# workflow
# Screenshots are saved in the respective img/ directory of each 
# subject/course/book directory under ~/docs/notes/
# This is so that I can use those images in markdown while writing notes
# and compile them using pandoc. Useful to take screenshots of diagrams
# from book that I am reading.

#nip - Notes images paths for notes in ~/docs/notes
[[ -e $HOME/.config/nip ]] || exit 0
n_path=$(cat $HOME/.config/nip | dmenu -l 15)
[[ -z $n_path ]] && exit 0
img_name=$(echo -n '' | dmenu -p "image name")
[[ -z $img_name ]] && exit 0
echo -n "$img_name.png" | xsel -ib
scrot -s "$n_path/$img_name.png" && notify-send "saved $n_path/$img_name.png"