Translate

Guide To Setting Up LXDE, The Lightweight Champion

1. Introduction12. Password and Name Changes, Autologin
2. Firefox (Iceweasel) & Pcmanfm13. Links for Terminal & Keyboard Launched Apps
3. Desktop14. Dual Monitors
4. Panels & Autostart15. Sound & Recording with VLC
5. Wallpaper, Rotator & Wallpaper Geometry16. Network Sharing, Printers & Wireless
6. Installing Handbrake17. Samba Home Network Sharing
7. Installing Oracle-Java18. Keyboards, Keybindings & Touchpad
8. Installing Lxmed & Lxmenuman19. Remastersys
9. Menu Categories & MyStuff20. Recommended Applications and Service Controls
10. Wine, Wine Programs and Skype21. Some Important Places
11. Desktop and Panel Links, Bash Script Launchers22. Setting Up an FTP Home Computer Network

Introduction

LXDE Guide
Debian LXDE
Beginner's Guide
Arachnophilia HTML
Araneae HTML Editor
Debian Remastersys
FastStone Image Editor
MyStuff Menu
Openbox Menu
PhotoFiltre Editor
Tint2 Panel
Utorrent
Wbar Dock

LXDE stands for Lightweight X11 Desktop Environment. It is by design a lightweight, no frills, computer-friendly, user-friendly general desktop control system for a variety of operating system. It's not designed to be powerful and bloated, but to be usable and slim and to keep the resource usage low. Different from other desktop environments, LXDE doesn't tightly integrate every component. Instead, LXDE tried to make all components independent, so that each of them can be used independently with fewer dependencies. It is basic, and rather primitive by comparison to the slick and bigger desktops. But don't be fooled by the lightweight characterization. LXDE can do everything the bigger distributions do. It is mostly a matter of personal preference. Do you want to spend time removing bloat from a heavy distribution, or add just what you want to a lightweight one? You want plasmoids, fancy multi-dimensional drop-down menus, rotating cubes, etc, just add them. Do you want your computer to be a tool or a toy? Although I sometimes treat it as a toy, I really want it, first and foremost, to be a tool. I want it to conveniently and quickly launch and shutdown the maximum possible number of applications (software) possible, and to flawlessly run these applications. The role of the desktop and its associated companions, the file browser and windows manager, is to supply the tools that do the launching and shutting down. This is where LXDE delivers. It is simple to adjust, offers a broad range of operations and performs quickly. You click on something and BAM there it is, no waiting. LXDE is the most stable of the Linux desktops in my experience. Things that work today will work the same way tomorrow. Finally, don't be fooled by the "conventional propaganda" that the LXDE desktop is only for old computers with lack-luster hardware. Others cry out, "our modern computers are so powerful, it doesn't matter," whenever you mention system requirements these days. The fact remains though - it does matter. A desktop that runs fast on a slow system will fly on a quick system. Resources should be there for your applications to use, not for your desktop environment to eat up. I put LXDE or its components on all my computers, some of which have 8 GB of memory and none of which has a CPU under 2 GHz, because it is the best desktop tool available for performance, and it is reliable, too. For a somewhat outdated but still accurate comparison of the 4 main Linux desktops regarding system memory useage, see the chart at the bottom of Beginners Guide.

Most new computers over the past few years come with dual or more CPUs and 4 GBs or more RAM, which means they perform for most tasks better with a 64-bit (Amd64) operating system, instead of a 32-bit (i386, i486, i686) one. See 32-bit vs 64-bit for a comparison. On 64-bit systems LXDE is even faster, but well-supported, good, ready-made 64-bit LXDE systems are not popular with developers. However, this lack of good stock 64-bit LXDE systems can be easily circumvented by loading an LXDE desktop on almost any 64-bit system and then choosing LXDE as the default. My favorites are Sparky Linux and Crunchbang Linux, which are constructed around Openbox, the LXDE windows manager. Little supplementing is required to change them to a complete LXDE system, second to none, after-market or otherwise. Also, any XFCE desktop can be easily converted to an LXDE desktop. The bigger desktops are not so easy to convert without retaining garbage that will slow down performance.

LXDE does have a price. Without a lot of GUI's (Graphical User Interfaces) it is a bit harder for some to set-up the initial desktop. The main purpose of this Guide is to offer help for getting past this initial barrier. The big things - internet connection, apps launching, sound, video, etc - probably depend more upon the underlying operating system and your computer's hardware than the desktop system.

The LXDE system consists of 11 primary packages and a few supporting packages depending upon the distribution, each related to a special function and each essentially independent, which makes after-market installing and substituting very easy. The 11 primary packages are:

Supporting packages are: The chain of command in an LXDE desktop is the display manager starts the session manager, and then the session manager starts the windows manager and panel: lxdm>lxsession>(openbox + lxpanel). All of this is done according to a well specified and widely implemented standard protocol, and so any of these main components can be replaced by corresponding components from other desktops, or visa versa.

To install an aftermarket LXDE desktop, simply use synaptic to install lxde-core, or:

   sudo apt-get install lxde-core.

Then, log-out and back-in, choosing lxde or lxsession when asked. Configure your lxde desktop as outlined in this guide, and add and remove applications as desired. Finish by installing upgrade-system and/or wajig. Run

   sudo upgrade-system

and/or

   sudo wajig purge-orphans.

2. Firefox (Iceweasel) & Pcmanfm

Useful configurations for Firefox (Iceweasel):

Useful configurations for Pcmanfm:

Pcmanfm has many very useful features:

If Pcmanfm isn't performing perfectly, he can be relaunched by putting the following in the terminal:
   pcmanfm --desktop --profile=LXDE.

3. Desktop

menu-xmlThere are 3 installed GUI's (Graphical User Interfaces) for customizing the desktop, excluding panels and wallpaper: Recommended customizations:

openbox-iconsA new desktop-right-click-menu offers a small application menu, the Openbox Applications Menu (see photo below-left, which is after an edit). To really get a useful Openbox Menu, edit it to include any and all applications with icons, provided you have Openbox 3.5.0-2 or later, by coping the text file named menu.xml in /etc/xdg/openbox to your home directory to more easily edit it. Put all the applications that you want in this menu. Enter applications according to the pattern in the picture on the upper-right. Put the icons of .png type associated with your apps into /usr/share/icons and make that address the icon entry. See Openbox Menu for a template of menu.xml and an expanded discussion. When finished, place a copy of your modified menu.xml in the following 3 openbox directories (replacing any menu.xml already there):

   /etc/xdg/openbox
   /usr/share/lxde/openbox
   ~/.config/openbox .

These addresses (part before openbox) may be slightly different depending upon the underlying distribution. Edit the rc.xml or lxde-rc.xml in the above 3 openbox directories so that the line following <menu> is

   <showIcons>yes</showIcons>.

keybindWhile the rc.xml or lxde-rc.xml are open, edit their keybinding parts as illustrated by the picture on the right. Make sure keybindings exist for at least terminal, pcmanfm, main menu, lxpanel and screenshooter. Some day these will come in useful!

Use icons of the .png type as .svg icons do not seem to work. By the way, there is nothing sacred about the bloated, repetitive dull icon sets included in distro installs. Get a nice image editor like PhotoFiltre and create your own. I keep a special icon directory in my network storage just for LXDE installs. One of the first things that I do to a new install is copy this set of icons to /usr/share/icons, and then use them as needed. Most distributions appear to have icons stored in numerous directories. One particular bountiful one in some distributions is /usr/share/app-install/icons. See section 20 below for others.

I also keep a stock openbox menu.xml to use to replace the ones in a new install. Again, see Openbox Menu for an expanded discussion on setting up Openbox menus and all the useful things that can be included.

4. Panels & Autostart

Right click anywhere on an open space in a panel (the default after the install is usually for just a bottom panel) to get a menu for that panel. Choosing Panel Preferences brings up 4 categories - Geometry, Appearance, Panel Applets, Advanced - for editing. Here you can change the panel geometry, appearance and applets. The Advanced category offers the choice of hiding the panel and/or allowing windows to cover an unhidden panel (uncheck the two boxes in Properties). Clicking Add-Remove also brings up a menu to add applets and one to add any application in the Main Menu. To add applications, click Add>Application Launch Bar>Add, which will bring up a second box and put an empty spot on the right side of the Panel. In this second box choose the application you wish to add to the panel, click it, then click add. For example, if you want to add Firefox, click the + sign by Internet and a list with Firefox appears. Click Firefox>add. Continue this procedure with each application that you want in this group. Applications are added in groups, because an empty space on the panel is generally obtained only between groups and not between applications in the same group, However, even the latter can be achieved by just adding an Application Launch Bar without specifying an Application. So you should decide ahead which applications you want on the taskbar and how you want them grouped. All the application groups, other stuff and spaces can be ordered by highlighting and using the up and down arrows. You will notice the icon for a new applications will always first appear on the right side of the panel. Highliting it in the main list and repeated clicking up will move the app's icon on the panel to the left. Clicking down will move it to the right. For more details and pictures of these procedures, see Configuring LXPanel.

Occassionally people have had the LXDE panel misbehave (freeze, disappear, ...), especially when compiz is installed and multiple instances of libre office are open. In such instances, Lxpanel can be generally relaunched by putting the following into the terminal:

   lxpanelctl restart,

or by recalling it with a keyboard combination, provided you set that up as described above. A third remedy can be constructed by adding a lxpanel launcher to the Openbox menu as described in Section 3 above. Use

   <execute>lxpanelctl restart</execute>.

Another reasonable solution to a disappearing lxpanel is to replace it with the very configurable and lightweight (1011 kb) tint2 panel. Be sure to put @tint2, into the /etc/xdg/lxsession/LXDE/autostart file. See Tint2 Guide for putting applications and the Main Menu on a Tint2 panel. One of my bottom Tint2 panels with a Main Menu and a couple of applets on the left side:
xfce4-tint2 panel

There are 2 autostart files, a general one associated with the LXDE desktop and a local one associated with Openbox. There is also a local autostart directory associated with Openbox. These are located at

   /etc/xdg/lxsession/LXDE/autostart
   ~/.config/openbox/autostart.sh
   ~/.config/autostart.

If the lxde-core desktop is installed, then the lxde-autostart takes precedence. If only Openbox is installed or lxde-autostart doesn't do the job, then the best bet for autostarting something is putting an application desktop file (see Section 11 below) for it into the ~/.config/autostart directory. This seems to always work.

5. Wallpaper, Rotator & Wallpaper Geometry

In a traditional set-up wallpaper can be changed by terminal launching a wallpaper GUI:

   pcmanfm --desktop-pref,

or by directly editing ~/.config/pcmanfm/LXDE/pcmanfm.conf. The default wallpaper folders are /usr/share/backgrounds and /usr/share/lxde/wallpapers.

rotator.sh

#! /bin/bash

DIR=~/Wallpaper/
FLOOR=1
RANGE=`ls -1 "$DIR"/*.jpg | wc | awk '// {print $1}'`

number=0

