How do I prevent Xmobar from hiding behind other Xmonad windows? - xmonad

EDIT: It turns out my problem was just a temporary bug in Xmobar. See the accepted answer.
There are lots of solutions to this on Google, and almost none of them are working for me. I'm setting up an Arch system, so my first inclination is to use the config on the Arch wiki. Here's mine:
import XMonad
import XMonad.Hooks.DynamicLog
main = xmonad =<< xmobar defaultConfig { terminal = "gnome-terminal" }
Without an xmobarrc (or with any I've tried to copy), xmobar is visible in the empty workspace, but opening any application covers it up completely. Trying to toggle the bar space with Alt-b doesn't bring it back. I've also tried copying John Goerzen's config files verbatim, and that doesn't work either.
The one hack that has worked (from John Goerzen) is to start trayer in my xinitrc. When trayer is running, somehow it successfully reserves space at the top of the screen, which xmobar can also use. But I'd like to get xmobar working by itself. Thanks for any suggestions.

Solved by OODavo on the #xmonad IRC channel. Turns out the latest xmobar package on Arch (0.16-3) simply has a bug in it that breaks the avoidStruts layout. The workaround is either to downgrade to the previous version, or to build the latest version from git.
Previous version of the package: http://arm.konnichi.com/2012/12/02/community/os/x86_64/xmobar-0.16-1-x86_64.pkg.tar.xz
Instructions for downgrading packages in Arch: https://wiki.archlinux.org/index.php/Downgrading_Packages#How_to_downgrade_a_package

I am using xmonad with xmobar on ubuntu and it works as expected.
I have the following configuration in xmonad.hs
manageHook = manageDocks <+> manageHook defaultConfig
layoutHook = avoidStruts $ layoutHook defaultConfig
my xmobarrc has custom configuration, but nothing specific to alignment.
My xmonad version is 0.11 and xmobar version is 0.18
I dont start xmobar automatically on system startup, I prefer to start it up manually and after it starts, all other windows politely make space for xmobar status bar.

Related

Why is XMonad's Prompt not working for me?

So my MWE xmonad.hs is as follows:
import XMonad
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Util.EZConfig
myKeys =
[ ("M-s", shellPrompt def)
, ("M-<Return>", spawn "/usr/bin/alacritty")
, ("M-q", kill)
, ("M1-r", spawn "xmonad --recompile && xmonad --restart")
]
main = do
xmonad $ def
{ modMask = mod4Mask
} `additionalKeysP` myKeys
The key bindings work except for
("M-s", shellPrompt def)
With another config i tried it works as expected but I can not figure out, what's wrong with my MWE above (obviously it compiles just fine). Also I already have a config I am rather content with so I would prefer implementing prompts in my own config instead of trimming down the linked one.
System: Arch Linux
~ $ pacman -Qi xmonad | grep Version
Version : 0.15-72
Any suggestions are much appreciated. Please let me know if you require additional info. Thank you!
EDIT 1:
I added two more key bindings to the mwe:
, ("M-S-e" , spawn $ "xdotool text 'test'")
, ("M-S-w" , spawn $ "xdotool key Cotrol_L+F4")
neither of them works, just like the prompt (xdotool is installed). So there might be a connection?
I have also tried to use the standard syntax for key bindings without using XMonad.Util.EZConfig to no avail.
I had the same issue and this ArchWiki link sent me on the right path solve my problem.
The problem seems to be caused by missing fonts on the system that the xmonad prompt expects.
Excerpt:
Broken/missing XMonad.Prompt and window decorations
XMonad by default uses the font -misc-fixed-----10-------*
[5]. If this font is missing those windows simply fail to render at
all. Easiest fix is to install xorg-fonts-misc.
I am actually running Gentoo 5.4.80 and my solution was to install the x11-base/xorg-x11 package.

ide-haskell for atom editor isn't working

I'm trying to use the Ide-Haskell package for atom, but for some reason, it's not working.
First, I have ghc-mod and stylish haskell installed in sandboxes under ~/lib/. Here is what my config.cson file looks like:
athan#THETA ~> cat ~/.atom/config.cson
'global':
'exception-reporting':
'userId': '3b5a8a6c-7778-b310-6a5f-d8ecc314b30f'
'welcome':
'showOnStartup': false
'core':
'themes': [
'atom-dark-ui'
'seti-syntax'
]
'ide-haskell':
'ghcModPath': '/home/athan/lib/ghc-mod-5.2.1.1/.cabal-sandbox/bin/ghc-mod'
'stylishHaskellPath': '/home/athan/lib/stylish-haskell-0.5.11.0/.cabal-sandbox/bin/stylish-haskell'
'editor':
'fontSize': 14
'showIndentGuide': true
'showInvisibles': true
'softWrapAtPreferredLineLength': true
'invisibles': {}
I've tested those paths, and they're correct - I can call command --help, etc.
I'm also currently running linux, not Mac, so I had to add some keymappings:
athan#THETA ~> cat ~/.atom/keymap.cson
'.workspace':
'ctrl-alt-o': 'ide-haskell:toggle-output'
'.editor':
'ctrl-alt-s': 'ide-haskell:prettify-file'
These register just fine, and are visible in the ide-haskell's package settings. However, issuing the keystroke doesn't do anything (It used to open a file and save-as, respectively).
Where am I most likely to have screwed up? I installed ide-haskell before finishing the ghc-mod installation, but that shouldn't really matter... the links are correct. If anyone could help with this, I would be ecstatic :)
You need to create a cabal project in the directory you're working in. Just run cabal init and answer the questions. Then open atom in the current directory. The Haskell IDE menu should appear.
I know this is old but I want to mention that if you are using stack then you can run stack exec atom to run atom within your configured Haskell environment. That works great for me on Windows.

xmonad modmask change not working

I modified a default config of xmonad filled with commented explanations. All I did was change defaultModMask = mod1Mask. to mod4Mask The config later uses the var to set the actual modmask I'm not sure what the issue is. I've played around with setting the value directly and changing to mod3mask, etc. No matter what my mod key is left-alt. I use xmonad --restart between each poke at trying to fix this.
here is the config, search defaultmodmask will jump to areas of interest.
http://paste.ubuntu.com/8766834/
You have to recompile xmonad too after changing your configuration, not just restart it. In exactly execute
xmonad --recompile
xmonad --restart
which should also be bound to ModMask-q per default.

Xmonad can't find module XMonad (or any other)

Whenever xmonad starts, restarts, or is recompiled, I get an xmessage:
xmonad.hs:1:8:
Could not find module `XMonad'
Perhaps you meant
Monad (needs flag -package haskell98-2.0.0.2)
CgMonad (needs flag -package ghc-7.6.3)
DsMonad (needs flag -package ghc-7.6.3)
Use -v to see a list of the files searched for
This doesn't stop it from starting, but I only see updates to xmonad or xmobar settings on system reboot. My current xmonad.hs is just
import XMonad
main = xmonad defaultConfig
and it still produces the error. Any attempts to import other modules give similar results. I have both xmonad and xmonad-contrib installed from the Arch repositories, so the modules should be properly in the ghc search path, right? I've tried reinstalling the packages from Cabal like some other sources have suggested, but it turned into a complete snafu, so I went back to the Arch repos, which ought to work. Kind of at a loss for where to go from here; any help would be greatly appreciated.
EDIT: ghc-pkg list xmonad returns
/usr/lib/ghc-7.6.3/packag.conf.d
xmonad-0.11
/home/decalis/.ghc/x86_64-linux-7.6.3/package.conf.d
and ghc-pkg check output is here: http://pastebin.com/BsCPMn8M. The issue is a little clearer after seeing that, but I still don't get why it's looking in ~/.cabal when all of the packages and their dependencies were resolved from the Arch repos by pacman.
For me the solution was to run ghc-pkg recache since the ghc cache was just out of sync for some reason. It's worth trying before wiping the whole ghc database.
In cases like this one of the first things to try is to "start from scratch", i.e. forget about all the local packages that you might have installed in the past.
To do this, wipe (or rename/move) ghc's package database, which is under ~/.ghc/$arch-$os-$ghcver (such as ~/.ghc/i386-linux-7.6.3). Or just remove ~/.ghc altogether.

starting xmonad

I'm completely new to xmonad but I'd like to start using it to boost my productivity.
This is the guide I've been using (I'm using Apple OS X Snow Leopard)
http://xmonad.org/tour.html#start
So far I've managed to install Haskell-Platform, Cabal, dMenu, and xmonad (using cabal install).
When I attempt to run xmonad from the terminal I run into this error:
SDGL0990Z464C:~ cflynn$ echo $PATH
/Users/cflynn/.cabal/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin
SDGL0990Z464C:~ cflynn$ xmonad
/Users/cflynn/.xmonad/xmonad-i386-darwin: executeFile: does not exist (No such file or directory)
X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 2 (X_ChangeWindowAttributes)
Serial number of failed request: 7
Current serial number in output stream: 8
Can anyone explain what this means? Thanks!
Does the file /Users/cflynn/.xmonad/xmonad-i386-darwin exist? It sounds like it does not. You will need to compile your xmonad config and put the resulting executable at that location.
Skip to the bottom of this page - http://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_on_Apple_OSX
Add the contents to .xinitrc rather than starting it at the terminal.
http://www.google.com/search?q=X11+macintosh - you need X11 to be installed and running, in order to use a windowmanager that relies on it .) -> is that the case, or am I mistaken for the problems cause?

Resources