Switch Keyboard Layout on Linux Mint 12 LXDE

I normally use the US-Dvorak keyboard layout, but for some typing in foreign languages, I like to switch back to the basic US keyboard layout. On other Linux distros it’s I had use the keyboard setting graphic user interface to set up the two US keyboard layouts, and then assign a key combination to switch between the two (personally, I like to hold down both the left and right shift-keys for the switch.)

However, on Linux Mint 12 LXDE, I could not find a graphic interface that would allow me to load the two keyboard layouts and assign the switch key combo.

Here’s what I found out about setting my desire layouts and hot-key the manual way:

Per session setting, at the command terminal use the setxkbmap command:

setxkbmap -layout "us,us" -variant "dvorak,basic" -option "grp:shifts_toggle" 

For a more permanent configuration, edit the /etc/default/keyboard file and change the XKB-variables:

XKBMODEL="pc105"
XKBLAYOUT="us,us"
XKBVARIANT="dvorak,basic"
XKBOPTIONS="grp:shifts_toggle"

Adding Desktop Entries to System

Desktop entry files provide information about item in menus.

Desktop entry files must reside in the $XDG_DATA_DIRS/applications directory and must have a .desktop file extension. If $XDG_DATA_DIRS is not set, then the default path is /usr/share is used.

User specific desktop entries may be located at $XDG_DATA_HOME/applications which is searched first. If $XDG_DATA_HOME is not set, then the default path ~/.local/share is used. Desktop entries are collected from all directories in the $XDG_DATA_DIRS environment variable. Directories which appear first in $XDG_DATA_DIRS are given precedence when there are several .desktop files with the same name.

So, if you drop a correctly formatted .desktop file in any of the above mentioned locations, a new launcher icon will appear in the menu hierarchy as specified by the keywords in the .desktop file.

The freedesktop.org maintains software base platform and specification for desktop software on Linux and UNIX. To get more information on the latest desktop entry files, see the Desktop Entry Specification at freedesktop.org.

Here’s a sample desktop entry file for Eclipse:

[Desktop Entry]
Version=1.0
Name=Eclipse
GenericName=Eclipse IDE
Comment=Eclipse IDE
Exec=/home/puppychau/bin/eclipse/eclipse %F
Icon=/home/puppychau/bin/eclipse/icon.xpm
Type=Application
Terminal=false
Categories=Development;IDE

[deprecated] Using Oracle’s plugins in Firefox

Deprecated post: This post is left here for archival purpose. Beginning in Firefox version 52 released March 7, 2017, installed NPAPI plugins are no longer supported in Firefox.

Enable Oracle’s JRE plugin for Firefox in Linux.

  1. See my other post on Installing Oracle JDK 10.0.1 on Linux.
  2. Create your .mozilla/plugins directory if one isn’t already exists.
    mkdir ~/.mozilla/plugins
  3. Create a symbolic link of the JRE’s libnpjp2.so shared object file in your plugins directory. In my installation, this JRE file is found in /opt/jdk-10.0.1/lib/libnpjp2.so
    ln -s /opt/jdk-10.0.1/lib/libnpjp2.so ~/.mozilla/plugins 
  4. Restart Firefox and browse to one of the JVM tester page to see the version of Java your browser is using.