Tips & Tricks

Search my computer

Strigi / Nepomuk / Akonadi

Nepomuk is a background indexing service that examines files and stores information about them in a database. It takes CPU cycles to run. Akonadi stores PIM (personal information, e.g. address books, etc.) and is also available to a search query. Strigi is the client application that accesses the index database to perform a search. It is accessed as the "Search" bar of the Dolphin file manager or of the Konqueror browser. To turn the services on or off or to adjust the cache/database size:

K menu -> Settings -> System Settings -> Advanced -> Desktop Search

Disable AkonadiTray

The KDE Plasma / System Tray widget AkonadiTray does not display correctly on my system. (I do not use Akonadi and have it turned off, but AkonadiTray appears anyway.) The solution is to merely rename the akonaditray module:

sudo mv /usr/bin/akonaditray /usr/bin/akonaditray.bak

Other search apps

These apps do not rely on an index database (so that the CPU-intensive indexing apps can be turned off). However, they therefore take longer to examine the computer during a search.

Choose Bootup/Startup services

Run a script from a menu item

It is possible to place a short script in a menu item / shortcut to answer an interactive query (such as a password query). Here is an example that is used to enter a password during an SSH negotiation. First, install the utility expect:

In this example the password sshpassword is returned when the ssh program requires a password. Expect waits for some text to be displayed in the command-line terminal then returns text in return. The Menu Item must be "Run in terminal", therefore.

KDialog (User interface for scripts)

KDialog allows user input to scripts. This allows the automation of tasks with the option of user input during those scripts.

SHC (Encrypt scripts)

SHC is a simple script compiler that will convert a script into a binary, obscuring the code (and passwords, etc.). Usage instructions are here. Install by adding the Debian Etch repository:

sudo add-apt-repository 'http://archive.debian.org/debian etch main'

then install the shc package:

sudo apt-get install shc

Run Command

You can run any application in your path using the Run Command. Right-click on the Plasma Icon in the upper right of your desktop to find the command. You can also use Alt+F2.

Add Menu items to Desktop or Panel

To copy a program icon to the desktop or panel bar, you must first unlock widgets:

Widget icon (upper right corner of desktop) -> Unlock Widgets

then right-click on any menu item in the K menu and select "Add to Desktop" or "Add to Panel". You can move the icon anywhere you desire and then re-lock the widgets.

For example, I like to have the icon for Konsole (the command-line interface terminal) in my Panel bar (since I like to work in the command-line interface frequently). I therefore right-click on K menu -> System -> Konsole then choose "Add to Panel".

Restore the Task Manager bar

It is easy to remove the Task Manager bar accidentally and find yourself with an empty desktop. Here's how to restore it to its default state at installation:

If you have accidentally erased your Task Manager bar completely, add it again from the Plasma icon in the upper right corner of your desktop. You can drag your Task Manager bar anywhere you want using the "handle" on the edge of the bar (which pops up unless you have the widgets locked).

Right-click on the Task Manager bar -> Panel Settings to configure it. You will notice a configuration bar that will pop up. While this is displayed you can drag things around the Task Manger bar how you like them. You can also change the dimensions of the Task manager bar using the arrows, and can choose the centering options for the Task Manager bar.

You can also (re-)add widgets to the Task Manager bar using the Add Widget option on this configuration bar as well. (Note: This is different from the Add widgets option found in the Plasma icon in the upper right corner of your desktop, which adds widgets to your desktop, not to the task manager bar).

The original default task manager bar at installation included the "Applications Launcher (traditional menu based)" widget, the "Digital Clock" widget, the "Pager" widget, the "Task Manager" widget, the "System Tray" widget, and the "Trashcan" widget. Add whichever ones you have accidentally removed, then drag them around the Task Manager bar into desired positions.

Close the configuration bar when you are done by clicking on the red X.

Move Notifications widget from System Tray to Panel bar

The Notifications widget developed a bug after Precise 12.04 and now has become ill-behaved when enabled in the System Tray. The solution is to disable it in the System Tray and to instead add notifications as a standalone widget on the Panel bar:

Screen snapshot

Turn off Hot Keys

This is the most evil option on any operating system, in my opinion. A mis-stroke enables any number of random events. Unfortunately, this problem is pervasive in operating systems and is difficult to turn off.

