Home Pauline Howto Articles Uniquely NZ Small Firms Search
Fun with Lubuntu

Contents

Introduction

Ubuntu Linux Related Pages

This series of pages was started six years ago and since then a number of topics have been split off into more specialised pages. This page and the pages split off from it are primarily a how I did it story with a lot of detailed information. There are now some additional how you should do it pages for the newcomer. The full set of Ubuntu related pages comprises:

Background to the Writing the series of pages on Ubuntu Linux

I started experimenting with Linux because I have got so tired of the continual updates to Microsoft Windows XP and the associated Virus checkers, Firewalls and Malware detectors. With Windows, it is almost impossible to prevent a large data flow when one first connects and many programs seek information on updates etc. I have noticed that there are dozens of processes running in the background under Windows XP and the hard drive is now in continuous use even minutes after the last user activity has finished. This all makes Windows XP difficult to use securely whilst traveling on a costly mobile connection rather than Broadband.

Linux has come a long way since I first looked at it and many of the main Linux distributions had what are called LiveCD versions where you have bootable CD which allows you to trial the system without having to load anything onto your machine. The next stage is to install a dual (or multiple boot system) and the install programs will automatically partition your disk and put in a boot loader to allow you to choose when the machine starts up.

I did some research and the best seemed to be a Linux distribution called Ubuntu 6.06 (Dapper Drake) which promised a 3 year support (updates, fixes etc.) for the desktop version and has a LiveCD and a simple install from the LiveCD. For those with some prior knowledge Ubuntu is based on the Debian implementation of Linux with the GNOME desktop interface and it has several additional flavours - Kubunto is a variation with the KDE interface, Xubuntu uses the XFCE desktop and most recently Lubuntu using the LXDE desktop which is ideal for lower powered and legacy machines. recently Ubuntu has adopted a home grown desktop called Unity. Ubuntu is directed towards the desktop and is arguably the most popular version for home use, a position it achieved in less than 2 years from the first release. A good background introduction to Ubuntu is given in the Ubuntu Wikipedia Entry. The name comes from the African concept of ubuntu one part of which loosely translates as "humanity towards others".

Before we go any further I should point out one important difference between Ubuntu and many Linux implementations - you do not need to be a root user (administrator) to do system work but can use the terminal command sudo (SuperUser Do) to temporarily carry out root activities after entering a password which 'sticks' for 15 minutes - a big security and safety feature. This is one factor in my choice of Ubuntu along with the extensive and growing support for it in the community and by software providers. You will find that Ubuntu Linux system work is still more terminal oriented than Windows although it is fair to remember that it is virtually impossible to avoid the Run Command completely even in XP Vista and Windows 7.

These page has become a record of my progress with details of all the changes I have made (and how) to the systems so I can repeat them in the future. It started in a sort of chronological order although I have done some re-ordering to avoid swapping back and forwards between different aspects. I have also included many of the links I found useful at the time. I hope it will be useful to others and perhaps avoid yet more reinventions of the wheel - in due course it may become refined enough to became a 'guide'.

It is now in 2014 six years on from the issue of version 6.06 Dapper Drake that I started with. I upgraded most of my machines, without too many tears, to the next Long Term Support (LTS) version 8.04 Hardy Heron and then further LTS versions 10.04 Lucid Lynx and 12.04 Precise Pangolin until finally most machines are upgraded to the 14.04 Trusty LTS version in the Mint 17 and Lubuntu flavours. 14.04 Trusty has much better support for some hardware making much of the original document redundant. I have gradually been updated this document and dropping the parts which are no longer relevant as the versions covered lose support although I will keep the Original for reference and users of Dapper Drake and a frozen copy of Fun with Ubuntu Linux for Hardy, Jaunty and Karmic a as well as Oneiric Ocelot here.

I have extracted the majority of the mobile aspects to a new page - Ubuntu Linux on the Move and have started another new page covering what is perhaps the second most important activity after communications for inveterate travelers like ourselves, that is handling all the photographs we take with digital cameras, viewing them and ultimately putting them into a form that can be used on our web site. Retaining the fun approach I have called it Ubuntu Linux on the Take - it is currently being extended to include capturing video, editing video and authoring DVDs. Ubuntu on the Lookout - covers installing and setting up the main programs which interact with the outside world through the Internet, namely Browsers, Email, Contacts, Calendars and Tasks. Various aspects of Sharing, Networking, Backup, Synchronisation and Encryption under Ubuntu Linux form another page. Logically the next should be "Ubuntu Linux on the Make" covering Web Authoring!

I have written a guide go with the lectures I have given. This guide enables a normal unsophisticated computer user without programming experience to make the transition to Linux with no more hassle than the change from Microsoft Windows XP to Vista. It is titled The Road to Freedom -A progressive migration from Windows to Ubuntu for Safety, Security and Savings in Computing. It is split into two parts and the first part mainly covers Windows and the Base Camp - part two mainly covers Ubuntu.

The proof of a lot of what I have written here is our MSI Wind U100 Netbook which is more powerful than a Toshiba Satellite yet only weighs in at 1.1 Kgs - this is now entirely used with Linux and I have fully covering the transition in Ubuntu on the MSI Wind U100 - it proved so successful we bought a second one so Pauline and I each have one and Pauline rarely uses anything else even at home. I also have a new laptop a Chillblast Defiant.

Introduction to Lubuntu

