mirror of
https://github.com/kmein/niveum
synced 2026-03-20 12:01:06 +01:00
feat(i3status-rust): add sun timer
This commit is contained in:
@@ -92,6 +92,16 @@ in {
|
|||||||
units = "metric";
|
units = "metric";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
block = "custom";
|
||||||
|
interval = 60 * 60;
|
||||||
|
command = let inherit (import <niveum/configs/spacetime.nix>) location; in pkgs.writers.writeDash "sun-times" ''
|
||||||
|
result="$(${pkgs.curl}/bin/curl -sSL "https://api.sunrise-sunset.org/json?formatted=0&lat=${toString location.latitude}&lng=${toString location.longitude}")"
|
||||||
|
sunrise="$(echo "$result" | ${pkgs.jq}/bin/jq -r .results.sunrise)"
|
||||||
|
sunset="$(echo "$result" | ${pkgs.jq}/bin/jq -r .results.sunset)"
|
||||||
|
echo "🌅 $(${pkgs.coreutils}/bin/date +%R -d "$sunrise") 🌇 $(${pkgs.coreutils}/bin/date +%R -d "$sunset")"
|
||||||
|
'';
|
||||||
|
}
|
||||||
{
|
{
|
||||||
block = "custom";
|
block = "custom";
|
||||||
interval = 60 * 60;
|
interval = 60 * 60;
|
||||||
|
|||||||
Reference in New Issue
Block a user