diff options
author | jao <jao@gnu.org> | 2021-02-13 01:54:43 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-02-13 01:54:43 +0000 |
commit | 4de0e15f9e7f1022afa8b74479ec66b867d50398 (patch) | |
tree | d0891470dd4e704c2d527978ee14e8eeb6234775 | |
parent | ce257ed04c3a95bc7651fd972debd6e362ce68f1 (diff) | |
download | xmobar-config-4de0e15f9e7f1022afa8b74479ec66b867d50398.tar.gz xmobar-config-4de0e15f9e7f1022afa8b74479ec66b867d50398.tar.bz2 |
Accepting explicit location for wttr.in
-rw-r--r-- | src/TopC.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/TopC.hs b/src/TopC.hs index 46d45bc..894fd98 100644 --- a/src/TopC.hs +++ b/src/TopC.hs @@ -45,8 +45,9 @@ music = concatMonitor " " (fni "\xf1bc")) -- "https://wttr.in?format=" ++ fnn 3 "%c" ++ "+%t+%C+%w++" ++ fnn 1 "%m" -wttrURL = "https://wttr.in?format=" ++ fnn 2 "+%c+" ++ "+%t+%C+" ++ fn 5 "%w" - where fnn n x = urlEncode ("<fn=" ++ show n ++ ">") ++ x ++ urlEncode "</fn>" +wttrURL l = "https://wttr.in/" ++ l ++ "?format=" ++ fmt + where fmt = fnn 2 "+%c+" ++ "+%t+%C+" ++ fn 5 "%w" + fnn n x = urlEncode ("<fn=" ++ show n ++ ">") ++ x ++ urlEncode "</fn>" encode c | c == ' ' = "+" | Char.isAlphaNum c || c `elem` "-._~" = [c] @@ -80,7 +81,7 @@ config p = (baseConfig p) { , Run laTime , Run localTime -- , Run w -- LEGE, LEBL, KCV0 - , Run (ComX "curl" [wttrURL] "" "wttr" 18000) + , Run (ComX "curl" [wttrURL "Edinburgh"] "" "wttr" 18000) ] , template = " " ++ "|batt0| " |