Skip to content

Commit

Permalink
Fixed everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffser committed Nov 19, 2023
1 parent b603908 commit 8c4f40b
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 53 deletions.
6 changes: 6 additions & 0 deletions .config/waybar/config.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"temperature",
"network",
"bluetooth"
],
"include": [
"~/.config/waybar/default-modules.jsonc"
]
},
{
Expand All @@ -44,6 +47,9 @@
"battery",
"network",
"bluetooth"
],
"include": [
"~/.config/waybar/default-modules.jsonc"
]
}
]
13 changes: 11 additions & 2 deletions .config/waybar/default-modules.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,19 @@
},
"custom/weather": {
"tooltip": true,
"format": "{}",
"format": "{icon} {}",
"interval": 30,
"exec": "~/.config/waybar/scripts/waybar-wttr.py",
"return-type": "json"
"return-type": "json",
"format-icons": {
"sunny" : "󰖙",
"partly_cloudy" : "󰖕",
"cloudy" : "󰖐",
"rainy" : "󰖗",
"thundershower" : "󰖓",
"snowy" : "󰖘",
"snowstorm" : "󰼶"
}
},
"tray": {
"icon-size": 18,
Expand Down
101 changes: 50 additions & 51 deletions .config/waybar/scripts/waybar-wttr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,54 @@
from datetime import datetime

WEATHER_CODES = {
'113': '☀️ ',
'116': '',
'119': '☁️ ',
'122': '☁️ ',
'143': '☁️ ',
'176': '🌧️',
'179': '🌧️',
'182': '🌧️',
'185': '🌧️',
'200': '⛈️ ',
'227': '🌨️',
'230': '🌨️',
'248': '☁️ ',
'260': '☁️ ',
'263': '🌧️',
'266': '🌧️',
'281': '🌧️',
'284': '🌧️',
'293': '🌧️',
'296': '🌧️',
'299': '🌧️',
'302': '🌧️',
'305': '🌧️',
'308': '🌧️',
'311': '🌧️',
'314': '🌧️',
'317': '🌧️',
'320': '🌨️',
'323': '🌨️',
'326': '🌨️',
'329': '❄️ ',
'332': '❄️ ',
'335': '❄️ ',
'338': '❄️ ',
'350': '🌧️',
'353': '🌧️',
'356': '🌧️',
'359': '🌧️',
'362': '🌧️',
'365': '🌧️',
'368': '🌧️',
'371': '❄️',
'374': '🌨️',
'377': '🌨️',
'386': '🌨️',
'389': '🌨️',
'392': '🌧️',
'395': '❄️ '
'113': 'sunny',
'116': 'partly_cloudy',
'119': 'cloudy',
'122': 'cloudy',
'143': 'cloudy',
'176': 'rainy',
'179': 'rainy',
'182': 'rainy',
'185': 'rainy',
'200': 'thundershower',
'227': 'snowy',
'230': 'snowy',
'248': 'cloudy',
'260': 'cloudy',
'263': 'rainy',
'266': 'rainy',
'281': 'rainy',
'284': 'rainy',
'293': 'rainy',
'296': 'rainy',
'299': 'rainy',
'302': 'rainy',
'305': 'rainy',
'308': 'rainy',
'311': 'rainy',
'314': 'rainy',
'317': 'rainy',
'320': 'snowy',
'323': 'snowy',
'326': 'snowy',
'329': 'snowstorm',
'332': 'snowstorm',
'335': 'snowstorm',
'338': 'snowstorm',
'350': 'rainy',
'353': 'rainy',
'356': 'rainy',
'359': 'rainy',
'362': 'rainy',
'365': 'rainy',
'368': 'rainy',
'371': 'snowstorm',
'374': 'snowy',
'377': 'snowy',
'386': 'snowy',
'389': 'snowy',
'392': 'rainy',
'395': 'snowstorm '
}

data = {}
Expand Down Expand Up @@ -92,9 +92,8 @@ def format_chances(hour):
if tempint > 0 and tempint < 10:
extrachar = '+'


data['text'] = ' '+WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \
" "+extrachar+weather['current_condition'][0]['FeelsLikeC']+"°"
data['alt'] = WEATHER_CODES[weather['current_condition'][0]['weatherCode']]
data['text'] = extrachar+weather['current_condition'][0]['FeelsLikeC']+"°"

data['tooltip'] = f"<b>{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°</b>\n"
data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}°\n"
Expand Down

0 comments on commit 8c4f40b

Please sign in to comment.