Add ability to set custom lockscreen text, tabs (#65)

This commit is contained in:
zv0n 2018-09-17 15:33:41 +02:00 committed by Pavan Jadhaw
parent 33b7763283
commit 031140d5c4

View file

@ -6,6 +6,7 @@
# find your resolution so images can be resized to match your screen resolution # find your resolution so images can be resized to match your screen resolution
res=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/') res=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/')
locktext="Type password to unlock..."
init_filenames() { init_filenames() {
#$1 resolution #$1 resolution
@ -60,8 +61,8 @@ lock() {
i3lock \ i3lock \
-t -i "$1" \ -t -i "$1" \
--timepos="x+110:h-70" \ --timepos="x+110:h-70" \
--datepos="x+135:h-45" \ --datepos="x+43:h-45" \
--clock --datestr "Type password to unlock..." \ --clock --date-align 1 --datestr "$locktext" \
--insidecolor=$background --ringcolor=$foreground --line-uses-inside \ --insidecolor=$background --ringcolor=$foreground --line-uses-inside \
--keyhlcolor=$letterEnteredColor --bshlcolor=$letterRemovedColor --separatorcolor=$background \ --keyhlcolor=$letterEnteredColor --bshlcolor=$letterRemovedColor --separatorcolor=$background \
--insidevercolor=$passwordCorrect --insidewrongcolor=$passwordIncorrect \ --insidevercolor=$passwordCorrect --insidewrongcolor=$passwordIncorrect \
@ -179,8 +180,25 @@ usage() {
echo " used to set blur intensity. Default to 1." echo " used to set blur intensity. Default to 1."
echo " E.g: betterlockscreen -u path/to/image.png -b 3" echo " E.g: betterlockscreen -u path/to/image.png -b 3"
echo " E.g: betterlockscreen -u path/to/image.png --blur 0.5" echo " E.g: betterlockscreen -u path/to/image.png --blur 0.5"
echo
echo
echo " -t --text"
echo " to set custom lockscreen text (max 31 chars)"
echo " E.g: betterlockscreen -l dim -t \"Don't touch my machine!\""
echo " E.g: betterlockscreen --text \"Hi, user!\" -s blur"
} }
# check if --text argument is given
if [ $# -gt 2 ] ; then
if [ "$1" == "-t" -o "$1" == "--text" ] ; then
locktext="$2"
# delete first 2 arguments and reset numbering ( 3 -> 1, 4 -> 2, ...)
set -- "${@:3}"
elif [ \( "$3" == "-t" -o "$3" == "--text" \) -a $# -gt 3 ] ; then
locktext="$4"
fi
fi
# Options # Options
case "$1" in case "$1" in
"") "")