Lubuntu is a lightweight Linux operating system based on Ubuntu but using the LXDE desktop environment in place of Ubuntu's Unity shell and GNOME desktop. LXDE is far less resource hungry and is closer in many ways to the classic Gnome Desktop many people came to know and love than the new Unity Desktop. LXDE stands for Lightweight X11 Desktop Environment. Lubuntu is targeted at "normal" PC and laptop users running on low-spec hardware. Users who may not know how to, or wish to, use command line tools, but don't have enough resources to run the with all the bells and whistles of the "full-featured" mainstream distributions. Lubuntu received official recognition as a formal member of the Ubuntu family, commencing with Lubuntu 11.10. This means that the Ubuntu team take care of LXDE and other packages that are part of the Lubuntu install and one can even swap between desktops without a complete reinstall. All the programs available under Ubuntu are available through the Synaptic Package Manager and PPAs can also be used.

LXDE is a very lightweight and minimal desktop environment using the Openbox window manager, the PCManFM file manager, and a carefully selected list of default applications. It is compatible with basic freedesktop standards and all necessary parts are already packaged in Ubuntu. It’s surprising what can be achieved when one restricts unnecessary eye-candy and the bloat that Ubuntu is rapidly gaining. Lubuntu only requires 128 MB of RAM to run and 256 MB of RAM to install with the graphic installer although the recommended minimum RAM to run a live CD session is 384 MB.

The LXDE/Lubuntu window manager is Openbox - an OpenSource window manager for the X Window System. Looking under the hood, Openbox is designed to be small, fast, and fully compliant with the Inter-Client Communication Conventions Manual (ICCCM) and Extended Window Manager Hints (EWMH). It supports many features such as menus by which the user can control applications or which display various dynamic information. Openbox allows a right-click "main menu" on the desktop, and allows users to configure the way windows are managed. When a window is minimized it becomes invisible which initial can cause consternation. To bring windows up again most use Alt+Tab or the Desktop menu, accessible from the right-click menu. Openbox is extended under LXDE with small programs that add icons, taskbars,etc.

The PCManFM file manager is arguably a little too light and does not compete with Thunar, leave alone Nautilus and nemo but it's a competent and robust application that doesn't hog resources like Nautilus.

Another major reason why Lubuntu runs fast and uses less resources is that it starts less daemons and services than Ubuntu by default, as you can see in the process list as well as in the menu (Preferences -> Desktop Session Settings -> Automatically Started Applications).

In summary LXDE/Lubuntu fulfills the goal that Xubuntu, with the XCFE desktop was intended to address but currently falls well short of, namely that of providing a lightweight desktop environment on machines with low amounts of RAM. Tests show Lubuntu can use half as much RAM as Xubuntu making it an attractive choice for netbooks, mobile devices and, in particular, older PCs with "minimal" or legacy hardware. I am now using it on machines which do not have the graphics to run Mint which I am running on all other machines.

A Lubuntu Project - using a legacy machine as a network music player

Whilst I was starting to write up about Lubuntu I came up with the idea of using an actual 'project' I am using Lubuntu for on an old laptop - a Toshiba Portege 3440. The Portege was a classic machine in it's time, a slimline wonder designed to use Windows SE and upgraded to have a 30 Gbyte hard drive, 192 Mbytes of memory and sporting a 500 Mhz Pentium processor and running under Windows XP professional when I got it. It was one of the first machines I used for Ubuntu 6 years ago and even back then it was difficult to install with 192 Mbytes RAM and a special dock with a slow CD drive. By various tricks and the use of an external USB CD as well as the dock I succeeded but that is another story. Lubuntu is an obvious choice, I tried Xubuntu but it was struggling but Lubuntu is fine for what I want. I want to be able to play my music through the hifi which is held on a hard drive, along with videos and pictures on one of my main machines. There is probably no reason why pictures should be a problem but lets consider playing music in a simple way. So some of the requirements are:

Requirements for the network music player

The machine should be set up so it starts up, mounts the music over the network and starts the music player automatically with no need for passwords etc yet in a way that security is maintained and use a music player which is well indexed and enables one to easily find any piece of music. Much of the background work has already been done and solutions to playing music from a network source is already covered in Ubuntu Making Music so I really only want to cover the specifics of how to set up the Lubuntu Machine. So we need to consider:

 

How to Automatically Login to Lubuntu (with LightDM greeter)

This does not mean that you will not need the password for any administrative activities using Sudo but is ideal for a machine used for routine tasks like playing music. For security it is best to automatically login in to a user without administrative rights such as Sudo

First we need to edit (or create if it does not exist) the file /etc/lightdm/lightdm.conf with the following contents. This needs to be owned by root so, in a terminal:

sudo leafpad /etc/lightdm/lightdm.conf

and copy and paste so the file has the following contents with yourusername replaced with your actual user name:

[SeatDefaults]
autologin-user=yourusername
autologin-user-timeout=0
user-session=Lubuntu
greeter-session=lightdm-gtk-greeter

If you wish to stop using autologin then comment out the lines starting with autologin as below

[SeatDefaults]
# autologin-user=yourusername
# autologin-user-timeout=0
user-session=Lubuntu
greeter-session=lightdm-gtk-greeter

The timeout value seems to have no effect which means there is no way to operate with multiple users as you never see the choices before the login takes place. This is bug https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/902852 so it will hopefully be cured shortly.

How to automatically start wifi after an autologin

Autologin may seem a very insecure way to operate however there are a number of built in protection mechanisms in Linux (gnome) and one of those will prevent use of wifi after an autologin. When you login normally a 'keyring' which holds a lot of sensitive information such as wifi access codes (WEP, WAP etc) and passwords for other machines when you are networking. This is not unlocked when you do an autologin and the first time you try to access it - which is normally the automatic starting of wifi - it will produce a box asking for you logon password with words like "Enter Password to Unlock your Login Password" or it may refer to a default keyring. The general solution to this in the conferences is to delete the keyring or remove the password - This Is Not The Way - Never delete keyrings or their passwords as it is very insecure. The correct way is very simple and is to change the wifi settings to 'available to all users' which just removes the keyring requirement for wifi by:

  1. Logout and login normally using a password - you now have your usual access to everything.
  2. Right click your wireless (Network Manager) icon in the tray and click Edit Connections.
  3. Click the Wireless tab, highlight your wireless connection, then click Edit.
  4. At the bottom there is a checkbox called "Available to all users". Click it then click Apply to save your change.
  5. It will ask for your password because it is a system-wide change, but that's it! You, or anyone else you make an account for can now log on and get the wireless connection without anyone having access to your other passwords in an unencrypted form.

