i3lock-fancy
i3lock script that takes a screenshot of the desktop, blurs the background and adds a lock icon and text
Top Related Projects
🍀 sweet looking lockscreen for linux system
The world's most popular non-default computer lockscreen.
Quick Overview
i3lock-fancy is a shell script that enhances the functionality of the i3lock screen locker for Linux systems. It adds features like blurring the current screen, adding an icon, and customizing colors, providing a more visually appealing and secure lock screen experience.
Pros
- Improves the aesthetics of the default i3lock with blurring and customization options
- Easy to install and use with minimal dependencies
- Supports multiple monitors and different screen resolutions
- Allows for custom icons and color schemes
Cons
- Requires external dependencies like ImageMagick and scrot
- May have slightly slower lock times compared to vanilla i3lock due to image processing
- Limited to systems using i3lock as the base screen locker
- Some users report occasional issues with multi-monitor setups
Getting Started
-
Clone the repository:
git clone https://github.com/meskarune/i3lock-fancy.git
-
Install dependencies (example for Debian-based systems):
sudo apt-get install i3lock imagemagick scrot
-
Make the script executable:
chmod +x i3lock-fancy/lock
-
Run the script to lock your screen:
./i3lock-fancy/lock
-
Optionally, add a keyboard shortcut or autostart entry to use i3lock-fancy:
bindsym $mod+l exec /path/to/i3lock-fancy/lock
For more customization options and advanced usage, refer to the project's README file on GitHub.
Competitor Comparisons
🍀 sweet looking lockscreen for linux system
Pros of betterlockscreen
- More customization options, including blur, dim, and pixel effects
- Caching feature for faster lock screen activation
- Active development and community support
Cons of betterlockscreen
- Requires more dependencies (i3lock-color, imagemagick, xdpyinfo)
- Slightly more complex setup process
- May consume more system resources due to additional features
Code comparison
i3lock-fancy:
#!/bin/bash
scrot /tmp/screen.png
convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png
i3lock -i /tmp/screen.png
betterlockscreen:
#!/usr/bin/env bash
betterlockscreen -u /path/to/image.jpg
betterlockscreen -l dim
Summary
betterlockscreen offers more advanced features and customization options compared to i3lock-fancy, but comes with increased complexity and resource usage. i3lock-fancy provides a simpler, lightweight solution with fewer dependencies. The choice between the two depends on the user's preferences for features versus simplicity.
The world's most popular non-default computer lockscreen.
Pros of i3lock-color
- More customization options for colors, fonts, and layouts
- Supports multiple monitors with different background images
- Actively maintained with regular updates and bug fixes
Cons of i3lock-color
- More complex setup and configuration process
- Requires compilation from source, which may be challenging for some users
- Larger codebase, potentially leading to more bugs or performance issues
Code Comparison
i3lock-fancy:
#!/bin/bash
scrot /tmp/screen.png
convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png
i3lock -i /tmp/screen.png
i3lock-color:
char *image_path = NULL;
int blur = 0;
char *font_str = "sans-serif";
int ver_shift = 0;
int hor_shift = 0;
double radius = 50;
i3lock-fancy is a simple bash script that captures the screen, applies a blur effect, and locks the screen using the standard i3lock. i3lock-color, on the other hand, is written in C and offers more advanced customization options through its code structure.
While i3lock-fancy provides a quick and easy solution for screen locking with a blurred background, i3lock-color offers greater flexibility and customization at the cost of increased complexity. Users seeking a simple, out-of-the-box solution may prefer i3lock-fancy, while those desiring more control over their lock screen appearance might opt for i3lock-color.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
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
Dependencies
i3lock-color-git- i3lock-color-git - this is a fork of i3lock-color that is kept up to date with i3lock
- imagemagick
- bash
- awk
- util-linux
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:
- Arch Linux: https://aur.archlinux.org/packages/i3lock-fancy-git/
- GNU Guix: Run
guix package --install i3lock-fancy
- Debian: https://packages.debian.org/sid/i3lock-fancy
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:
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
Top Related Projects
🍀 sweet looking lockscreen for linux system
The world's most popular non-default computer lockscreen.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot