summaryrefslogtreecommitdiffhomepage
path: root/Plugins/Monitors/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/Monitors/Common.hs')
-rw-r--r--Plugins/Monitors/Common.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs
index 13f6323..9362fd8 100644
--- a/Plugins/Monitors/Common.hs
+++ b/Plugins/Monitors/Common.hs
@@ -41,6 +41,7 @@ module Plugins.Monitors.Common (
, showWithColors'
, showPercentsWithColors
, showPercentBar
+ , showLogBar
, showWithUnits
, takeDigits
, showDigits
@@ -394,6 +395,12 @@ showPercentBar v x = do
s <- colorizeString v (take len $ cycle bf)
return $ s ++ (take (bw - len) $ cycle bb)
+showLogBar :: Float -> Float -> Monitor String
+showLogBar f v = do
+ h <- fromIntegral `fmap` getConfigValue high
+ bw <- fromIntegral `fmap` getConfigValue barWidth
+ showPercentBar v $ f + (logBase 10 (v / h)) / bw
+
-- $threads
doActionTwiceWithDelay :: Int -> IO [a] -> IO ([a], [a])