5

I've managed to create a custom keyboard layout for my language.

Now that the keyboard is in a state that I can share it. I don't know how to make it a redistributable package.

2 Answers 2

7
+25

To add it to the official xkeyboard-config package, you would develop it as a patch for the xkeyboard-config package. See their code contribution guide; contributed layouts are made by patches on their bug tracker. You can clone the upstream repository with:

git clone git://anongit.freedesktop.org/git/xkeyboard-config
  • From a quick glance at your layout, I think you need to add the default keyword to the stanza definition (default xkb_symbols "basic"), to declare that layout the default for that file. Your file itself would be put in the symbols directory.

  • In addition to your new layout file, you'll need to add it to the rules templates (rules/base.xml.in or possibly rules/base.extras.xml.in -- the rules/evdev.xml file will be generated from the same template).

  • Doublecheck the project documentation for other specifics that I might have missed.


You could also add that patch to the Ubuntu source package apply it with the standard dpkg build tools. This would allow you to distribute your modifications to other Ubuntu users with minimal difficulty. See questions like How to create and maintain patch on Debian package? for more specifics.

2
  • Can your custom package-approach of the upstream one be used in this challenge: unix.stackexchange.com/q/346073/16920 ? Apr 11, 2017 at 4:59
  • 1
    @LéoLéopoldHertz준영 sure. i'd strongly advise making your layout a new variant, rather than changing an existing one, but for personal use it's fine.
    – quixotic
    Apr 12, 2017 at 13:59
2

You can wrap your keyboard layout as a Debian package. This will create a .deb file which can be installed from the command line with sudo apt install -f ./my-file.deb or just by double-clicking the file in the file explorer.

I've done this and have published the work on GitHub. That repository contains really all you need to do this, but in the interest of having a self-contained answer here, I'll give an outline of the process.

Step zero, learn how to make a keyboard layout. You basically have to modify some configuration files in /usr/share/X11/xkb.

Then, learn how to make a Debian package. Our package's job is basically going to be to just modify the right files in the aforementioned xkb directory. However, if you try to do this, you'll find as I did that dpkg yells at you for trying to overwrite another package's files. You will need to get around this using diversions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .