diff --git a/home-manager/sway/waybar.nix b/home-manager/sway/waybar.nix index f936440..f93f7f8 100644 --- a/home-manager/sway/waybar.nix +++ b/home-manager/sway/waybar.nix @@ -204,12 +204,13 @@ weatherModule = { exec = pkgs.writeScript "weatherScript" '' # Fetch weather data - weather=$(fastfetch -c all -s weather -l none) - weather_temp=$(echo $weather | awk '{print $2}' | sed 's/^\+//') - weather_condition=$(echo $weather | awk '{print $4}') + fetch=$(fastfetch -c all -s weather -l none) + temp=$(echo $fetch | awk '{print $2}' | sed 's/^\+//') + condition=$(echo $fetch | awk '{print $4}') + city=$(echo "$fetch" | awk '{print $5}' | sed 's/[(),]//g') # Map weather conditions to emojis - case "$weather_condition" in + case "$condition" in "Clear") emoji="☀️";; "Clouds") emoji="☁️";; "Rain") emoji="🌧️";; @@ -221,7 +222,7 @@ esac # Display weather emoji and temperature - echo {\"text\":\"$emoji $weather_temp\",\"tooltip\":\"Condition: $weather_condition\"} + echo {\"text\":\"$emoji $temp\",\"tooltip\":\"$city: $condition\"} ''; format = "{}"; return-type = "json";