44 lines
932 B
Smarty
Executable File
44 lines
932 B
Smarty
Executable File
#!/bin/sh
|
|
|
|
TMP_IMG="/tmp/lock.png"
|
|
|
|
{% if hostname == "sputnik" %}
|
|
|
|
# rendered for sputnik
|
|
LOCKPROG=i3lock
|
|
LOCKARGS="-nef --image=$TMP_IMG"
|
|
LOCKARGS_NOCOOL="-c 302f3b"
|
|
OPTIONAL_CMDS="scrot lockscreen-blur"
|
|
SCREENCAP="scrot -"
|
|
BLUR_FACTOR=20
|
|
|
|
{% elif hostname == "vostok" %}
|
|
|
|
# rendered for vostok
|
|
LOCKPROG=swaylock
|
|
LOCKARGS="--config ~/.config/sway/swaylock.config --image $TMP_IMG"
|
|
LOCKARGS_NOCOOL="--config ~/.config/sway/swaylock.config --color 302f3b"
|
|
OPTIONAL_CMDS="grim lockscreen-blur"
|
|
SCREENCAP="grim -t ppm -"
|
|
BLUR_FACTOR=40
|
|
|
|
{% else %}
|
|
echo "screenlock not configured for this system"
|
|
exit 1
|
|
{% end %}
|
|
|
|
for CMD in $OPTIONAL_CMDS; do
|
|
if ! command -v "$CMD" &> /dev/null
|
|
then
|
|
echo "$CMD could not be found, falling back to basic mode."
|
|
|
|
$LOCKPROG $LOCKARGS_NOCOOL "$@"
|
|
|
|
exit 0
|
|
fi
|
|
done
|
|
|
|
$SCREENCAP | lockscreen-blur -o $TMP_IMG -b $BLUR_FACTOR --stamp ~/.config/wallpapers/ferris-stamp.png
|
|
|
|
$LOCKPROG $LOCKARGS "$@"
|