[xmonad] Hide xmobar under windows

Eric Velten de Melo ericvmelo at gmail.com
Sun Sep 2 18:01:27 CEST 2012


Ok, I am pretty sure this should not be too complicated to do, but
I've been trying many ways to hide the xmobar under the windows and so
far haven't achieved anything. Interesting thing is that many people
report having this behavior as something undesirable, but that's
precisely what I want. I don't want xmobar showing up on my workspace
all the time, and wanted somehow to toggle it on and off.

I have played with both toggleStruts in xmonad.hs and lowerOnStart =
True | False in .xmobarrc, but got nothing. Maybe this is something
very simple, but I'm not being able to do it. So far my xmonad.hs and
.xmobarrc look like this:

--------- xmonad.hs
--------------------------------------------------------------

import XMonad
import qualified Data.Map as M
import Data.Either.Utils
import qualified Network.MPD as MPD
import System.IO
import XMonad.Actions.GridSelect
import XMonad.ManageHook
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.NoBorders
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Actions.SpawnOn
import XMonad.Layout.PerWorkspace
import XMonad.Util.Run(spawnPipe)
import qualified XMonad.Util.EZConfig as EZ

myTerminal = "sakura"

_myKeys =
	[
	 ("M-t", goToSelected defaultGSConfig)
	,("M-p", spawnHere "exe=`yeganesh -x` && eval \"exec $exe\"")
	,("M-s", sendMessage ToggleStruts)
	,("<XF86Tools>", spawn "mpd")
	,("<XF86AudioPlay>", spawn "mpc --no-status toggle")
	,("<XF86AudioStop>", io $ return . fromRight =<< MPD.withMPD MPD.stop)
	,("<XF86AudioNext>", io $ return . fromRight =<< MPD.withMPD MPD.next)
	,("<XF86AudioPrev>", io $ return . fromRight =<< MPD.withMPD MPD.previous)
	]

myLayouts = avoidStrutsOn [] $ smartBorders $ layoutHook defaultConfig

myManageHook :: ManageHook
myManageHook = composeAll [ isFullscreen --> doFullFloat ]

myConfig = EZ.additionalKeysP defaultConfig _myKeys

main = do
	xmproc <- spawnPipe "xmobar"
	xmonad $ ewmh myConfig {
		terminal = myTerminal,
		manageHook = myManageHook,
		layoutHook = myLayouts,
		logHook = dynamicLogWithPP xmobarPP
			{ ppOutput = hPutStrLn xmproc
			, ppTitle = xmobarColor "green" "" . shorten 50
			}
		}

-----------------------------------------------------------------------------------------------------

----------------- .xmobarrc
-------------------------------------------------------------------

Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
       , bgColor = "black"
       , fgColor = "grey"
       , position = Top
       , lowerOnStart = False
       , commands = [ Run Weather "EGPF" ["-t","
<tempC>C","-L","64","-H","77","--normal","green","--high","red","--low","lightblue"]
36000
                    , Run Cpu
["-L","3","-H","50","--normal","green","--high","red"] 10
                    , Run Memory ["-t","Mem: <usedratio>%"] 10
                    , Run Swap [] 10
                    , Run Date "%a %b %_d %l:%M" "date" 10
                    , Run StdinReader
                    ]
       , sepChar = "%"
       , alignSep = "}{"
       , template = "%StdinReader% }{ %cpu% | %memory% * %swap%
<fc=#ee9a00>%date%</fc> | %EGPF%"
       }

-----------------------------------------------------------------------------------------------------

Any help appreciated,

Eric



More information about the xmonad mailing list