diff --git a/README.md b/README.md index 9e381ff..4733e5b 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ without the need to apply same effect again and again ## Screenshots -Screenshots or it didnt happen... :P - ![scrot1](https://github.com/pavanjadhaw/betterlockscreen.demo/raw/master/scrots/scrot1.png "scrot1.png") ![scrot2](https://github.com/pavanjadhaw/betterlockscreen.demo/raw/master/scrots/scrot2.png "scrot2.png") @@ -20,7 +18,28 @@ Screenshots or it didnt happen... :P * [Demonstration](https://www.youtube.com/watch?v=9Ng5FZwnn6M&feature=youtu.be) - youtube.com -## Getting Started +## Features + +``` +# Lock screen +betterlockscreen -l | --lock [modifier] +# Set wallpaper +betterlockscreen -w | --wall [modifier] +# Suspend system +betterlockscreen -s | --suspend [modifier] +# Update image cache +betterlockscreen -u | --update (path/to/image.png | path/to/directory) [-r | --resolution ] [-b | --blur ] + +Modifiers: +dim +blur +dimblur + +Example update image cache: +betterlockscreen -u path/to/directory -r 1920x1080 -b 0.5 +In this case a random image from the directory is chosen, and converted to a 1920x1080 resolution with the blur factor set to 0.5 +``` + ## Installation via [AUR package](https://aur.archlinux.org/packages/betterlockscreen-git/) @@ -38,16 +57,31 @@ yaourt -S betterlockscreen-git 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. +``` +git clone https://github.com/pavanjadhaw/betterlockscreen +# optionally copy the script to /usr/local/bin so you can execute it everywhere +cp betterlockscreen/betterlockscreen /usr/local/bin/betterlockscreen +``` + +OR + +If you dont want to clone the repo and save some bandwidth and diskspace you can do the following + +``` +wget https://raw.githubusercontent.com/pavanjadhaw/betterlockscreen/master/betterlockscreen +chmod u+x betterlockscreen +``` + ### Prerequisites Make sure you have following packages installed. * [i3lock-color](https://github.com/PandorasFox/i3lock-color) - i3lock fork with additional features (use development branch while building from source for arch use i3lock-color-git from AUR) * [imagemagick](https://www.imagemagick.org/script/index.php) - to apply effects to images -* [feh](https://feh.finalrewind.org/) - used to set custom wallpaper * [xdpyinfo](https://www.x.org/archive/X11R7.7/doc/man/man1/xdpyinfo.1.xhtml) - find your screen resolution (to resize images accordingly) * [xrandr](https://www.x.org/wiki/Projects/XRandR/) - depends for xdpyinfo -* [background.jpg](https://unsplash.com/) - find your fav background image +* [bc](https://www.gnu.org/software/bc/) - used for setting the blur level +* [feh](https://feh.finalrewind.org/) - used to set custom wallpaper *Note: systemd is required for the suspend feature.* @@ -55,17 +89,11 @@ Make sure you have following packages installed. To install required packages -Install feh and imagemagick - -``` -pacman -S imagemagick feh -``` - -Install xrandr and xdpyinfo (currently used to find screenresolution) +Install feh, imagemagick, xrandr and xdpyinfo (currently used to find screenresolution) If anyone knows better way so that these dependencies could be minimized, please open issue. ``` -pacman -S xorg-xrandr xorg-xdpyinfo +pacman -S imagemagick feh xorg-xrandr xorg-xdpyinfo ``` Install i3lock-color-git from AUR @@ -79,145 +107,11 @@ Yaourt users ``` yaourt -S i3lock-color-git ``` - -### How to get started - -#### Clone this repo - -``` -git clone https://github.com/pavanjadhaw/betterlockscreen -``` - -navigate to cloned repository - -``` -cd betterlockscreen -``` - ---- - -#### If you dont want to clone the repo and save some bandwidth and diskspace you can do the following - -``` -wget https://raw.githubusercontent.com/pavanjadhaw/betterlockscreen/master/betterlockscreen - -chmod u+x betterlockscreen -``` - ---- - -### Load/Update the image cache - -*Grab your favourite image for lockscreen background* - -``` -betterlockscreen -u path/to/image.img -``` - -*if you want to use random image from specific directory* - -``` -betterlockscreen -u path/to/imagedir -``` - -*set random image as desktop background too* - -``` -betterlockscreen -u path/to/imagedir && betterlockscreen -w -``` - ---- - -### To lockscreen - -Original image as background - -``` -betterlockscreen -l -``` - -Use dimmed image as lockscreen background - -``` -betterlockscreen -l dim -``` - -Use blurred image as lockscreen background - -``` -betterlockscreen -l blur -``` - -Use dim + blurred image as lockscreen background - -``` -betterlockscreen -l dimblur -``` - ---- - -### To suspend system with lockscreen - -Original image as background - -``` -betterlockscreen -s -``` - -Use dimmed image as lockscreen background - -``` -betterlockscreen -s dim -``` - -Use blurred image as lockscreen background - -``` -betterlockscreen -s blur -``` - -Use dim + blurred image as lockscreen background - -``` -betterlockscreen -s dimblur -``` - ---- - -### To set wallpaper - -Original Image - -``` -betterlockscreen -w -``` - -Use dimmed image as desktop background - -``` -betterlockscreen -w dim -``` - -Use blurred image as desktop background - -``` -betterlockscreen -w blur -``` - -Use dim + blurred image as desktop background - -``` -betterlockscreen -w dimblur -``` - --- 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 ``` -# below line no longer needed as cached images are now permanently stored -# exec betterlockscreen -u ~/.wall.png & - exec betterlockscreen -w ``` @@ -229,25 +123,18 @@ If you are i3wm user, add following line to your i3config (~/.config/i3/config o bindsym $mod+shift+x exec betterlockscreen --lock ``` -*update image cache and set last cached image as desktop background* +*set last cached image as desktop background* ``` -# Update image cache -# no longer required as cached images are permanently stored -# exec --no-startup-id betterlockscreen -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 betterlockscreen -w ``` -**OR** - -*use following if you would like to be surprised by random wallpaper from directory of your choice on each startup* +*set the image cache to a random image from a directory of your choice on each startup* ``` # where Pictures/Wallpapers is the directory you would want to get random wallpapers from exec --no-startup-id betterlockscreen -u ~/Pictures/Wallpapers -# add this only if you want to use same random image as desktop background too (you might want to) +# add this only if you want to use same random image as desktop background too # it might not work as it takes few seconds for images to be cached, # try adding delay of 5 seconds if thats the case exec --no-startup-id betterlockscreen -w @@ -262,5 +149,3 @@ This is my first bash script so if you think this could be improved or if you ha * Hat tip to anyone who's code was used * Thanks to those who contributed to make it better * Inspiration - r/unixporn -* etc -