Creating Launchers for the Lubuntu desktop - LXShortCut

You can put any item in the menu onto the desktop with a right click but there seems to be no built in way to create your own Desktop Launchers for LXDE (the graphic environment of Lubuntu), you can create .desktop files with a text editor (imitating the ones in /usr/share/applications) but it's much easier to run lxshortcut in a terminal.

lxshortcut -o ~/Desktop/new_desktop_shortcut.desktop

And a window, will pop up with all the fields you need to define (including an icon), save - that's it, you have a new shortcut icon on your desktop which you need to make executable (right click -> properties -> Permissions and tick box) and you should also rename it.

Autostart Programs in Lubuntu

1. Using .desktop files in the autostart folder (for a single user)

Any shortcut files in the folder at /home/username/.config/autostart will be run during the login sequence.

Use lxshortcut as above to create a new shortcut which you can test on the desktop then copy it into ~/.config/autostart/

Once .desktop files have been added you can manipulate them with the GUI configuration tool lxsession-edit (not yet tried)

You can also link a program's .desktop in /usr/share/applications/ file to ~/.config/autostart/. For example, to execute lxterminal automatically at startup:

$ ln -s /usr/share/applications/lxterminal.desktop ~/.config/autostart/

2. Using the autostart files (single user or global files exist)

The second method is to use a ~/.config/lxsession/Lubuntu/autostart file. This file is not a shell script, but each line represents a command to be executed, if a line begins with a @ symbol, the command following the @ will be automatically re-executed if it crashes. There is also a global autostart file at /etc/xdg/lxsession/LXDE/autostart. If both files are present, all entries in both files will be executed.

Dropbox and Lubuntu

A good example is Dropbox - This can be installed using the .deb file for Ubuntu from the Dropbox site but the Daemon is not automatically started in Lubuntu so it needs to be run using dropbox start

For example, to run dropbox every time we can use the autostart file to execute dropbox start automatically at startup. So in a terminal:

sudo leafpad ~/.config/lxsession/Lubuntu/autostart

and add the following string to either the new file or at the bottom of the existing contents -

@dropbox start

Note: The commands do not end with a & symbol.

 

Mounting a Remote File System securely using SSHFS for use by the media player

There are ways to add security when accessing the remote file system which contains our Media Files. The usual way is to use SSHFS but this is an involved process to set up and is not unique to Lubuntu. For completeness the following is extracted from Ubuntu All Together - Sharing, Networking, Backup, Synchronisation and Encryption with some additions specific to this application. The basic setting up of SSH and the associated Hostname Resolution required on a Network is also covered more fully Ubuntu All Together - Sharing, Networking, Backup, Synchronisation and Encryption - Enabling Hostname Resolution under Ubuntu

SSHFS (SSH File System) uses SSH to mounting a remote filesystem on a local machine. SSHFS uses FUSE (Filesystem in Userspace) which is included in Ubuntu and authenticates connections so only those who are authorised can mount them. SSH connections are encrypted, no one can see your files as they are transferred over the network and once mounted the FUSE filesystem is owned by the user that created it and other users on the local machine can not access them.

Firstly we must install sshfs using the Synaptic Package Manager by System -> Administration -> Synaptic Package Manager -> Search for sshfs, Right Click and Mark for Installation -> Apply.

Secondly you need to add yourself to the fuse group. Under Ubuntu 12.04 the settings via Users and Groups has been castrated and you can no longer set up or change individual Groups so it is back to the terminal. You can check the groups you are in (and get some other useful information), in a terminal, by typing:

id

The output from id on my system which works with gnome-PPP looks like:

pcurtis@vortex-ubuntu:~$ id
uid=1000(pcurtis) gid=1000(pcurtis) groups=4(adm),20(dialout),21(fax),24(cdrom),
25(floppy), 26(tape),29(audio),30(dip),44(video),46(plugdev), 104(fuse),
105(lpadmin),112(netdev),119(admin),122(sambashare),1000(pcurtis)
pcurtis@vortex-ubuntu:~$

The following commands will add YOURUSERNAME to the fuse group which is required to use SSHFS:

sudo adduser YOURUSERNAME fuse

Once you have added yourself to the fuse group, you need to either log out and log back in again or reboot for the change to take effect. I suggest checking again with id

There is a risk that your ssh session will automatically log out if it is idle. To keep the connection active add the following parameter to ~/.ssh/config or to /etc/ssh/ssh_config on the client.

ServerAliveInterval 15

This will send a "keep alive" signal to the server every 15 seconds.

Using sshfs in a Terminal

A local mount point must exist and have permissions set for you to use it before you connect. If you have it in your home directory you can use the file manager to create the new directory which will have the correct permissions.

Assuming that you have ssh installed and the server running on the remote machine you now just need to run the sshfs command to mount the remote directory. In a terminal type:

sshfs -o idmap=user username@remotemachine:/remotefolder ~/localfolder

The idmap=user option ensures that files owned by the remote user are owned by the local user. If you don't use idmap=user, files in the mounted directory might appear to be owned by a different user.

You can not unmount a FUSE file system mounted this way in a terminal using eject or unmount from a right click or nautilus; To unmount you again have to use the terminal and do:

