Installing Opera Widgets On Ubuntu Unity Desktop (Ubuntu 11.10)

Want to support HowtoForge? Become a subscriber!
 
Submitted by CSch (Contact Author) (Forums) on Tue, 2012-02-07 18:55. :: Ubuntu | Desktop

Installing Opera Widgets On Ubuntu Unity Desktop (Ubuntu 11.10)

Version 1.0
Author: Christian Schmalfeld <c [dot] schmalfeld [at]  projektfarm [dot] de>
Follow me on Twitter
Last edited 08/17/2011

1 Preliminary Note

Opera Widgets, unlike most other browser plugins, can be downloaded to serve as browser-independent desktop widgets. These are managed through Opera Widget Manager, so the Opera process remains open (without running the browser). This tutorial explains how to use Opera Widgets as desktop widgets on Ubuntu 11.10.

 

2 Install Opera

Opera can either be downloaded from the official Opera homepage or from the Linux Mint repository. To download from the homepage, go to http://www.opera.com/browser/download/:

Select Ubuntu as distribution and default package as package format (which is a debian package in our case). Click on the large download-button and save the package to your download directory (mine is /home/howtoforge/Downloads by default on Firefox):

Next, open a command line window and direct it to the directory you downloaded the package to:

cd /home/howtoforge/Downloads

To install the debian package manually, we use the dpkg command. Enter following (the package name may vary due to new versions of the program or the architecture of your machine - to get the correct one, just type opera and use the tab-key to autocomplete the package name):

sudo dpkg -i opera_11.61.1250_amd64.deb

Opera will then be installed.

To install Opera from the Linux Mint repository, you first have to add it to your sources.list file. Enter following into a terminal:

sudo gedit /etc/apt/sources.list

At the bottom of the file, add the following entry:

[...]
deb http://packages.linuxmint.com/ lisa main upstream import

Save the file afterwards and quit the text editor. Next, update your repositories and download and install Opera:

sudo apt-get update
sudo apt-get install opera

 

3 Download And Install Widgets

To download Widgets, open Opera and drop the main menu. Go to Widgets > Get Widgets to get an overview of the available widgets:

Select one that you like and hit the install-button:

A window will pop up that lets you specify a few download options. Drop the Advanced options and make sure the widget launcher creation checkbox is activated (there are two possibilities of where the launcher is created - one is /home/name/bin and the other is /root/bin. To me it appears that the choice which it is is taken quite randomly, since the same widget had the other option after clicking download again. If your target directory is your home directory, you are lucky since the root directory is followed by more work). Afterwards install it:

The launcher is basically what we want. Its name always is composed out of opera-widget- and the name of the widget, I'll take analog-clock here. This makes the name of my launcher opera-widget-analog-clock.

 

4 Configure Widgets To Autostart

If your widget was installed to your home folder this step will be easy. You just need to add the widget to your autostart-programs. Therefore, enter startup into the unity dash and open Startup Applications.

Hit Add and you will be prompted for the name and the command of of the application to add. In the command line, add the full path to the executable script of the widget. Afterwards click Save and you are done.

If your launcher was saved to the root directory instead, you have to get it out of there since you will not be able to call it by startup otherwise. To do that, log in as root, move the launcher to the desktop or any other directory owned by you and change permissions and ownership of the script:

sudo su

When you list the contents of the directory the launcher is in, you will notice that it's only a link:

root@howtoforge-VirtualBox:/home/howtoforge# ls -la /root/bin
total 8
drwxr-xr-x 2 root root 4096 2012-01-24 12:30 .
drwxr-xr-x 20 root root 4096 2012-01-24 12:22 ..
lrwxrwxrwx 1 root root 50 2012-01-24 11:23 opera-widget-analog-clock -> /root/.opera-widgets/bin/opera-widget-analog-clock
lrwxrwxrwx 1 root root 50 2012-01-24 12:30 opera-widget-functions-3d -> /root/.opera-widgets/bin/opera-widget-functions-3d
root@howtoforge-VirtualBox:/home/howtoforge#

I pick the original file for the process (and rename it for simplicity's sake):

cp /root/.opera-widgets/bin/opera-widget-analog-clock /home/howtoforge/Desktop
chmod 755 /home/howtoforge/Desktop/owac
chown howtoforge:howtoforge /home/howtoforge/Desktop/owac

Now you will be able to execute the script from startup, if it hasn't got any depedencies - if it has any however, it will alert you the moment you try to autorun it. The clock widget I use for example needs its configuration file, which is still located in the root folder and therefore cannot be accessed automatically. To correct that I move the configuration file out of root and repeat everything I have done for the launcher (the launcher usually tells you which file it needs and where it is located):

cp /root/.opera-widgets/usr/share/opera-widget-analog-clock/config.xml /home/howtoforge/Desktop
chmod 755 /home/howtoforge/Desktop/config.xml
chown howtoforge:howtoforge /home/howtoforge/Desktop/config.xml

Now you need one additional step: the launcher still searches the old directory for the configuration but needs to search the folder you placed it to instead. To change that, open the launcher in a text editor and change every occurence of the path to the old configuration with the new one. In my case, there is only one line including the path:

sudo gedit /home/howtoforge/Desktop/owac

[...]
exec "$OPERA_BIN" -pd "$HOME/.opera-widget-analog-clock" "$@" -widget "/root/.opera-widgets/usr/share/opera-widget-analog-clock/config.xml"

I replace it with the new one:

[...]
exec "$OPERA_BIN" -pd "$HOME/.opera-widget-analog-clock" "$@" -widget "/home/howtoforge/Desktop/config.xml"

Save the file, close it and proceed with adding the widget to the startup applications as described above.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.