6

Today I've started with Xmonad and can not get Xmobar to be visible on top of layouts At my .xmobarrc I has these code:

...
   , position =     TopW L 100
   , lowerOnStart =     True
   , hideOnStart =      False
   , allDesktops =      True
   , overrideRedirect = True
   , pickBroadest =     False
   , persistent =       True

...

And this is my xmonad.hs:

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import System.IO

main = do
  xmproc <- spawnPipe "xmobar"
  xmonad $ defaultConfig
    { manageHook = manageDocks <+> manageHook defaultConfig
    , layoutHook = avoidStruts  $  layoutHook defaultConfig
    , logHook = dynamicLogWithPP xmobarPP
                    { ppOutput = hPutStrLn xmproc
                    , ppTitle = xmobarColor "green" "" . shorten 50
                    }
    , terminal = "urxvt"
    , modMask = mod4Mask
    }

Xmobar is running with Xmonad but it's not visible. How can I solve it? I need that Xmobar always be visible at the top of monitor.

sivakov512
  • 415
  • 5
  • 14
  • 1
    I think some parts of the strut support have moved into the EWMH module. Can you try importing `XMonad.Hooks.EwmhDesktops` and changing the xmonad invocation to `xmonad . ewmh $ def ...`? If that works, I'm happy to throw it in an answer. If not, my next test would be to check that xmobar is asking for the right amount of space by running `xprop | grep _NET_WM_STRUT` and clicking on xmobar. – Daniel Wagner Jun 13 '17 at 18:43
  • It must looks like this? https://gist.github.com/cryptomaniac512/3718cb18498f723c545794b7b4e74b1c – sivakov512 Jun 14 '17 at 05:46
  • That looks right to me. Does it work? – Daniel Wagner Jun 14 '17 at 05:55
  • No( Xmobar works, but hidden by other windows. – sivakov512 Jun 14 '17 at 05:57
  • Then... did you run my proposed next test? What did it say? – Daniel Wagner Jun 14 '17 at 06:50
  • When I run `xprop | grep _NET_WM_STRUT` I get this output: `_NET_WM_STRUT(CARDINAL) = 0, 0, 21, 0` `_NET_WM_STRUT_PARTIAL(CARDINAL) = 0, 0, 21, 0, 0, 0, 0, 0, 0, 1919, 0, 0` – sivakov512 Jun 14 '17 at 06:50
  • Those struts look right to me. Does this happen on all workspaces? Does it persist if you reload the layout? (By default, mod+shift+space will reload the layout.) – Daniel Wagner Jun 14 '17 at 06:58
  • Yes. No changes. – sivakov512 Jun 14 '17 at 07:00

2 Answers2

9

Solution founded at https://unix.stackexchange.com/questions/288037/

I add this handleEventHook = handleEventHook defaultConfig <+> docksEventHook and now Xmobar always visible.

sivakov512
  • 415
  • 5
  • 14
0

Although many of the other solutions posted are also important, I had to add lowerOnStart = False to .xmobarrc, so it isn't sent to the bottom of the window stack on start.

bbarker
  • 11,636
  • 9
  • 38
  • 62