summaryrefslogtreecommitdiffhomepage
path: root/src/TopC.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/TopC.hs')
-rw-r--r--src/TopC.hs52
1 files changed, 8 insertions, 44 deletions
diff --git a/src/TopC.hs b/src/TopC.hs
index 4a190e0..c8bc447 100644
--- a/src/TopC.hs
+++ b/src/TopC.hs
@@ -3,9 +3,6 @@ import Config
import Monitors
import Music (mpris, gpmd, mpdt)
-import qualified Data.Char as Char
-import qualified Text.Printf as Printf
-
memoratio = Memory ["-t","<usedratio>%", "-p", "2", "-W", "3"] 20
topProcL p = TopProc (p <~> ["-t"
@@ -19,40 +16,11 @@ mpd a p t i =
MPDX [ "-W", "12", "-b", "░", "-f", "▒", "-t", t
, "--", "-p", p, "-P", fni "\xf144", "-Z", i, "-S", i] 20 a
-
-autoMPD light = AutoMPD [ "-T", "110", "-E", "…", "-W", "10", "-t" ,
- fc "grey40" (fni "\xf001") ++
- " <lapsed>/<length> <ppos>/<plength>" -- ++ mpdt light
- ]
-
-pollMPD port light =
- MPD [ "-T", "120", "-W", "10", "-E", "…", "-t", tm, "--", "-p", port] 20
- where tm = fc "grey40" (fni "\xf001") ++ " <remaining> <length> "
- -- ++ "<ppos>/<plength>"
- -- ++ mpdt light
-
-mprisName = "spotifyd"
-
-musicPipe = PipeReader "/tmp/music" "musicpipe"
-musicMPRIS p = mpris p mprisName 180
-
--- music light = toggleMonitor "/tmp/mpris.st" musicPipe (pollMPD light)
--- music p = toggleMonitor "/tmp/mpris.st" (pollMPD (pIsLight p)) (musicMPRIS p)
--- music port = pollMPD port . pIsLight
-music = concatMonitor " "
- (mpd "mpd" "6600" "<statei> <remaining>" (fni "\xf001"))
- (mpd "mopidy" "6669" "<statei> <ppos>/<plength> <remaining>"
- (fni "\xf1bc"))
-
--- "https://wttr.in?format=" ++ fnn 3 "%c" ++ "+%t+%C+%w++" ++ fnn 1 "%m"
-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]
- | otherwise = Printf.printf "%%%02X" c
- urlEncode = concatMap encode
+music = concatMonitor " " m ms
+ where m = mpd "mpd" "6600" "<statei> <remaining>" icm
+ ms = mpd "mopidy" "6669" "<statei> <ppos>/<plength> <remaining>" ics
+ icm = fni "\xf001"
+ ics = fni "\xf1bc"
config p = (baseConfig p) {
position = TopSize C 100 (defaultHeight - 1)
@@ -61,7 +29,6 @@ config p = (baseConfig p) {
defaultHeight - 6, defaultHeight - 8,
defaultHeight - 8, defaultHeight - 8]
, border = FullB
- , alpha = 229
, commands = [ Run (topProcL p)
, Run m
, Run (thinkTemp p)
@@ -81,7 +48,6 @@ config p = (baseConfig p) {
, Run laTime
, Run localTime
, Run w -- LEGE, LEBL, KCV0
- -- , Run (ComX "curl" [wttrURL "Edinburgh"] "" "wttr" 18000)
]
, template = " "
++ "|batt0| "
@@ -93,17 +59,15 @@ config p = (baseConfig p) {
++ "</action> "
++ ma
++ " |EGPH| "
- -- ++ " |wttr|"
++ " {} "
++ fc (pHigh p) "|elog|"
++ "|kbd| "
++ "|multicpu| "
++ "|multicoretemp| "
++ " |top| "
- ++ fni "\xf0c9" ++ " |memory| "
- -- ++ dimi "\xf1c0"
- ++ "|diskio| |disku| "
- ++ fni "\xf017" ++ " |datetime| "
+ ++ " " ++ fni "\xf0c9" ++ " |memory| "
+ ++ " |diskio| |disku| "
+ ++ " |datetime| "
++ "|laTime| "
} where dimi = fc (pDim p) . fni
m = music