aboutsummaryrefslogtreecommitdiffstats
path: root/bin/i3lock
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2017-06-26 15:14:35 +0200
committerDavid Runge <dave@sleepmap.de>2017-06-26 15:14:35 +0200
commit778661b3bd44f59532e98a4e9ad046645312155c (patch)
tree4147823314a418d4fef0170d8a7dc3fff9cabfbc /bin/i3lock
parent1e6b3edc442a4bb78ed58e3071d5ece27606f782 (diff)
downloaddotfiles-778661b3bd44f59532e98a4e9ad046645312155c.tar.gz
dotfiles-778661b3bd44f59532e98a4e9ad046645312155c.tar.bz2
dotfiles-778661b3bd44f59532e98a4e9ad046645312155c.tar.xz
dotfiles-778661b3bd44f59532e98a4e9ad046645312155c.zip
bin/i3lock: Modularizing functionality.
Diffstat (limited to 'bin/i3lock')
-rwxr-xr-xbin/i3lock19
1 files changed, 15 insertions, 4 deletions
diff --git a/bin/i3lock b/bin/i3lock
index fcee43c..375e838 100755
--- a/bin/i3lock
+++ b/bin/i3lock
@@ -2,9 +2,20 @@
set -euo pipefail
+image_fallback=/usr/share/archlinux/wallpaper/archlinux-underground.jpg
image_location=$XDG_RUNTIME_DIR/screen-lock.png
-/usr/bin/xset b off
-/usr/bin/scrot -q 100 $image_location
-/usr/bin/convert -quality 1 -implode 1 -motion-blur 16x10 $image_location $image_location
-/usr/bin/i3lock -i $image_location -ef
+function create_background()
+{
+ /usr/bin/xset b off
+ /usr/bin/scrot -q 100 $image_location
+ /usr/bin/convert -quality 1 -implode 1 -motion-blur 16x10 $image_location $image_location
+}
+
+function lock_screen()
+{
+ /usr/bin/i3lock -i $image_location -ef
+}
+
+create_background
+lock_screen