Skip to content

Very simple X11 keyboard layout switcher that have not conflicts with apllications hotkeys.

License

Notifications You must be signed in to change notification settings

X11-good-tools/xkbs1kls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

         Simple X11 1-key Keyboard layout switcher

    (c) Alexey Korop, 2014. Mailto: [email protected].
    This is free software under GNU GPLv3.

                     Installation

  Unpack archive and copy as root the s1kls file to the any location that is suitable for programs, /usr/bin/ for instance.
  It is recommended to run this program with root privileges for better poll accuracy. For do this set after installation SUID flag:
     chmod u+s /usr/bin/s1kls

                     Command line

        xkbs1kls keycode0 keycode1 ... -sN keycode ...

  The key with keycode 'keycode0' sets the layout 0,
  the key with keycode 'keycode1' sets the layout 1 ...
  You may also define several keycodes for switch to desired layouts temporary (while pressed). Layout is the digit N after '-s' (without space).

                     Features

  Only "LockGroup" switch type supported for permanent switch (each key select the own layout). No layout indicator supported. Also "Switch" type supported for temoparay switch.
  Key codes you can find out by calling this program in the terminal without parameters.

                     Backgrownd

  Standard X11 permanent layout switcher is activated immediately by PRESSING the keys and therefore conflicts with the application shortcuts. Also it is not possible to define Compose key that work regardless of the current layout.
  In this program permanent layout switcher is activated by RELEASING the keys, but only under the condition that no other key is pressed. For example, You were asked to switch to the layout 2 by RCtrl. Then if You press and release RCtrl, the layout will be switched. But if You pressed in a text editor RCtrl-Right, then the editor performs jump forward a word and layout will not be switched.
  Temporary layout switcher in this program works simultaneously with the standart X features and it is useful to define as temporary switcher to the English keyboard the same key thаt used as X Compose Key.

  If You need a layout indicator, You can use a standard X11 LED indicator or any tray indicator as xxkb.

                    Example

  I use 3 layouts: (us,ru,ua) and CapsLock as compose key. I want tu use for the permanent switching the keys following: RShift sets "us", RCtrl sets "ru" and RWin sets "ua". Also I define CapsLock as temopary switcher to tu "us" layout.  On the pc105 keyboard these keys have the keycodes 62, 105, 134 and 66.

  In the X11 keyboard config (in my ArchLinux it is the file /etc/X11/xorg.conf.d/01-keyboard-layout.conf) I define:

        Option "XkbLayout" "us, ru, ua"
        Option "XKbOptions" "grp_led:scroll,compose:caps"

  In the autostart I call this program:

        xkbs1kls 62 105 134 -s0 66 &


===========

What's new

1.02 Temporary layout switching added,
1.01 First public release.

https://sourceforge.net/projects/s1kls/

About

Very simple X11 keyboard layout switcher that have not conflicts with apllications hotkeys.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published