diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Config.hs | 3 | ||||
-rw-r--r-- | lib/Monitors.hs | 73 |
2 files changed, 53 insertions, 23 deletions
diff --git a/lib/Config.hs b/lib/Config.hs index a388e1e..248cd97 100644 --- a/lib/Config.hs +++ b/lib/Config.hs @@ -85,7 +85,8 @@ baseConfig p = defaultConfig { , borderColor = pBorder p , fgColor = pForeground p , bgColor = pBackground p - , additionalFonts = ["FontAwesome 9"] + , additionalFonts = ["FontAwesome 9", "Weather Icons 10"] + , textOffsets = [0, -1] , border = NoBorder , alpha = pAlpha p , overrideRedirect = True diff --git a/lib/Monitors.hs b/lib/Monitors.hs index 0b65af0..7f1c772 100644 --- a/lib/Monitors.hs +++ b/lib/Monitors.hs @@ -50,39 +50,65 @@ cpuFreq p = CpuFreq (p <~> ["-t" , "<avg> <max> <min> <cpu0> <cpu1> <cpu2> <cpu3 uptime p = Uptime (p <~> [ "-t" , "<days> <hours>", "-m", "3", "-c", "0", "-S" , "On" , "-L", "10", "-H", "100"]) 600 +-- https://erikflowers.github.io/weather-icons/ weather' tmp st p = WeatherX st - [ ("", "\129695") - , ("clear", "🔆") - , ("sunny", "🔆") - , ("fair", "🔆") - , ("mostly clear", "🌤️") - , ("mostly sunny", "🌤️") - , ("partly sunny", "⛅") - , ("obscured", "🌁") - , ("fog", "🌫️") - , ("foggy", "🌫️") - , ("cloudy", "☁️") - , ("overcast", "☁️") - , ("partly cloudy", "⛅") - , ("mostly cloudy", "☁️") - , ("considerable cloudiness", "🌂") - , ("light rain", "🌦️") - , ("rain", "🌨️") - , ("ice crystals", "❄️") - , ("light snow", "🌨️") - , ("snow", "❄️") + [ -- ("", "\129695") + -- , ("clear", "🔆") + -- , ("sunny", "🔆") + -- , ("fair", "🔆") + -- , ("mostly clear", "🌤️") + -- , ("mostly sunny", "🌤️") + -- , ("partly sunny", "⛅") + -- , ("obscured", "🌁") + -- , ("fog", "🌫️") + -- , ("foggy", "🌫️") + -- , ("cloudy", "☁️") + -- , ("overcast", "☁️") + -- , ("partly cloudy", "⛅") + -- , ("mostly cloudy", "☁️") + -- , ("considerable cloudiness", "🌂") + -- , ("light rain", "🌦️") + -- , ("rain", "🌨️") + -- , ("ice crystals", "❄️") + -- , ("light snow", "🌨️") + -- , ("snow", "❄️") + -- ("", "\xf054") + ("clear", "1 \xf00d") + , ("sunny", "2 \xf00d") + , ("fair", "3 \xf00d") + , ("mostly clear", "\xf00c") + , ("mostly sunny", "5 \xf00c") + , ("partly sunny", "6 \xf00c") + , ("obscured", "\xf063") + , ("haze", "\xf063") + , ("fog", "\xf04a") + , ("foggy", "\xf014") + , ("mist", "\xf014") + , ("fog in the vicinity", "\xf014") + , ("shallow fog", "\xf04a") + , ("cloudy", "10 \xf041") + , ("overcast", "\xf041") + , ("partly cloudy", "\xf083") + , ("mostly cloudy", "\xf013") + , ("considerable cloudiness", "14 \xf002") + , ("light rain", "\xf01c") + , ("rain", "\xf019") + , ("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' "<skyConditionS> <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 == ' ' = "+" @@ -90,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>" @@ -198,6 +226,7 @@ masterAlsa p = captureAlsa = Alsa "default" "Capture" ["-t", "<volume>"] +-- kbd p = Kbd [("us", "us"), ("us(intl)", "es")] -- kbi pDim kbd p = Kbd [("us", ""), ("us(intl)", kbi pHigh)] -- kbi pDim where kbi a = fc (a p) (fn 1 " \xf11c") |