xmonad WM

Talk about other linux distributions, or even other OSes.
User avatar
Duncan_Idaho
Posts: 216
Joined: 19. Sep 2009, 01:43
Location: Sietch Tabr, Planet Arrakis

Re: xmonad WM

Post by Duncan_Idaho »

I forgot to tell
if you want xmonad to be selectable from GDM then you need to create the following files:

/usr/share/xsessions/xmonad.desktop

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Type=XSession
Name=Xmonad
Exec=/etc/X11/xinit/xinitrc.xmonad
/etc/X11/xinit/xinitrc.xmonad

Code: Select all

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# Merge in defaults and keymaps
[ -f $sysresources ] && /usr/bin/xrdb -merge $sysresources
[ -f $sysmodmap ] && /usr/bin/xmodmap $sysmodmap
[ -f $userresources ] && /usr/bin/xrdb -merge $userresources
[ -f $usermodmap ] && /usr/bin/xmodmap $usermodmap

exec /usr/bin/xmonad
enjoy :geek:
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: xmonad WM

Post by mimosa »

Thanks Duncan_Idaho; I was going to ask about that. Following the instructions in the Readme means startx runs xmonad in runlevel 3, but your suggestion is far more practical.

For now, that and dmenu and the basic configuration are working well while I learn my way around. I don't really understand what MOD + , and MOD + . are doing, for instance, and I suspect my fingers will need to learn it first.
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: xmonad WM

Post by mimosa »

Duncan_Idaho, I've been trying to tailor the configuration and got a bit lost. It's difficult to pick isolated bits out of the many sets of configuration files online without understanding properly how they interact.

What I have is vanilla xmonad with a wallpaper and dmenu, started via gdm in the way you suggested. What I would like in addition to that is to see the wicd and update notifier icons, and an off switch. I thought trayer looked like a good app to do that (I'm not interested in how many teraflops my CPU is doing or the weather in Seattle, and especially not in whether someone somewhere has sent me a message of some kind). I installed it and added a line to /etc/X11/xinit/xinitrc.xmonad accordingly. The result is a narrow four-inch strip bang in the middle of my screen, showing a tiny piece of the wallpaper and no icons.

So two problems - oddly, trayer runs, but seemingly without paying attention to all those arguments telling it how to behave; this looks like its default conformation. Secondly, the stuff that goes in the tray in xfce must need to be told to talk to trayer. I was expecting to have to work on the off switch, because there isn't one in xfce, but I hoped to see the wicd and gslapt icons.

I can certainly live without it while I find out more about how xmonad works, but if you have any pointers for me, I'd be most grateful. :)

EDIT

It seems the solution may be closer than I thought. First, when I logged off and on again to try adding --distance [a low value], it worked - the tray appears in the right place, even without the --distance switch. I'd already rebooted, so who knows what was causing the funny position. Secondly, if I run wicd-client or slapt-update-notifier from the console, the icons duly appear. Actually, maybe the non-appearance is related to a problem with the notifier discussed here

http://www.salixos.org/forum/viewtopic. ... ier#p13374

but as far as I remember, the wicd icon appeared normally last time I ran xfce.

So, maybe it's a beta problem rather than an xmonad problem. That would leave the off switch!



Here is my xinitrc.xmonad. I don't appear to have an xmonad.hs, if find is to be trusted (there are two, but both in /man directories, so I suppose these are reference copies). Unfortunately I can't remember now what I did exactly on first installing xmonad, but probably not much beyond your suggestions.

Code: Select all

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# Merge in defaults and keymaps
[ -f $sysresources ] && /usr/bin/xrdb -merge $sysresources
[ -f $sysmodmap ] && /usr/bin/xmodmap $sysmodmap
[ -f $userresources ] && /usr/bin/xrdb -merge $userresources
[ -f $usermodmap ] && /usr/bin/xmodmap $usermodmap

trayer --edge bottom --align right --SetDockType true --SetPartialStrut true --expand true --width 15 --height 12 --transparent true --tint 0x000000 &
feh --bg-scale ~/wallpaper &

if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
  exec ck-launch-session /usr/bin/xmonad
else
  exec /usr/bin/xmonad
fi
User avatar
Duncan_Idaho
Posts: 216
Joined: 19. Sep 2009, 01:43
Location: Sietch Tabr, Planet Arrakis

Re: xmonad WM

Post by Duncan_Idaho »

a few quick things:
1) it's easier to edit the .xinitrc file in your home, just add the things you need at the end of it
it's a dotfile so it's hidden
2) when I was using scrotWM I used stalonetray from the repos for my trayer needs, you could try it to see if it works for you
3) the xmonad.hs you saw is both the default configuration and -as you said- a sample file, if you wish to edit xmonad settings you need to create a file called ~/.xmonad/xmonad.hs. Intead of creating an empty new one you could copy the sample and edit the settings you wish to change, it's fairly good documented

