diff --git a/betterlockscreen b/betterlockscreen index 0fb0046..2f6a6b5 100755 --- a/betterlockscreen +++ b/betterlockscreen @@ -6,6 +6,16 @@ init_config () { + # resolve i3lock-color binary + i3lockcolor_bin="$(command -v i3lock-color)" + + if [[ (! -e "$i3lockcolor_bin") && (-e "$(command -v i3lock)") ]]; then + i3lockcolor_bin="$(command -v i3lock)" + else + echo "Can not find locker-binary as 'i3lock' or 'i3lock-color', please make sure it is in your \$PATH!" + exit 1 + fi + # default options display_on=0 span_image=false @@ -107,7 +117,7 @@ lock() { local image="$1" - i3lock \ + $i3lockcolor_bin \ -i "$image" \ -c "$bgcolor" \ --screen "$display_on" \ @@ -135,7 +145,7 @@ failsafe() { local text="ffffffff" local error="ff0000" - i3lock \ + $i3lockcolor_bin \ -c "$bgcolor" \ --screen "$display_on" \ --time-pos="ix-170:iy-0" \ @@ -824,7 +834,7 @@ for arg in "$@"; do -v | --version) echo echo "Version: $VERSION" - i3lock-color --version + $i3lockcolor_bin --version convert --version if [[ -x "$(command -v dunstctl)" ]]; then