📜 ⬆️ ⬇️

kbdd - simple layout switch

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

In the general case, the task of saving the window layout is very simple, so it was implemented both in plug-ins to various window managers, and in various key switch programs attached to graphic environments. Based on this, the main goal of this program was to make another bike program that will solve this problem regardless of the software used, as well as some passing problems were solved. When writing this program, an attempt was made to execute it in a unix-style, i.e. kbdd should solve the problem posed to her and solve it well.

Immediately, I note that this project is not the only one implementing this function, for example, there are the following projects working in a similar direction:

xxkb is 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 auto-switching of layouts, translating text to another layout, and much more.

It is important to note the following features of kbdd :

Once again, I note that the program is not an indicator of the layout, because in any case it will result in tying it to the system toolkit and checking for the presence of the tray. In addition, the implementation of the indicator can be solved by means of WM or DE, and in this case, a mapping that fits into the interface will be guaranteed ( example for awesome ).
In kbdd , the following functions are implemented for interacting with the outside world (currently, this is only dbus methods and events):

In order to use kbdd to switch layouts by pressing certain keys, you can use the xbindkeys program. To do this, you need to install it and add the following lines to the configuration file (~ / .xbindkeysrc):

"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

This config will allow you to use the alt + shift + number of the layout to switch to the desired layout, this can be useful to those who use more than 2 layouts.
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), when you press alt + shift + 2, the English layout turns on, when you press alt + shift + 3, Spanish turns on, but while the English layout will be remembered as the "last used". Thus the alt + shift + 5 call will switch the layout from Spanish to English, remembering Spanish as the last used one. As a result, for each window, you can use the cyclic switching of the two layouts.

A more detailed description of the options for using kbdd is available on the github wiki page of this project.

Installation, launch use

Installation:
Now kbdd is distributed only in source codes that can be cloned from the git repository: git: //github.com/qnikst/kbdd.git , or a stable version (0.3.2 or 0.4) from here
Gentoo users can connect the rion overlay and install the package from there.

Assembly:
Building kbdd requires X header files, glib header files, and (if enabled) dbus-glib header files. And for the work of the program need the appropriate library. For installation, the autotools system is used, during assembly, you can specify the options —enable-debug — for a more detailed output of debug information (disabled by default) and –enable-dbus — to enable the dbus subsystem (enabled by default).

Run:
Since kbdd uses the standard xkb settings, there is no need to configure anything and you can simply run the program.

What do you want from interested users: if this program will be convenient for someone, but some functionality is missing, then I will be glad to hear suggestions. I would also be happy if there was a person who was ready to make or help to make packages for other Linux distributions in order to be able to distribute the program in a more adequate form.

Source: https://habr.com/ru/post/107815/


All Articles