xmonad modmask change not working - haskell

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.

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.

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.

Backspace in zsh fails to work in quite the strange way

I'm on a fresh Virtualbox install of CentOS 6.4.
After installing zsh 5.0.2 from source using ./configure --prefix=/usr && make && make install and setting it as the shell with chsh -s /usr/bin/zsh, everything is good.
Then some time after, after installing python it seems, it starts acting strange.
Happens with PuTTY and iTerm2 over SSH, does not happen on the raw terminal through Virtualbox.
typing something, then erasing it: rather than removing the char and moving the cursor back, the cursor moves forward.
Typing Ctrl+V then Backspace repeatedly prints out this repeating pattern '^#?'
Running cat from zsh works fine. Prints out '^H' if I type that, backspaces like normal if I type normal backspace.
Surely someone's seen this before and knows exactly what the hell it is.
I'm not positive yet, but it seems that installing oh-my-zsh can fix this. But I really want to know what the specific issue is here.
OK , I suggest you try
export TERM=xterm
in your .zshrc configuration
the Changing into Zsh caused the bug.
sigh I knew I solved this before.
It's too damn easy to forget things.
The solution is to compile and apply the proper terminfo data with tic, as I have a custom config with my terminal clients, xterm-256color-italic, that confuses zsh.
There appear to be other ways to configure this stuff too; I basically just need it to be properly set up so italics work everywhere (including in tmux) so hopefully I can figure out how to do this more portably than I am currently.
I encounter the same problem when I manually install ZSH without root, when the backspace turns to blankspace but still functions as Backspace. Finally, I find it is because "ncurses" is not installed well.
tic: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory
? tic could not build /home/user/ceph-data/soft/ncurses-6.1/share/terminfo
After I reinstall the "ncurses", the problem of ZSH backspace is solved. Just for your information.
my $TERM is xterm-256color, by the way.

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

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.

xmonad install clarification

I'm attempting to install xmonad on my machine and I'm at this point in the instructions
(http://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_on_Apple_OSX#Installing_xmonad)
2.2 Configuring Your .profile
Insert the following into your ~/.profile
export PATH=$PATH:~/.cabal/bin:/usr/local/bin
export USERWM=`which xmonad`
Much of this isn't needed until later, but it's good to get it out the way now.
2.2.1 Installing Cabal
I understand what's going on with export PATH=$PATH:~/.cabal/bin:/usr/local/bin but could someone please explain 1. what the USERWM global variable is and what exactly is meant to be assigned to it? (I'm assuming 'which xmonad' isn't meant literally). Is it a version number of xmonad? Something else?
It is later executed in ~/.xinitrc:
source ~/.profile
exec $USERWM
Cheers
Also, the line
export USERWM=`which xmonad`
is correct as is. The shell will treat things in backticks (next to the '1' on top of most keyboards) as a command to be executed. The which command will give the path to xmonad by searching through the PATH variable.
Note that this means
export USERWM='which xmonad'
will not work, since the shell wouldn't run the command with the regular tick marks.

Resources