{"id":20235195,"url":"https://github.com/kopoli/keyboard","last_synced_at":"2025-03-03T14:15:03.949Z","repository":{"id":21005984,"uuid":"24296607","full_name":"kopoli/keyboard","owner":"kopoli","description":"A tool for setting custom keyboard layout in X","archived":false,"fork":false,"pushed_at":"2015-09-06T18:14:11.000Z","size":284,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-14T00:43:46.129Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kopoli.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-21T16:40:37.000Z","updated_at":"2024-12-24T22:39:16.000Z","dependencies_parsed_at":"2022-07-31T05:48:04.865Z","dependency_job_id":null,"html_url":"https://github.com/kopoli/keyboard","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopoli%2Fkeyboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopoli%2Fkeyboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopoli%2Fkeyboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopoli%2Fkeyboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kopoli","download_url":"https://codeload.github.com/kopoli/keyboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241678154,"owners_count":20001682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T08:15:14.025Z","updated_at":"2025-03-03T14:15:03.927Z","avatar_url":"https://github.com/kopoli.png","language":"Shell","readme":"* Tool for setting up a custom keyboard layout in X\n\n  I use this tool to set my keyboards to the following layout:\n\n  [[./img/keyboard-layout.png]]\n\n  This is a typical QWERTY layout with Finnish configuration with the\n  following changes:\n  - Control_L replaces caps-lock.\n  - Hyper_L replaces Control_L.\n  - Tab and Meta_L are swapped.\n\n  - There is a layout for Kinesis Freestyle2 keyboard with the\n    following additional changes:\n    - Insert and pause-break buttons are swapped. In Freestyle2 the insert\n      button is behind a modal Fn key.\n    - Reorganize the Home-column into the following order: Home, PageUp,\n      PageDown, End\n\n  Contents:\n  - xkb-layout.sh: A script that sets the current keyboard layout.\n  - xkb-unlocker: A C program that disables caps lock if it is currently\n    enabled.\n  - keyboard layout files:\n    - keyboard/*.xkb: Layouts that are selectable using xkb-layout.\n  - keyboard symbols files:\n    - keyboard/symbols/special: The configuration for the above paragraph.\n  - generate-deb-pkg.sh: A script to generate debian packages of layouts described by\n    the files in directory packages.\n  - generate-xkl.sh: generates a script that runs the xkb-layout.sh with the\n    wanted keyboard layout. The generated script is called 'xkl' and should be\n    copied somewhere in $PATH.\n\n** Requirements\n\n  For xkb-layout script:\n  - xkbcomp\n  - setxkbmap\n  - notify-send (for displaying the changed keymap)\n\n  For caps-lock unlocking:\n  - A C-compiler\n  - libx11 development packages\n\n  For building and generating the keyboard layout file:\n  - GNU Make\n  - xkbprint\n  - ps2pdf\n\n  For generating debian packages:\n  - dpkg-deb\n  - fakeroot\n\n** Basic usage of xkb-layout script\n\n   Running the ./xkb-layout.sh without arguments gives the basic\n   usage. Example:\n\n   #+begin_src shell\n   ./xkb-layout.sh fi-hs-qwerty\n   #+end_src\n\n   This will enable the keyboard layout described in the introduction of this\n   file.\n\n** Displaying of the current keyboard layout\n\n   You can create a PDF-image of the current keyboard layout with the\n   following:\n\n   #+begin_src shell\n   make image\n   #+end_src\n\n   The first image is with no modifiers pressed, the following is with shift\n   and thereafter is shift+alt-gr. The image will be similar to the one\n   displayed in this README. See manpage of xkbprint(1).\n\n** Installing the layout setting script $PATH\n\n   You should run the './generate-xkl.sh' script and select your wanted\n   keyboard layout. This will create the 'xkl' script. Afterwards the Makefile\n   can install that wrapper to BINDIR. It will also create *.desktop -files\n   for the keyboard setting and install them into INSTDIR. Look into the\n   Makefile for details.\n\n   The following command compiles the xkb-unlocker, installs the wrapperscript,\n   xkb-unlocker to ~/bin and the desktop-files to ~/.local/share/applications:\n\n   #+begin_src shell\n   ./generate-xkl.sh fi-hs-qwerty\n   make BINDIR=~/bin\n   #+end_src\n\n   This git repository needs to exist when running the wrapper script, because\n   the keyboard configurations are kept in the keyboard/ subdirectory.\n\n   There is also a make uninstall command to remove the installed files from\n   the aforementioned directories.\n\n** Modifying and creating layouts\n\n   You can modify whole layouts by modifying the xkb-files in the keyboard\n   directory. You can add or modify partial symbol mappings in the files of\n   the keyboard/symbols directory.\n\n   Guides on the syntax can be found through google and for example:\n\n   - http://www.charvolant.org/~doug/xkb/html/node5.html\n   - https://wiki.archlinux.org/index.php/X_KeyBoard_extension#xkb_symbols\n\n   When developing keyboard layouts the X will cache the generated keymap when\n   it is enabled the first time and it will use the cache from then\n   on. Therefore one should remove the cache in the following way:\n\n   #+begin_src shell\n   rm -f /var/lib/xkb/server-*.xkm\n   #+end_src\n\n** Creating a debian package of a keyboard layout\n\n   You can create a proper keyboard layout file that can be loaded with\n   setxkbmap with the generate-deb-pkg.sh script. The basic usage is the\n   following:\n\n   #+begin_src shell\n   ./generate-deb-pkg.sh \u003ccontrol-file\u003e\n   #+end_src\n\n   There are example control files in the directory packages. To generate all\n   packages in that directory, run the following command:\n\n   #+begin_src shell\n   make pkg\n   #+end_src\n\n*** The control file for generating the package\n\n    The control file is a debian control file with some special headers:\n\n    XKL-symbols: The partial xkb_symbols -sections that will be included to the\n    default xkb_symbols -section in the generated symbols file.\n\n    XKL-name: The string that will be in the name[Group1] -item in the\n    xkb_symbols section.\n\n    XKL-data: The file that is used as the base of the xkb_symbols -file. The\n    path is relative to the directory the command is run from. The file is\n    parsed until a row with string \"IGNORE-FOLLOWING-XKL-DATA\" is found. This\n    is to make possible to have keymaps that collect the different\n    sub-keymaps, but not have them in the installed keymap file\n\n    XKL-shortDescription: The contents of the shortDescription tag in the\n    evdev.xml file.\n\n    XKL-langiso639Id: The contents of langiso639Id tag in the evdev.xml file.\n\n    XKL-files: Files that are searched from directory ${PKGNAME}-files and\n    installed to given directory. The arguments are a space separated list of\n    the following format \"filename|directory\" See an example in the file\n    packages/xkl-common.\n\n    Some variables are expanded with shell. Notable ones:\n\n    ${PKGNAME} - The filename of the keymap.\n\n*** Example usage\n\n    The following will generate and install keymap package. Finally it will\n    create a keyboard.pdf with the current keyboard layout.\n\n    #+begin_src shell\n    ./generate-deb-pkg.sh xkl-common\n    ./generate-deb-pkg.sh xkl-hyper\n    sudo dpkg -i xkl-common*deb\n    sudo dpkg -i xkl-hyper_*deb\n    setxkbmap xkl-hyper\n    make image\n    #+end_src\n\n*** Making it available for the system's keyboard layout utility\n\n    To add a layout to a system's own utility, usually the\n    /usr/share/X11/xkb/rules/evdev.xml file needs to be modified. The package\n    xkl-common contains a script called xkl-regen-evdev which will modify that\n    file in accordance to xml fragments found in directory\n    /usr/share/X11/xkb/rules/evdev.xml.d. All control files containing the\n    XKL-name (etc.) will generate an xml-fragment in addition to the actual\n    keyboard layout files. Run the following command after installing the\n    xkb-* packages to regenerate the evdev.xml file:\n\n    #+begin_src shell\n    sudo xkl-regen-evdev update\n    #+end_src\n\n    When your system recognizes the keyboard layout you don't need to run any\n    scripts to enable it. Which makes the 'xkl' trickery unnecessary.\n\n    *Note:* If the evdev.xml file gets corrupted, you should just install it\n    back from the 'xkb-data' debian package. (This is just for being prepared,\n    because the script might contain bugs.)\n** License\n\n   MIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopoli%2Fkeyboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkopoli%2Fkeyboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopoli%2Fkeyboard/lists"}