diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Main.hs | 4 | ||||
-rw-r--r-- | app/Sensor.hs | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/app/Main.hs b/app/Main.hs index caee3fb..0ed59de 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -192,8 +192,8 @@ createWindow args = do [pure (lit (if args.icons then "\xf0a0 " else "disk ")), lit <$> disk], [pure (lit (if args.icons then "\xf1638 " else "io ")), lit <$> io], [pure (lit (if args.icons then "\xf0200 " else "net ")), lit <$> net], - [pure (lit (if args.icons then "\xf028 " else "snd ")), lit <$> Sensor.snd], - [lit <$> bat], + [pure (lit " "), lit <$> Sensor.snd], + [pure (lit " "), lit <$> bat], [pure (lit " "), lit <$> date, pure (lit ", "), lit <$> time], [] ] 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) |