Adding quickshell configuration script
This commit is contained in:
parent
5fbb3ffcc3
commit
3e5b4a6268
1 changed files with 46 additions and 0 deletions
46
.scripts/quickshell
Executable file
46
.scripts/quickshell
Executable file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue