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.

Installing Virtubox Guest Additions in Ubuntu Guest Machines

  1. Install the needed packages to create kernel modules:
    sudo apt-get install dkms build-essential linux-headers-generic 
  2. Press the Host+ D key combination or click on the Devices menu and choose the Install Guest Additions… option.
    Install Guest Additions...
  3. Mount the Guest Additions iso CD image:
    sudo mount -t iso9660 /dev/cdrom /media/cdrom

    mount: block device /dev/sr0 is write-protected, mounting read-only

  4. Run the installation script
    sudo /media/cdrom/VBoxLinuxAdditions.run
  5. Restart the guest machine.