Installing KMFL on Ubuntu

From LSDevLinux
Jump to: navigation, search

Contents

Introduction

KMFL (Keyboard Mapping For Linux) lets you redefine the keyboard to type special characters. It basically does for Linux what Tavultesoft Keyman does for Windows. KMFL works with IBus (Intelligent Input Bus for Linux).

In order to use KMFL you need a KMFL/Keyman keyboard source file. You can view and create your own sample one here. KMFL also needs an image to use as an icon. Here is a sample one KMFL Sample Icon.png. You can right-click and save it.

A compiled Keyman file for Windows (.kmx or .kmp) will not work. You will need the source file (.kmn). If you need to build your own, a KMFL programmers guide is available here. The Keyman Developer Programmer's Guide may also be useful.

KMFL on Ubuntu 14.04 Trusty and Wasta 16.04

Install KMFL on Ubuntu

Skip this section for Wasta 16.04, which already has ibus-kmfl installed.

  1. Enable the main packages.sil.org repository by following instructions at http://packages.sil.org/ .
  2. Launch Ubuntu Software Center.
  3. Search for and install ibus-kmfl.

Make sure IBus is being used

  1. Launch Language Support. If you see a message, "The language support is not installed completely," click Remind me later.
  2. Make sure the Keyboard input method system is set to IBus. Click Close.
  3. If you had to change the Keyboard input method system, then log out or reboot now or after installing your KMFL keyboard.

Install a KMFL keyboard

Some KMFL keyboards are available in the software repository, with names starting with kmfl-keyboard. After installing a KMFL keyboard from the software repository, log out or reboot so the new keyboard can be found. You can install a KMFL keyboard from the software repository by launching Ubuntu Software Center (in Ubuntu) or Synaptic Package Manager (in Wasta 16.04), and searching for and installing a KMFL keyboard, for example "kmfl-keyboard-devanagari".

If your keyboard is not available from the software repository, but you have a .kmn file for it, you can install the keyboard either for a single user's use or to be available to all user accounts on your computer, by following the instructions below.

Install a keyboard just for one user

  1. Launch Files. Under Places (in Ubuntu) or My Computer (in Wasta 16.04) click Home to go to the home folder.
  2. On the View menu, make sure Show Hidden Files is selected.
  3. Look for a folder named .kmfl. If it is not there, then from the File menu select Create Folder (or Create New Folder in Wasta 16.04), name this folder .kmfl and then open the .kmfl folder and create a folder inside called icons
  4. Copy the .kmn file to the folder .kmfl
  5. Copy the icon file to the folder .kmfl/icons
  6. Log out or reboot so the new keyboard can be found.

Install a keyboard system-wide for all user accounts

  1. Log into an account that has sudo/administration privileges.
  2. Launch Files.
  3. Copy the keyboard file (.kmn) and the corresponding icon file (.bmp; .png; jpg) to your Downloads folder (or a folder of your choice).
    For illustration, we've used the name mykeyboard.kmn for the keyboard file and myicon.bmp for the icon file. Replace those names in commands below with the names of the files you have used. Replace Downloads if you have the keyboard and icon in a different location.
  4. Launch Terminal and enter the following commands:
  5. sudo mkdir -p /usr/share/kmfl/icons
    sudo cp ~/Downloads/mykeyboard.kmn /usr/share/kmfl/
    sudo cp ~/Downloads/myicon.bmp /usr/share/kmfl/icons/
    
  6. Log out or reboot so the new keyboard can be found.

Add your keyboard to the list of available keyboards

Do the following, depending on if you are using Ubuntu 14.04 or Wasta 16.04.

In Wasta 16.04:

  • Launch IBus Preferences.
  • Click the Input Method tab.
  • Click Add. The Select an input method window appears.
  • Find the keyboard you wish to make available and click Add. If your kmfl keyboard has a "store(&language)" line in the header section, then the keyboard will be categorized under that language; otherwise you will find it at the end of the keyboard list under "Other."

In Ubuntu 14.04:

  • Launch Text Entry.
  • In the Input sources to use list, click the + plus sign. The Choose an input source window appears.
  • Select the keyboard you wish to make available and click Add. If your KMFL keyboard has a "store(&language)" line in the header section, then the keyboard will be sorted in the list by that language; otherwise it will be sorted in the list as "Other".

Use your keyboard in a text application

  • Launch Text Editor.
  • In Wasta 16.04, in the lower right of your screen there should be a keyboarding icon, which may say "EN". Or in Ubuntu 14.04, in the top-right of your screen there should be a keyboarding icon, such as a white box that says "En".
  • Click this icon to show a list of keyboards.
  • Select your keyboard and start typing.

KMFL on Ubuntu 10.04 Lucid and Ubuntu 12.04 Precise

An on itconnect has some additional information and shows a semi-automated way of setting up KMFL.

Install the ibus-kmfl package

  • Enable the main packages.sil.org repository by following instructions at http://packages.sil.org/ .
  • Launch Ubuntu Software Center
  • Type kmfl into the Quick Search box of Software Center (upper right corner). Select the package ibus-kmfl “kmfl engine for iBus”.
  • In Software Center click the Install button. Follow the prompts; you may have to supply your password. Close Software Manager once the installation is complete. Restart the computer.

