55 lines
866 B
Bash
Executable file
55 lines
866 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# Logging helper
|
|
log_notify() {
|
|
level="$1" # e.g., low, normal, critical
|
|
title="$2"
|
|
message="$3"
|
|
notify-send -u "$level" "$title" "$message"
|
|
}
|
|
|
|
# Check if the given command exists silently
|
|
command_exists() {
|
|
command -v "$@" >/dev/null 2>&1
|
|
}
|
|
|
|
proc-kill-if() {
|
|
if pgrep "$1"; then
|
|
pkill "$1"
|
|
fi
|
|
}
|
|
|
|
barsetup() {
|
|
local bar="${1:-quickshell}"
|
|
|
|
proc-kill-if "$bar"
|
|
|
|
# case "$bar" in
|
|
# hyprpanel)
|
|
# pkill hyprpanel
|
|
# hyprpanel &
|
|
# ;;
|
|
# gBar)
|
|
# pkill gBar
|
|
# gBar bar 0 &
|
|
# ;;
|
|
# waybar)
|
|
# pkill waybar
|
|
# waybar &
|
|
# ;;
|
|
# quickshell)
|
|
# pkill qs
|
|
# qs &
|
|
# ;;
|
|
# *)
|
|
# pkill $bar
|
|
# $bar &
|
|
# ;;
|
|
# esac
|
|
}
|
|
|
|
if barsetup "$@"; then
|
|
log_notify "normal" "Status-Bar" "initialized $bar"
|
|
else
|
|
log_notify "critical" "Status-Bar" "Something went wrong, your bar is probably not up.. sorry.."
|
|
fi
|