From 24385e6e654e68ae7cbbcf634f9b89371a20420b Mon Sep 17 00:00:00 2001 From: Nicholai Date: Sun, 23 Nov 2025 23:08:47 -0700 Subject: [PATCH] Add waybar layout and style switcher scripts Created convenient scripts for testing different configurations: - switch-layout.sh: Switch between 24 available layouts - switch-style.sh: Switch between 30+ themes - Works with rofi (GUI) or CLI menu - Automatically reloads waybar after switching --- scripts/switch-layout.sh | 30 ++++++++++++++++++++++++++++++ scripts/switch-style.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100755 scripts/switch-layout.sh create mode 100755 scripts/switch-style.sh diff --git a/scripts/switch-layout.sh b/scripts/switch-layout.sh new file mode 100755 index 0000000..9bb840a --- /dev/null +++ b/scripts/switch-layout.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Quick waybar layout switcher + +waybar_layouts="$HOME/.config/waybar/configs" +waybar_config="$HOME/.config/waybar/config" + +# Get all available layouts +layouts=($(ls "$waybar_layouts" | sort)) + +# If rofi is available, use it for selection +if command -v rofi &> /dev/null; then + choice=$(printf '%s\n' "${layouts[@]}" | rofi -dmenu -i -p "Waybar Layout") +else + # Otherwise use a simple CLI menu + echo "Available Waybar Layouts:" + for i in "${!layouts[@]}"; do + echo "$((i+1)). ${layouts[$i]}" + done + read -p "Select layout (1-${#layouts[@]}): " selection + choice="${layouts[$((selection-1))]}" +fi + +if [[ -n "$choice" ]]; then + ln -sf "$waybar_layouts/$choice" "$waybar_config" + echo "Switched to: $choice" + killall waybar + waybar & +else + echo "No selection made" +fi diff --git a/scripts/switch-style.sh b/scripts/switch-style.sh new file mode 100755 index 0000000..fbf45d0 --- /dev/null +++ b/scripts/switch-style.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Quick waybar style/theme switcher + +waybar_styles="$HOME/.config/waybar/style" +waybar_css="$HOME/.config/waybar/style.css" + +# Get all available styles +styles=($(ls "$waybar_styles"/*.css 2>/dev/null | xargs -n1 basename | sort)) + +# If rofi is available, use it for selection +if command -v rofi &> /dev/null; then + choice=$(printf '%s\n' "${styles[@]}" | rofi -dmenu -i -p "Waybar Style") +else + # Otherwise use a simple CLI menu + echo "Available Waybar Styles:" + for i in "${!styles[@]}"; do + echo "$((i+1)). ${styles[$i]}" + done + read -p "Select style (1-${#styles[@]}): " selection + choice="${styles[$((selection-1))]}" +fi + +if [[ -n "$choice" ]]; then + ln -sf "$waybar_styles/$choice" "$waybar_css" + echo "Switched to: $choice" + killall waybar + waybar & +else + echo "No selection made" +fi