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?)
1 Answer 1
Silly me! After a bit of thinking I found a good and easy way of doing it:
- Copy the contents of
~/.xprofileinto a script somewhere. Make sure it's executable. - Start
gnome-session-propertiesand 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 :)
.bashrcor.profile?/etc/gdm/Xsessionin 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.~/.profileshould cause it to be run on login, adding it to~/.bashrcwill require a terminal since it is only read for non-login shells. See here./etc/gdm/Xsessionit sources both~/.profileand~/.xprofile(in that order), so moving stuff from~/.xprofileto~/.profileis pointless. Unless of course,gnome-sessionitself sources~/.profilebut not~/.xprofile, which it doesn't according to my tests just now.source ~/.xprofile && ecplipse?