diff options
-rw-r--r-- | src/Bottom.hs | 6 | ||||
-rw-r--r-- | src/Top.hs | 5 | ||||
-rw-r--r-- | src/lib/Bottom.hs | 3 | ||||
-rw-r--r-- | src/lib/Config.hs | 5 | ||||
-rw-r--r-- | src/lib/MPD.hs | 4 | ||||
-rw-r--r-- | stack.yaml | 2 |
6 files changed, 14 insertions, 11 deletions
diff --git a/src/Bottom.hs b/src/Bottom.hs index bfc4ecb..4ff7265 100644 --- a/src/Bottom.hs +++ b/src/Bottom.hs @@ -8,7 +8,7 @@ import System.Environment (getArgs) main :: IO () main = do args <- getArgs - let mpris = if null args then "spotify" else head args + let mpris = if null args then "spotify" else last args if mpris == "mpd" - then palette >>= xmobar . MPD.config - else palette >>= xmobar . (Mpris.config mpris) + then palette >>= configFromArgs . MPD.config >>= xmobar + else palette >>= configFromArgs . (Mpris.config mpris) >>= xmobar @@ -23,7 +23,7 @@ dynNetwork p = DynNetwork (p <~> ["-t", "↑ <tx> ↓ <rx>" config p = (baseConfig p) { position = TopSize C 100 defaultHeight - , textOffset = 16 + , textOffset = defaultHeight - 8 , commands = [ Run (topProc p) , Run (wireless p) , Run (multiCPU p) @@ -41,4 +41,5 @@ config p = (baseConfig p) { } main :: IO () -main = palette >>= xmobar . config +main = + palette >>= configFromArgs . config >>= xmobar diff --git a/src/lib/Bottom.hs b/src/lib/Bottom.hs index 0c6a372..3ca31e1 100644 --- a/src/lib/Bottom.hs +++ b/src/lib/Bottom.hs @@ -66,7 +66,8 @@ memory = Memory ["-t","<available> M", "-p", "2"] 20 config cs p = (baseConfig p) { position = BottomSize C 100 defaultHeight - , textOffset = 17 + , textOffset = defaultHeight - 6 + , textOffsets = [defaultHeight - 5] , commands = [ Run (uptime p) , Run brightness , Run (weather "EGPH") -- LEGE, LEBL, KCV0 diff --git a/src/lib/Config.hs b/src/lib/Config.hs index 4ab805d..45904f4 100644 --- a/src/lib/Config.hs +++ b/src/lib/Config.hs @@ -5,7 +5,7 @@ import System.Environment (lookupEnv) import Xmobar defaultHeight :: Int -defaultHeight = 24 +defaultHeight = 22 data Palette = Palette { pNormal :: String , pLow :: String @@ -53,7 +53,8 @@ baseConfig p = defaultConfig { , borderColor = pBorder p , fgColor = (pForeground p) , bgColor = (pBackground p) - , border = FullBM 1 + -- , border = FullBM 1 + , border = NoBorder , alpha = (pAlpha p) , additionalFonts = [] , overrideRedirect = True diff --git a/src/lib/MPD.hs b/src/lib/MPD.hs index be09f5f..da0f954 100644 --- a/src/lib/MPD.hs +++ b/src/lib/MPD.hs @@ -1,7 +1,7 @@ module MPD where import Xmobar -import Config (palette) +import Config (palette, defaultHeight) import qualified Bottom (config) mpd = MPD [ "-W", "12", "-b", "░", "-f", "▒", "-t" @@ -22,5 +22,5 @@ config p = (Bottom.config [(Run mpd), (Run autoMPD)] p) { \|diskio| |disku| · |bright| · |coretemp| \ \|memory| · |uptime| |b0| " , additionalFonts = ["xft:Hack-7"] - , textOffsets = [17] + , textOffsets = [defaultHeight - 7] } @@ -1,7 +1,7 @@ resolver: nightly-2018-10-28 packages: - . -- ../git +- ../xmobar extra-deps: - iwlib-0.1.0 - alsa-mixer-0.2.0.3 |