#!/bin/bash | |
# i3lock blurred screen inspired by /u/patopop007 and the blog post | |
# http://plankenau.com/blog/post-10/gaussianlock | |
# Timings are on an Intel i7-2630QM @ 2.00GHz | |
# Dependencies: | |
# imagemagick | |
# i3lock | |
# scrot (optional but default) | |
IMAGE=/tmp/i3lock.png | |
SCREENSHOT="scrot $IMAGE" # 0.46s | |
# Alternate screenshot method with imagemagick. NOTE: it is much slower | |
# SCREENSHOT="import -window root $IMAGE" # 1.35s | |
# Here are some imagemagick blur types | |
# Uncomment one to use, if you have multiple, the last one will be used | |
# All options are here: http://www.imagemagick.org/Usage/blur/#blur_args | |
#BLURTYPE="0x5" # 7.52s | |
#BLURTYPE="0x2" # 4.39s | |
#BLURTYPE="5x2" # 3.80s | |
BLURTYPE="2x8" # 2.90s | |
#BLURTYPE="2x3" # 2.92s | |
# Get the screenshot, add the blur and lock the screen with it | |
$SCREENSHOT | |
convert $IMAGE -blur $BLURTYPE $IMAGE | |
i3lock -i $IMAGE | |
rm $IMAGE |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
karulont
commented
Jul 15, 2014
check out https://github.com/karulont/i3lock-blur. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
masoncodes
commented
Mar 21, 2016
this worked for me! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
z3t0
commented
Mar 22, 2016
how are the time measurements done? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
masoncodes
commented
Mar 22, 2016
@z3t0 probably a stopwatch or something... |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
bechampion
commented
Apr 29, 2016
I like it but it takes a bit of time to blur ...bit insecure |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
greenbagels
Jul 22, 2016
You can use imagemagick's import command to screencap as well, reducing the number of required packages.
greenbagels
commented
Jul 22, 2016
You can use imagemagick's import command to screencap as well, reducing the number of required packages. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
Chabam
Mar 10, 2017
A quick suggestion to improve the time to render the blurred image, you could reduce the size of the screen cap before applying the blur:
convert $IMAGE -resize 50%
convert $IMAGE -blur $BLURTYPE $IMAGE
Then put back to 200% to get back to orginal size
convert $IMAGE -resize 200%
Chabam
commented
Mar 10, 2017
A quick suggestion to improve the time to render the blurred image, you could reduce the size of the screen cap before applying the blur: |
ilthegan
commented
Sep 11, 2017
Thanks !!! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
darddan
Feb 22, 2018
I know it's been some time since you published this gist. I used this method until today, but because I use an older computer it would take me 2-5 seconds to take the screenshot, add the effect and then run the i3lock. i3lock-blur flickers and doesnt work in my computer.
I've forked scrot and added a blur option and an option to add an icon here: darddan/scrot
Running scrot -B 5 -i icon.png output.png
generates a blurred screenshot with an icon over it in about 300 milliseconds.
darddan
commented
Feb 22, 2018
•
edited
edited
I know it's been some time since you published this gist. I used this method until today, but because I use an older computer it would take me 2-5 seconds to take the screenshot, add the effect and then run the i3lock. i3lock-blur flickers and doesnt work in my computer. |
check out https://github.com/karulont/i3lock-blur.