How to combine xmonad with Ubuntu?

Are any Ubuntu users here? I just got a new box with Ubuntu on it, and I wonder how to best combine xmonad with Ubuntu. Ubuntu seems to have a lot of useful functionality built into the graphical environment, such as checking for updates, checking for the network one is in, and perhaps other things. I guess if I go my old route of replacing all of Gnome with my custom ~/.xinitrc script, then I'll lose that stuff. Suggestions? Kai

On Sat, Sep 08, 2007 at 12:37:11AM +0200, Kai Grossjohann wrote:
Are any Ubuntu users here? I just got a new box with Ubuntu on it, and I wonder how to best combine xmonad with Ubuntu. Ubuntu seems to have a lot of useful functionality built into the graphical environment, such as checking for updates, checking for the network one is in, and perhaps other things.
I guess if I go my old route of replacing all of Gnome with my custom ~/.xinitrc script, then I'll lose that stuff.
Suggestions?
I use Ubuntu with xmonad under xdm, but I don't use any of the graphical config stuff personally. However, all those apps are still available of course - you just need to find out their names then you can call them from the shell or dmenu or whatever. For example, IIRC, network-admin is the name of the network setup control thing. So maybe just look at the shortcuts and find out the names of the stuff you want to use. Oh, on second thoughts, I might be misleading you here, because I never used classic Ubuntu: I used Xubuntu instead, which comes with xfce instead of gnome. I did that specifically because I knew I'd strip it back and didn't want the overhead of gnome. So maybe network-admin is a Xubuntu specific thing; I don't know. Hmmm, thinking on, I seem to recall seeing a screenshot of xmonad with a KDE kicker at the bottom, around the time status bars started happening... Ah, here we are: looks like Spencer's the expert here. http://xmonad.org/images/screen-sjanssen-kde-kicker.png (on http://xmonad.org/contrib.html) Maybe you can do something similar with whatever app Gnome uses to display its menu/status? (Or maybe it's an intractable mess of interconnected bloat - I really don't know. :-) ) HTH, -Andy -- Andy Gimblett Computer Science Department University of Wales Swansea http://www.cs.swan.ac.uk/~csandy/

Andy Gimblett on 2007-09-10 17:02:06 +0100:
Hmmm, thinking on, I seem to recall seeing a screenshot of xmonad with a KDE kicker at the bottom, around the time status bars started happening... Ah, here we are: looks like Spencer's the expert here.
http://xmonad.org/images/screen-sjanssen-kde-kicker.png
(on http://xmonad.org/contrib.html)
Maybe you can do something similar with whatever app Gnome uses to display its menu/status? (Or maybe it's an intractable mess of interconnected bloat - I really don't know. :-) )
I need access to GNOME's network applet (nm-applet) to do wireless with WPA - it's just been a mess for me otherwise. There's no command-line analogue, and xmonad won't display just the applet in its own window, so I've been using 'trayer' to start it up and do my configuration. More than a bit of a hack, but works well enough.

Alec Berryman wrote:
Andy Gimblett on 2007-09-10 17:02:06 +0100:
Hmmm, thinking on, I seem to recall seeing a screenshot of xmonad with a KDE kicker at the bottom, around the time status bars started happening... Ah, here we are: looks like Spencer's the expert here.
http://xmonad.org/images/screen-sjanssen-kde-kicker.png
(on http://xmonad.org/contrib.html)
Maybe you can do something similar with whatever app Gnome uses to display its menu/status? (Or maybe it's an intractable mess of interconnected bloat - I really don't know. :-) )
I need access to GNOME's network applet (nm-applet) to do wireless with WPA - it's just been a mess for me otherwise. There's no command-line analogue, and xmonad won't display just the applet in its own window, so I've been using 'trayer' to start it up and do my configuration. More than a bit of a hack, but works well enough.
I tried sending this yesterday, but it didn't work for some reason: I have found that including "gnome-settings-daemon" and "gnome-power-manager" in ~/.xinitrc will allow me to retain unobtrusive notifications concerning m laptop's battery. I think starting "update-notifier" will also present you with notifications concerning updates, but I have not been able to test this yet.

