Friday, May 4, 2012

Script for Installing AWN in Ubuntu Precise, Oneiric and Natty

If you aren't satisfied with Unity's approach, with the Launcher locked at the left screen edge, lacking the ability to minimize windows by clicking on their respective icons, Avant Window Navigator is yet another alternative for you. It would sit at any screen edge you want it to and would behave quite familiar, just like things used to be in Gnome 2.x. If you've already tried running AWN in Ubuntu Precise and Oneiric and aren't that satisfied with the outcomes, the easy-to-use script attached to this post might well sort out most of the issues you faced.


Primarily, there are two approaches for running AWN in Ubuntu. The first one is to add AWN to the Startup Applications and disable the Unity Plugin in CCSM, but that's not too great of an idea, because this way you would be deprived of your original Unity session. The other, and more sensible, approach is to create a custom session for AWN. While AWN can run as a standalone dock and can hold all the indicators, a notification area, etc., I would recommend to run the Unity 2D Panel along with it, so that you are not deprived of the Global Menu at least, although there won't be things like HUD, Lenses or Quicklists in this session obviously, as the former require the Dash functionality and the latter the Launcher, of course.

Installation / Setup

To make the installation and setup process as easy as possible, Krytarik has created an easy-to-use script. You just need to download and run it and it would automatically install and set up AWN in the best possible way, including some default settings and, if needed, fixes, and would create the necessary files for both the sessions and the before mentioned stuff.

As indicated above, running the script would sort out a couple of issues, including duplicate titlebars of maximized windows in 'AWN + Unity 2D' sessions, the by default non-working Indicator Applet and the broken 'Session' sub-menu in the Cairo Menu applet. And it would also offer to install Synapse (an alternative to the Alt + F2 run dialog as well as the Dash) as well as Unity 2D Panel if any of these aren't installed already.

It is strongly recommended to install at least the former, as it also tends to be a convenient life-saver in a number of possible occasions and especially when needing to restart AWN in any of the added sessions! If installed, it would add Synapse to the Startup Applications straight away, so that it is accessible already right after your next login, whether that is in to one of the newly added AWN sessions or not - by default, you can access it by pressing 'Ctrl + Space'.

The script works with all the latest three Ubuntu versions, Precise 12.04, Oneiric 11.10 and Natty 11.04, regardless that some of the additional fixes mentioned above are only needed for the former two.

First, get to a Terminal and download the script (into the top level of your home directory) by running:

wget -t 5 -T 10 -O ~/awn-session-installer http://files.tuxgarage.com/awn-session-installer

Now, make the script executable by running:

chmod +x ~/awn-session-installer

Finally, run the script using this command:

sudo ~/awn-session-installer

Once the installation is finished, you can log out and choose any of the 4 newly created AWN sessions from the session options on the login screen. 'AWN' and 'AWN (No effects)' would log you in to standalone AWN sessions with Compiz or Metacity as the window manager, respectively. The 'AWN + Unity Panel' and 'AWN + Unity Panel (No effects)' session options would add the Unity 2D Panel to these general setups. If your machine is not capable of running Compiz, you would be automatically fall back to the corresponding Metacity session.


Side Notes

In order to get the installation as slim as possible and especially to not pull in the Gnome Classic sessions if they aren't installed already, as a matter of dependencies, we have deliberately left out a couple of applets. If you have the Gnome Classic sessions already installed anyway, or Tomboy, for that matter, you can, of course, opt to install any of the concerning applets individually once the installer has done its job. These are the applets left out:
  • 'awn-applet-cpufreq' - pulls in Gnome Classic
  • 'awn-applet-yama' - pulls in Gnome Classic
  • 'awn-applet-tomboy-applet' - pulls in a lot of packages, incl. Tomboy
  • 'awn-applet-webapplet' - pulls in a lot of packages
Precise-specific Bugs

Despite all the efforts we have done to make AWN work as great as possible, particularly in the both latest Ubuntu versions, there are currently two bugs with it when running it in Precise 12.04 that are beyond the scope of our control - both seem to be caused by some major bugs with the GConf settings backend that Precise apparently has currently:
  • The Task Manager applet doesn't manage to remove its initial Plus icon upon finishing starting up (bug report) - you can easily work around that for now by simply drag & drop'ing onto it any launcher you already have in the applet.
  • Any changes you do to AWN via its settings manager aren't taking effect straight away (no specific bug reports found so far, neither any related results on a web search) - unfortunately, to 'work around' that for now, you can only restart AWN after having done some changes you want to have applied immediately; quite easy, though, if you either have a desktop icon for launching AWN or are using Synapse, as recommended above. But it's definitely a pain when you are trying to tweak some of its many appearance settings!
Update 11/22/2012: Two new reports were just added to the main thread on the Ubuntu Forums regarding the 'Plus icon' issue, fostering that manually installing the package "libdesktop-agnostic-cfg-gconf" (click to install), as mentioned in the comments #21 and #22 on the bug report linked to above, might be the easiest way to solve the issue, and I might presume, the other issue mentioned above as well. I'll try to test that in the next days, and if it indeed solves at least one of those issues, and makes sense in all possible scenarios (particularly regarding installed session options), add it to the installer script.

Update 11/24/2012: My tests have shown that...
  1. in all Ubuntu versions since Precise 12.04, for some reason, the other alternative for the virtual package "libdesktop-agnostic-cfg", "libdesktop-agnostic-cfg-keyfile", is pulled by default, instead of "libdesktop-agnostic-cfg-gconf", as it used to be;
  2. installing "libdesktop-agnostic-cfg-gconf" indeed solves both of the above mentioned issues right away;
  3. installing "libdesktop-agnostic-cfg-gconf" has no negative effect on the overall installation.
Therefore, I have included it in the installer script now, so that it is installed if it isn't already - so just forget about all the crap above now!

Reverting the Changes

The script also includes an option to remove everything again later, that is, all session-related files and at least most of the packages that have been installed - that's to prevent any unintentional removal of packages that might have been added afterwards. To do that, just run the script with the '--remove' parameter appended, from the directory where the script is located, obviously:

sudo ~/awn-session-installer --remove

Related Posts:

Dock , Session