From 600a35020b244399c488ecdf92d9551335484932 Mon Sep 17 00:00:00 2001 From: Nicholai Date: Sun, 23 Nov 2025 23:13:58 -0700 Subject: [PATCH] Fix symlink paths to use absolute paths Changed scripts to use realpath() to create absolute symlinks instead of relative paths, which were breaking with filenames containing special characters. Also added sleep delay before restarting waybar. --- scripts/switch-layout.sh | 4 +++- scripts/switch-style.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/switch-layout.sh b/scripts/switch-layout.sh index a48febc..22cdfbf 100755 --- a/scripts/switch-layout.sh +++ b/scripts/switch-layout.sh @@ -21,9 +21,11 @@ else fi if [[ -n "$choice" ]]; then - ln -sf "$waybar_layouts/$choice" "$waybar_config" + # Use absolute path for the symlink target + ln -sf "$(realpath "$waybar_layouts/$choice")" "$waybar_config" echo "Switched to: $choice" killall waybar + sleep 0.5 waybar & else echo "No selection made" diff --git a/scripts/switch-style.sh b/scripts/switch-style.sh index e280768..a9c3640 100755 --- a/scripts/switch-style.sh +++ b/scripts/switch-style.sh @@ -21,9 +21,11 @@ else fi if [[ -n "$choice" ]]; then - ln -sf "$waybar_styles/$choice" "$waybar_css" + # Use absolute path for the symlink target + ln -sf "$(realpath "$waybar_styles/$choice")" "$waybar_css" echo "Switched to: $choice" killall waybar + sleep 0.5 waybar & else echo "No selection made"