Skip to content

Instantly share code, notes, and snippets.

@dotland
Created April 19, 2022 07:25
Show Gist options
  • Save dotland/f736a1e81e32be05c1a8a8f3e95bdd8c to your computer and use it in GitHub Desktop.
Save dotland/f736a1e81e32be05c1a8a8f3e95bdd8c to your computer and use it in GitHub Desktop.
Installation of KeyboardLayoutEditor on Linux

KeyboardLayoutEditor is written in Python 2

To see the versions of Python installed run

update-alternatives --list python
sudo apt install python2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 2

Install Python 2 Package Manager

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 get-pip.py

Install libraries user by KLE

sudo apt-get install libgirepository1.0-dev gcc libcairo2-dev pkg-config python2-dev gir1.2-gtk-3.0
sudo pip install pycairo
sudo pip install PyGObject
sudo pip install paramiko
sudo apt-get install libpango-1.0-0
sudo apt-get install python-lxml

wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pygtk/python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pygtk/python-glade2_2.24.0-5.1ubuntu2_amd64.deb
sudo apt-get install ./python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
sudo apt-get install ./python-glade2_2.24.0-5.1ubuntu2_amd64.deb

Setup one-time KLE

git clone https://github.com/simos/keyboardlayouteditor.git
cd keyboardlayouteditor/
sudo pip install http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.2.tar.gz
wget http://www.antlr3.org/download/antlr-3.1.2.jar
java -classpath antlr-3.1.2.jar org.antlr.Tool *.g

Run the KLE

./KeyboardLayoutEditor

After using KLE, change python version to 3

sudo update-alternatives --config python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment