diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Bottom.hs | 14 | ||||
-rw-r--r-- | src/lib/Bottom.hs | 2 | ||||
-rw-r--r-- | src/lib/MPD.hs (renamed from src/MPD.hs) | 5 | ||||
-rw-r--r-- | src/lib/Mpris.hs (renamed from src/Mpris.hs) | 10 |
4 files changed, 22 insertions, 9 deletions
diff --git a/src/Bottom.hs b/src/Bottom.hs new file mode 100644 index 0000000..bfc4ecb --- /dev/null +++ b/src/Bottom.hs @@ -0,0 +1,14 @@ +import Xmobar +import Config +import qualified MPD +import qualified Mpris + +import System.Environment (getArgs) + +main :: IO () +main = do + args <- getArgs + let mpris = if null args then "spotify" else head args + if mpris == "mpd" + then palette >>= xmobar . MPD.config + else palette >>= xmobar . (Mpris.config mpris) diff --git a/src/lib/Bottom.hs b/src/lib/Bottom.hs index 4bd6614..0c6a372 100644 --- a/src/lib/Bottom.hs +++ b/src/lib/Bottom.hs @@ -54,7 +54,7 @@ masterVol = Volume "default" "Master" ["-t", "<status> <volume>" , "--", "-C", "black", "-c", "sienna4", "-O", "" - , "-o", "×"] 10 + , "-o", " ×"] 10 captureVol = Volume "default" "Capture" ["-t", "<volume>"] 10 diff --git a/src/MPD.hs b/src/lib/MPD.hs index d237867..be09f5f 100644 --- a/src/MPD.hs +++ b/src/lib/MPD.hs @@ -1,3 +1,5 @@ +module MPD where + import Xmobar import Config (palette) import qualified Bottom (config) @@ -22,6 +24,3 @@ config p = (Bottom.config [(Run mpd), (Run autoMPD)] p) { , additionalFonts = ["xft:Hack-7"] , textOffsets = [17] } - -main :: IO () -main = palette >>= xmobar . config diff --git a/src/Mpris.hs b/src/lib/Mpris.hs index 09c155d..1936d57 100644 --- a/src/Mpris.hs +++ b/src/lib/Mpris.hs @@ -1,20 +1,20 @@ +module Mpris where + import Xmobar import Config (palette) import qualified Bottom (config) -mpris = - Mpris2 "spotify" -- "clementine" -- +mpris client = + Mpris2 client -- "clementine" -- ["-t", " <tracknumber>\ \ <title> <fc=sienna4><artist></fc>\ \ <album> <length>" , "-T", "180", "-E", "...", "-M", "100", "-x", ""] 10 -config p = (Bottom.config [Run mpris] p) { +config client p = (Bottom.config [Run (mpris client)] p) { template = "|kbd||default:Master| |default:Capture| \ \|mpris2| {} |mbox| \ \|EGPH| \ \|diskio| |disku| · |bright| · |coretemp| \ \|memory| · |uptime| |b0| " } -main :: IO () -main = palette >>= xmobar . config |