~/.Xmodmap not read on login

Bug #1072120 reported by Ryan Kaskel
98
This bug affects 19 people
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

In most previous Ubuntu version I can remember, settings in ~/.Xmodmap were read upon login.

In Quantal Quetzal, this is no longer the case.

(Sorry, I don't know what package this issue belongs to)

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1072120/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed
affects: ubuntu → gnome-control-center (Ubuntu)
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

The default login manager in Ubuntu, lightdm, seems to read ~/.Xmodmap unless the environment variable XKB_IN_USE is set (see /usr/sbin/lightdm-session).

affects: gnome-control-center (Ubuntu) → lightdm (Ubuntu)
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Ryan,

Do you use some other login manager but lightdm?

If not, what does the command

env | grep XKB

output?

Changed in lightdm (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

Hi Gunnar. No env var with that name.

I also can't find any information in the log files.

A workaround is trivial but it does seem a bit strange...

Revision history for this message
Dario Bertini (berdario) wrote :

I also have this problem, lightdm is the only login manager in use, and I don't have XKB set

Ryan Kaskel, what workaround do you use?
I tried to add "xmodmap ~/.Xmodmap" to my ~/.xsessionrc but it doesn't fix anything (but the rest of the file is sourced correctly)... maybe it's related to the underlying problem?

Changed in lightdm (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

I added "xmodmap /home/ryan/.Xmodmap" to my start up applications.

Revision history for this message
Kev Percy (kevinpercy) wrote :

Adding

xmodmap ~/.Xmodmap

To startup applications does not seem to work for me.

Running

xmodmap ~/.Xmodmap

in a terminal does.

Linux 3.5.0-18-generic #29-Ubuntu SMP Fri Oct 19 10:26:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

What if you try using the absolute path to the file? /home/kev/.Xmodmap

Revision history for this message
Kev Percy (kevinpercy) wrote :

Hi,

thanks for that, yes using the absolute path in the startup applications entry works fine

xmodmap /home/kev/.Xmodmap

Go figure eh?

Revision history for this message
rubax (egerubak) wrote :

Hi,

I have no luck with this workaround. I have tried to add the following entry to .xinitrc, .xsessionrc and startup applications with no luck:
xmodmap /home/rubak/.Xmodmap
It works as expected when executed from a terminal. Is there some other place I can try to put this which you know for sure is loaded on startup?

I have a fresh install of 12.10 (a few hours old).

Linux 3.5.0-23-generic #35-Ubuntu SMP Thu Jan 24 13:15:40 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
rubax (egerubak) wrote :

Just a quick follow-up: I can use the suggested workaround as follows.
1) Create a bash-script in my homedir with the xmodmap command.
2) Add this bash-script to startup applications.

It just didn't work when I put the command directly in startup applications... Go figure..

Revision history for this message
Gaston la Gaffe (i-komorowski) wrote :

Hi,

I have no luck with all these workarounds:
 - xmodmap /home/kev/.Xmodmap in startup applications entry
 - bash-script with that call in startup applications entry
 - bash-script with that call after sleep 30 in startup applications entry
 - bash-script in 'pre-satart script' - part in /etc/init/read-xmod.conf , start on runlevels 235

bash-script or comand itself works fine when called in terminal

problem occured after upgrade from 12.04 to 12.10

Thanks for all ideas / workarounds

Revision history for this message
Christian Koehler (christian-koehler-berlin) wrote :

I habe also no luck with a automatic start of .Xmodmap, only the manual way in a console windows succeeded. My version is Ubuntu 13.10.

Revision history for this message
Dirk Schuster (dirk-schuster) wrote :

yesterday I opened a very similar sounding bug in saucy (13.10):
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1243642
(I don't know if the affected project suggested by the apport-bug process is correct nor if a relation has to be added. help welcome.)

I additionally discovered:

> ... that by switching the keyboard layouts using "gnome-control-center region layouts" the mappings of the "xmodmap ~/.Xmodmap" will be lost again. Then another manual execution of "xmodmap ~/.Xmodmap" has to be executed and it works again.

Perhaps this information is of any help for this bug.

Is there anybody here who has switched to saucy in between and would like to test and confirm the effects I discovered in
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1243642
?
@Christian: What about you?

thanks Dirk

Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

I've long abandoned xmodmap. As the Arch wiki states (https://wiki.archlinux.org/index.php/Xmodmap): "Generally it is not recommended to use xmodmap, except maybe for the simplest tasks."

Even for simple tasks, there are often easier options available using XKB. You can browse the data files (e.g. symbols and rules) in /usr/share/X11/xkb. setxkbmap (http://www.x.org/releases/X11R7.7/doc/man/man1/setxkbmap.1.xhtml) can be used like xmodmap.

That's not to say that there aren't similar issues with XKB and Ubuntu. For example, the new keyboard indicator in 13.10 borked my custom symbol maps (https://github.com/ryankask/dotfiles/blob/master/xkb/symbols/gb -- the include "ctrl(swapcaps)" no longer works).

See these issues for more details:

* http://askubuntu.com/questions/361128/why-did-13-10-break-my-custom-keyboard-layout
* https://bugs.launchpad.net/ubuntu/+source/indicator-keyboard/+bug/1218322

That being said, if you want to use any of the symbols in /usr/share/X11/xkb (for example, i use ctrl(swapcaps) found in /usr/share/X11/xkb/symbols/ctrl, use dbusconf to edit the values in org.gnome.desktop.input-sources (see this page for the schema: https://github.com/GNOME/gsettings-desktop-schemas/blob/master/schemas/org.gnome.desktop.input-sources.gschema.xml.in.in)

Revision history for this message
Dirk Schuster (dirk-schuster) wrote :

Hi Ryan,

thanks for your hints. It helped me to find a workaround, without using ~/.Xmodmap. And now I'm able to switch the keyboard layouts using "gnome-control-center region layouts", too, withour "loosing" the € or $ key of the acer laptop again.

I found these links very helpful. Perhaps they can be helpful for others who are using the approach you suggested:
https://help.ubuntu.com/community/Howto%3A%20Custom%20keyboard%20layout%20definitions
http://www.charvolant.org/~doug/xkb/html/node5.html

cheers Dirk

Revision history for this message
eridal (eridal) wrote :

Hi all,

I know this is thread is way old but since I have the same problem I believe it's worth sharing.

I wasn't able to use the startup command workaround out of the box, and after some digging the cause is that it runs too early, we need to wait for some seconds to run.

This is how it worked for me: I have created a bash script that contains these lines, and call it from the startup applications...

    sleep 3
    xmodmap ~/.Xmodmap

As always YMMV according to your machine speed, and you may need to "sleep" a little longer.

Hope it helps!
  eridal

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.