screenshot (790B)
1 #!/bin/bash 2 3 DIR="$HOME/.config/bspwm" 4 5 rofi_command="rofi -theme $DIR/rofi/themes/screenshot.rasi" 6 7 # Options 8 screen="" 9 area="" 10 window="" 11 12 # Variable passed to rofi 13 options="$screen\n$area\n$window" 14 15 chosen="$(echo -e "$options" | $rofi_command -p 'Screenshot' -dmenu -selected-row 1)" 16 case $chosen in 17 $screen) 18 sleep 1; scrot 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f' 19 ;; 20 $area) 21 scrot -s 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f' 22 ;; 23 $window) 24 sleep 1; scrot -u 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f' 25 ;; 26 esac 27