1 #!/bin/bash
   2 
   3 args=()
   4 opts=$(getopt -o bptrwGRVI:L -l '
   5     blur,pixel,paint,radial,wave,
   6     gray,rotate,vignette,image:,level
   7 ' -- "$@")
   8 eval set -- "$opts"
   9 
  10 while true; do
  11     case $1 in
  12         -b|--blur) args+=(-blur 0x10);;
  13         -p|--pixel) args+=(-scale 10% -scale 1000%);;
  14         -t|--paint) args+=(-paint 2);;
  15         -r|--radial) args+=(-radial-blur 5);;
  16         -w|--wave) args+=(-wave 15x50);;
  17 
  18         -G|--gray) args+=(-colorspace gray);;
  19         -R|--rotate) args+=(-rotate 180);;
  20         -V|--vignette) args+=(-background black -vignette 0x50);;
  21         -I|--image) args+=($2 -gravity center -composite);;
  22         -L|--level) args+=(-level 0%,100%,0.6);;
  23 
  24         --) break;;
  25     esac
  26     shift
  27 done
  28 
  29 [[ ! $args ]] &&
  30 grep -o '\-\w|--\w\+' $0 |
  31 sed 's/|/ /' && exit
  32 
  33 i=$(mktemp).png
  34 scrot $i
  35 convert $i "${args[@]}" $i
  36 
  37 pacmd list-sinks |
  38 awk '/index/ { print $NF }' |
  39 xargs -I % pacmd set-sink-mute % 1
  40 
  41 music.sh stop
  42 i3lock -ni $i
  43 
  44 pacmd list-sinks |
  45 awk '/index/ { print $NF }' |
  46 xargs -I % pacmd set-sink-mute % 0