diff options
| author | JaKooLit <jimmielovejay@gmail.com> | 2023-11-11 11:36:08 +0900 |
|---|---|---|
| committer | JaKooLit <jimmielovejay@gmail.com> | 2023-11-11 11:36:08 +0900 |
| commit | c516bd3be3502c6c064f43fc6cb39260a0fe7ca5 (patch) | |
| tree | 4dae2043b8c233357fd6180eeaf62683bd43883c /config/hypr/scripts/WaybarLayout.sh | |
| parent | b69298b7d4c6763d429f8c537e58723fb4439748 (diff) | |
Waybar clean up and update
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 & |
