Skip to main content
add a new option with its instructions
Source Link
user.dz
  • 1.9k
  • 16
  • 33

I have tried a long time ago to make package for a custom keyboard layout. Here the option i could find at that time:

  1. Modify original layout (ex: /usr/share/X11/xkb/symbols/us)

    Issues:

    • It got overwritten on xkb-data update. Package name may differ from distribution to another.
    • Bad idea to create a debian package that overwrites another package file.
  2. Add new layout with different name xy like in this post

    Issues:

    • Same issues of previous method but with layout declaration file: /usr/share/X11/xkb/rules/evdev.xml that need to be modified. AFAIK, Xorg server does not support dynamic loading for new layouts.

The above methods relay on XIM (Standard X input method), a legacy system. I would recommend using a modern input method that support plug-ins (modular design) like IBus or SCIM.

I didn't try that but I expect ibus-table is the easiest way to go like as explain in this post. The added file could be packaged and installed separately like most IBus engines & layouts, IBus take care to loading them.

Update:

Well, this answer on AskUbuntu mentions a cleaner way to modify the upstream package. Here are the minimum instructions to rebuild the package

  1. Enable the source code for repository

  2. Download build dependencies

     sudo apt build-dep  xkb-data
    
  3. Download the source

     mkdir sandbox
     cd sandbox
     apt source xkb-data
    
  4. Create new quilt patch following Ubuntu packaging guide

     cd xkeyboard-config*/
     quilt new username_custom_layout.diff
     quilt add symbols/us
    

    Make your needed modification on symbols/us then

     quilt refresh
    
  5. Build the unsigned source & binary package

     debuild -us -uc 
    

I have tried a long time ago to make package for a custom keyboard layout. Here the option i could find at that time:

  1. Modify original layout (ex: /usr/share/X11/xkb/symbols/us)

    Issues:

    • It got overwritten on xkb-data update. Package name may differ from distribution to another.
    • Bad idea to create a debian package that overwrites another package file.
  2. Add new layout with different name xy like in this post

    Issues:

    • Same issues of previous method but with layout declaration file: /usr/share/X11/xkb/rules/evdev.xml that need to be modified. AFAIK, Xorg server does not support dynamic loading for new layouts.

The above methods relay on XIM (Standard X input method), a legacy system. I would recommend using a modern input method that support plug-ins (modular design) like IBus or SCIM.

I didn't try that but I expect ibus-table is the easiest way to go like as explain in this post. The added file could be packaged and installed separately like most IBus engines & layouts, IBus take care to loading them.

I have tried a long time ago to make package for a custom keyboard layout. Here the option i could find at that time:

  1. Modify original layout (ex: /usr/share/X11/xkb/symbols/us)

    Issues:

    • It got overwritten on xkb-data update. Package name may differ from distribution to another.
    • Bad idea to create a debian package that overwrites another package file.
  2. Add new layout with different name xy like in this post

    Issues:

    • Same issues of previous method but with layout declaration file: /usr/share/X11/xkb/rules/evdev.xml that need to be modified. AFAIK, Xorg server does not support dynamic loading for new layouts.

The above methods relay on XIM (Standard X input method), a legacy system. I would recommend using a modern input method that support plug-ins (modular design) like IBus or SCIM.

I didn't try that but I expect ibus-table is the easiest way to go like as explain in this post. The added file could be packaged and installed separately like most IBus engines & layouts, IBus take care to loading them.

Update:

Well, this answer on AskUbuntu mentions a cleaner way to modify the upstream package. Here are the minimum instructions to rebuild the package

  1. Enable the source code for repository

  2. Download build dependencies

     sudo apt build-dep  xkb-data
    
  3. Download the source

     mkdir sandbox
     cd sandbox
     apt source xkb-data
    
  4. Create new quilt patch following Ubuntu packaging guide

     cd xkeyboard-config*/
     quilt new username_custom_layout.diff
     quilt add symbols/us
    

    Make your needed modification on symbols/us then

     quilt refresh
    
  5. Build the unsigned source & binary package

     debuild -us -uc 
    
Source Link
user.dz
  • 1.9k
  • 16
  • 33

I have tried a long time ago to make package for a custom keyboard layout. Here the option i could find at that time:

  1. Modify original layout (ex: /usr/share/X11/xkb/symbols/us)

    Issues:

    • It got overwritten on xkb-data update. Package name may differ from distribution to another.
    • Bad idea to create a debian package that overwrites another package file.
  2. Add new layout with different name xy like in this post

    Issues:

    • Same issues of previous method but with layout declaration file: /usr/share/X11/xkb/rules/evdev.xml that need to be modified. AFAIK, Xorg server does not support dynamic loading for new layouts.

The above methods relay on XIM (Standard X input method), a legacy system. I would recommend using a modern input method that support plug-ins (modular design) like IBus or SCIM.

I didn't try that but I expect ibus-table is the easiest way to go like as explain in this post. The added file could be packaged and installed separately like most IBus engines & layouts, IBus take care to loading them.