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 = {
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 = "<span font_size='11pt'>{}</span>";
return-type = "json";