четверг, 22 января 2009 г.

Translate from my russian blog: http://emacs23.blogspot.com/2008/10/gnome-places.html
The fact Gnome Panel only can contain 5 items really annoy me, and this behaviour cannot be changed through GUI, but directly from code.
These are steps to improve the issue in Debian derivatives, such as Ubuntu:
  1. Install apt-build package:
    sudo aptitude install apt-build
  2. After the configuration file like *apt-build* or something would be in directory /etc/apt/sources.list.d/, I don't know exactly. One of them would contain line like deb file:/var/cache/apt-build....... You need to place this line at the top of the file /etc/apt/sources.list in order aptitude to know where to get rebuilded packages. If you don't change repository settings while apt-build installation, this line would be:
    deb file:/var/cache/apt-build/repository apt-build main
    Place it at the top of /etc/apt/sources.list
  3. Now get Gnome Panel sources from repos:
    sudo apt-build source gnome-panel
  4. Need to change capacity value. It's in the file /var/cache/apt-build/build/gnome-panel-...../gnome-panel/panel-menu-items.c. These dots ..... in the file path are Gnome Panel version numbers, but they are depends on the Gnome version you use, so, you need to manually complete a path - just use Tab key ;). Use your favourite text editor (I know, this is Emacs :D:D:D):
    sudo emacs /var/cache/apt-build/build/gnome-panel-....../gnome-panel/panel-menu-items.c
    , then find a line:
    #define MAX_ITEMS_OR_SUBMENU 5
    this is a key - current Places menu capacity: 5. Change it with another value, I use 50. Then save the file.
  5. Build the package:
    sudo apt-build install gnome-panel
  6. It's all, you must see updates notification now - it's time to install.
Here is the command line to perform this automatically:
sudo aptitude apt-build; echo 'deb file:/var/cache/apt-build/repository apt-build main' | cat /etc/apt/sources.list > ~/lol.list; sudo mv ~/lol.list /etc/apt/sources.list; sudo apt-build source gnome-panel; file=`find /var/cache/apt-build/build -name *gnome-panel -type d | sort | tail -1`'/panel-menu-items.c'; sed -e 's/^#define MAX_ITEMS_OR_SUBMENU.*/#define MAX_ITEMS_OR_SUBMENU 50/g' $file > ~/lol.tmp; sudo mv ~/lol.tmp $file; sudo apt-build install -f gnome-panel; killall gnome-panel