1

I've just switched from LXDE to Gnome and I'm struggling with configuring the keyboard the way I want it. The Swedish keyboard layout is painful when programming (e.g. {[]} require right-hand finger acrobatics) so I've remapped them using xkbcomp.

Under LXDE/LXDM I could have the mapping happen automatically on login by putting it in ~/.xprofile. This doesn't work under Gnome/GDM though. /etc/gdm/Xsession, which GDM uses to launch gnome-session, does source ~/.xprofile, but by the time I'm logged in and starting a terminal the mappings have been undone. I'm guessing something that gnome-session or one of its cohorts undoes my careful changes to the keyboard map.

I suppose I need to somehow make my changes at a later stage in the login process, but I've not managed to find a way to achieve that. How can I do that?

(Alternatively, is there a way to add user keyboard layouts that get picked up by the Gnome3 keyboard layout settings dialogue? Or failing that, how can I add layouts in the system?)

asked Jan 4, 2013 at 10:11
7
  • Have you tried using .bashrc or .profile? Commented Jan 4, 2013 at 10:20
  • I have tried running /etc/gdm/Xsession in a login shell with no luck. Just adding it to either of those files will require that I start a terminal before the mappings are active, which isn't ideal since I do quite a bit of my development in Eclipse. Commented Jan 4, 2013 at 10:28
  • Adding it to ~/.profile should cause it to be run on login, adding it to ~/.bashrc will require a terminal since it is only read for non-login shells. See here. Commented Jan 4, 2013 at 11:53
  • The big question is when during login. When looking more closely at my system's /etc/gdm/Xsession it sources both ~/.profile and ~/.xprofile (in that order), so moving stuff from ~/.xprofile to ~/.profile is pointless. Unless of course, gnome-session itself sources ~/.profile but not ~/.xprofile, which it doesn't according to my tests just now. Commented Jan 4, 2013 at 14:02
  • Hmm... OK, how about the ugly hack of making eclipse an alias to something like source ~/.xprofile && ecplipse? Commented Jan 4, 2013 at 14:23

1 Answer 1

1

Silly me! After a bit of thinking I found a good and easy way of doing it:

  1. Copy the contents of ~/.xprofile into a script somewhere. Make sure it's executable.
  2. Start gnome-session-properties and add a new startup program. Point it to the script.

That's it.

Much easier than fiddling around with special dot-files that are sourced on login, really :)

answered Jan 4, 2013 at 16:24

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.