Thursday, October 13, 2011

GUI for Changing Unity 2D's Settings, all Ubuntus

At the time of the release of Ubuntu Natty 11.04, Mariano Chavero has developed a simple GUI for changing the few available settings of Unity 2D, as well as some other desktop features. These settings could also be changed via GConf-Editor in Natty, or via DConf-Editor in Oneiric/Precise. But, you might guess it already :P , it's way easier to do that via a simple, dedicated GUI.


Version 1.2

I've finally taken the plunge to consolidate both the placement of the widgets and the sizing of the window, so now the GUI looks great no matter what fonts and font sizes are used. I've also added "About" and "Close" buttons and in turn removed the entire menu, as these were the sole items of it, improving both the GUI's usability and consistency, whether Global Menu is being used or not.

Changelog
  • Consolidated widget placement and window sizing
  • Added "About" and "Close" buttons, removed the menu
  • Changed the application icon
  • Dropped the Ubuntu version from the "About" dialog
Installation

Just run these commands to install and keep it updated - if you are using a Daily version of Unity 2D in Oneiric, just change "oneiric" to "precise" in the PPA's settings in your "Software Sources > Other Software" after running the first command!:

sudo add-apt-repository ppa:krytarik/tuxgarage
sudo apt-get update
sudo apt-get install unity-2d-settings

Or to upgrade from an earlier version, just replace the last command with:

sudo apt-get upgrade

PPA: https://launchpad.net/~krytarik/+archive/tuxgarage

Once installed, search the Dash for "Unity 2D Settings", or if you are running Unity 2D in a classic Gnome session, you'll find it under "System > Preferences". Other than that, everything is pretty self-explanatory.

Notes: In Natty/Oneiric, when you set the Unity Launcher to "Dodge Windows", you need to either just relogin, or restart its process - via the Alt+F2 dialog, run "killall unity-2d-launcher"; if it fails to restart automatically, just run "unity-2d-launcher". When you change any Metacity settings, it seems to be a matter of luck if they are applied immediately, cause Metacity to crash and possibly restart, or none of both, plus possible weird side-effects; so be prepared to have to either relogin, or run "metacity --replace" via the Alt+F2 dialog.

In Precise (as of now - Beta 1), any changes to the Launcher hide-mode are applied 'on the fly'; and when you change any Metacity settings, just opening the Dash would trigger their application, whether or not with an intermittent crash of Metacity; but if something nasty happens reg. the latter, just relogin.

Version 1.1

Thanks to the hint by zgrge in the comments, I've finally added the 'Compositor Effects' option to the Oneiric version of the GUI tool, along with an option to toggle the handling of the desktop by Nautilus, to both versions; and I've pretty much cleaned up the code, so it doesn't stress the resources unnecessarily anymore, and works more reliable now; and since Unity 2D's special settings still aren't covered sufficiently by either the default "System Settings" or any other tool, I've also created a new version to work with both current Daily versions of Unity 2D and the upcoming Precise 12.04. Please also see the full changelog below. For this new version, I'm proud to have finally managed to upload it to Launchpad - Yay! :D


Changelog
  • Integrated the "About" stuff into the main script and moved that
    into "/usr/bin" to be found through the default PATH variable
  • Added option to toggle the 'Compositor Effects' of Metacity
    (Oneiric/Precise; no separate setting for that in Natty)
  • Added option to toggle the handling of the desktop by Nautilus
  • Removed handling of the "use-strut" setting (Precise)
  • Created a separate section in the UI for the Nautilus settings
  • Changed a couple of labels in the UI
  • Improved reliability, minimized calls to the settings backends
  • Removed unnecessary code
Version 1.0

As Unity 2D has shifted to using DConf for its settings, Mariano's version doesn't work with Oneiric, and he hasn't released an Oneiric version yet. So I've modified his script to work with Oneiric, and also removed the session dependency - which was actually a nice idea/implemention, but turned out to be hindering if you are not running the session that is specified in the script, I mean literally. For the full changelog, please see below.


Changelog
  • Adapted to DConf, which Unity 2D and Nautilus are using now (Oneiric)
  • Removed dependency on the running desktop environment
  • Changed its name, labels in the UI, added icons to the menu
  • General code clean-up
  • Package is now architecture-independent
Icon Size and More Customization

In Precise 12.04, you can for the first time properly change the icon size of the Launcher items. Basically, that involves changing the icon size and related settings in three different program files of Unity 2D. Ubuntu Forums member ppd has written a script that does that quite nicely, you only need to pass the desired icon size to it, then it will do backups of the concerning files, and change the respective settings. As the concerning program files are subject of change, and therefore the script might need to be updated, I'll rather point you directly to the original source at the Ubuntu Forums, a post where the script is attached, along with instructions:

http://ubuntuforums.org/showthread.php?t=1954637

Notice, however, that you might find yourself limited to using either the default 48px or 32px. That's because the icons of some applications, particularly LibreOffice, might not be scalable to any other size in between those. And for me, 32px is quite too small, even though it's kinda commonly used already with the regular Unity.

Also, directly changing program files obviously has quite a few downsides - such as that the changes will be reverted by an update of the respective package, the changes are system-wide, and the program files are subject of change. Because of that, compounded by the icon scaling issue, I won't include it in the GUI tool for now. But downloading and running the script is for sure easy enough already!

For some more system-wide tweaks - basically intended for Oneiric 11.10, but adaptable to Precise in most cases - please see this guide:

http://www.tuxgarage.com/2011/10/customizing-unity-2d-ubuntu-natty.html

Related Posts:

Unity , Unity 2D