Skip to content

YazdanZ/betterlockscreen

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

betterlockscreen

simple, minimal lockscreen

Betterlockscreen allows you to cache images with different filters and lockscreen with blazing speed.

Example

lockscreen with blurred effect

betterlockscreen --lock blur

Fork Preview

Watch some of the features of betterlockscreen in action

Table of Contents

About

Most of i3lock wrapper scripts out there takes an image, adds some effect and locks the screen adding effects, overall experience doesn't feel natural given delay of 2-3 seconds. Who would like a delay of 2-3 seconds while locking screen?

So betterlockscreen was my attempt to solve this problem, as we dont need to change lockscreen background frequently this script caches images with effect so overall experience is simple and as fast as native i3lock.

About this Fork

  • the ring indicator to the right of the screen
  • gets rid of the faded text box
  • replace the custom text with the system date.

How it works

The script takes image adds various effects and caches those images in special directory and then uses those images as lockscreen background depending on argument provided by user.

Requirements

Note: Make sure your system has all dependencies satisfied

  • i3lock-color - i3lock fork with additional features( >= 2.11-c )
  • imagemagick - To apply effects to images
  • xdpyinfo, xrandr, bc and feh - To find screen resolution, set custom blur level and wallpaper handling.

Installation

git clone https://github.com/yazdanz/betterlockscreen
cd betterlockscreen
cp betterlockscreen ~/.local/bin/

Configuration

You can customise various colors for betterlockscreen, copy config file from examples directory to ~/.config/betterlockscreenrc and edit it accordingly.

If configuration file is not found then default configurations will be used.

If you have installed betterlockscreen from AUR package, then you can copy default config from docs

cp /usr/share/doc/betterlockscreen/examples/betterlockscreenrc ~/.config

Usage

Run betterlockscreen and point it to either a directory (betterlockscreen -u "path/to/dir") or an image (betterlockscreen -u "/path/to/img.jpg") and that's all. betterlockscreen will change update its cache with image you provided.

usage: betterlockscreen [-u "path/to/img.jpg"] [-l "dim, blur or dimblur"]
           [-w "dim, blur, pixel or dimblur"] [-t "custom text"] [-s "lockscreen and suspend"]
					 [-r "resolution"] [-b "factor"] [--off <timeout>]

betterlockscreen - faster and sweet looking lockscreen for linux systems.

required:
	-u, --update "path/to/img.jpg"	caches all required images

usage:
	-l, --lock effect-name
			locks with provided effect
	-w, --wall effect-name
			set desktop background with provided effect
	-s, --suspend effect-name
			lockscreen and suspend

			Available effects:
				dim, blur, pixel or dimblur

	-t, --text "custom text"
			set custom lockscreen text
	-b, blur 0.0 - 1.0
			set blur range
	-r, --resolution res
			uses a custom resolution
	--off, --off <timeout>
			sets custom monitor timeout (<timeout> in seconds)


Usage examples:
1. Updating image cache(required)
betterlockscreen -u ~/Pictures/Forests.png # caches given image
betterlockscreen -u ~/Pictures             # caches random image from ~/Pictures directory

2. Custom resolution and blur range
betterlockscreen -u path/to/directory -r 1920x1080 -b 0.5

3. Lockscreen
betterlockscreen -l dim                    # lockscreen with dim effect

4. Lockscreen with custom text
betterlockscreen -l pixel -t "custom lockscreen text"

5. Set desktop background
betterlockscreen -w blur                   # set desktop background with blur effect

6. Lockscreeen with custom monitor off timeout
betterlockscreen --off 5 -l blur           # set monitor off lockscreen timeout (5 seconds)

Set desktop background on startup

Add this line to .xinitrc.

# set desktop background with custom effect
betterlockscreen -w dim

# Alternative (set last used background)
source ~/.fehbg

i3wm

Add this line to ~/.config/i3/config

# set desktop background with custom effect
exec --no-startup-id betterlockscreen -w dim

# Alternative (set last used background)
exec --no-startup-id source ~/.fehbg

Keybindings

To lockscreen using keyboard shortcut

i3wm

Add this line to your ~/.config/i3/config

bindsym $mod+shift+x exec betterlockscreen -l dim

bspwm

Add this line to your ~/.config/sxhkd/sxhkdrc

# lockscreen
alt + shift + x
    betterlockscreen -l dim

Lockscreen when suspended(systemd service)

# move service file to proper dir (the aur package does this for you)
cp betterlockscreen@.service /etc/systemd/system/

# enable systemd service
systemctl enable betterlockscreen@$USER

# disable systemd service
systemctl disable betterlockscreen@$USER


# Note: Now you can call systemctl suspend to suspend your system
# and betterlockscreen service will be activated
# so when your system wakes your screen will be locked.

Countributing

Thanks to all the amazing people for all your wonderful PRs, issues and ideas!

How can I support developers?

  • Star our GitHub repo ⭐
  • Create pull requests, submit bugs, suggest new features or documentation updates πŸ”§

License

Betterlockscreen is under MIT license.

Feel free to use and distribute

  • Hat tip to anyone who's code was used
  • Thanks to those who contributed to make it better
  • Inspiration - r/unixporn

About

πŸ€ sweet looking lockscreen for linux system

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%