fusermount -u ~/localfolder

Using Public Key Authentication with ssh and sshfs to avoid password requests

It is often inconvenient to have to provide a password when one logs into a remote machine using ssh and impossible if you are automatically mounting a file system at login. The way round this is to use public/private key authentication instead. The key is encrypted and passed between the machines but there is obviously a security implication as anyone who gains access to one machine has access to the other. There is a good introduction to ssh at http://kimmo.suominen.com/docs/ssh/ which covers this.

The following procedure allows one to set up access via a public/private key pair between two machines running OpenSSH. You should first check that you can log in to the remote machine and are authenticated on it. When running ssh-keygen you will be prompted for a file name and a passphrase. Simply hit the return key to accept the default file name, and enter no passphrase at this time - you can and should enter one a latter stage to improve security. scp is a command for a secure copy using ssh which is part of the ssh package. The command examples below need to be edited to use your own machines and usernames. It assumes you are logged in as username1 on host1 and want remote access to username2 on host2. Run the following commands in a terminal.

cd .s
ssh-keygen -t dsa
scp id_dsa.pub username2@host2:/home/username2/.ssh/host1_username1_id_dsa.pub
ssh username2@host2:
cd .ssh
cat host1_username1_id_dsa.pub >> authorized_keys

You should find that you no longer have to provide a password when using ssh sshfs scp etc. If it ever stops working try ssh in terminal as it is possible the ip addresses have changed and you need to reset things by deleting ~/.ssh/known_hosts and doing a new ssh login. This gets tedious after a few IP address changes (due to DCHP) and you can make the following change to configure the secure shell (ssh) on the local machine not to check the IP, again with a reduction in security. You find the ssh configuration file in /etc/ssh/ssh_config

sudo leafpad /etc/ssh/ssh_config

and the section to change is:

####### CheckHostIP
#
# If this flag is set to "yes", ssh will additionally check the
# host ip address in the known_hosts file. This allows ssh to
# detect if a host key changed due to DNS spoofing. If the option is
# set to "no", the check will not be executed.
#
CheckHostIP no

Scripts to Mount and Unmount the Media on Matrix (my server machine) using sshfs (or djmount)

I have written two scripts to mount and unmount the media. The mounting script has delays to ensure that the Wifi is up when it is added to the startup program list activated at login. Both scripts check whether the file system was already mounted and has been successfully unmounted and put up alert boxes. This script requires zenity to be installed to display the alert boxes.

#!/bin/bash
# Script to mount server on matrix ~/mediamount using sshfs.
# Assumes that password is not needed.
# Assumes that local mount point has been set up in ~/mediamount
# and has correct permissions
# Script lives in ~/bin/sshfs_mediamount where it must be given execute permissions
# and ~/bin should have been be added to to #PATH in ~/.bashrc
# by adding the line
# PATH=$PATH:~/bin
#
# Check if Media Folder already has contents
if [ "$(ls -A ~/mediamount)" ]; then
  zenity --info --text "Media Folder was already available for Media Players to use"
else
# Allow time for Wifi to come up when script automatically run at login
  sleep 35;
  sshfs -o idmap=user pcurtis@matrix:/media/DE_MEDIA ~/mediamount;
# Alternative for djmount
# djmount ~/mediamount;
#
# Check mediamount folder now has contents
  if [ "$(ls -A ~/mediamount)" ]; then
    zenity --info --text "Media Folder has been successfully Mounted for Media Players to use"
  else
    zenity --warning --text "Media Folder mounting failed - is Matrix turned on? If not turn on and try again using the Desktop Icon";
  fi
fi

#!/bin/bash
# Script to unmount ~/mediamount
# This script requires zenity to be installed to display alert box.
# Lives in ~/bin/unmount_localmedia where it must be given execute permissions
# and ~/bin should have been be added to to #PATH in ~/.bashrc
# by adding the line
# PATH=$PATH:~/bin
fusermount -u ~/mediamount
# Confirm folder is now empty
if [ "$(ls -A ~/mediamount)" ]; then
  zenity --warning --text "Media Folder Un-mounting failed - is it in use?"
else
  zenity --info --text "Media Folder has been successfully Un-mounted"
fi

 

 

Lubuntu - Tips and Tricks

PCManFM File Manager Features and Tips on Effective Use

PCManFM's features include:

