29 December 2012

Migrating to Lubuntu - tips and fixes

If you want a fast, no frills version of Ubuntu, I suggest giving Lubuntu a try. It's Ubuntu with the LXDE desktop environment. I made the switch after installing Ubuntu 12.10 by installing lubuntu-core.

lubuntu-core doesn't install a lot of Lubuntu programs though, e.g. lxtask, so there's some fiddling to do with user settings to make the environment really usable. I'll describe some of what I did below.

I've tried migrating by installing lubuntu-desktop on another computer, which gave me all the programs associated with Lubuntu (like Abiword), but I preferred the Ubuntu set of programs — plus all the stuff I've accumulated thus far from using Ubuntu for the last few years — so I really just want the LXDE core modules. If you're installing a fresh OS, I suggest installing Lubuntu directly instead.

When using Lubuntu, you'll have to get used to not having a GUI for everything. There's some GUI system tools, but they don't always work all that well. Lubuntu is such a young OS, there's a lot of rough edges compared to Ubuntu. In fact, don't try Lubuntu unless you're running the latest (not necessarily LTS) distribution release — I encountered some problems with Ubuntu 12.04 LTS with the lubuntu-desktop package installed that were fixed with Lubuntu 12.10.

lxpanel keyboard shortcuts to the Main Menu stops working

The Main Menu contains shortcuts to lots of programs and system preferences. Usually Alt-F1 or Ctrl-Esc will activate it. But there's been a continual bug with the keyboard shortcuts when Lubuntu is installed over top of Ubuntu so that the keyboard shortcut may work once then stop working. Actually, that bug in lxpanel was fixed by Lubuntu 12.10, but a different bug took its place.

It turns out lxpanel runs in the background, and lxpanelctl controls it. But if you bring up the "Panel Settings/Preferences" window, the keyboard shortcut stops working. The keyboard shortcuts are actually bound to execute the lxpanelctl command, so it's lxpanelctl that loses control of lxpanel. Another way lxpanelctl loses control is when the "Run" window (lxpanelctl run) opens, and you type in a program name that then gets matched, then you use arrow keys to highlight one of the matches, then type escape repeatedly until the window closes. It's weird, but the fix is the same:

Kill lxpanel and restart it. I do it in the command line with a quick

killall lxpanel; lxpanel -p Lubuntu &
In fact, I have a bash alias to do that because it happens so often...

lxkeymap forgets your settings after log out

I like my caps lock changed to be another control key, and lxkeymap lets me make that setting. Oh, lxkeymap needs to be installed separately from lubuntu-core first. But why does it forget it's settings after logging out and logging back in? It's a bug in the lxkeymap package.

Per that bug report, you can fix this by creating a .desktop file with the following:


[Desktop Entry]
Name=Lxkeymap
Exec=lxkeymap --autostart
Terminal=false
Type=Application
StartupNotify=false
OnlyShowIn=LXDE
Then put that file in the directory

~/.config/autostart/
Log out and in to test it out.

Another solution requires creating a shell script that autoruns setxkbmap on login, but using lxkeymap seems better.

Show all windows Mac Expose style

skippy-xd is pretty amazing. Once installed, running it on the command line will show all currently displayed windows spread out like Expose, Kompose, or Compiz. When done, it quits. Fast, quick, and doesn't take up memory when not being used. Once installed, you can bind a keyboard shortcut to open skippy-xd just like how lxpanelctl was bound to various keyboard shortcuts.

In fact, all keyboard shortcuts in Lubuntu can be found in the settings file at:

~/.config/openbox/lubuntu-rc.xml
It's an XML file so I just opened it in emacs or gedit, found the keybind section below the line:

<chainQuitKey>C-g</chainQuitKey>
And added in another keybind like this:

<keybind key="W-w">
  <action name="Execute">
    <command>skippy-xd</command>
  </action>
</keybind>
Log out and in to see it work.

Cntl-Alt-Del brings up an error instead of lxtask

Cntl-Alt-Del doesn't bring up lxtask because lubuntu-core package doesn't include it. While you've got lubuntu-rc.xml opened, search for lxtask and replace it with gnome-system-monitor.

Adding application shortcuts to Main Menu

Gnome has alacarte, and KDE has kmenuedit. Both of which doesn't help in Lubuntu. There's apparently a GUI program that can edit it written in Java, but I didn't try it, since I was elbow-deep editing settings files already.

There is good instructions at LXDE Wiki, Ubuntu forums, and Remastersys forums.

It boils down to making a .desktop file containing the command you want executed and putting that file in:

~/.local/share/applications
Then adding a menu entry in the file:

~/.config/menus/lxde-applications.menu
For example, I wanted a shortcut to open The Weather Network in the epiphany web browser. I created WN.desktop containing this:

[Desktop Entry]
Encoding=UTF-8
Name=Weather Network - Calgary
Comment=Open URL to Weather Network - Calgary in Epiphany web browser
Icon=applications-internet
Exec=epiphany 'http://www.theweathernetwork.com'
Type=Application
Then in lxde-applications.menu I added it into a sub-menu:

<?xml version="1.0" ?>
<!DOCTYPE Menu
  PUBLIC '-//freedesktop//DTD Menu 1.0//EN'
  'http://standards.freedesktop.org/menu-spec/menu-1.0.dtd'>
<Menu>
  <Name>Applications</Name>
  <MergeFile type="parent">/etc/xdg/lubuntu/menus/lxde-applications.menu</MergeFile>
  <Menu>
    <Name>Internet</Name>
    <Include>
      <Filename>WN.desktop</Filename>
    </Include>
  </Menu>     
</Menu>

Make Nautilus the default file manager again

Lubuntu and LXDE uses the PCmanFM file manager. It's light and fast, and doesn't have much features or options. It's barebones to the point where I want to use Nautilus instead, and we can!

First, while you've got lubuntu-rc.xml opened from before, search for pcmanfm and replace it with nautilus.  That will take care of opening a file manager explicitly.

Secondly, we basically want to, when opening a folder (mime type: inode/directory), to open it with the nautilus program.  So we need to associate the mime type (as hinted at in this forum post).  Open the file:

~/.local/share/applications/mimeapps.list

And add in under the [Added Associations] and/or [Default Applications] sections a new line:

inode/directory=nautilus-browser.desktop;

I'm not sure if it needs to be in both sections, but I added it in both.

Lastly, the "Desktop" is actually just the file manager, so in fact you could killall pcmanfm and then open nautilus -n to let Nautilus handle it instead of PCManFM.  But we need this to auto happen on logging in.  Logging in is handled by lxsession which uses by default the config file at:

/etc/xdg/lxsession/Lubuntu/autostart

if the per-user config file isn't present at:

~/.config/lxsession/Lubuntu/autostart

So let's make the per-user config file by running:

mkdir -p ~/.config/lxsession/Lubuntu
cp /etc/xdg/lxsession/Lubuntu/autostart ~/.config/lxsession/Lubuntu/autostart

Then open the per-user autostart config file and replace this line:

@pcmanfm --desktop --profile lubuntu

with this line:

@nautilus -n

Log out and in to test it out.

Scrollbars are too small or thin in LibreOffice Calc, Firefox, Thunderbird, etc.

The default scrollbar widths are way too small.  They're thin because of Unity's overlay scrollbars, and it's annoying in other programs, but it makes LibreOffice Calc's sheet selector on the bottom horizontal scrollbar barely usable.

These two bug reports describe the problem but don't describe a real fix.  The real fix is in changing the GTK 2.0 theme's scrollbar widths.  This can be achieved by copying the desired theme folder (containing a GTK 2.0 theme) from /usr/share/themes to ~/.themes (with a new theme folder name) and changing the  gtkrc file in the enclosed gtk-2.0 folder to contain:

style "scroll" {
  GtkScrollbar::slider-width = 23
}
class "*" style "scroll"


If there's a gtk-3.0 folder, edit gtk-widgets.css and add the attribute -GtkScrollbar-slider-width: 23; within the * CSS selector.

You'll have to choose the theme to activate it, but unfortunately the Openbox Configuration Manager only activates the openbox theme.  Instead, install from apt-get the gnome-tweak-tool and gtk-chtheme programs.  They are GUI programs that lets you select the GTK 2.0 theme and activate.  I suggest using gtk-chtheme to activate the GTK 2.0 theme, and use gnome-tweak-tool for the GTK 3.0 theme.  In terminal, use gsettings get org.gnome.desktop.interface gtk-theme to verify it's set to your theme as well.

I actually just chose the 'Ambiance' theme rather than make a new one, and it helped a lot.

Last word

Ubuntu is fantastic in spreading far and wide a user-friendly distribution of GNU / Linux. Not just a "user friendly" user interface, but the whole process, from installing the OS, to using the OS, to installing more software. But they've gone the way of Apple and Microsoft in changing the UI for the sake of change, and adding in eye-candy for the sake of soaking up CPU cycles.

The new Unity interface is pretty, but compared to pre-Unity Ubuntu, it's dog slow and memory hungry. The internet search and shopping lenses makes using the Unity HUD a real pain (speed wise and privacy wise). The application dock is hard to use with a mouse when there's a lot of icons. Did I mention it's slow?

Lubuntu is a breath of fresh air. It has a lot of room to mature still in terms of user friendly-ness, but I hope it stays fast and light.

No comments: