Fix critical bug in switcher scripts array building

Fixed broken array building that was splitting filenames with spaces/brackets:
- Changed from: layouts=$(($command)) which splits on whitespace
- Changed to: mapfile -t which preserves full filenames

This fixes:
- Wofi showing 69 broken fragments instead of 25 layouts
- Wofi showing 83 broken fragments instead of 30 styles
- Symlinks pointing to non-existent fragmented paths
- Layouts not actually changing when selected

Also repaired broken config symlink that pointed to non-existent
/home/nicholai/.config/waybar/configs/BOT] back to working
Custom Minimal layout.
This commit is contained in:
Nicholai 2025-11-24 04:18:45 -07:00
parent 600a35020b
commit 2fa5c52963
3 changed files with 5 additions and 5 deletions

2
config
View File

@ -1 +1 @@
configs/[TOP] Custom Minimal
/home/nicholai/.config/waybar/configs/[TOP] Custom Minimal

View File

@ -4,8 +4,8 @@
waybar_layouts="$HOME/.config/waybar/configs"
waybar_config="$HOME/.config/waybar/config"
# Get all available layouts
layouts=($(ls "$waybar_layouts" | sort))
# Get all available layouts (using mapfile to preserve filenames with spaces)
mapfile -t layouts < <(ls "$waybar_layouts" | sort)
# If wofi is available, use it for selection
if command -v wofi &> /dev/null; then

View File

@ -4,8 +4,8 @@
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))
# Get all available styles (using mapfile to preserve filenames with spaces)
mapfile -t styles < <(find "$waybar_styles" -maxdepth 1 -type f -name "*.css" -exec basename {} \; | sort)
# If wofi is available, use it for selection
if command -v wofi &> /dev/null; then