Full gvfs support with seamless access to remote filesystems (Able to handle sftp://, webdav://, smb://, ...etc when related backends of gvfs are installed.)
Thumbnails for pictures (default is only for local pictures)
Desktop management - shows wallpaper and desktop icons which can be positioned but does not support drag and drop onto icons or Trash.
Bookmarks - saved places. You can see them in the left panel of PCManFM.
Multilingual (translated in several languages)
Very fast start up and quick loading of directories
Tabbed windows (similar to Firefox tabs)
Volume management (mount/umount/eject, requires appropriate gvfs backends)
Drag & Drop support
Files can be dragged among tabs
File association support (default application)
Provides icon view, compact view, detailed list view and thumbnail view.
Complies with the FreeDesktop.org guidelines
Clean and user-friendly interface (GTK+ 2)
Trash support (but not on Desktop)

The list above is based on the lxde wiki with a few additional clarifications

PCManFM now uses a GVFS backend so you can use the ssh://user@server/path/to/directory to remotely access files on other computers from within PCManFM using SSH (Basically, it's sshfs). This feature does not show up in Go or Places but having set up a connection you can add it to your Bookmarks. There is a minor problem about this though - there is no apparent way to eject the volume. The best you can do, from what I can tell, is kill the ssh process. For background GVFS is the virtual filesystem for the GNOME desktop, which allows users easy access to remote data via SFTP, FTP, WebDAV, SMB, SSH and local data via HAL integration, OBEX and others. The list of special addresses that I have discovered so far comprises

Two useful features in PCManFM are Tools -> Open Current Folder in Terminal and Tools -> Open Current Folder as Root, these tools save a lot of clicks and typing. The permissions tab of the File Properties Window allows one to change file permissions. PCManFM will display a small warning icon in the toolbar while you are running it as root to remind you to be careful. Picture thumbnails are supported, but you may need to increase the maximum file size from 1024 KB in the Preferences dialog to view high resolution photos.

 

Customising the Desktop - adding Launchers

Have you ever wondered how the 'launchers' for programs and internet links which are in menus and on the desktop work and how you can add them or make your own? Making your own has become increasingly difficult with Ubuntu - it is almost as if Ubuntu is trying to discourage the use of the desktop with Unity and there is not even an easy way to add launchers for existing programs one can find with the dash to the desktop.

Lubuntu is better in many ways than Unity and you can easily add any program which is in the main menus to the desktop straight from those menus by right clicking the item and 'Panel Settings' makes it easy to add them to a panel. There is also a tool to help you create new launchers for the main menu or the desktop - it provides a graphical interface but has to be launched from the terminal or a run box by:

lxshortcut -o ~/Desktop/new_desktop_shortcut.desktop

You can add also them to the menu by:

lxshortcut -o ~/.local/share/applications/new_menu_shortcut.desktop

Application Shortcut

This is what the window looks like when it is filled in to generate a Network Icon on the desktop and it generates a file which I called pcmanfm_network.desktop with the contents:

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Network
Name[en_GB]=Network
Icon=/usr/share/icons/gnome/48x48/places/network_local.png
Exec=pcmanfm network:///
Comment[en_GB]=Local Network Browser
StartupNotify=true

More about Desktop Entry files (.desktop)

When you see a 'launcher' on the desktop you are actually seeing the representation of a Desktop Entry File which ends in .desktop. In Lubuntu you can right click them and open them in leafpad or gedit and you will find they all follow a standard format. When a program is installed it places a launcher (.desktop file) in one of a few well defined places. Programs which are accessible to all users have a launcher (.desktop) file in /usr/share/applications or sometimes in /usr/local/share/applications . Programs which are unique to a user such as wine place their launchers in ~/.local/share/applications - in the case of wine they are in ~/.local/share/applications/wine/Programs/programfolder. When a user needs a specific or modified launcher those in ~/.local/share/applications take priority when the menus are created but the menus are usually only created at login time so modifications are not apparent until a logout and re-login has taken place.

The full format for a Desktop Entry Specified in http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html but only a few of the entries and mandatory. So lets look at a typical .desktop file for Catfish, a file searching program where I have put in red the Mandatory entries and those which the lxshortcut program handles in orange - see an example above of its output. The other entries are usual - Comment gives a tooltip, Icon does what it says, Terminal specifies whether to run in a terminal so normally false or left out, StartupNotify is more complex and invokes a mechanism allowing a desktop environment to track application startup, to provide user feedback and other features (probably leave out if you are creating your own unless you are absolutely sure of what you are doing!). Note that in this case all the programs and icons etc are in the path which is searched - if you are creating your own it is safest to specify the full path for the executable (and icon if you want to avoid it changing with the theme).

[Desktop Entry]
Version=1.0
Type=Application
Name=Catfish
Exec=catfish

Comment=File search
Icon=catfish

Terminal=false
StartupNotify=true

We have already covered lxshortcut to generate these files in a GUI and Lubuntu (LXDE) has a menu editor and desktop files creator under development called lxmed which is not in the repositories or a PPA see http://lxmed.sourceforge.net/help.html - I have tried it and it shows promise but is still a beta and it is not easy to install at this stage. However it does allow tuning of the menu and gives an easy way to get to and edit launchers. Doug has an excellent page on tuning LXDE which has a first class introduction to desktop files at http://douwil7.100webspace.net/linux/Tuning.html#11 which is applicable to many distributions.

Using Bluetooth in Lubuntu

I have recently bought a very cheap miniature USB Bluetooth adapter to give Bluetooth access to one of my phones for internet access from an old laptop without bluetooth built in. My Lubuntu machine was to hand when I wanted to test it out so I plugged it in and rapidly came to realise that the Bluetooth support I expect from an Ubuntu system was not installed. I expected a Bluetooth Indicator Applet to be running in the system tray area either all the time or when a bluetooth device was enabled which would allow basic detection and pairing etc. So I now had the problem of knowing whether any problems were with the dongle or the system! So how does one proceed to check a device has been initially recognised [correctly] and drivers made available etc.

There are two easy ways - one is to look at the kernel message log using dmesg | tail in a terminal after the device has been plugged in and there should be some entries at the end which give a clue as what has gone on. The second is to run lsusb ( stands for List USB) in a terminal and the bluetooth device should again show up. The output looked like:

pcurtis@satellite:~$ dmesg | tail
........
[ 138.845937] PPP BSD Compression module registered
[ 138.877643] PPP Deflate Compression module registered
[13497.788087] usb 3-2: new full-speed USB device number 3 using ohci_hcd
pcurtis@satellite:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
pcurtis@satellite:~$

This is promising and one can see that the dongle is a Cambridge Silicon Radio, Ltd Bluetooth Dongle operating in HCI (Host Controller Interface) mode and that the kernel has recognised it and installed it as a full speed USB device and is using the ohci_hcd module for access.

I then looked through all the preferences and system tools menu items looking for things to do with bluetooth and found a Bluetooth Manager and ran it. It looked very different to want I expected but seemed to do some of the usual things and I could use it to pair the phone giving me confidence that the dongle was working. It put an indicator into the panel but did not have any obvious options to keep it, or the bluetooth daemon running through a restart. I continued a dual pronged approach and googled 'lubuntu bluetooth' and ran the Synaptic Package Manager and searched for 'bluetooth' on my lubuntu machine and one with a full ubuntu 12.04 which I use bluetooth with all the time.

Inspecting the search results from Synaptic revealed many differences but the most important seemed to be that Lubuntu used blueman as a bluetooth manager whilst Ubuntu had bluetooth providing the bluetooth services and gnome-bluetooth providing all the tools including the appindicator.

The web search confirmed that the usual ubuntu approach required, as a minimum, one to install bluetooth and bluez-utils . This provides the basic utilities and the bluetooth daemon is set up and runs automatically but does not provide all the networking or the bluetooth appindicator which needs gnome-bluetooth which brings in a raft of extra programs which is not ideal for a lightweight distribution.

For my purposes of having a bluetooth tethered internet connection through my mobile phone using gnome-ppp the extra steps before using my existing procedures in Ubuntu Mobile - Bluetooth Connections to Mobile Phones with inbuilt Modems are:

sudo apt-get install bluetooth bluez-utils

Remember to add yourself to the dip and dialout groups or gnome-ppp will not work - this is the same in Lubuntu and Ubuntu. Everything else is in Ubuntu Mobile - Bluetooth Connections to Mobile Phones with inbuilt Modems and the internet access worked fine on my new dongle when I worked through all the stages.

I left blueman installed so I could pair etc easily without the overheads of installing gnome-bluetooth and it also allows one to send files to the phone, for example contacts. If you install gnome-bluetooth you should probably remove all blueman created pairings and uninstall blueman after which the the wizard should be able to create a dial-up connection in the network manager so you do not need to use gnome-ppp however that has been bug ridden recently so I prefer gnome-ppp even if it takes a lot of initial work.

If you want full file sharing the read http://neilobremski.wordpress.com/2011/04/10/lubuntu-and-bluetooth-file-copy/

 

Lubuntu - Tips, Tricks and Bug Workarounds

Customising Panels and the Desktop

ScreenshotIt is very easy to do some simple customisation- I will start by adding an extra panel which will contain all the programs we will need to use - have a look what it looks like on the left when it is not hidden

If one right clicks in the empty area of the panel at the bottom one gets a menu which has an item Add New Panel which opens a window like the one below which is how I have my extra panel on the left set up on the Geometry tab

Screenshot

This is the Panel Applets tab and I have already Added an Application Launch Bar with a spacer at top and bottom

Screenshot

Next we highlight the Application Launch Bar and click Edit to add Items (from the main menu) the window to do so looks like the following

 

Screenshot

After we have added and ordered the programs we want we finally want to set it up on the Advanced tab to autohide just leaving a narrow bar to remind us that it is there.

That I think shows how easy it is to customise Lubuntu

Restoring the Quick Search which has been disabled the Synaptic Package Manager in Lubuntu

The quick search feature in Synaptic is disabled by default, due to hanging on some systems with it enabled. However if you are confident that this won't happen to you, it is easily enabled. Just open a LXTerminal session and enter the following command:

sudo apt-get install apt-xapian-index

It has an additional dependency it wants to install to function properly. After installation it will index the repositories, which will take few minutes the first time. After this small venture to the terminal it should work properly again.

Bug with Rhythmbox and Exaile in Lubuntu - should have been fixed by 14.04

Both these media players crash in Lubuntu because there is effectively an unmet dependency in that they need gstreamer0.10-alsa to link to the sound system when they start to play. You will find various messages on the screen or in a terminal if you run from the command line when you start to play. These include:

Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started

Another message is

audiosink bin 1 is not working

This took me a good part of a day before I discovered from a remote posting that the solution is simple - just install gstreamer0.10-alsa by

sudo apt-get install gstreamer0.10-alsa

You will also need ubuntu-restricted-extras or specific other gstreamer packages to play MP3 files. ubuntu-restricted-extras brings in a wide sweep of useful programs, fonts and codecs but does take up a fair amount of space. If not try gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly and gstreamer0.10-ffmpeg

Restoring Dropbox Icons to coloured defaults

The standard icon themes used by Lubuntu change the Dropbox icon in the panel to dark grey colour and it is very difficult to see when Syncing is required or taking place. It is possible to find the icons for the theme you are using or the defaults that it reaches and to disable them forcing Dropbox to use its own defaults which are blue with a green tick when everything is in sync. First you have to search for the icons to disable - I found them in /usr/share/icons/elementary/panel/22 and they all start with dropboxstatus and are type .svg . I renamed them to have a .svg-default ending you then need to update the icon cache and stop and restart dropbox to see the changes

It is best to do a search for the icons and you may wish to install Catfish which is a very fast file search program

apt-get install catfish

sudo nautilus /usr/share/icons/ # modify to reach the required directory and disable the icons

sudo update-icon-caches /usr/share/icons/elementary/panel
dropbox stop
dropbox start

This may not be a very permanent as the changes could well be overwritten if the theme is updated.


Workround and Solution to Execute in Terminal not working in PCManFM Bug

I keep a few scripts on the desktop for common actions such as rebuilding wifi drivers and in Ubuntu you can double click them and choose Execute in Terminal. In Lubuntu which uses PCManFM you get the option but it does nothing. This is reported as a bug on PCManFM at https://bugs.launchpad.net/ubuntu/+source/pcmanfm/+bug/975152

A workround until this is fixed is to create launchers (.desktop files) on the Desktop for the scripts which explicitly start the script in the terminal by an entry such as Exec=lxterminal -e "bash /home/yourusername/rtl8192cu.sh"

Note ~/ and $HOME do not seem to work in the path to the script. lxshortcut can be used to create launchers.

A little after producing the workround I realised what the problem is - the default setting for the terminal is wrong in Lubuntu. Do Edit -> Preferences -> Advanced Tab and add the option -e to the string so it reads "x-terminal-emulator -e %s" - this calls lxterminal with the -e option which opens the terminal and executes the command line in %s. See man lxterminal. For more clarity change the string to "lxterminal -e %s"

Screenshot


Stop the scroll wheel on your mouse changing the Desktop Workspace.

Lubuntu is usually set up so the scroll wheel on the mouse and equivalent actions on a touchpad can be used to change workspace when hovering over the desktop - this can be inconvenient as it is easy to do accidentally especially with a touchpad

Make a backup and open lubuntu-rc.xml

cd ~/.config/openbox
cp lubuntu-rc.xml lubuntu-rc.xml.bak
leafpad lubuntu-rc.xml

Search for and comment out lines which look like:

<mousebind button="UP" action="click">
<action name="DesktopPrevious" />
<mousebind button="Down" action="click">
<action name="DesktopNext" />

Log out and Log in back again to see the changes.

Touchpad settings

Edit ~/.config/lxsession/Lubuntu/autostart with the respective values to achieve the desired result on the following.

These are a few of the options. Check the man pages for synaptic (the driver options), synclient (interfaces with the driver), & syndaemon (handles relationship between keyboard and touchpad).

You can view current settings with

synclient -l


Enable horizontal two finger scrolling

@synclient HorizTwoFingerScroll=1

Disable tap to click

@synclient MaxTapTime=0

Disable coasting (scrolling after release)

@synclient CoastingSpeed=0

Disable touchpad while typing

@syndaemon -d -t

Optionally add -k to allow for modifier keys so that you can do CTRL-click, for example.

See https://help.ubuntu.com/community/Lubuntu/Mouse for more details.

 

Truecrypt

I use Truecrypt on all my machines and despite various well documented shock withdrawal by the authors it is still well regarded, safe and available for download. See https://www.grc.com/misc/truecrypt/truecrypt.htm. There are many conspiracy theories based round the fact that the security services could not crack it for its sudden withdrawal. It:

It creates a Virtual Disk with the contents encrypted into a single file or onto a disk partition or removable media such as a USB stick. The encryption is all on the fly so you have a file, you mount it as a disk and from then on it is used just like a real disk and everything is decrypted and re-encrypted invisibly in real time. The virtual Drive is unmounted automatically at close down and one should have closed all the open documents using the Virtual Drive by that point just like when you shut down normally. The advantage is that you never have the files copied onto a real disk so there are no shadows or temporary files left behind and one does not have to do a secure delete. I have loaded it onto two of my Windows systems.

Truecrypt obviously installs deep into the operating system in order to encrypt decrypt invisibly on the fly. This has meant in the past that it was specific to a Linux Kernel and had to be recompiled/installed every time a Kernel was updated. Fortunately TrueCrypt has now reached version 7 which can be downloaded as as an installer for both 32 and 64 bit versions of Ubuntu – make sure you get the correct version. The installed is packed into a compressed file .tar.gz just double click truecrypt-7.x-ubuntu-x86.tar.gz to open the archive and drag the folder to the desktop, double click it then click 'run in Terminal' to run the installer script.

This linux version of Truecrypt is a great improvement and has a GUI interface almost identical to that in Windows. It can be run by just typing truecrypt in a terminal or from a launcher. It opens virtual disks which are placed on the desktop. Making new volumes (encrypted containers) is now trivial – just use the wizard. Old files can be opened but it is best to create a new volume and copy the contents across. This is now a very refined product under Linux.

The only feature I have found is that one has to have administrative privileges to mount ones volumes. This means that one is asked for ones administrative password on occasions as well as the volume password. There is a way round this by providing additional 'rights' specific to just this activity to a user (or group) by additions to the sudoer file. There is information on the Sudoers file and editing it at:

https://help.ubuntu.com/community/Sudoers

Because sudo is such a powerful program you must take care not to put anything formatted incorrectly in the file. To prevent any incorrect formatting getting into the file you should edit it using the command visudo run as root or by using sudo ( sudo visudo ). The default editor for visudo is nano, a terminal editor, which looks incomprehensible at least to those used to Windows.

You have to use nano in the terminal with great care - the commands are at the bottom. There is a good and enthusiastic description and guide for nano at http://www.tuxradar.com/content/text-editing-nano-made-easy . The cut and paste commands in nano are different and do not use the 'standard' clipboard but you can use right click cut and paste to get text into nano and the middle click also works for highlighted text.

There are two ways to proceed, if you have a lot of users then it is worth creating a group for truecrypt, changing truecrypt to be a member of that group and adding all the users that need truecrypt to that group. You then use sudoer to giving group members the 'rights' to use it without a password. See:

http://wiki.archlinux.org/index.php/Truecrypt or
http://www.howtoforge.com/truecrypt-with-gui-on-ubuntu

If you only have one or two users then it is easier to give them individual rights by adding a line(s) to the configuration file so launch visudo in a terminal by:

sudo -E /usr/sbin/visudo


and append one of the following lines for either a single user (replace USERNAME with your username) or a group called truecrypt:

USERNAME ALL = (root) NOPASSWD:/usr/bin/truecrypt
#or
%truecrypt ALL = (root) NOPASSWD:/usr/bin/truecrypt

Save and exit - if there are errors there will be a message and a request what to do in the terminal.

I have used it both the simple way and by creating a group called truecrypt. In the case of the Wind where I have two users I created a a new group truecrypt using System -> Administration -> Users and Groups and Truecrypt now runs under all both users without continual prompts for passwords. There is a third Brute Force method which I have tried which works for all users without a truecrypt group needed but this is much less secure - append the following string

ALL All=NOPASSWD:/usr/bin/truecrypt

What to do about programs that are 'hard-wired' to Nautilus such as Truecrypt when using PcManFm (or Nemo)

Nautilus is replaced by PcManFm as file (and desktop) manager when one is using Lubuntu and by Nemo when Cinnamon is used.

Unfortunately I have some scripts and many cut and paste terminal strings which reference nautilus directly which is an inconvenience which can be reduced by the use of an alias. There are also a few programs including the important Truecrypt where references to Nautilus are hard coded in - when you mount a drive it is very convenient to have it open in a file manager window and if nautilus is not present you just get error messages when you mount the drive. The answer is to rename and replace the nautilus binary file by a script which calls nemo or pcmanfm and passes all the parameter strings across - nemo is a close fork of nautilus so the parameters are identical and this works perfectly but this is not always the case with pcmanfm. The binary is called nautilus and lives in /usr/bin so one replaces it with a little file which needs to be owned by root and with execute permissions and contains. For nemo it looks like this.

#!/bin/bash
exec nemo $1 $2 $3 $4
exit 0

Use this in a terminal to get to the folder to rename nautilus and add the replacement script using right click menus:

sudo nautilus /usr/bin

TrueCrypt calls Nautilus like:

/usr/bin/nautilus --no-default-window --no-desktop /path/to/truecrypt-file-or-volume

Unfortunately PcManFm does not recognize those command line options and just produces error messages.

I have currently done a quick fudge and for pcmanfm I changed the script to:

#!/bin/bash
exec pcmanfm $3
exit 0

This proves the technique works but really a more complex script is now needed which checks for the invalid parameters from Truecrypt but will otherwise work for standard single parameter 'cut and paste' strings. I leave this for an exercise for the reader who should feel free to email me with an elegant solution.

There is another option which is to install Nemo and my original script.

Using the Nemo File Manager in addition to PcManFm in Lubuntu

This section is been based on Webup8 -Install Nemo Without Cinnamon Dependencies In Ubuntu

Nemo is a much more powerful file manager than PcManFm yet still agile enough for a system with low resources. It is a dramatically improved fork of Nautilus developed for Mint Cinnamon to replace the facilities removed recently from Nautilus and then add additional functionality. A special PPA has been developed for which allows Nemo to be installed independently of Cinnamon and thus not depend on advanced graphics. It has the following features, some of the ones I particularly find important have been bolded:

It can be installed using a PPA from Webup8 without needing Cinnamon to be used. In the basic installation that I have done it is available from the various menus and terminal but it does not manage the desktop as it would with Mint/Cinnamon or Ubuntu Unity so clicking on a Desktop folder still opens PcManFm unless it is done by a right click menu - a small cost for such a great improvement and the Dropbox integration. It also improves the integration of Truecrypt - see above for how to integrate Nemo in place of Nautilus in Truecrypt. To install:

sudo add-apt-repository ppa:webupd8team/nemo
sudo apt-get update
sudo apt-get install nemo nemo-fileroller

There are many Nemo extensions available which can most easily be installed using the Synaptic Package Manager once the PPA is installed. For example nemo-dropbox is a must if you use Dropbox. Also see Webup8 -Install Nemo Without Cinnamon Dependencies In Ubuntu for more information.

The above procedure is not intended to replace PcManFm as the desktop manager - it makes Nemo available as an alternative file manager so none of the advantages of Lubuntu as a lightweight system are lost. The panel launchers can be replaced by Nemo or both can be made available. The only restriction is that opening a folder on the desktop by a double click will always launch PcmanFm although Nemo can be launched from the right click menu. It is possible to use Nemo as the Desktop Manager but one needs to bring in much of the gnome desktop negating many of the advantages of using Lubuntu.

Under some circumstances nemo may take over the desktop, the PPA was intended for use with Unity and has the 'autostart' file available to do so. It is worth move it to a harmless place - renaming does not work in that folder. The file name is nemo-autostart.desktop and it lives in /etc/xdg/autostart. You will need to have root privileges to create a new folder (say saved) under xdg and move it into it.

sudo nemo /etc/xdg/autostart

I believe it is a worthwhile change if only to improve the integration of Truecrypt and Dropbox.

Adding Ctrl-Alt-Backspace Functionality to Lubuntu

Mint and early versions of Gnome had an 'escape from jail card' in the Ctrl-Alt-Backspace key combination which forced an immediate logout by restarting Xorg which worked from most frozen states. This can simply be added to Lubuntu by adding the same .desktop shortcut to the autostart list as is used in Mint. You just need to create a file /etc/xdg/autostart/ctrl-alt-backspace.desktop with the following contents

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Ctrl Alt Backspace
Comment=Allows Ctrl+Alt+Backspace to restart Xorg
Exec=setxkbmap -option terminate:ctrl_alt_bksp
Terminal=false
Type=Application
StartupNotify=false
Terminal=false

It is best to shut all programs down before testing this as it is immediate and forces closure without warnings - it will, for example, upset open copies of firefox, thunderbird and libreoffice - certainly make sure truecrypt does not have vaults open. Even so it can be a lifesaver if you ever get a freeze.

Before You Leave

I would be very pleased if visitors could spare a little time to give me some feedback - it is the only way I know who has visited, if it is useful and how I should develop it's content and the techniques used. I would be delighted if you could send comments or just let me know you have visited by sending a quick Message to me.

Home Pauline Howto Articles Uniquely NZ Small Firms Search
Copyright © Peter and Pauline Curtis
Layout revised: 11th June, 2015
Settings - opens in a new window or tab Link to W3C HTML5 Validator