diff options
author | jao <jao@gnu.org> | 2018-12-10 01:36:46 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2018-12-10 01:36:46 +0000 |
commit | 48c0e1ebcc0e6a7c9ae302f44c814508bfda7b6a (patch) | |
tree | d6a4ff080420e2e36fe1db68c51f4dfb30069169 /src | |
parent | 0b8f1901f6e955fb1f0f42b0b6b598bbf8a2ae12 (diff) | |
download | xmobar-config-48c0e1ebcc0e6a7c9ae302f44c814508bfda7b6a.tar.gz xmobar-config-48c0e1ebcc0e6a7c9ae302f44c814508bfda7b6a.tar.bz2 |
Using the new Xmobar.configFromArgs
Diffstat (limited to 'src')
-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 |
5 files changed, 13 insertions, 10 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] } |