aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Sellmeier <mail@sebastian-sellmeier.de>2021-08-07 14:48:15 +0200
committerSebastian Sellmeier <mail@sebastian-sellmeier.de>2021-08-07 14:48:15 +0200
commit7157b045645df1ada33af5d0e21418b202bb84cd (patch)
treecd76f4919a621f77adf90bcdc8728f2b903b64a3
parentf452ef0ec47b858db855316fb14587e3bf68221a (diff)
Fix installer to also detect i3lock-color if command is i3lock
-rwxr-xr-xinstall.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/install.sh b/install.sh
index 8623e30..8adc691 100755
--- a/install.sh
+++ b/install.sh
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
+cmd_exists () {
+ command -v "$1" >/dev/null
+}
+
echof() {
local colorReset="\033[0m"
local prefix="$1"
@@ -55,8 +59,12 @@ DEPS["xdpyinfo"]="xdpyinfo"
DEPS["xrdb"]="xrdb"
DEPS["xset"]="xset"
+if ! cmd_exists DEPS["i3lock-color"] && cmd_exists "i3lock"; then
+ DEPS["i3lock-color"]="i3lock"
+fi
+
for key in "${!DEPS[@]}"; do
- [[ ! -e "$(command -v ${DEPS[$key]})" ]] && echof error "Missing '$key'!" && exit 1
+ [[ ! -e "$(command -v ${DEPS[$key]})" ]] && echof error "Missing '$key' under binary named '${DEPS[$key]}'!" && exit 1
done
echof ok "done!"