You are not logged in.

#1 2015-07-21 20:44:58

incertia
Member
Registered: 2014-10-25
Posts: 49

XMonad likes to set SHLVL to something that is not 0 in the desktop

Hey it's been a while since I've last posted here, but I've decided to migrate towards XMonad and I noticed that starting X and XMonad will end up setting SHLVL to something undesirable, such as 2 or 4 (by default when having SHLVL=1 after logging in and using exec xmonad in .xinitrc). I got it to 2 by lowering the value in .xinitrc, but I can't seem to figure out how to have all my spawned xterms start with SHLVL=1 within XMonad. Am I stuck with this behavior or is there a shell script that X/XMonad will source after setting up the desktop?

Offline

#2 2015-07-21 21:17:44

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: XMonad likes to set SHLVL to something that is not 0 in the desktop

XMonad.Core.spawn passes strings to /bin/sh to be interpreted as shell commands. So that would increase SHLVL. If you use this to spawn xterm, the shell running in the xterm increases it again, so you get a minimum of 2 (assuming all non-negative numbers). XMonad.Util.Run.safeSpawn (or safeSpawnProg) in xmonad-contrib should help you get rid of the first increment.

Offline

Board footer

Powered by FluxBB