My personal dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lock.sh 874B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # i3lock blurred screen inspired by /u/patopop007 and the blog post
  3. # http://plankenau.com/blog/post-10/gaussianlock
  4. # Timings are on an Intel i7-2630QM @ 2.00GHz
  5. # Dependencies:
  6. # imagemagick
  7. # i3lock
  8. # scrot (optional but default)
  9. IMAGE=/tmp/i3lock.png
  10. SCREENSHOT="scrot $IMAGE" # 0.46s
  11. # Alternate screenshot method with imagemagick. NOTE: it is much slower
  12. # SCREENSHOT="import -window root $IMAGE" # 1.35s
  13. # Here are some imagemagick blur types
  14. # Uncomment one to use, if you have multiple, the last one will be used
  15. # All options are here: http://www.imagemagick.org/Usage/blur/#blur_args
  16. BLURTYPE="0x5" # 7.52s
  17. #BLURTYPE="0x2" # 4.39s
  18. #BLURTYPE="5x2" # 3.80s
  19. #BLURTYPE="2x8" # 2.90s
  20. #BLURTYPE="2x3" # 2.92s
  21. # Get the screenshot, add the blur and lock the screen with it
  22. $SCREENSHOT
  23. convert $IMAGE -blur $BLURTYPE $IMAGE
  24. i3lock -i $IMAGE
  25. rm $IMAGE