and that's it, I haven't played too much with xmonad out of laziness but I think I'll force myself to use it more once I figure how to set xmobar correctly :mrgreen:
a good place to start is to look at the oficial documentation and their wiki
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: xmonad WM

Post by mimosa »

Thanks for those pointers. I got my tray icons just by putting

Code: Select all

wicd-client &
slapt-update-notifier &
in that file, and with width and height 'as requested' by the apps, the tray is very unobtrusive.

The update notifier is still behaving oddly, but that's got nothing to do with xmonad. For now, I'm enjoying using it without any further refinements; I don't think I'm fully exploiting even its basic features, but the combination of lack of distractions and flexible, efficient use of space when you do want two or more apps on the same screen (copy & paste from online tutorial to console) has won me over. Maybe I'll end up drifting back towards something more conventional sooner or later ... many people do seem to.

I'm using this stunning wallpaper by Maximus:
maximus wrote:Glad you like it :) Here's a PNG and here's the SVG if anyone's interested.
User avatar
f.bluedevil
Posts: 91
Joined: 9. Jan 2011, 23:06

Re: xmonad WM

Post by f.bluedevil »

Many thanks indeed - I would not have got there without help.
+1

Spent a few hours trying to install ghc with no success until I came across this post. Now I'm up and working. :D

I later tried to install haskell-platform and ran into the same problem again, it's looking for an older version of the compiler. But so far, no problems, so no worries.

Code: Select all

checking version of ghc... 7.0.1
configure: error: The Haskell Platform version 2010.2.0.0 requires ghc-6.12.3
  It is recommended that you upgrade to ghc-6.12.3 however if you
  really want to use this release with an unsupported version of GHC
  then use ./configure --enable-unsupported-ghc-version
fakeroot -- sh haskell-platform.SlackBuild Failed
User avatar
Duncan_Idaho
Posts: 216
Joined: 19. Sep 2009, 01:43
Location: Sietch Tabr, Planet Arrakis

Re: xmonad WM

Post by Duncan_Idaho »

@f.bluedevil, I have 2 things to say regarding your problem with haskell-platform:

1.- did you read the description of the package?
http://slackbuilds.org/repository/13.1/development/haskell-platform/ wrote:This is intended to be installed on a system that does not already have any
haskell-related components (other than ghc, of course) installed, so for best
results (and chance of success), you should remove any of those before you
try to build haskell-platform.
considering that in order to install Xmonad you have to pull A LOT of haskell-related dependencies you might want to take a look in that direction

2.- this is more of a general rule tip, if you have problems/trouble getting something from slakcbuilds.org to compile/install you should contact the maintainer of that SLACKBUILD
User avatar
f.bluedevil
Posts: 91
Joined: 9. Jan 2011, 23:06

Re: xmonad WM

Post by f.bluedevil »

Hey Duncan,
1.- did you read the description of the package? http://slackbuilds.org/repository/13.1/development/has
I'm not sure why you made the comment. The only thing I have installed to date is the GHC compiler. I tried to install the platform first, because according to the book I'm reading, the platform includes the compiler. However, when I tried installing the platform it barked back with - "unable to find GHC".
2.- this is more of a general rule tip, if you have problems/trouble getting something from slakcbuilds.org to compile/install you should contact the maintainer of that SLACKBUILD
Thanks for the tip, at this point I'm not sure how I would determine who the maintainer is or how to contact them. Up until January of this year I was pretty much locked into Debian. I'm just learning to get around in Slack, so, tips are appreciated :D

As far as Haskell, I'm just trying to learn the language. I think the compiler and an editor is all I'm going to need for now.
User avatar
Duncan_Idaho
Posts: 216
Joined: 19. Sep 2009, 01:43
Location: Sietch Tabr, Planet Arrakis

Re: xmonad WM

Post by Duncan_Idaho »

well, given that you posted a haskell-related problem in this thread about xmonad I assumed that you had xmonad and it's deps already installed. but that was not the case it seems :geek:

regarding the maintainer issue, if you are curious about who maintains wich package you have to go to http://www.slackbuilds.org and search the package you are interested in, in this case haskell-platform http://slackbuilds.org/repository/13.1/ ... -platform/
User avatar
f.bluedevil
Posts: 91
Joined: 9. Jan 2011, 23:06

Re: xmonad WM

Post by f.bluedevil »

regarding the maintainer issue, if you are curious about who maintains which package you have to go to http://www.slackbuilds.org and search the package you are interested in
acknowledged - thanks
Post Reply