Back to rankings

meskarune/i3lock-fancy

Shell

i3lock script that takes a screenshot of the desktop, blurs the background and adds a lock icon and text

i3i3locki3lock-colori3wmbash-script
Star Growth
Stars
1.6k
Forks
183
Weekly Growth
Issues
13
5001k1.5k
Jan 2015Nov 2018Sep 2022Jul 2026
README

i3lock-fancy

This is an i3lock bash script that takes a screenshot of the desktop, blurs the background and adds a lock icon and text

website: github pages website

screen shot of lockscreen

Dependencies

Optional Dependencies

  • wmctrl
  • a screenshot utility such as scrot or maim.

Installation

To install i3lock-fancy manually, git clone the repository:

git clone https://github.com/meskarune/i3lock-fancy.git

Then change to the directory and run make.

cd i3lock-fancy
sudo make install

IMPORTANT NOTE: the way to install i3lock-fancy has changed! If you are a package maintainer or previously installed manually you may have to review and update your configurations. The new change simplifies a lot of things so updates will be easier in the future.

The following distro's have packages you can use to install:

Usage

i3lock-fancy [options]

Options:
    -h, --help       This help menu.

    -d, --desktop    Attempt to minimize all windows before locking. Requires wmctrl.

    -g, --greyscale  Set background to greyscale instead of color.

    -p, --pixelate   Pixelate the background instead of blur, runs faster.

    -f <fontname>, --font <fontname>  Set a custom font.

    -t <text>, --text <text> Set a custom text prompt.

    -l, --listfonts  Display a list of possible fonts for use with -f/--font.
                     Note: this option will not lock the screen, it displays
                     the list and exits immediately.

    -n, --nofork     Do not fork i3lock after starting.

    --               Must be last option. Set command to use for taking a
                     screenshot. Default is 'import -window root'. Using 'scrot'
                     or 'maim' will increase script speed and allow setting
                     custom flags like having a delay.

example: i3lock-fancy -gpf Comic-Sans-MS -- scrot -z

Extras

The lock screen in action:

lockscreen animation

To use this script you can set a hotkey in your window manager to run the lock command, set xautolock to run at boot, or use a systemd script to either lock on suspend or run xautolock.

xautolock is a utility to automatically lock the screen after a set time. It also supports hot corners.

Systemd Unit file example (edit for your own use):

[Unit]
Description=Lock the screen automatically after a timeout

[Service]
Type=simple
User=meskarune
Environment=DISPLAY=:0
ExecStart=/usr/bin/xautolock -time 5 -locker /usr/bin/i3lock-fancy -detectsleep

[Install]
WantedBy=graphical.target

Multiple Monitors

There is a branch called dual monitor with support for multiple monitors. (it is currently out of date compared to the main locker, I need to update it with all the new features) This branch uses a grey icon and text with outlines to make it visible on light and dark backgrounds (though it looks better on dark backgrounds). I am still working to get it looking just right right. The script is usable now, but it's under developement and things may change.

Static image

If you would like to run i3lock-color with a static image in the style of i3lock-fancy, run convert from image magick directly on the background image you want to use. Then specify the result newimage.png to i3lock -i:

#!/bin/sh
# Add a lock icon and text to the center of an image
convert /path/to/background.png -font Liberation-Sans \
    -pointsize 26 -fill white -gravity center \
    -annotate +0+160 "Type Password to Unlock" lock.png \
    -gravity center -composite newimage.png
i3lock -i newimage.png
Related repositories
nikitabobko/AeroSpace

AeroSpace is an i3-like tiling window manager for macOS

SwiftMIT Licensei3wmmacos
nikitabobko.github.io/AeroSpace/guide
21.9k597
davatorium/rofi

Rofi: A window switcher, application launcher and dmenu replacement

COtherrofidmenu
davatorium.github.io/rofi/
16.3k691
i3/i3

A tiling window manager for X11

CBSD 3-Clause "New" or "Revised" Licensebsdi3
i3wm.org
10.5k814
Airblader/i3

A fork of the i3 window manager with gaps and some other features. :warning: i3-gaps has been merged into i3.

CBSD 3-Clause "New" or "Revised" Licensei3-gapsi3
5.8k310
vivien/i3blocks

The hacker-friendly status_command for Sway and i3

CGNU General Public License v3.0swayi3
vivien.github.io/i3blocks/
2.5k184
acsandmann/rift

a tiling window manager for macos

Rustcrates.ioOtheri3macos
2.1k72
ryan4yin/nix-config

❄️ My nix config for both desktops(NixOS+macOS) and homelab servers(NixOS).

NixMIT Licensenixosnixos-configuration
nixos-and-flakes.thiscute.world
2k98
aaronjanse/3mux

Terminal multiplexer inspired by i3

GoGo ModulesMIT Licensetmuxtui
1.8k46
addy-dclxvi/i3-starterpack

A simple guide (and example of configuration) about how to install i3 & its and essentials packages, then make them look eye candy, also contains my dotfiles of Debian 12 (Bookworm) setup

Schemedebiandotfiles
1.7k169
dikiaap/dotfiles

Get ready for dotfiles. Contains i3, i3blocks, rofi, dunst, picom, vim, tmux, and zsh.

ShellMIT Licensedotfileslinux
git.io/~dotfiles
1.5k173
vivien/i3blocks-contrib

Official repository for community contributed blocklets

PythonPyPIOtheri3i3blocks
github.com/vivien/i3blocks
1.4k497
cococry/ragnar

Minimal, flexible & user-friendly X tiling window manager

CGNU General Public License v3.0window-managerx11
1.2k28