diff options
| -rwxr-xr-x | bin/sp-hook.sh | 11 | ||||
| -rw-r--r-- | cabal.project | 2 | ||||
| -rw-r--r-- | src/TopC.hs | 20 | ||||
| -rw-r--r-- | src/lib/Config.hs | 4 | ||||
| -rw-r--r-- | src/lib/Monitors.hs | 28 | ||||
| -rw-r--r-- | src/lib/Music.hs | 6 | ||||
| -rw-r--r-- | stack.yaml | 13 | ||||
| -rw-r--r-- | xmobar-config.cabal | 1 | 
8 files changed, 39 insertions, 46 deletions
| diff --git a/bin/sp-hook.sh b/bin/sp-hook.sh new file mode 100755 index 0000000..feed245 --- /dev/null +++ b/bin/sp-hook.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +p="/tmp/music" +fmt="{{xesam:trackNumber}} {{title}} <fc=sienna3>{{artist}}</fc> {{album}} <fc=grey50>{{duration(mpris:length)}}</fc>" + +info=$(playerctl -p spotifyd -f "$fmt" metadata) + +[[ -p $p ]] || mkfifo $p + +echo -e "$info" > "/tmp/debug" +echo "$info" > $p diff --git a/cabal.project b/cabal.project index 4c9d10e..7d6bef1 100644 --- a/cabal.project +++ b/cabal.project @@ -1,2 +1,4 @@  packages: ., ../xmobar  flags: +all_extensions +targets: ex:xmobar-exwm + diff --git a/src/TopC.hs b/src/TopC.hs index 4941adb..1adef23 100644 --- a/src/TopC.hs +++ b/src/TopC.hs @@ -4,7 +4,7 @@ import Monitors  import Music (mpris, gpmd, mpdt)  topProcL p = TopProc (p <~> ["-t" -                            , "<both1> <both2> <both3>  <mboth1> <mboth2> " +                            , "<both1> <both2> <both3>  <mboth1> <mboth2> <mboth3>"                              , "-w", "10", "-L" , "10", "-H", "80"]) 15  diskIOL p = DiskIO [("/", "<totalbipat>"), ("/home", "<totalbipat>")]                     (diskArgs p) 10 @@ -19,9 +19,13 @@ ompd light =    where tm = " <remaining> " ++ mpdt light  compMPD light = concatMonitor " " mpd (autoMPD light) -mpn = "spotify" +mpn = "spotifyd"  -- music light = toggleMonitor "/tmp/mpris.st" (mpris mpn 120) (autoMPD light) -music = ompd +-- music = ompd +-- music l = toggleMonitor "/tmp/mpris.st" (ompd l) (mpris mpn 120) +-- musicPipe = MarqueePipeReader "/tmp/music" (20, 10, "..") "musicpipe" +musicPipe = PipeReader "/tmp/music" "musicpipe" +music l = toggleMonitor "/tmp/mpris.st" musicPipe (ompd l)  -- <fn=1> 💡 </fn>  config p = (baseConfig p) { @@ -33,7 +37,8 @@ config p = (baseConfig p) {    , alpha = 255    , commands = [ Run (topProcL p)                 , Run m ---               , Run (mail p) +               , Run (thinkTemp p) +               , Run (mail p)                 , Run (cpuBars p)                 , Run memory                 , Run (diskU p) @@ -54,19 +59,20 @@ config p = (baseConfig p) {               ++ "|bright| "               ++ "<action=`toggle-app.sh nm-applet`>|proton0||wlp1s0wi|</action> "               ++ "|dynnetwork| " ---             ++ "|mail| "               ++ "<action=`toggle-app.sh pasystray`>|default:Master| \                   \|default:Capture|</action> "               ++ "<action=`toggle-pipe.sh /tmp/mpris.st`>|" ++ ma ++ "|</action>"               ++ fn 1 " |kbd|"               ++ " {} " -             ++ " |multicpu| " +             ++ "|mail|" +             ++ "|multicoretemp| " +             ++ "|multicpu| "               ++ " |top| "               ++ "|memory| "               ++ fc "grey60" "|diskio|" ++ " |disku| "               ++ " |EGPH| "               ++ fn 2 "🕓  " ++ "|datetime| |laTime| " -  } where m = music (pIsLight p) +  } where m = music (pIsLight p) -- ompd (pIsLight p) -- (mpris mpn 120) --            ma = alias m            w = (weather' "<skyConditionS> <tempC>° <weather>" "EGPH" p) diff --git a/src/lib/Config.hs b/src/lib/Config.hs index c2a7720..b4db0b9 100644 --- a/src/lib/Config.hs +++ b/src/lib/Config.hs @@ -38,7 +38,7 @@ lightPalette = Palette { pNormal = "black"                         , pBorder = "grey80"                         , pForeground = "#000000"                         , pBackground = "white" -                       , pAlpha = 255 +                       , pAlpha = 0                         , pIconRoot = icons "light"                         , pIsLight = True                         } @@ -61,7 +61,7 @@ darkPalette = Palette { pNormal = zenburnFg                        , pBorder = "black" -- zenburnBackLight                        , pForeground = zenburnFg                        , pBackground = doomBack -- zenburnBack -                      , pAlpha = 255 +                      , pAlpha = 100                        , pIconRoot = icons "dark"                        , pIsLight = False                        } diff --git a/src/lib/Monitors.hs b/src/lib/Monitors.hs index ff27dd8..26183c5 100644 --- a/src/lib/Monitors.hs +++ b/src/lib/Monitors.hs @@ -91,8 +91,7 @@ weather' tmp st p =             , ("partly cloudy", fn 3 "⛅")             , ("mostly cloudy", fn 3 "☁")             , ("considerable cloudiness", fn 4 "⛈")] -           (mkArgs p ["-t", tmp , "-L","10", "-H", "25"] -                     ["-w", "", "-m", "False"]) +           (mkArgs p ["-t", tmp , "-L","10", "-H", "25"] ["-w", ""])             18000  weather = weather' "<skyConditionS> <tempC>° <rh>% <windKmh> (<hour>)" @@ -113,6 +112,11 @@ batt p =             , "-H", "10", "-L", "7"             , "-h", pHigh p, "-l", pLow p] 50 "batt0" +thinkTemp p = +  MultiCoreTemp (mkArgs p +                        ["-t", "<core1>°C", "-L", "40", "-H", "70", "-d", "0"] +                        []) 50 +  avgCoretemp p =    MultiCoreTemp (p <~> ["-t", "<avg>°"                         , "-L", "50", "-H", "75", "-d", "0"]) 50 @@ -138,28 +142,10 @@ diskIO p =           ] (diskArgs p) 10  -- <fn=1>📨 🖅 🖃 📩 ✉ </fn> --- mbox = MBox [ ("L", "/var/mail/jao", "grey60") ---             -- , ("B", "bigml.spool", "sienna4") ---             -- , ("S", "bigsup.spool", "sienna4") ---             -- , ("G", "geiser.spool", "darkseagreen4") ---             -- , ("X", "xmobar.spool", "darkseagreen4") ---             -- , ("g", "gnu.spool", "") ---             -- , ("k", "books.spool", "") ---             ] [] -- ["-p", "<fn=2>📩 </fn>", "-s", ""] ---            "mbox" - --- mail = Mail [ ("I", "~/var/maildir/jao/inbox") ---             , ("G", "~/var/maildir/jao/geiser") ---             , ("X", "~/var/maildir/jao/xmobar") ---             , ("B", "~/var/maildir/bigml/inbox") ---             , ("S", "~/var/maildir/bigml/support") ---             ] ---             "mail" -  mail p = MailX [ ("I", "jao/inbox", pHigh p)                 , ("G", "jao/geiser", "")                 , ("X", "jao/xmobar", "") -               , ("g", "jao/gnu", pLow p) +               , ("b", "bigml/bugs", pHigh p)                 , ("B", "bigml/inbox", pHigh p)                 , ("S", "bigml/support", "")                 ] diff --git a/src/lib/Music.hs b/src/lib/Music.hs index 5544d50..db12519 100644 --- a/src/lib/Music.hs +++ b/src/lib/Music.hs @@ -8,9 +8,9 @@ import GMPDP (GMPDP(..))  mpris client width =    Mpris2 client -- "clementine" -- -         ["-t", " <tracknumber> <title> " ++ fc "sienna4" "<artist>" -                ++ " <album> <length>" -         , "-T", show width, "-E", "…", "-M", "100", "-x", ""] 10 +         ["-t", "<tracknumber> <title> " ++ fc "sienna3" "<artist>" +                ++ " <album> <length> <composer>" +         , "-T", show width, "-E", "…", "-M", "100", "-x", ""] 40  mprisConfig client p = Bottom.config [Run (mpris client 165)] "|mpris2|" p diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index 50a69f4..0000000 --- a/stack.yaml +++ /dev/null @@ -1,13 +0,0 @@ -resolver: lts-14.20 - -packages: - - . - - ../xmobar - -flags: - xmobar: -  all_extensions: true -  with_threaded : true - -extra-deps: - - netlink-1.1.1.0 diff --git a/xmobar-config.cabal b/xmobar-config.cabal index 6c90a13..c99b799 100644 --- a/xmobar-config.cabal +++ b/xmobar-config.cabal @@ -40,3 +40,4 @@ executable xmobar-bottom    ghc-options: -rtsopts -with-rtsopts=-V0  -threaded    build-depends: base, xmobar, xmobar-config    default-language: Haskell2010 + | 
