aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 9d1cb3eb8b3f04fdd8f0d911ad65f04e0cd769d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# better_lockscreen

A simple lock script for i3lock
Most of i3lock script out there converts your defined image to add blur, glitch or dim effect to image and it feels so slow and btw who needs dynamic lock background,
its not like I change lockscreen background every 5 minutes.
I wanted something that was fast and still should have all the effects I want for lockscreen background.
This script generates or already caches the variant for your custom images before hand so they can be later used any number of time as lockscreen background,
without the need to apply same effect again and again

## Screenshots

Screenshots or it didnt happen... :P

![scrot1](https://github.com/pavanjadhaw/betterlockscreen/raw/master/demo/scrot1.png "scrot1.png")

![scrot2](https://github.com/pavanjadhaw/betterlockscreen/raw/master/demo/scrot2.png "scrot2.png")

### demo.mp4

* [demo.mp4](https://www.youtube.com/watch?v=9Ng5FZwnn6M&feature=youtu.be) - youtube.com

## Getting Started

Clone this repo, push this script somewhere handy or you can even copy this script to /usr/local/bin so that it can be used from your i3config without defining whole path.

### Prerequisites

Make sure you have following packages installed.

* [i3lock-color](https://github.com/PandorasFox/i3lock-color) - i3lock fork with additional features
* [imagemagick](https://www.imagemagick.org/script/index.php) - to apply effects to images
* [feh](https://feh.finalrewind.org/) - used to set custom wallpaper
* [background.jpg](https://unsplash.com/) - find your fav background image

### How to get started

Clone this repo

```
git clone https://github.com/pavanjadhaw/betterlockscreen
```

navigate to cloned repository

```
cd betterlockscreen
```

grab your fav image for lockscreen background

```
./lock.sh -u path/to/image.img
```

well, now lockscreen (original image)

```
./lock.sh -l
```

Use dimmed image as lockscreen background

```
./lock.sh -l dim
```

Use blurred image as lockscreen background

```
./lock.sh -l blur
```

well, now set wallpaper (original image)

```
./lock.sh -w
```

Use dimmed image as desktop background

```
./lock.sh -w dim
```

Use blurred image as desktop background

```
./lock.sh -w blur
```


To set desktop background on startup, add following lines to your .xintrc after pushing script to your path or you can use absolute path to script too

```
exec lock.sh -w
```

If you are i3wm user, add following line to your i3config (~/.config/i3/config or ~/.i3/config)

```
# custom keybinding to lockscreen, use --lock dim or --lock blur below for different backgrounds
bindsym $mod+shift+x exec lock.sh --lock
# bindsym $mod+shift+x exec lock.sh --lock dim
# bindsym $mod+shift+x exec lock.sh --lock blur

# Update image cache
exec --no-startup-id lock.sh -U ~/.wall.png

# Set last used image as desktop background, comment out below line if you use different desktop background utility
exec --no-startup-id lock.sh -w
```

## Feel free to use and distribute

This is my first bash script so if you think this could be improved or if you have any suggestion. Feel free.

* Hat tip to anyone who's code was used
* Inspiration - r/unixporn
* etc