Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Tuesday, May 10, 2011

Unity: adding items to the dock

In this blog post I will outline a way to add new items to the dock in Unity.

Unity is a new graphic shell for the latest Ubuntu; Nauty Narwal. One of the more prominent features is a docking area.

In this docking area icons for running applications appear. You can decide to keep the icon as a launcher for the application. This feature is nicely integrated with the software center. Whenever new software is installed it will write a desktop file to /usr/share/applications/. This file describes how the menu-item will appear on the dock.

The only downside is that not all software is installed via the software center. One of the reasons is that the software center repositories hold older versions. For example the version of eclipse found in the repository is 3.5.2 (Galileo). At this moment the latest version of eclipse is 3.6 (Helios).
Software which is not installed via the software center does not readily appear on the dock. The reason is the missing desktop file. The rest of the blog post describes how to provide a custom desktop file.

I found the following site helpful. There is a more formal specification of the Desktop Entry Specification. A quick overview is given at anatomy-of-a-desktop-file.

The following steps create a launcher for an application which is not installed via the software center.

  1. Create a desktop file for the application
  2. Place the desktop file in ~/.local/share/applications/
  3. [Optionally] Drag the desktop file onto the dock

Create a desktop file for the application
There are various routes to creating a desktop file. One can create a desktop file from scratch, or copy and modify an existing one. A great place for inspiration are the desktop files in /usr/share/applications.
Below is an example of a desktop file. I created it to launch Eclipse. Paths mentioned are specific for my system and can be changed. The shortcut groups defined at lines 13, 15 and 20 appear when you right-click the icon.

[Desktop Entry]
Name=Eclipse Helios
GenericName=Eclipse
Comment=Start the awesome Eclipse IDE
Exec=/home/dvberkel/bin/eclipse/eclipse
Terminal=false
Type=Application
Icon=/home/dvberkel/bin/eclipse/icon.xpm
Categories=IDE;
StartupNotify=true
OnlyShowIn=GNOME;Unity;

X-Ayatana-Desktop-Shortcuts=Choose;Workspace;

[Choose Shortcut Group]
Name=Choose workspace
Exec=/home/dvberkel/bin/eclipse/eclipse
TargetEnvironment=Unity

[Workspace Shortcut Group]
Name=Workspace
Exec=/home/dvberkel/bin/eclipse/eclipse -data /home/dvberkel/workspace
TargetEnvironment=Unity

Place the desktop file in ~/.local/share/applications/
Unity is looking for custom desktop files in the ~/.local/share.applications directory. It could be that Unity should be restarted before changes are picked up. This can be accomplished by issuing the following command: unity --replace.

[Optionally] Drag the desktop file onto the dock
By dragging the desktop file onto the dock it immediately can be used as a launcher. This option really worked well for me.

This concludes this blog post. In it I explained a means to provide a custom desktop file which gets picked up by Unity.

Saturday, August 28, 2010

Inputting Unicode characters in Ubuntu

This blog is a reminder for myself how to use the keyboard to input Unicode characters in Ubuntu.

Somethings I just can not remember. Every time I need to enter a Unicode character I realize that I do not remember how to do this in Ubuntu, without resorting to graphical character picker.

So this post will settle the score once and for all, and hopefully after this I will be able to remember it. (At least I will be able to come here for reference.)

The keyboard shortcut to enter a Unicode character in Ubuntu is:

Ctrl+Shift+u <Unicode>

For example to enter a € symbol type Ctrl+Shift+u 20ac. All that is left is learning usefull Unicode codes.

Update
Here's a unicode character map

Saturday, August 7, 2010

Tethering made easy with easytether

In this blog post I point at a very easy way of tethering an android phone to a Ubuntu machine.

Ever since I got my android phone, I was looking at a way to tether it to my phone. There were options available but none to my liking. You either had to tether to a windows machine or get root access to the phone. Because I exclusively use Ubuntu as an operating system and I feel a little uneasy about rooting my phone, I was left tether-less.

Not so any longer. I accidentally stumbled upon a post explaining how to tether Ubuntu to your phone via easytether.

The instructions in the above post worked off the shelf, so I can now tether easily. I even made a little script to setup the connection so it is as easy as executing one command.