mirror of https://git.sr.ht/~skiqqy/bin
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
684 B
19 lines
684 B
#!/bin/bash
|
|
# Simple lock, using i3-lock
|
|
# Author: Skiqqy
|
|
|
|
# Import stuff
|
|
SCRIPT_PATH=$(dirname $0)
|
|
. "$SCRIPT_PATH/import/alert.sh" > /dev/null 2>&1
|
|
|
|
# Check dependencies
|
|
[ ! $(command -v error) ] && echo "[WARNING] Missing 'alert.sh' import"
|
|
[ ! $(command -v i3lock) ] && error "Missing command 'i3lock'" || tick "'i3lock' found"
|
|
[ ! $(command -v scrot) ] && error "Missing command 'scrot'" || tick "'scrot' found"
|
|
[ ! $(command -v convert) ] && error "Missing 'convert', provided by ImageMagick" || tick "'convert' found"
|
|
|
|
path="$HOME/Pictures"
|
|
scrot $path/.slock.png
|
|
convert -scale 10% -scale 1000% $path/.slock.png $path/.slock.png
|
|
i3lock -i $path/.slock.png
|
|
rm $path/.slock.png
|
|
|