Tuesday, August 27, 2013

How to stop xmobar from going below windows

If you are like me, you tried to use xmobar but whenever you open a window it falls below it. Or, worse yet, xmobar forces itself on TOP of the Windows you're trying to open. There are ways to change the behavior of xmobar by editing some Haskell code, but most people aren't comfortable doing that. There is a perfectly acceptable alternative (even if it is a hack) that I read from a forum somewhere that I now forget. Whoever originally discovered this, I thank you.

Fixing Xmobar with Trayer
There is a program called Trayer that will properly reserve the space for xmobar. Trayer is originally a system tray, but we will not being using it that way (we won't see trayer at all, actually). Install trayer and Install xmobar, then open up a file called xmobarFix.sh

The text for the file should be as follows:

trayer --edge top --height 14 &
xmobar &

If your xmobar is configured to be on the bottom, then change --edge top to --edge bottom.

Make the file executable with chmod +x xmobarFix.sh 

Lastly, copy the file to /usr/bin with sudo mv xmobarFix.sh /usr/bin/xmobarF   

You can now properly launch xmobar by calling "xmobarF &" from the command line. 

My displaytrays:



No comments:

Post a Comment