How to install xkb-switch on Ubuntu 16.04

How to install xkb-switch on Ubuntu 16.04

The xkb-switch is a C++ program that allows the user to query and change the XKB layout state. The XKB is a part of the X window system that has the ability to control the keyboard. The switch is used to switch from the x keyboard layout from the command line. This tutorial covers the installation procedure of xkb-switch on Ubuntu 16.04.

Installation procedure

To begin with the installation procedure, add the repo to the target system and execute the following command.

root@linuxhelp1:~# add-apt-repository ppa:atareao/atareao
Applications from atareao
More info: https://launchpad.net/~atareao/+archive/ubuntu/atareao
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmpolawt5mj/secring.gpg'  created
gpg: keyring `/tmp/tmpolawt5mj/pubring.gpg'  created
gpg: requesting key 36FD5529 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpolawt5mj/trustdb.gpg: trustdb created
gpg: key 36FD5529: public key " Launchpad PPA for atareao"  imported
gpg: Total number processed: 1
gpg:imported: 1(RSA: 1)
OK

The repositories have been successfully added, now to update the repo use the apt-get update command and run it.

root@linuxhelp1:~# apt-get update
Get:1 http://ppa.launchpad.net/atareao/atareao/ubuntu xenial InRelease [17.5 kB]
Hit:2 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:6 http://ppa.launchpad.net/atareao/atareao/ubuntu xenial/main amd64 Packages [6,296 B]
Get:7 http://ppa.launchpad.net/atareao/atareao/ubuntu xenial/main i386 Packages [6,288 B]
Get:8 http://ppa.launchpad.net/atareao/atareao/ubuntu xenial/main Translation-en [3,348 B]
Fetched 33.5 kB in 1s (17.8 kB/s)
Reading package lists... Done

The target system is updated with the required repositories. Then install the xkb-switch package and execute the following command.

root@linuxhelp1:~# apt-get install xkb-switch -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
xkb-switch
0 upgraded, 1 newly installed, 0 to remove and 475 not upgraded.
Need to get 20.9 kB of archives.
After this operation, 80.9 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/atareao/atareao/ubuntu xenial/main amd64 xkb-switch amd64 1.4.0-2 [20.9 kB]
Fetched 20.9 kB in 0s (23.5 kB/s)
Selecting previously unselected package xkb-switch.
(Reading database ... 176594 files and directories currently installed.)
Preparing to unpack .../xkb-switch_1.4.0-2_amd64.deb ...
Unpacking xkb-switch (1.4.0-2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up xkb-switch (1.4.0-2) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...

The xkb-switch is installed successfully. To know more about the options, execute the following command.

root@linuxhelp1:~# xkb-switch --help
Usage: xkb-switch -s ARGSets current layout group to ARG
xkb-switch -l|--listDisplays all layout groups
xkb-switch -h|--helpDisplays this message
xkb-switch -v|--versionShows version number
xkb-switch -w|--wait [-p]Waits for group change
xkb-switch -W|--Infinitely waits for group change, prints group names to stdout
xkb-switch -n|--nextSwitch to the next layout group
xkb-switch [-p]Displays current layout group

For removing the package, execute the following command and press y to continue with the uninstallation.

root@linuxhelp1:~# apt-get remove xkb-switch -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
xkb-switch
0 upgraded, 0 newly installed, 1 to remove and 475 not upgraded.
After this operation, 80.9 kB disk space will be freed.
(Reading database ... 176600 files and directories currently installed.)
Removing xkb-switch (1.4.0-2) ...
Processing triggers for man-db (2.7.5-1) ...

Wasn' t that an easy installation procedure? The xkb-switch has an association of actions to keys in the keyboard layout.

FAQ
Q
how to remove the xkb-switch on ubuntu?
A
For removing the package, execute the following command
# apt-get remove xkb-switch -y
Q
what is the command to install the xtb-switch in ubuntu?
A
install the xkb-switch package and execute the following command.
# apt-get install xkb-switch -y
Q
which command to add the repo for xkb-switch in ubuntu?
A
add the repo to the target system and execute the following command
# add-apt-repository ppa:atareao/atareao
Q
why we need xkb-switch in ubuntu?
A
The xkb-switch is a C++ program that allows the user to query and change the XKB layout state. The XKB is a part of the X window system that has the ability to control the keyboard. The switch is used to switch from the x keyboard layout from the command line.
Q
how to check the version of xkb-switch?
A
use the following command to check the version of xkb-switch # xkb-switch -V