Update pika-hyprland-settings/etc/skel/.config/ags/lib.js

This commit is contained in:
ferreo 2024-08-27 11:47:13 +02:00
parent 7622dff84b
commit 34ecee9a2b

View File

@ -11,9 +11,13 @@ export const getWeatherSymbol = (weatherCode) => {
const dt = new Date();
const hour = dt.getHours();
if (hour <= 7 || hour >= 20) {
return NIGHT_WEATHER_SYMBOL[WWO_CODE[weatherCode]];
return NIGHT_WEATHER_SYMBOL[OMAPI_CODE[weatherCode]];
}
return WEATHER_SYMBOL[WWO_CODE[weatherCode]];
return WEATHER_SYMBOL[OMAPI_CODE[weatherCode]];
};
export const getWeatherDesc = (weatherCode) => {
return OMAPI_CODE_DESC[weatherCode];
};
export const getFormattedTime = () => {
@ -67,55 +71,66 @@ const battIcons = ["battery_0_bar","battery_1_bar","battery_2_bar","battery_3_ba
const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
const WWO_CODE = {
"113": "Sunny",
"116": "PartlyCloudy",
"119": "Cloudy",
"122": "VeryCloudy",
"143": "Fog",
"176": "LightShowers",
"179": "LightSleetShowers",
"182": "LightSleet",
"185": "LightSleet",
"200": "ThunderyShowers",
"227": "LightSnow",
"230": "HeavySnow",
"248": "Fog",
"260": "Fog",
"263": "LightShowers",
"266": "LightRain",
"281": "LightSleet",
"284": "LightSleet",
"293": "LightRain",
"296": "LightRain",
"299": "HeavyShowers",
"302": "HeavyRain",
"305": "HeavyShowers",
"308": "HeavyRain",
"311": "LightSleet",
"314": "LightSleet",
"317": "LightSleet",
"320": "LightSnow",
"323": "LightSnowShowers",
"326": "LightSnowShowers",
"329": "HeavySnow",
"332": "HeavySnow",
"335": "HeavySnowShowers",
"338": "HeavySnow",
"350": "LightSleet",
"353": "LightShowers",
"356": "HeavyShowers",
"359": "HeavyRain",
"362": "LightSleetShowers",
"365": "LightSleetShowers",
"368": "LightSnowShowers",
"371": "HeavySnowShowers",
"374": "LightSleetShowers",
"377": "LightSleet",
"386": "ThunderyShowers",
"389": "ThunderyHeavyRain",
"392": "ThunderySnowShowers",
"395": "HeavySnowShowers",
const OMAPI_CODE_DESC = {
"0": "Clear",
"1": "Mostly Clear",
"2": "Partly Cloudy",
"3": "Cloudy",
"45": "Fog",
"48": "Freezing Fog",
"51": "Light Drizzle",
"53": "Drizzle",
"55": "Heavy Drizzle",
"56": "Light Freezing Drizzle",
"57": "Freezing Drizzle",
"61": "Light Rain",
"63": "Rain",
"65": "Heavy Rain",
"66": "Light Freezing Rain",
"67": "Freezing Rain",
"71": "Light Snow",
"73": "Snow",
"75": "Heavy Snow",
"77": "Light Snow Shower",
"80": "Light Rain Shower",
"81": "Rain Shower",
"82": "Heavy Rain Shower",
"85": "Snow Shower",
"86": "Heavy Snow Shower",
"95": "Thunderstorm",
"96": "Heavy Thunderstorm",
"99": "THunderstorm with Hail"
}
const OMAPI_CODE = {
"0": "Sunny",
"1": "PartlyCloudy",
"2": "Cloudy",
"3": "VeryCloudy",
"45": "Fog",
"48": "Fog",
"51": "LightShowers",
"53": "LightRain",
"55": "HeavyShowers",
"56": "LightSleetShowers",
"57": "LightSleet",
"61": "LightRain",
"63": "LightRain",
"65": "HeavyRain",
"66": "LightSleet",
"67": "LightSleet",
"71": "LightSnow",
"73": "HeavySnow",
"75": "HeavySnow",
"77": "LightSnowShowers",
"80": "LightShowers",
"81": "HeavyShowers",
"82": "HeavyShowers",
"85": "LightSnowShowers",
"86": "HeavySnowShowers",
"95": "ThunderyShowers",
"96": "ThunderyHeavyRain",
"99": "ThunderySnowShowers"
}
const WEATHER_SYMBOL = {