while [ 1 -eq 1 ]; do

   number=$RANDOM
   while [ "$number" -le $FLOOR ]; do
      number=$RANDOM
   done
   let "number %= $RANGE" # Scales $number down within $RANGE.
   COUNTER=1
   for X in "$DIR"/*.jpg
   do
      if [ $number -eq $COUNTER ]; then
      pcmanfm --set-wallpaper "$X"
      fi
   COUNTER=$(($COUNTER+1))
   done
   COUNTER=1
   sleep 5m
done

Wallpaper pictures look best if their size mimics the screen resolution. For example, if your resolution is 1680x1050, then only use pictures 1680 pixels wide and 1050 pixels high. To use photos whose dimension proportions are not 1680 to 1050, first change the photo size, maintaining dimension proportion, so that either the width is 1680 and the height is less than 1050, or the height is 1050 and the width is less than 1680. Then center your photo on a colorful 1680x1050 canvas, and the result is set to go as wallpaper. All this can be easily accomplished by using a simple photo editor like PhotoFiltre Editor, which has the exact tool (Tools>Automate Batch) needed to resize and canvas batches of images. PhotoFiltre saves your settings, and thereafter, resizing and canvassing takes about 1 second per image to do a batch.

A great shell script to set-up an automatic rotator (slide show) for wallpaper is given by Longform in the Pclinuxos Forums. The script is given on the right. Just copy and paste it with your text editor, edit DIR= and sleep to your desire, and save as rotator.sh, wherever you like. I use the directory, ~/bin, present in some distributions (just create it if not present), for special programs like this and Wine programs, forgoing the Linux default ~/.wine/drive_c/'Program Files' directory. This makes these programs quickly accessible, ownership is automatic and editing is quick and easy. Make rotator.sh executable and put @~/bin/rotator.sh in /etc/xdg/lxsession/LXDE/autostart. I also forgo the Linux default wallpaper directories identified above by creating a special wallpaper directory, ~/Wallpaper, in my home directory. So DIR=~/Wallpaper/ is the address in my rotator.sh script.

To cap the wallpaper story for LXDE, install a small application, webilder, which is an automatic, but controllable, picture downloader from Flickr, a great source of interesting images. Webilder also contains a wallpaper rotator, but it does not work in LXDE. To install webilder, download the .deb file from webilder.org, and install using gdebi. Launch webilder_desktop (use run or terminal if not in the menu) to get a GUI for adjusting the rate, type, destination, etc of the downloads.

6. Installing Handbrake

Add (as root) the following line to /etc/apt/sources.list:

deb http://www.debian-multimedia.org sid main.

Next, put into the terminal in turn:

sudo apt-get update
sudo apt-get install debian-multimedia-keyring
sudo apt-get install handbrake-gtk.

7. Installing Oracle-Java

Java is one of the equalizers in the operating system world. Pure java programs can be run on any operating system with a good java platform installed. Oracle-Java (sometimes refered to as Sun-Java), probably the best available java, installs easily in Linux and is free to at least home users. We will review some good pure java applications, like Arachnophilia, in the future. Just watch the Applications portion of this page's links. To install Oracle-Java go to the Oracle Website and download the appropriate tarball version (32-bit or 64-bit) of JDK. Suppose you have downloaded jdk-7u4-linux-x64.tar.gz to your Downloads directory. Open it by putting into the terminal:

    tar -xvf ~/Downloads/jdk-7u4-linux-x64.tar.gz.

Be sure the folder name in the above command reflects exactly the name of the jdk file in your Downloads directory. It will be different if you downloaded the 32-bit, or if these instructions are outdated. This should put in your home directory a folder, named something like jdk1.7.0_03. Next:

   sudo apt-get install build-essential
   sudo mkdir -p /usr/lib/jvm/jdk1.7.0
   sudo mv jdk1.7.0_03/* /usr/lib/jvm/jdk1.7.0/ .

Be sure the first directory name in the last command exactly reflects the name of the extracted java folder in your home directory. This command is just moving the downloaded java files to the newly created directory. Now do each of these commands in turn:

    sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
   sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
    sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1 .

Next, creat a Mozilla plugin in your home directory:

   mkdir ~/.mozilla/plugins/ .

Finally, create a symbolic link to your Mozilla plugins folder. For 32-bit systems, replace "amd64" with "i386":

   ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/ .

You can now use Synaptic and remove openjdk-7-jre and the other icedtea and OpenJDK installations. Finally, as insurance to make sure that OpenJDK remnants are not going to confuse your computer, configure your java components to make Oracle-Java the default:

   sudo update-alternatives --config javac,
   sudo update-alternatives --config java,
   sudo update-alternatives --config javaws.

See the next section for a guide to putting Java on the Lxde-menu. Java applications come in files carrying the suffix .jar in their name. To launch an app.jar, put the following in the terminal:

   sudo java -jar path-to-app.jar

8. Installing Lxmed & Lxmenuman

lxmed
Download lxmed-20110717.tar.gz from sourceforge to your Downloads directory. This is a tarball, a compactification of something else, in this case, the lxmed installer. A program for installing a tarball will be usually in the package as a text file with a name that includes install or read me. Some may come with all the files already built and installation simply requires moving these files to the appropriate directory in your computer. This is the case here. Lxmed installation recipe:

    cd Downloads/lxmed
    sudo apt-get install build-essential
    sudo mkdir -v /opt/lxmed
    sudo cp -v content/lxmed /usr/bin
    sudo chmod -v +x /usr/bin/lxmed
    sudo cp -v content/LXMenuEditor.jar /opt/lxmed
    sudo cp -v content/uninstall.sh /opt/lxmed
    sudo chmod -v +x /opt/lxmed/uninstall.sh
    sudo cp -v content/lxmed.png /opt/lxmed
    sudo cp -v content/lxmed.desktop /usr/share/applications.

A GUI menu editor should now be present: Preferences/Main Menu Editor. Lxmed is a java program and requires a good Java software like Oracle Java to run successfully. The Oracle Java installed in Section 7 may not be on the Main Menu. It is a good idea to have a Java launcher there. Therefore, use lxmed (Main Menu Editor) to put Java on the menu. Use as exec, but first confirm that this is the correct path to javaws in your computer, the following:

    Exec=/usr/lib/jvm/jdk1.7.0/bin/javaws.

   lxmenuman.sh
#!/bin/bash
cd ~/bin/LXMenuMan_1.0.2 && sudo ./lxmenuman
fi
For those who do not want to install a java program, a lightweight menu editor is available from lxmenuman. Simply download the latest tarball version and extract it to ~/bin. Everything is included in the extraction. Launch lxmenuman by putting

   cd ~/bin/LXMenuMan_1.0.2 && sudo ./lxmenuman

in the terminal, or by putting the small shell script shown on the upper-left in ~/bin and using it as a command (execute) in an Openbox Menu entry or .desktop file (see Section 11 below).

9. Menu Categories & MyStuff

New categories can be added to the main LXDE menu. To illustrate, suppose a new category named Favorites is desired. Proceed as follows: