More waybar touchups

This commit is contained in:
Jimbo 2024-09-13 02:27:13 -04:00
parent 07666417e0
commit 6cfdf760c5

View file

@ -204,12 +204,13 @@
weatherModule = { weatherModule = {
exec = pkgs.writeScript "weatherScript" '' exec = pkgs.writeScript "weatherScript" ''
# Fetch weather data # Fetch weather data
weather=$(fastfetch -c all -s weather -l none) fetch=$(fastfetch -c all -s weather -l none)
weather_temp=$(echo $weather | awk '{print $2}' | sed 's/^\+//') temp=$(echo $fetch | awk '{print $2}' | sed 's/^\+//')
weather_condition=$(echo $weather | awk '{print $4}') condition=$(echo $fetch | awk '{print $4}')
city=$(echo "$fetch" | awk '{print $5}' | sed 's/[(),]//g')
# Map weather conditions to emojis # Map weather conditions to emojis
case "$weather_condition" in case "$condition" in
"Clear") emoji="";; "Clear") emoji="";;
"Clouds") emoji="";; "Clouds") emoji="";;
"Rain") emoji="🌧";; "Rain") emoji="🌧";;
@ -221,7 +222,7 @@
esac esac
# Display weather emoji and temperature # Display weather emoji and temperature
echo {\"text\":\"$emoji $weather_temp\",\"tooltip\":\"Condition: $weather_condition\"} echo {\"text\":\"$emoji $temp\",\"tooltip\":\"$city: $condition\"}
''; '';
format = "<span font_size='11pt'>{}</span>"; format = "<span font_size='11pt'>{}</span>";
return-type = "json"; return-type = "json";