emperor: (Default)
Add MemoryShare This Entry
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
There are 14 comments on this entry. (Reply.)
 
posted by [identity profile] woodpijn.livejournal.com at 12:19pm on 20/06/2012
[livejournal.com profile] atreic has been very kindly letting me use their computer
if, for example, you wanted to let [livejournal.com profile] atreic log in to their own computer

Is that a universal policy of yours to use singular-they for everyone, or a new preference of [livejournal.com profile] atreic's I haven't heard about?
emperor: (Default)
posted by [personal profile] emperor at 12:25pm on 20/06/2012
No. It's just how I wrote this post.
 
posted by [identity profile] ilanin.livejournal.com at 12:48pm on 20/06/2012
He might be using a plural they, of course ;).
 
posted by [identity profile] cartesiandaemon.livejournal.com at 02:11pm on 20/06/2012
For atreic? If atreic wanted to be plural, wouldn't that equally much be a new preference woodpijn hadn't heard about, albeit a more surprising one :)
 
posted by [identity profile] the-alchemist.livejournal.com at 04:24pm on 20/06/2012
It could be a computer belonging to a group of people, of whom [livejournal.com profile] atreic is one (e.g. [livejournal.com profile] atreic and her parents).
simont: A picture of me in 2016 (Default)
posted by [personal profile] simont at 12:29pm on 20/06/2012
Reading the Ubuntu bug report, it seems bizarre to me that they're all arguing based on the false dichotomy that either they provide that .desktop file in such a way that it's always installed, or else they require users to manually muck about with files in /usr/share or /etc. I wonder why nobody in the whole thread suggested simply putting that desktop file in a separate package, which a user could install once and then have it auto-updated forever just like any other package?
 
posted by [identity profile] imc.livejournal.com at 01:02pm on 20/06/2012
Indeed, and in Fedora that package is called xorg-x11-xinit-session.

(In Fedora, if you don't have install rights to install that or would rather not have to select it from the menu, you can also just hack your environment in such a way that the command "gnome-session" actually invokes your startup script - for example, by putting ~/bin in your PATH and symlinking ~/bin/gnome-session to the startup script. This doesn't need root access, but is a bit yucky.)
simont: A picture of me in 2016 (Default)
posted by [personal profile] simont at 01:07pm on 20/06/2012
So there's some file where you can store environment variables which will be read and honoured before running gnome-session? Sounds handy.
 
posted by [identity profile] imc.livejournal.com at 01:16pm on 20/06/2012
On the systems I've seen, gdm invokes your .bash_profile before starting your preferred desktop from /usr/share/xsessions. (I assume it does something like invoking the desktop from your login shell.)
simont: A picture of me in 2016 (Default)
posted by [personal profile] simont at 01:19pm on 20/06/2012
Ah, so you can't arrange an environment change that's only seen by gdm. I was hoping for some sort of special .gdm_env file.

But if that's a feature of gdm itself, it might carry over to things other than Fedora. I'll squirrel the technique away for the next time I'm on a system where none of my other hacks works!
 
posted by [identity profile] imc.livejournal.com at 01:32pm on 20/06/2012
Ah, so you can't arrange an environment change that's only seen by gdm.

Not that I'm aware (GNOME is mostly a mystery to me, btw); however, you could hack something up by looking at $(ps -o comm -p $PPID), I'm sure...
gerald_duck: (unimpressed)
posted by [personal profile] gerald_duck at 02:07pm on 20/06/2012
A few years ago, I found that gdm wouldn't pay any attention to your .xsession file unless you put some magic in some .gnome directory. This annoyed me. There was a perfectly good existing system for managing how a user's X session is started and they appeared to think they knew better for no good reason. Why shouldn't gdm go via the xsession mechanism to launch gnome for a user?

In the end, it annoyed me enough I went back to xdm.
 
posted by [identity profile] timeplease.livejournal.com at 05:18pm on 20/06/2012
Typo: "dm-tool" at the end there...
emperor: (Default)
posted by [personal profile] emperor at 05:33pm on 20/06/2012
Oh, yes, good spot! Now fixed, thanks.

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