diff --git a/.scripts/quickshell b/.scripts/quickshell new file mode 100755 index 0000000..bc9e558 --- /dev/null +++ b/.scripts/quickshell @@ -0,0 +1,46 @@ +#!/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