summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2025-03-08 19:12:53 +0000
committerjao <jao@gnu.org>2025-03-08 19:12:53 +0000
commit8b7596da3b93a5fae687f59af55b04f4f7e5c9e4 (patch)
tree3547cbfcd44e81665cc423b2ddaeddb5a078f836
parent974409e73556984ceeb1c5cb2e9a1b4bf944dc7a (diff)
downloadxmobar-config-8b7596da3b93a5fae687f59af55b04f4f7e5c9e4.tar.gz
xmobar-config-8b7596da3b93a5fae687f59af55b04f4f7e5c9e4.tar.bz2
weather nitsHEADmaster
-rw-r--r--lib/Config.hs2
-rw-r--r--lib/Monitors.hs35
-rw-r--r--src/Single.hs2
3 files changed, 24 insertions, 15 deletions
diff --git a/lib/Config.hs b/lib/Config.hs
index 845aa8a..248cd97 100644
--- a/lib/Config.hs
+++ b/lib/Config.hs
@@ -86,7 +86,7 @@ baseConfig p = defaultConfig {
, fgColor = pForeground p
, bgColor = pBackground p
, additionalFonts = ["FontAwesome 9", "Weather Icons 10"]
- , textOffsets = [0, -2]
+ , textOffsets = [0, -1]
, border = NoBorder
, alpha = pAlpha p
, overrideRedirect = True
diff --git a/lib/Monitors.hs b/lib/Monitors.hs
index 1444305..7f1c772 100644
--- a/lib/Monitors.hs
+++ b/lib/Monitors.hs
@@ -73,37 +73,42 @@ weather' tmp st p =
-- , ("ice crystals", "❄️")
-- , ("light snow", "🌨️")
-- , ("snow", "❄️")
- ("", "\xf054")
- , ("clear", "\xf00d")
- , ("sunny", "\xf00d")
- , ("fair", "\xf00d")
+ -- ("", "\xf054")
+ ("clear", "1 \xf00d")
+ , ("sunny", "2 \xf00d")
+ , ("fair", "3 \xf00d")
, ("mostly clear", "\xf00c")
- , ("mostly sunny", "\xf00c")
- , ("partly sunny", "\xf00c")
+ , ("mostly sunny", "5 \xf00c")
+ , ("partly sunny", "6 \xf00c")
, ("obscured", "\xf063")
- , ("fog", "\xf014")
+ , ("haze", "\xf063")
+ , ("fog", "\xf04a")
, ("foggy", "\xf014")
- , ("cloudy", "\xf041")
+ , ("mist", "\xf014")
+ , ("fog in the vicinity", "\xf014")
+ , ("shallow fog", "\xf04a")
+ , ("cloudy", "10 \xf041")
, ("overcast", "\xf041")
, ("partly cloudy", "\xf083")
, ("mostly cloudy", "\xf013")
- , ("considerable cloudiness", "\xf002")
+ , ("considerable cloudiness", "14 \xf002")
, ("light rain", "\xf01c")
, ("rain", "\xf019")
- , ("ice crystals", "\xf077")
- , ("light snow", "\xf01b")
- , ("snow", "\xf01b")
+ , ("ice crystals", "17 \xf077")
+ , ("light snow", "18 \xf01b")
+ , ("snow", "19 \xf01b")
]
(mkArgs p ["-t", tmp , "-L", "10", "-H", "25" , "-T", "20"]
["-w", ""])
18000
-weather = weather' "<fn=2><skyConditionS></fn> <tempC>° <windKmh> <weather>"
+weather = weather' $ fn 2 "<weatherS>" ++ " <tempC>° <windKmh>"
-- "https://wttr.in?format=" ++ fnn 3 "%c" ++ "+%t+%C+%w++" ++ fnn 1 "%m"
-- , Run (ComX "curl" [wttrURL "Edinburgh"] "" "wttr" 18000)
wttrURL l = "https://wttr.in/" ++ l ++ "?format=" ++ fmt
- where fmt = fnn 2 "+%c+" ++ "+%t+%C+" ++ fn 5 "%w"
+ where -- fmt = fnn 2 "+%c+" ++ "+%t+%C+" ++ fn 5 "%w"
+ fmt = fnn 0 "%c%t+%w"
fnn n x = urlEncode ("<fn=" ++ show n ++ ">") ++ x ++ urlEncode "</fn>"
encode c
| c == ' ' = "+"
@@ -111,6 +116,8 @@ wttrURL l = "https://wttr.in/" ++ l ++ "?format=" ++ fmt
| otherwise = Printf.printf "%%%02X" c
urlEncode = concatMap encode
+edinWeather = Run (ComX "curl" [wttrURL "Edinburgh"] "" "wttr" 18000)
+
batt p =
BatteryN ["BAT0"]
["-t", "<acstatus> <left>"
diff --git a/src/Single.hs b/src/Single.hs
index ca21243..1ea4a38 100644
--- a/src/Single.hs
+++ b/src/Single.hs
@@ -54,6 +54,7 @@ config p = (baseConfig p) {
, Run localTime
, Run (cpuFreq' p)
, Run (weather "EGPH" p)
+-- , edinWeather
] ++ extraCmds
, template = trayT
++ " |batt0| "
@@ -66,6 +67,7 @@ config p = (baseConfig p) {
++ " |alsa:default:Master| " ++ dimi "\xf130" ++ " |alsa:default:Capture|"
++ "</action>"
++ " |EGPH|"
+-- ++ " |wttr|"
++ mail
++ " |kbd| "
++ eLog p