46 lines
759 B
Bash
Executable file
46 lines
759 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# ─< Check if the given command exists silently >─────────────────────────────────────────
|
|
command-exists() {
|
|
command -v "$@" >/dev/null 2>&1
|
|
}
|
|
|
|
check-env() {
|
|
local dir bin
|
|
|
|
bin=quickshell
|
|
dir="$HOME/.config/quickshell"
|
|
|
|
if command-exists $bin; then
|
|
return 0
|
|
else
|
|
return 69
|
|
fi
|
|
|
|
if [ -d "${dir}" ]; then
|
|
return 0
|
|
else
|
|
return 69
|
|
fi
|
|
}
|
|
|
|
check-env
|
|
|
|
init-quickshell() {
|
|
local modules
|
|
local dir="$HOME/.config/quickshell"
|
|
|
|
modules=(
|
|
"activate-linux"
|
|
)
|
|
|
|
for mod in "${modules[@]}"; do
|
|
module="${dir}/${mod}.qml"
|
|
|
|
if [ -f "$module" ]; then
|
|
quickshell -p "$module" &
|
|
fi
|
|
done
|
|
}
|
|
|
|
init-quickshell
|