emperor: (Default)
posted by [personal profile] emperor at 01:10pm on 20/06/2012 under , , ,
I encountered this problem yesterday, and it took a bit of yak-shaving to fix. Further, I didn't find much of immediate help by googling, so I thought I'd note down what I did.

A little background



Back in the day, you configured your X session by writing a small script that would run a few programs (say a clock, maybe an xterm or two, something to fettle your background), and finally execute a window manager. You'd call this ~/.xsession, and all was good. As time went by, linux distributions started shipping increasingly fancy desktop environments like GNOME and KDE, but you could always write yourself an .xsession, and keep your old-style setup.

I've never quite been convinced by fancy window managers; I can't afford really massive monitors, so am jealous of my screen real-estate, and all these taskbars and widgets and so on take up too much of my screen. Also, I'm very used to my X setup, so it's efficient for me to carry on using it. If you care, I run fvwm with a 4x3 set of virtual screens, either xplanet (the earth as viewed from the moon) or xphoon (the moon in its current phase) as backdrop, and a little buici-clock.

The problem



Anyhow, [livejournal.com profile] atreic has been very kindly letting me use their computer to work from. It's running Ubuntu 12.04 LTS, which has unity as the default window manager, and lightdm as the default display manager. I wanted to get my usual setup going, but with minimal disruption to [livejournal.com profile] atreic's computer (which implies minimal system-level changes). I installed fvwm, and that meant that lightdm would then offer me an fvwm option when I logged in, but that still didn't run my .xsession.

The solution



A bit of digging found me this Debian bug report, which was forwarded upstream to Ubuntu. Debian resolved the problem by adding another .desktop file to their lightdm package that would run the user's .xsession. Ubuntu's developers, in their wisdom, decided that anything resembling a "run my .xsession" option would be far too confusing for their users. Instead, as a Ubuntu user, you have no way of getting your .xsession run without admin access to the machine.

Thankfully, I do have this, so I was able to pinch lightdm-xsession.desktop from Debian's package, and install it into /usr/share/xsessions/. And all was well with the world again!

A little grumbling



It seems to me that Ubuntu have chosen to break a traditional linux behaviour with not a great deal of justification; I ought to be able to get my .xsession run without needing rootly powers. Further, the man-pages for unity, lightdm, and dm-tool all leave a lot to be desired; the configuration files for lightdm, for example, are pretty poorly documented.

A couple of footnotes



I gather that Ubuntu's package of gdm does include a .desktop file that runs the user's .xsession. That's quite a heavyweight workaround!

If you want to know what all these .desktop files are about, there's a specification online.

You might well want to be able to get back to the Ubuntu login screen without logging out (if, for example, you wanted to let [livejournal.com profile] atreic log in to their own computer ;-). You can do this from the command-line thus:
dm-tool switch-to-greeter

October

SunMonTueWedThuFriSat
      1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
26
 
27
 
28
 
29
 
30
 
31