diff options
author | jao <jao@gnu.org> | 2021-01-07 17:39:46 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-01-07 17:39:46 +0000 |
commit | d4f0550b65166a6448d68298db3b919872144f18 (patch) | |
tree | 95f9440d4e239f309b173d707be57f342833de38 | |
parent | 13e823bdc27fe33136d4d028a2d3e62d22e99c51 (diff) | |
download | xmobar-config-d4f0550b65166a6448d68298db3b919872144f18.tar.gz xmobar-config-d4f0550b65166a6448d68298db3b919872144f18.tar.bz2 |
wttr: make do with a single curl call
-rw-r--r-- | src/TopC.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/TopC.hs b/src/TopC.hs index c2c3426..4255b41 100644 --- a/src/TopC.hs +++ b/src/TopC.hs @@ -3,6 +3,8 @@ import Config import Monitors import Music (mpris, gpmd, mpdt) +memoratio = Memory ["-t","<usedratio>%", "-p", "2", "-W", "3"] 20 + topProcL p = TopProc (p <~> ["-t" , "<both1> <both2> <both3> <both4>" ++ " · <mboth1> <mboth2> <mboth3> <mboth4>" @@ -37,6 +39,8 @@ music = concatMonitor (fni " \xf1bc ") (mpd "mpd" "6600" "<remaining>") (mpd "mopidy" "6669" "<ppos>/<plength> <remaining>") +wttrURL = "https://wttr.in?format=%3Cfn%3D3%3E%c%3C%2Ffn%3E+%t+%C" + config p = (baseConfig p) { position = TopSize C 100 (defaultHeight - 1) , textOffset = defaultHeight - 8 @@ -50,7 +54,7 @@ config p = (baseConfig p) { , Run (thinkTemp p) , Run (NamedXPropertyLog "_EMACS_LOG" "elog") , Run (cpuBars p) - , Run memory + , Run memoratio , Run (diskU p) , Run (diskIOL p) , Run brightness' @@ -64,8 +68,7 @@ config p = (baseConfig p) { , Run laTime , Run localTime -- , Run w -- LEGE, LEBL, KCV0 - , Run (Com "curl" ["https://wttr.in?format=%c"] "wttr" 20000) - , Run (Com "curl" ["https://wttr.in?format=%t+%C"] "wttrT" 20000) + , Run (ComX "curl" [wttrURL] "" "wttr" 18000) ] , template = " " ++ "|batt0| " @@ -77,7 +80,7 @@ config p = (baseConfig p) { ++ "</action> " ++ ma -- ++ " |EGPH| " - ++ fn 3 " |wttr| " ++ "|wttrT|" + ++ " |wttr|" ++ " {} " ++ fc (pHigh p) "|elog|" ++ "|kbd| " @@ -91,7 +94,7 @@ config p = (baseConfig p) { } where dimi = fc (pDim p) . fni m = music ma = dimi "\xf001" ++ " |" ++ alias m ++ "| " - w = (weather' "<skyConditionS> <tempC>° <weather>" "EGPH" p) +-- w = (weather' "<skyConditionS> <tempC>° <weather>" "EGPH" p) main :: IO () main = palette >>= configFromArgs . config >>= xmobar |