Activate Suspend or Hibernate

Power Management settings can be accessed:

K Menu -> System -> System Settings -> Power Management

Turn off Device Notifier

The Device Notifier is the pop-up that appears when you attach a new removable device, such as a USB, CD/DVD, or removable hard-drive. The default behaviour is to automatically mount the device in the Dolphin file manager, but in addition the Device Manager presents a list of options for the device that are set in K Menu -> Settings -> System Settings -> Device Actions. Those options can be edited there, or the Device Notifier pop-up can be disabled altogether:

<right-click> on the System Tray icon in the Panel bar (looks like a triangle) -> System Tray Settings

From Dolphin, right-click on musicfile.mp3 -> Open with... -> Known Applications ->

choose Audacious

-> Click: "Remember application association for this type of file"

Now all .mp3 files will be associated with Audacious.

How to use network options in Dolphin file manager

Open the "Network" icon in Dolphin.

A network folder can also be mounted in the left navigation pane for repeated quick access. For example, a Samba (Windows-type) network folder located at a LAN IP address of 192.168.0.177 can be added:

Dolphin -> <right-click> on the left panel -> Add entry...

-> Label: Network folder -> Location: smb://192.168.0.177

How to mount a camera in Dolphin file manager

Use Windows-appearing fonts

Users who switch to Kubuntu from Windows may notice subtle differences between the default fonts in Kubuntu and those in Windows. The Microsoft Core Fonts can be installed as part of the kubuntu-restricted-extras package, or separately:

sudo apt-get install ttf-mscorefonts-installer

Most default fonts in Windows are Times New Roman. You can select the Times New Roman fonts in applications like Firefox to make them appear like Windows. However, the Deja Vu font in Kubuntu mimics the Times New Roman font closely, and has been found to be desirable for most users.

Run a Gnome desktop from Kubuntu

It is possible to install the GTK-based Gnome desktop (the default in Ubuntu) in Kubuntu.

apt-get install ubuntu-desktop

There is a risk of software bloat and some incompatibilities between modules when doing this. At login, you can choose (as an option) whether to start the KDE (Kubuntu) desktop or the Gnome (Ubuntu) desktop. Nevertheless, when there are two modules trying to perform the same function (one from each desktop), it is possible to have conflicts.

Filenames with spaces

Filenames or folder names with spaces in them should be enclosed with quotation marks (" "). For example, to change to a directory named "This Dir" or "/home/This Dir", use the command:

cd "This Dir"

or

cd /home/"This Dir"

Alternatively, a space in a filename or folder name can be preceded with a backslash. For example, to change to a directory named "This Dir" or "/home/This Dir":

cd This\ Dir

or

cd /home/This\ Dir

Root user tasks

Many tasks in (K)Ubuntu must be accomplished with root user (superuser) privileges. For many simple tasks, temporary root superuser are achieved using the "kdesudo" command (or the "sudo" command for command-line functions). A user must be in the "sudo" group to use kdesudo or sudo. See this section about adding/changing user groups.

A user may open a file manager (such as Dolphin) with root user (superuser) privileges. See this section.

A service menu may be installed in Dolphin that allows many tasks to be accomplished with root user (superuser) privileges. See this section regarding the "Root Actions Servicemenu."

A user in the "sudo" group may become the root user. To do so, a password for the root user must already have been set. See this section. This is not recommended for routine usage.

For some tasks (such as installing packages from the Muon package manager) the system will present a list of users in the "sudo" group. Any user in the list can be chosen and the password for that user entered in order to complete the task.

Software Troubleshooting

Manually edit menus

The Kmenuedit program has quirks and may create a menu that has extraneous entries. To manually edit the KDE menu:

kate ~/.config/menus/applications-kmenuedit.menu

where ~ refers to /home/user

Python2.5

(K)Ubuntu Lucid has Python2.6, yet many apps (including GoogleApps) require Python2.5. To install Python2.5 from a PPA repository, see the instructions at the PPA repository.

Amarok Troubleshooting

Amarok permissions error on Amarok startup

If you get a permissions error when launching Amarok, try the following:

sudo chown -R user /home/user

Note: Replace user with the actual username. This command changes the owner of the folder /home/user to user. -R means "recursively", i.e. including all subfolders.