d0tfiles

*nix dotfiles for arch linux setup
Log | Files | Refs | README | LICENSE

screenshot (814B)


      1 #!/bin/bash
      2 
      3 STYLE="default"
      4 
      5 rofi_command="rofi -theme $STYLE/screenshot.rasi"
      6 
      7 # Options
      8 screen=" Whole Desktop"
      9 area=" Selected Area"
     10 window=" Focused Window"
     11 
     12 # Variable passed to rofi
     13 options="$screen\n$area\n$window"
     14 
     15 chosen="$(echo -e "$options" | $rofi_command -p 'Take A Shot' -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