You are not logged in.

#1 2018-04-12 10:20:55

cuicui-369
Banned
Registered: 2018-04-02
Posts: 18

ctrl-alt-del to lock the screen (i3lock)

I manage to lock my screen with i3lock when I type ctrl-alt-del.  I made a script named i3locker, that has those lines:

#!/bin/bash
/usr/local/share/i3locker/scrot /usr/local/share/i3locker/screenshot.png -B 2 -i /usr/local/share/i3locker/icon/lock.png
xset dpms force off
sleep 1s
i3lock -i /usr/local/share/i3locker/screenshot.png
xset s activate

It's the fastest script I found.  I'm using the scrot fork of darddan and  I use this icon 1qgwmt.png.  The speed is great and I was curious to know if my script could get improvement.  I use before i3lock-next,i3lock-fancy, but found those script not as fast. Let me know what you find.

Last edited by cuicui-369 (2018-04-12 11:12:01)

Offline

#2 2018-04-12 22:24:49

cuicui-369
Banned
Registered: 2018-04-02
Posts: 18

Re: ctrl-alt-del to lock the screen (i3lock)

I made some modification mostly because my laptop is not enough fast to perform the task.  My laptop has a core i5-4300U processor, 8GB of DDR3L/1600 memory, and a 256GB SSD.  It take a bit too long to get the picture of the desktop (screenshot) display again after having been blur. 

my /usr/local/bin/i3locker has the following lines:

#!/bin/bash
/usr/local/share/i3locker/scrot /usr/local/share/i3locker/screenshot.png -B 2 -i /usr/local/share/i3locker/icon/lock.png
#convert /usr/local/share/i3locker/screenshot.png -colors 255 /usr/local/share/i3locker/screenshot.png
feh -F /usr/local/share/i3locker/screenshot.png &
xset dpms force suspend
i3lock -n -i /usr/local/share/i3locker/screenshot.png
sleep 0.05 ; killall feh

This script require imagemagick, scrot (from my previous post, but not mandatory), feh and i3lock.

I'm looking forward to know if on a i7 this script will run faster or what.

Last edited by cuicui-369 (2018-04-12 22:25:06)

Offline

Board footer

Powered by FluxBB