Add multimonitor support along with option to set custom resolution (#19)

This commit is contained in:
Targuinius 2017-12-24 05:36:53 +01:00 committed by Pavan Jadhaw
parent 7dd83ed6e9
commit e53a3bea25

View file

@ -42,7 +42,7 @@ lock() {
background=00000000 background=00000000
foreground=ffffffff foreground=ffffffff
i3lock \ i3lock \
-n -i "$1" \ -t -n -i "$1" \
--timepos="x-90:h-ch+30" \ --timepos="x-90:h-ch+30" \
--datepos="tx+24:ty+25" \ --datepos="tx+24:ty+25" \
--clock --datestr "Type password to unlock..." \ --clock --datestr "Type password to unlock..." \
@ -148,6 +148,13 @@ case "$1" in
echo " Ex: betterlockscreen -w blur (for blurred wallpaper)" echo " Ex: betterlockscreen -w blur (for blurred wallpaper)"
echo " Ex: betterlockscreen -w dimblur (for dimmed + blurred wallpaper)" echo " Ex: betterlockscreen -w dimblur (for dimmed + blurred wallpaper)"
echo echo
echo
echo " -r --resolution"
echo " to be used after -u"
echo " used to set a custom resolution for the image cache."
echo " Ex: betterlockscreen -u path/to/image.png -r 1920x1080"
echo " Ex: betterlockscreen -u path/to/image.png --resolution 3840x1080"
echo
;; ;;
-l | --lock) -l | --lock)
@ -253,8 +260,11 @@ case "$1" in
user_image="$folder/user_image.png" user_image="$folder/user_image.png"
# 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
y_res=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/') if [ "$3" == "-r" ] || [ "$3" == "--resolution" ]; then
y_res=$4
else
y_res=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/')
fi
# create folder # create folder
if [ ! -d $folder ]; then if [ ! -d $folder ]; then
echo "Creating '$folder' directory to cache processed images." echo "Creating '$folder' directory to cache processed images."