kbdd - a simple layout switch

    Kbdd is a small daemon for storing layouts one by one, written in pure C and distributed under the GPL-3 license. The peculiarity of this daemon is that it does not depend on third-party WM and / or DE.
    Now the program is in a state of finalization: stabilization of the API, adding information about errors, additional checks of the transmitted values. Therefore, I present the program to a wide range of users, so that those interested can try it, make suggestions about the functionality, criticize, etc. If you are interested, then under the cat a detailed description.

    In the general case, the task of saving layouts one by one is very simple, therefore it was implemented both in plugins for various window managers and in various key switch programs that are attached to graphical environments. Based on this, the main goal of this program was to make another bike a program that will solve this problem regardless of the software used, and some associated tasks were also solved. When writing this program, an attempt was made to execute it in a unix-style, i.e. kbdd should solve the task assigned to it and solve it well.

    I note right away that this project is not the only one that implements this functionality, for example, there are the following projects working in a similar direction:

    xxkb- A fairly good program that serves many people, but has problems with tiling (more precisely, no-reparenting) window managers.

    xneur is a much more complex program that supports the functions of auto-switching layouts, translating text to another layout, and much more.

    It is important to note the following features of kbdd :
    • lack of any layout display interface and visual control interface
    • dbus interoperability (optional)
    • architecture to add additional means of interaction

    Once again, I note that the program is not an indicator of the layout, because in any case it will lead to tying up the system toolkit and checking for the presence of the tray. In addition, the implementation of the indicator can be solved using WM or DE, in which case a display that fits into the interface will be guaranteed ( example for awesome ).
    In kbdd following functions are implemented to communicate with the outside world (at the moment it is only dbus methods, and events):
    • receiving events of changing the current layout (number or string description)
    • getting the layout name by its number
    • switching to the layout by its number
    • switching to the previous (for this window) layout

    In order to use kbdd to switch layouts by pressing certain keys, you can use the xbindkeys program . To do this, install it and add the following lines to the configuration file (~ / .xbindkeysrc): This config allows you to use the keys alt + shift + layout number to switch to the desired layout, this can be useful for those who use more than 2 layouts.

    "dbus-send --dest=ru.gentoo.KbddService /ru/gentoo/KbddService ru.gentoo.kbdd.set_layout uint32:0"
    Mod1+Shift + 1
    "dbus-send --dest=ru.gentoo.KbddService /ru/gentoo/KbddService ru.gentoo.kbdd.set_layout uint32:1"
    Mod1+Shift + 2
    ..и т.д.
    "dbus-send --dest=ru.gentoo.KbddService /ru/gentoo/KbddService ru.gentoo.kbdd.prev_layout"
    Mod1+Shift + 5


    It is also possible to switch to the last selected layout by calling the prev_layout method. For example, if you use layouts (1: ru, 2: en, 3: es), then (for this config), pressing alt + shift + 2 will turn on the English layout, pressing alt + shift + 3 will turn on the Spanish, but in this case, the English layout will be remembered as the "last used". Thus, calling alt + shift + 5 will switch the layout from Spanish to English, remembering Spanish as the last used. As a result, for each window, you can use the cyclic switching of two layouts.

    A more detailed description of the kbdd use cases can be found on the github wiki page of this project.

    Installation, start using

    Installation:
    Now kbdd it distributed only in source code that you can clone from git repository: git: //github.com/qnikst/kbdd.git , or stable version (0.3.2 or 0.4) from here
    Members Gentoo pogut connect overlay rion and install it from there .

    Build:
    To build kbdd, you need X header files, glib header files, and (if included) dbus-glib header files. And for the program to work, you need the appropriate libraries. The system uses autotools for installation; during assembly, you can specify the options --enable-debug - for more detailed output of debugging information (disabled by default) and --enable-dbus- to enable the dbus subsystem (enabled by default).

    Launch:
    Since kbdd uses the standard xkb settings, you do not need to configure anything and you can just run the program.

    What I want from interested users: if this program is convenient for someone, but lacks any functionality, I will be glad to hear suggestions. I would also be glad if there was a person who was ready to make or help make packages for the rest of the Linux distributions, so that the program could be distributed in a more adequate form.

    Also popular now: