From bb8fc0abf3d55f292601d04517818f74f79c6e30 Mon Sep 17 00:00:00 2001 From: Fabian Kirchner Date: Mon, 12 Aug 2024 14:04:31 +0200 Subject: feat:adjust snd icon depending on value --- app/Sensor.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'app/Sensor.hs') diff --git a/app/Sensor.hs b/app/Sensor.hs index 2dcf6c0..0c05519 100644 --- a/app/Sensor.hs +++ b/app/Sensor.hs @@ -230,8 +230,15 @@ instance (S.MonadSensor m) => S.Aggregate m Snd Float where where parse = liftIO do (/ 153) . read <$> [sh|pamixer --get-volume|] -snd :: (S.MonadSensor m) => S.Sensor m () Float -snd = S.sensor Snd +snd :: (S.MonadSensor m) => S.Sensor m () String +snd = do + value <- S.sensor Snd + return + ( if + | 0.4 < value -> "\xf028" + | 0.0 < value -> "\xf027" + | otherwise -> "\xf026" + ) data DiskStat = DiskStat deriving (Show) -- cgit v1.2.3