Install a keyboard into iBus kmfl

You may install a keyboard either for a single user's use or to be available to all users of your computer. There are a few keyboards now that have been packaged for Ubuntu, such as the IPA keyboard from NRSI. In those cases you can just install that package and skip the steps for manually creating folders and copying the files into those folders, just continue after step 3 below.

  • For a user-specific keyboard
  1. Log into the user's account. Open Places—Home Folder, or Places—[username].
  2. If you can not see numerous folders with names starting with "." (period/fullstop), from the View menu select Show Hidden Files. Check for a folder named ".kmfl". If it is not there, from the File menu select Create Folder, and name this folder .kmfl .
  3. Copy the .kmn file to ~/.kmfl and the icon file to ~/.kmfl/icons. You may need to create another new folder icons inside .kmfl.
  • For a system-wide keyboard
  1. Log into an account with sudo privileges. Open Places—Home Folder, or Places—[username].
  2. Copy the keyboard file (.kmn) and the corresponding icon file (.bmp; .png; jpg) to your Downloads folder /home/[username]/Downloads (or a folder of your choice).
    For illustration, we've used the name mykeyboard.kmn for the keyboard file and myicon.bmp for the icon file. Replace those names in commands below with the names of the files you have used. Replace Downloads if you used a different folder in 2.
  3. Run Terminal and enter the following commands:
sudo mkdir -p /usr/share/kmfl/icons
sudo cp ~/Downloads/mykeyboard.kmn /usr/share/kmfl/
sudo cp ~/Downloads/myicon.bmp /usr/share/kmfl/icons/
  • For either type of keyboard installation
  1. Launch Language Support. If you see a message, "The language support is not installed completely," click Remind me later.
  2. Check to be sure the Keyboard Input Method System is set to ibus. Close this window.
  3. Now log out and back in again to Ubuntu, or if the ibus keyboard icon is showing in your system tray you may left-click it and select restart to get the new keyboard(s) registered.

Configure iBus to display your keyboard

  • Launch Keyboard Input Methods. (Or open System-->Preferences-->iBus Preferences.)
  • On the Input Methods tab, click Select an Input Method. Find the keyboard you wish to make available and click Add. If your kmfl keyboard has a "store(&language)" line in the header section, then the keyboard will fall under that language in the ibus keyboard list; otherwise you will find it at the end of the keyboard list under "Other."
In Ubuntu 12.04, iBus preferences is found by right clicking the keyboard icon on the menu bar and choosing Preferences.
  • Experiment with the settings on the General tab. You may enable either an icon in the panel system tray or a separate language panel/bar, or both. They have different features, but to enable a keyboard left-click on either and select your keyboard.
**The keyboard list only appears when the active window allows text input (email, text editor, etc)! If this is not the case you will not see your keyboard when you click on the iBus icon.

Enable your keyboard in a text application

  • To test your keyboard, close the iBus Preferences window; open a new file for editing (eg launch gedit). Left-click on either the system tray keyboard icon or the Language bar icon. Select your keyboard and start typing. The Language bar may be dragged around the screen using the little handle at the left. This should work in any application that allows text entry.

Uninstall a keyboard

  • For a user-specific keyboard delete the (.kmn) file from the user's home folder: ~/.kmfl, and the (.bmp) file from ~/.kmfl/icons.
  • For a system-wide keyboard using scim, log in as a user with sudo privileges. Then open a Terminal and enter the following commands, substituting the filenames of your keyboard and icon files as described above.
sudo rm /usr/share/scim/kmfl/mykeyboard.kmn
sudo rm /usr/share/scim/kmfl/icons/myicon.bmp
  • For a system-wide keyboard using ibus, log in as a user with sudo privileges. Then open a Terminal and enter the following commands, substituting the filenames of your keyboard and icon files as described above.
sudo rm /usr/share/kmfl/mykeyboard.kmn
sudo rm /usr/share/kmfl/icons/myicon.bmp

Notes regarding appearance and behaviour of iBus

  • It may be useful to have IBus automatically start each time you reboot your computer. Doing this can help solve some inconsistant behaviour. To do this launch Language Support. It may suggest that it needs to install some things and you can either Remind you later or let that happen now. Once the Lanuguage & Text dialog box is open, down at the bottom set the Keyboard input method system to be ibus.
  • If you enable more than one keyboard for any language, including "Other," those keyboards will appear on a secondary cascading menu. This doesn't seem to be changeable for the current version of iBus; if you would like to see this or another feature change you may request it on the ibus issues website at http://code.google.com/p/ibus/issues.
  • In the iBus--Input Methods screen it says "the first keyboard in the list is default. Move keyboards up and down to set the default." I haven't been able to make this work.
  • Be careful not to drag the Language bar so far up or down that the handle leaves the visible screen area! If this happens you can use alt+drag to get the handle back in view.
Personal tools