summaryrefslogtreecommitdiffstats
path: root/app/Sensor.hs
diff options
context:
space:
mode:
authorLibravatar Fabian Kirchner <kirchner@posteo.de>2024-08-12 14:04:31 +0200
committerLibravatar Fabian Kirchner <kirchner@posteo.de>2024-08-12 14:04:31 +0200
commitbb8fc0abf3d55f292601d04517818f74f79c6e30 (patch)
tree28c06fa821470d0d94b88ca69604327d94d4922a /app/Sensor.hs
parentb28555a116278861ffbbfc43199a470e438d45f4 (diff)
feat:adjust snd icon depending on value
Diffstat (limited to 'app/Sensor.hs')
-rw-r--r--app/Sensor.hs11
1 files changed, 9 insertions, 2 deletions
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)