diff options
Diffstat (limited to 'config/hypr/scripts/WaybarLayout.sh')
| -rwxr-xr-x | config/hypr/scripts/WaybarLayout.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/config/hypr/scripts/WaybarLayout.sh b/config/hypr/scripts/WaybarLayout.sh new file mode 100755 index 00000000..87af0fa5 --- /dev/null +++ b/config/hypr/scripts/WaybarLayout.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +CONFIG="$HOME/.config/waybar/configs" +WCONFIG="$HOME/.config/waybar/config" + +menu() { + cat <<EOF +default +Top(gnome) +Bottom(plasma) +simple-long +simple-short +Top-&-Bottom +Left +Right +Top-Left +Top-Right +Bottom-Left +Bottom-Right +all-sides +no panel +EOF +} + +apply_config() { + ln -sf "$CONFIG/config-$1" "$WCONFIG" +} + +main() { + choice=$(menu | rofi -dmenu -config ~/.config/rofi/config-waybar.rasi) + + case $choice in + "no panel") + if pgrep -x "waybar" >/dev/null; then + pkill waybar + exit + fi + ;; + *) + apply_config "$choice" + ;; + esac +} + +# Check if rofi is already running +if pidof rofi >/dev/null; then + pkill rofi + exit 0 +else + main +fi + +exec ~/.config/hypr/scripts/Refresh.sh & |
