Monday, July 16, 2012

Some enhancements to Raspbian on my RPi

First, I'll just mention that this is the first blog post I've made from my RPi (using Qupzilla 1.3.0)
With the "upgrades" I mentioned yesterday, it really does perform quite acceptably, if still just a little slow.
Today, I want to describe some nice "window-dressing" that I made on my Raspbian.

One nice feature of the LXDE environment is that desktop shortcuts are very easy to make as explained in this post.
The command

$ lxshortcut  -o newname.desktop
(where newname is any name you want to provide) will open a dialog box where you can specify a name, the command linked to the shortcut and a tooltip. You also have the opportunity to change the icon for your shortcut (there are many sites where you can download free icons such as this.)
The commands can be quite elaborate so you're by no means limited to paths to binaries.
For example, I have made an icon to display all of my keyboard shortcuts in a list which is contained in a simple text file.
The command I use is
bash -c "leafpad /home/paul/kbd_shortcuts"
and this works perfectly.

Now, one little annoyance of LXDE is that no trash cannister is visible on the desktop. Indeed, to empty the trash requires cd'ing to ~/.local/share/Trash and removing the content of the files directory (which contains the actual files in the trash) and, if you want, the contents of the info directory which contains only the names of these files.
I chose to remove only the files directory contents and made a very small script as follows:
cd ~/.local/share/Trash/files/
rm -rf *
I stored it in my home directory, named it Trash_remove and made it executable.
Finally, I made a desktop shortcut with a suitable icon so that I now have a traditional trash can on my Desktop.
Clicking it empties my trash.
The only difference is there is no indication as to whether I have stuff in there or not.

Fiddling around with a mouse slows down your productivity. When using the RPi, which is already slow, you need to avoid anything that will unnecessarily contribute to your lack of speed.
Keyboard shortcuts are the answer and LXDE allows these to be created very easily as explained here.
I have created keyboard shortcuts for all of my most-used apps (terminal, leafpad, qupzilla, midori, uzbl, dwb. as well as shortcuts for shutdown and reboot).
All work extremely well and really enhance productivity on the RPi.

Finally, as I type in both English and Brazilian Portuguese, I wanted an easy way to switch between the two keyboard layouts.
There are two steps:
First, add a setxkbmap line to /etc/xdg/lxsession/LXDE/autostart as explained here.
The line I added was:
setxkbmap -layout "us,br" -option "grp:alt_space_toggle"
and, that's correct, I didn't put an @ at the start of the line, which is normal for additions to the autostart file. However, it works fine.
Next add the Keyboard Layout Switcher to your lxde panel as explained in this thread.
Now, not only can I see which keyboard layout is currently enabled from the flag icon uin the panel, but by simply hitting Alt-Space I can switch from one to the other.
Additionally, I understand this proceedure works for at least three differnt layouts.

The screenshot I posted yesterday shows most of the enhancements I describe here.

1 comment:

  1. Hi!
    A little comment. After creating the .desktop file, you need to either move it to your ~/Desktop directory, or make a link in it which points to the .desktop file. Then it should appear automatically on your desktop.

    Thanks for a great post!