2019-01-23 06:28:54 +00:00
# betterlockscreen
2018-11-19 14:56:55 +00:00
2018-11-22 20:45:28 +00:00
> simple, minimal lockscreen
2017-12-10 22:25:05 +00:00
2019-01-23 06:28:54 +00:00
Betterlockscreen allows you to cache images with different filters and lockscreen with blazing speed.
2017-12-07 18:51:34 +00:00
2018-11-22 20:45:28 +00:00
## Example
2017-12-07 20:16:52 +00:00
2018-11-22 20:45:28 +00:00
> lockscreen with blurred effect
2017-12-07 20:16:52 +00:00
2018-11-22 20:45:28 +00:00
```sh
betterlockscreen --lock blur
```
2017-12-07 20:16:52 +00:00
2018-11-22 20:45:28 +00:00
![scrot2 ](https://github.com/pavanjadhaw/betterlockscreen.demo/raw/master/scrots/scrot2.png 'scrot2.png' )
2017-12-07 20:16:52 +00:00
2019-01-20 05:49:20 +00:00
> [Watch some of the features of betterlockscreen in action](https://www.youtube.com/watch?v=9Ng5FZwnn6M&feature=youtu.be)
2017-12-07 20:16:52 +00:00
2018-09-18 18:40:52 +00:00
## Table of Contents
2018-01-03 05:04:25 +00:00
2018-11-22 20:45:28 +00:00
- [about ](#about )
- [how it works ](#how-it-works )
- [requirements ](#requirements )
- [installation ](#installation )
2019-01-23 06:42:01 +00:00
- [configuration ](#configuration )
2018-11-22 20:45:28 +00:00
- [usage ](#usage )
- [background ](#set-desktop-background-on-startup )
- [keybinding ](#keybindings )
- [lockscreen on suspend ](#lockscreen-when-suspendedsystemd-service )
### 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.
### How it works
2018-01-03 05:04:25 +00:00
2018-11-22 20:45:28 +00:00
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.
2018-09-18 03:33:59 +00:00
2018-11-22 20:45:28 +00:00
### Requirements
> Note: Make sure your system has all dependencies satisfied
2018-09-18 03:33:59 +00:00
2018-11-19 14:56:55 +00:00
- [i3lock-color ](https://github.com/PandorasFox/i3lock-color ) - i3lock fork with additional features( >= 2.11-c )
- [imagemagick ](https://www.imagemagick.org/script/index.php ) - To apply effects to images
- [xdpyinfo ](https://www.x.org/archive/X11R7.7/doc/man/man1/xdpyinfo.1.xhtml ), [xrandr ](https://www.x.org/wiki/Projects/XRandR/ ), [bc ](https://www.gnu.org/software/bc/ ) and [feh ](https://feh.finalrewind.org/ ) - To find screen resolution, set custom blur level and wallpaper handling.
2018-09-18 03:33:59 +00:00
2018-11-22 20:45:28 +00:00
### Installation
2018-09-18 03:33:59 +00:00
2018-11-22 20:45:28 +00:00
> manual installation
2017-12-15 02:22:48 +00:00
2018-09-18 18:40:52 +00:00
```sh
2018-11-19 14:56:55 +00:00
git clone https://github.com/pavanjadhaw/betterlockscreen
2018-09-18 18:40:52 +00:00
cd betterlockscreen
2018-12-17 06:56:34 +00:00
cp betterlockscreen ~/.local/bin/
2018-11-22 20:45:28 +00:00
```
2017-12-15 02:22:48 +00:00
2018-11-22 20:45:28 +00:00
< p style = "text-align: center" > OR< / p >
```sh
2018-09-18 18:40:52 +00:00
# or wget the script ~12KB
wget -O betterlockscreen https://git.io/fASUJ
chmod u+x betterlockscreen
2018-12-17 06:56:34 +00:00
cp betterlockscreen ~/.local/bin/
2018-11-22 20:45:28 +00:00
```
2018-09-18 18:40:52 +00:00
2018-11-22 20:45:28 +00:00
```sh
2018-09-18 18:40:52 +00:00
# Add betterlockscreen to PATH:
# (In your .bashrc, .zshrc etc)
export PATH="${PATH}:${HOME}/.local/bin/"
2017-12-15 02:22:48 +00:00
```
2018-11-22 20:45:28 +00:00
### Package Manager
2017-12-07 18:51:34 +00:00
2018-09-18 18:40:52 +00:00
#### Arch Linux
2018-01-03 05:04:25 +00:00
2018-09-18 18:40:52 +00:00
###### Installing dependencies(not required if using betterlockscreen aur package)
2018-11-19 14:56:55 +00:00
2018-09-18 18:40:52 +00:00
`pacman -S imagemagick feh xorg-xrandr xorg-xdpyinfo`
2018-11-19 14:56:55 +00:00
- i3lock-color - `trizen -S i3lock-color`
2018-01-03 05:04:25 +00:00
2018-09-18 18:40:52 +00:00
#### Aur package
2018-01-03 05:04:25 +00:00
2018-09-18 18:40:52 +00:00
`betterlockscreen` is available in the Arch User repos as `betterlockscreen` and `betterlockscreen-git` .
2017-12-07 18:51:34 +00:00
2018-11-19 14:56:55 +00:00
- betterlockscreen - `trizen -S betterlockscreen`
- betterlockscreen-git - `trizen -S betterlockscreen-git`
2017-12-07 18:51:34 +00:00
2018-09-18 18:40:52 +00:00
#### Debian and derivatives
2017-12-07 18:51:34 +00:00
2018-09-18 18:40:52 +00:00
UtkarshVerma was so kind to provide an installation script for debian based systems, ![check it out here ](https://github.com/UtkarshVerma/installer-scripts ).
2017-12-24 04:33:52 +00:00
2019-01-23 06:42:01 +00:00
### 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.
2019-01-28 05:26:47 +00:00
If you have installed betterlockscreen from AUR package, then you can copy default config from docs
```sh
cp /usr/share/doc/betterlockscreen/examples/betterlockscreenrc ~/.config
```
2018-11-22 20:45:28 +00:00
### Usage
2017-12-10 04:41:23 +00:00
2018-09-18 18:40:52 +00:00
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.
2017-12-10 04:41:23 +00:00
2018-09-18 18:40:52 +00:00
```sh
usage: betterlockscreen [-u "path/to/img.jpg"] [-l "dim, blur or dimblur"]
[-w "dim, blur, or dimblur"] [-t "custom text"] [-s "lockscreen and suspend"]
[-r "resolution"] [-b "factor"]
2017-12-08 06:01:03 +00:00
2018-09-18 18:40:52 +00:00
betterlockscreen - faster and sweet looking lockscreen for linux systems.
2017-12-08 06:01:03 +00:00
2018-09-18 18:40:52 +00:00
required:
-u, --update "path/to/img.jpg" caches all required images
2017-12-07 18:51:34 +00:00
2018-09-18 18:40:52 +00:00
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
2018-05-19 15:16:04 +00:00
2018-09-18 18:40:52 +00:00
Available effects:
dim, blur or dimblur
2018-05-19 15:16:04 +00:00
2018-09-18 18:40:52 +00:00
-t, --text "custom text"
set custom lockscreen text
-b, blur 0.0 - 1.0
set blur range
-r, --resolution res
uses a custom resolution
2018-05-19 15:16:04 +00:00
2017-12-07 18:51:34 +00:00
2018-09-18 18:40:52 +00:00
Usage examples:
1. Updating image cache(required)
betterlockscreen -u ~/Pictures/Forests.png # caches given image
betterlockscreen -u ~/Pictures # caches random image from ~/Pictures directory
2017-12-07 18:51:34 +00:00
2018-09-18 18:40:52 +00:00
2. Custom resolution and blur range
betterlockscreen -u path/to/directory -r 1920x1080 -b 0.5
2017-12-07 18:51:34 +00:00
2018-09-18 18:40:52 +00:00
3. Lockscreen
betterlockscreen -l dim # lockscreen with dim effect
4. Lockscreen with custom text
betterlockscreen -l dim -t "custom lockscreen text"
5. Set desktop background
betterlockscreen -w blur # set desktop background with blur effect
2017-12-11 01:22:40 +00:00
```
2017-12-07 18:59:37 +00:00
2018-11-22 20:45:28 +00:00
### Set desktop background on startup
2018-09-18 18:40:52 +00:00
Add this line to `.xinitrc` .
```sh
# set desktop background with custom effect
betterlockscreen -w dim
# Alternative (set last used background)
source ~/.fehbg
2017-12-11 01:22:40 +00:00
```
2018-09-18 18:40:52 +00:00
#### i3wm
Add this line to `~/.config/i3/config`
```sh
# set desktop background with custom effect
exec --no-startup-id betterlockscreen -w dim
# Alternative (set last used background)
exec --no-startup-id source ~/.fehbg
2017-12-07 18:51:34 +00:00
```
2018-11-22 20:45:28 +00:00
### Keybindings
2018-09-20 13:46:15 +00:00
2019-01-23 06:42:01 +00:00
To lockscreen using keyboard shortcut
2018-09-20 13:46:15 +00:00
#### i3wm
2018-09-18 18:40:52 +00:00
Add this line to your `~/.config/i3/config`
```sh
2018-09-20 13:46:15 +00:00
bindsym $mod+shift+x exec betterlockscreen -l dim
```
#### bspwm
Add this line to your `~/.config/sxhkd/sxhkdrc`
```sh
# lockscreen
alt + shift + x
betterlockscreen -l dim
2017-12-11 01:22:40 +00:00
```
2018-11-22 20:45:28 +00:00
### Lockscreen when suspended(systemd service)
2018-09-18 18:40:52 +00:00
```sh
# 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.
2017-12-11 01:22:40 +00:00
```
2017-12-08 06:01:03 +00:00
---
2018-11-22 20:45:28 +00:00
### Countributing
2018-11-19 14:56:55 +00:00
2018-11-19 15:06:34 +00:00
Thanks to all the amazing people for all your wonderful PRs, issues and ideas!
2018-11-19 14:56:55 +00:00
[![ ](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/images/0 )](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/links/0)[![](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/images/1)](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/links/1)[![](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/images/2)](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/links/2)[![](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/images/3)](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/links/3)[![](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/images/4)](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/links/4)[![](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/images/5)](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/links/5)[![](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/images/6)](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/links/6)[![](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/images/7)](https://sourcerer.io/fame/pavanjadhaw/pavanjadhaw/betterlockscreen/links/7)
## How can I support developers?
- Star our GitHub repo :star:
- Create pull requests, submit bugs, suggest new features or documentation updates :wrench:
## License
2018-11-22 20:45:28 +00:00
Betterlockscreen is under [MIT ](https://github.com/pavanjadhaw/betterlockscreen/blob/master/LICENSE ) license.
2018-11-19 14:56:55 +00:00
2017-12-07 18:51:34 +00:00
## Feel free to use and distribute
2018-11-19 14:56:55 +00:00
- Hat tip to anyone who's code was used
- Thanks to those who contributed to make it better
- Inspiration - r/unixporn
2018-11-22 20:45:28 +00:00
[logo]: .github/hero.png
[website]: https://mdxjs.com