From 3e5b4a62680ded44c7c3862479a98f6c9849e579 Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 8 Jun 2025 09:47:26 +0200 Subject: [PATCH] Adding quickshell configuration script --- .scripts/quickshell | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 .scripts/quickshell 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