dotfiles/files/.config/i3/bin/screenshot

17 lines
312 B
Text
Raw Normal View History

2016-12-13 16:06:25 +01:00
#!/bin/bash
BASEPATH="$HOME/Images/screenshots"
cName="$BASEPATH/$(date +%F_%H-%M-%S).png"
case "$1" in
'root')
import -window root "$cName"
;;
'active')
import -window $(xdotool getwindowfocus -f) -frame "$cName"
;;
*)
>&2 echo -e "Error: bad action type. Usage:\n$0 [root|active]"
exit 1
esac