On Mon, Sep 10, 2007 at 02:59:18PM -0400, Geoffrey Alan Washburn wrote:
I have found that including "gnome-settings-daemon" and "gnome-power-manager" in ~/.xinitrc will allow me to retain unobtrusive notifications concerning m laptop's battery. I think starting "update-notifier" will also present you with notifications concerning updates, but I have not been able to test this yet.
This is interesting. Perhaps I could log in via Gnome and take a snapshot of all processes, then compare with the xmonad login. I had been thinking of the opposite route: Keep the normal Gnome session but just replace the window manager. (Gnome has a setting that says which WM to run.) I'm not sure how that will pan out. The dwm folks had been talking about making subuntu, another Ubuntu derivative for shell (Plan9?) aficionados. That hasn't gone anywhere, though, I believe. And then I believe that you can get an X11-less system by installing the server variant of Ubuntu. Surely they have some mechanisms for updates and the like that do not depend on a desktop environment. But I don't know any details. Kai

On Sep 11, 2007, at 7:22 , Kai Grossjohann wrote:
And then I believe that you can get an X11-less system by installing the server variant of Ubuntu. Surely they have some mechanisms for updates and the like that do not depend on a desktop environment. But I don't know any details.
Same way Debian does it: apt-get. The other tools, whether CLI, curses, or GUI, are just wrappers around the APT toolkit. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Tue, Sep 11, 2007 at 08:05:44AM -0400, Brandon S. Allbery KF8NH wrote:
On Sep 11, 2007, at 7:22 , Kai Grossjohann wrote:
And then I believe that you can get an X11-less system by installing the server variant of Ubuntu. Surely they have some mechanisms for updates and the like that do not depend on a desktop environment. But I don't know any details.
Same way Debian does it: apt-get. The other tools, whether CLI, curses, or GUI, are just wrappers around the APT toolkit.
That's not what I meant. What I meant is a replacement for the little tool in Gnome that pops up a window saying that there are updates and asks whether these should be installed. I installed apticron on my Debian system. It is very nice. Every morning about 1/2 h after turning on the laptop, if there are updates, I get an email saying that there are updates, and then I go to a shell and type "sudo aptitude dist-upgrade". So if Debian is nice, Ubuntu will be nicer still :-) Kai

On Tue, Sep 11, 2007 at 02:57:01PM +0200, Kai Grossjohann wrote:
I installed apticron on my Debian system. It is very nice. Every morning about 1/2 h after turning on the laptop, if there are updates, I get an email saying that there are updates, and then I go to a shell and type "sudo aptitude dist-upgrade".
That's nice. Alas, now you have me distracted from my thesis and wanting to write something which works similarly but instead pops up a "U" or something on my dzen2 statusbar. ;-) (Though, that might be too subtle - my laptop keeps shutting itself down because I fail to keep an eye on the statusbar; I need to pop something up with xmessage or xosd or something (what's nice for this?). More hacking! Anyway, back to it...) -Andy -- Andy Gimblett Computer Science Department University of Wales Swansea http://www.cs.swan.ac.uk/~csandy/

