Ubuntu – .xmodmap doesn’t work for two layouts

13.10keyboard-layoutxmodmap

before doing the upgrade to Ubuntu 13.10 I was using two layouts for the Keyboard – GR & DE. I was able to set both in one .xmodmap, means I was able to configure GR and DE. Now, when I create a .xmodmap it contains only the layout I currently use, but I want both layouts to be in. How can I achieve this?

Best Answer

I have not solved this problem on 14.04, but I know that this bug keyboard-indicator. After the change of layout, xmodmap settings are reset. I made a script that resets the settings after changing the layout. I hope it will be useful to someone realties.

#!/usr/bin/env python

import os, dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop

def event_handler(args):
        if args == "com.canonical.indicator.keyboard":
                os.system("xmodmap ~/.Xmodmap")

dbus.mainloop.glib.DBusGMainLoop(set_as_default = True)

bus = dbus.SessionBus()
bus.add_signal_receiver(event_handler,
                        dbus_interface="com.canonical.Unity.Panel.Service",
                        signal_name="ReSync")

loop = gobject.MainLoop()
loop.run()
Related Question