aboutsummaryrefslogtreecommitdiff
path: root/betterlockscreen
diff options
context:
space:
mode:
authorSebastian Sellmeier <mail@sebastian-sellmeier.de>2021-08-07 01:18:44 +0200
committerSebastian Sellmeier <mail@sebastian-sellmeier.de>2021-08-07 01:18:44 +0200
commit583ad3468f6b3c8e0ec6d5074fcc82edd52850cd (patch)
treea96d9aff33a91dc044d5187c8253444ec058cb8b /betterlockscreen
parent6537717ab1b1cf560c69964394c41eac8d0c9d38 (diff)
Add code to autodetect if i3lock-color is available under its name or i3lock and validate custom values from config, extend copyright matching LICENSE
Diffstat (limited to 'betterlockscreen')
-rwxr-xr-xbetterlockscreen15
1 files changed, 14 insertions, 1 deletions
diff --git a/betterlockscreen b/betterlockscreen
index 807de75..17b4e43 100755
--- a/betterlockscreen
+++ b/betterlockscreen
@@ -1,9 +1,13 @@
#!/usr/bin/env bash
-# Author : Pavan Jadhaw
+# Author : Copyright (c) 2017-2021 Pavan Jadhaw, and others (https://github.com/pavanjadhaw/betterlockscreen/graphs/contributors)
# Github Profile : https://github.com/pavanjadhaw
# Project Repository : https://github.com/pavanjadhaw/betterlockscreen
+cmd_exists () {
+ command -v "$1" >/dev/null
+}
+
init_config () {
# default options
@@ -18,6 +22,10 @@ init_config () {
description=""
i3lockcolor_bin="i3lock-color"
+ if ! cmd_exists "i3lockcolor_bin" && cmd_exists "i3lock"; then
+ i3lockcolor_bin="i3lock"
+ fi
+
# default theme
loginbox=00000066
loginshadow=00000000
@@ -50,6 +58,11 @@ init_config () {
source "$USER_CONF"
fi
+ if ! cmd_exists "$i3lockcolor_bin"; then
+ echof error "Unable to find i3lock-color binary under detected/configured name: '$i3lockcolor_bin'!"
+ exit
+ fi
+
# Please make sure to adjust this before release!
VERSION="4.0.0-beta1"