nichts/nyx/homes/notashelf/services/wayland/ags/js/utils/weather.js
2024-04-09 23:11:33 +02:00

15 lines
390 B
JavaScript

import { Variable, App } from "../imports.js";
export const WeatherValue = Variable(
{},
{
poll: [
36000,
["sh", "-c", `python ${App.configDir}/bin/weather`],
(out) => JSON.parse(out),
],
},
);
export const getWeatherIcon = (value) => value.text || "...";
export const getWeatherTooltip = (value) => value.tooltip || "...";