On Tue, Sep 11, 2007 at 03:28:02PM +0100, A.M.Gimblett@swansea.ac.uk wrote:
That's nice. Alas, now you have me distracted from my thesis and wanting to write something which works similarly but instead pops up a "U" or something on my dzen2 statusbar. ;-)
(Though, that might be too subtle - my laptop keeps shutting itself down because I fail to keep an eye on the statusbar; I need to pop something up with xmessage or xosd or something (what's nice for this?). More hacking! Anyway, back to it...)
I wrote a similar tool in python to be used whithin procmail. put this in your .procmailrc: :0icw | mail-popup -y 1024 -x 1280 -f It is in attachement. It should work out-of-the-box Cheers -- Sébastien Gross

* Kai Grossjohann (kai@emptydomain.de) wrote:
That's not what I meant. What I meant is a replacement for the little tool in Gnome that pops up a window saying that there are updates and asks whether these should be installed.
You could do this easily with dzen, i use something alike: $ cat duc.sh #!/bin/sh # # Debian update checker # # (c) 2007 by Robert Manea # TMPFILE=/tmp/duc.$$ apt-get update > /dev/null && \ apt-get -s upgrade | sed -ne 's/^Inst \(.*\)/\1/p' > $TMPFILE NRUPDATES=`cat $TMPFILE| wc -l` if [ $NRUPDATES != "0" ]; then (echo "^fg(red)$NRUPDATES new system update(s) available"; \ cat $TMPFILE) | \ dzen2 -p -l 4 -w 600 fi rm -rf $TMPFILE exit 0 $ This script will show you the number of outstanding updates in dzen's title window and the actual packages that need updating in the slave window. You could even use an action with dzen, like 'button1=exec:$UPGRADECOMMAND' in order to initiate the upgrade with a button click. Bye, Rob.

On Tue, Sep 11, 2007 at 10:35:44PM +0200, Robert Manea wrote:
* Kai Grossjohann (kai@emptydomain.de) wrote:
That's not what I meant. What I meant is a replacement for the little tool in Gnome that pops up a window saying that there are updates and asks whether these should be installed.
You could do this easily with dzen, i use something alike:
Très cool! Kai

Kai Grossjohann wrote:
I had been thinking of the opposite route: Keep the normal Gnome session but just replace the window manager. (Gnome has a setting that says which WM to run.) I'm not sure how that will pan out.
This is the same approach I'd like to take. I've tried doing: export WINDOW_MANAGER="/usr/bin/xmonad" but I'm always stuck with Metacity. That var seems to be ignored because xmonad doesn't appear to even launch. Going the opposite route, I've had trouble getting gnome-panel to launch inside the gap -- it wants to go into the main area instead. Has anyone else gotten this to work, and how? -- Alex Tarkovsky

On Tue, Sep 11, 2007 at 07:40:42AM -0500, alextarkovsky@gmail.com wrote:
This is the same approach I'd like to take. I've tried doing:
export WINDOW_MANAGER="/usr/bin/xmonad"
but I'm always stuck with Metacity. That var seems to be ignored because xmonad doesn't appear to even launch.
In GDM please select « Use an xinit script » (or something similar) My ~/.xsession looks like: xsetroot -solid black xrdb ${HOME}/.Xdefaults xmodmap ${HOME}/.xmodmap ssh-add < /dev/null & DISPLAY=:0.0 xmonad At next login you can chose «Use previous session» Hope this helps. -- Sébastien Gross

On Tue, Sep 11, 2007 at 02:58:47PM +0200, Sébastien Gross wrote:
On Tue, Sep 11, 2007 at 07:40:42AM -0500, alextarkovsky@gmail.com wrote:
This is the same approach I'd like to take. I've tried doing:
export WINDOW_MANAGER="/usr/bin/xmonad"
but I'm always stuck with Metacity. That var seems to be ignored because xmonad doesn't appear to even launch.
In GDM please select « Use an xinit script » (or something similar)
That replaces the Gnome session with .xinitrc or .xsession. What Alex and I are looking for is something that starts the normal Gnome session but only replaces Metacity/Compiz with xmonad. Kai

Kai Grossjohann wrote:
On Mon, Sep 10, 2007 at 02:59:18PM -0400, Geoffrey Alan Washburn wrote:
I have found that including "gnome-settings-daemon" and "gnome-power-manager" in ~/.xinitrc will allow me to retain unobtrusive notifications concerning m laptop's battery. I think starting "update-notifier" will also present you with notifications concerning updates, but I have not been able to test this yet.
This is interesting. Perhaps I could log in via Gnome and take a snapshot of all processes, then compare with the xmonad login.
I had been thinking of the opposite route: Keep the normal Gnome session but just replace the window manager. (Gnome has a setting that says which WM to run.) I'm not sure how that will pan out.
How has it panned out? If it doesn't work, here's my experience doing similar things. I'm running Debian, so details below might be similar for Ubuntu. When I'm running xmonad or dwm, I typically launch the stuff that 'gnome-session' does from my .xsession file, and I choose "Launch Xclient script" in gdm. That seems to be the easiest way. Until now, I've stuck to 'gnome-settings-daemon' (for fonts and desktop background) and 'gnome-volume-manager' (to enable automounting USB drives), and some other things preceding xmonad in my .xsession file. Thanks to Geoffrey for pointing out 'gnome-power-manager', I may be adding that to my .xsession... :) For kicks I tried looking around now to discover just what is actually launched in a normal gnome session. It's a bit labyrinthine, but the man pages are adequate and I've made some progress. Maybe you can start with this and come up with the definitive answer, which I am far too lazy to discover: Starting with 'man gdm', we're led to '/etc/gdm/gdm.conf', from there to '/usr/share/gdm/defaults.conf', which states where session files live. One of those session files, '/usr/share/xsessions/gnome.desktop', shows that for "Gnome", gdm runs 'gnome-session'. That program manages the various others. I think gdm actually does some other work including launching ssh-agent as a parent process, you'll have to go spelunking through /etc/X11/Xsession* to figure that out. (I did once before and I've forgotten it now.) Onward, 'man gnome-session' and 'man default.session' point to '/usr/share/gnome/default.session', which contains on my system references to 'gnome-wm', 'gnome-panel', 'nautilus', and others. I expect that gnome-panel launches your network status app itself. I don't much like gnome-panel, so I have little experience making it work with xmonad. Trying it now, it starts tiled, not floating, and does not repaint itself properly. I had to adjust its "height" in its configuration tabs to make it do so. Just to obtain a tray utility, I think I'd go for the 'trayer' app previously mentioned by Alec, and launch applets from a script. Nautilus manages desktop icons. I don't like desktop icons, but I do like the nautilus file manager, so I use gconf-editor to uncheck /apps/nautilus/preferences/show_desktop, and I don't launch it from my .xsession. 'gnome-wm' is supposed to obey the environment variable WINDOW_MANAGER, but apparently it does not work for Alex? I suspect that his 'export' statement is not occurring in a place where gnome-wm will be able to spot it, but I haven't tried it myself, nor have I tried to use gnome's control center to configure a different wm. 'gnome-settings-daemon' also gets launched by gnome-session, though apparently that's hard-coded within the executable and not mentioned in the man page. I don't know yet where gnome-volume-manager or gnome-power-manager are first launched. That's as far as I got. I'd be delighted to know if you discover the optimal way to accomplish this. Mike

as an obvious aside, its trivial to query the battery status, every modern os should have an acpi query tool on freebsd: sysctl hw.acpi.battery i place my own status indicator into gnu screen i don't know that much about the advanced features of xmonad as i do not use them, but, if there is a simple way to pipe output from a user command to some area of the screen (dmenu?), you might find this easier than messing with gnome-session

brad clawsie
as an obvious aside, its trivial to query the battery status, every modern os should have an acpi query tool
on freebsd: sysctl hw.acpi.battery
Right. In GNU/Linux, you can always cat the files under /proc/acpi.
i place my own status indicator into gnu screen
i don't know that much about the advanced features of xmonad as i do not use them, but, if there is a simple way to pipe output from a user command to some area of the screen (dmenu?), you might find this easier than messing with gnome-session
There are tools like dzen or osd_cat in xosd. In fact, I use the latter one. -- c/* __o/* <\ * (__ */\ <

On Tue, Sep 11, 2007 at 01:26:22PM -0400, Michael F. Lamb wrote:
Kai Grossjohann wrote:
This is interesting. Perhaps I could log in via Gnome and take a snapshot of all processes, then compare with the xmonad login. I had been thinking of the opposite route: Keep the normal Gnome session but just replace the window manager. (Gnome has a setting that says which WM to run.) I'm not sure how that will pan out.
How has it panned out?
Ayee. I can only spend limited time on this, and so far I haven't got an Ubuntu installation that works. (I want encrypted filesystems, this is not supported by the standard Ubuntu install.) Kai
participants (11)
-
Alec Berryman
-
Alex Tarkovsky
-
Andy Gimblett
-
brad clawsie
-
Brandon S. Allbery KF8NH
-
Geoffrey Alan Washburn
-
Kai Grossjohann
-
Michael F. Lamb
-
Robert Manea
-
Sébastien Gross
-
Xiao-Yong Jin