summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Fabian Kirchner <kirchner@posteo.de>2024-08-12 18:51:07 +0200
committerLibravatar Fabian Kirchner <kirchner@posteo.de>2024-08-12 18:51:07 +0200
commit289471bd87727a6cee6e8a5c219d7cbadf9a4849 (patch)
treebc40bc67e3e1a3a4b83eb6f33e5530e4e14f9012
parentc8095f71c8f739a15579edb820ece9dbf19daf56 (diff)
feat: add icon for weather forecast
-rw-r--r--app/Sensor.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/Sensor.hs b/app/Sensor.hs
index d65b556..512870b 100644
--- a/app/Sensor.hs
+++ b/app/Sensor.hs
@@ -360,8 +360,13 @@ getForecast = handle (\(e :: SomeException) -> print e >> throwIO e) do
addUserAgent req = addRequestHeader (fromString "user-agent") (fromString "astatusbar") req
weatherForecast :: (S.MonadSensor m) => S.Sensor m () (Maybe String)
-weatherForecast =
- S.sensor WeatherForecast
+weatherForecast = do
+ value <- S.sensor WeatherForecast
+ return
+ ( case value of
+ Just "partlycloudy_night" -> Just "\xe37e"
+ _ -> value
+ )
data CurrentTime = CurrentTime deriving (Show)