Ubuntu Forums Archive Viewer

HOW TO: Display more than 5 bookmarks in gnome-panel "Places" menu

Archived thread 1066964 from Tutorials. Markdown source: Tutorials/thread_1066964_HOW_TO_Display_more_than_5_bookmarks_in_gnome-pane.md

Original URL About this archive
#1

Derived from: http://brainstorm.ubuntu.com/idea/14381/ http://ubuntuforums.org/showthread.php?t=733808

1) Open Terminal

2a) Install apt-build

sudo apt-get update
sudo apt-get install apt-build

2b) Configure apt-build: [*]Optimization level: Medium

  • Add apt-build repository to sources.list: Yes
  • Architecture: <SELECT YOUR ARCHITECTURE>

3) Install files required to build gnome-panel from source and download the source

sudo apt-get build-dep gnome-panel
sudo apt-build source gnome-panel

4) Navigate to the downloaded gnome-panel source folder and open the menu items file

cd /var/cache/apt-build/build/gnome-panel-*
sudo gedit gnome-panel/panel-menu-items.c

5) Set the the maximum number of bookmarks to display before placing them in the *Bookmarks* submenu

Find the line: [php]if (g_slist_length (add_bookmarks) <= MAX_ITEMS_OR_SUBMENU) {[/php] and replace it with: [php]if (g_slist_length (add_bookmarks) <= 20) {[/php] Save the file.

6) Install the modified gnome-panel and restart it

sudo ./configure
sudo make
sudo make install
killall gnome-panel

Before and after pics: [img]http://img178.imageshack.us/img178/7450/beforenr0.jpg[/img] [img]http://img19.imageshack.us/img19/2271/afterup4.jpg[/img]

#2

Instead of changing ``` if (g_slist_length (add_bookmarks) <= MAX_ITEMS_OR_SUBMENU) {

you could change ```
#define MAX_ITEMS_OR_SUBMENU 5
#3

Both works fine but i prefer changing MAX_ITEMS_OR_SUBMENU

#4

If Network Places and Removeable Media aren't a concern, changing MAX_ITEMS_OR_SUBMENU is the way to go.

#5

Thank you so much for this. The five item limit is so annoying. And the last time i tried to compile from source the whole system went wrong. It seemed like I installed the originale gnome-panel instead of Ubuntu's edit. Guess it had something to do with the .dsc anf .diff.gz files, but i never figured it out then. So I was surprised your guide not included these files in any way, but it seemed thorough, so I followed the guide, and it works just fine!

Thanks

#6

Thanks. I wasn't sure on the archetecture. I know the Q6600 is AMD64 and that didn't appear as an option, so I chose the amd10 (or whatever is was) and it worked.

#7

If I'd do this, would I lose all customizations made to my panels, like applets (and their settings), custom icons, etc? Or would everything just stay the way it is now, with the larger number of bookmarks and volumes the only change noticable?

#8

If I'd do this, would I lose all customizations made to my panels, like applets (and their settings), custom icons, etc?

I think you should be ok there, posted a bit more in the nautilus thread

#9

I followed the instructions from the startpost with the difference that I changed the line in the third step from this:

sudo apt-get build-dep gnome-panel

to this:

sudo aptitude build-dep gnome-panel

... because I would get an error, dependency problems, if I didn't.

That was all I had to change from the instructions, which worked nicely.

I also noticed my launchers and applets and everything is just the way it was, with the exception of more bookmarks and devices visible underneath eachother. Yay!

Conclusion: 1) it works 2) the configuration of the gnome-panel is completely kept and reused

#10

[COLOR="DarkRed"]sudo[/COLOR] ./configure

[COLOR="DarkRed"]sudo[/COLOR] make

moooep!

OUCH! You shouldn't, you really shound NOT build packages as root. Most probably you'll run into segmentation faults, wondering why, cause a Seg Fault only tells you it just seg faulted.

Regressions based upon these commands are very likely.

#11

thank you, worked great. much easier to navigate between subfolders of subfolders

edit: worked great again w/ new installation (Lucid)

#12

I filed a bug report on launchpad for this because I don't think it is proper to hard-code this... http://ubuntuforums.org/showthread.php?t=1066964:(

#13

Gathered from throughout. The Right way!

  1. Install apt-build
sudo apt-get update
sudo apt-get install apt-build

3) Install files required to build gnome-panel from source and download the source

  • Optimization level: Medium
  • Add apt-build repository to sources.list: Yes
  • Architecture: <SELECT YOUR ARCHITECTURE>
sudo aptitude build-dep gnome-panel
sudo apt-build source gnome-panel

cd /var/cache/apt-build/build/gnome-panel-*
sudo gedit gnome-panel/panel-menu-items.c

#define MAX_ITEMS_OR_SUBMENU 5

I changed it to 30. Save.

6) Install the modified gnome-panel and restart it

(Sudo is necessary. Otherwise is _does not_ work. :)


sudo ./configure
sudo make
sudo make install
killall gnome-panel
#14

not in this build directory... whatever

#15

Thank you! It worked for me!

#16

can this also be done for the "Removable Media" section? i've got another linux install and its 4 partitions show up here, as well as an NTFS partition, my DVD drive and any usb media i have plugged in and after 5 it defaults to the drop down menu too.

#17

can this also be done for the "Removable Media" section?

'Removable media' should also be included, in other words not just limited to bookmarks, see screen

#18

I have a problem while i'm writing this command on Terminal

I write sudo apt-get build-dep gnome-panel And i get this:

Leyendo lista de paquetes... Hecho

Creando árbol de dependencias Leyendo la información de estado... Hecho E: No se pudo encontrar un paquete de fuentes para gnome-panel

it says: Could not find a source package for gnome-panel

What can i do to fix it? I can't go on because of this messege. :(

Regards!!!

#19

Could not find a source package for gnome-panel

if not resolved by now you need to enable "Source code" for the ubuntu repos in your sources.

Easiest way is to open System -> Admin.. -> Software Sources and on main page ck. the box that says "Source code", then click close and reload.

Make sure the box gets an actual check mark, not just turn a color

#20

You are a Genious!!! Thanks a lot!!!!

I could do it doing what you told me. :D

Really, thank you!!!!

Regards From Argentina!

#21

This is an excellent guide, many thanks! I'd been looking for a way to around this stupid restriction for eternity and I'm glad someone much smarter than me figured it out.

On another note why is such a simple modification so cumbersome? I love that you can do things like this in Linux don't get me wrong - open source is great for reasons just like this, but seriously recompiling the whole panel just to change one setting is a little like overkill. I think this UI restriction needs to be addressed in a future release, maybe a gconf option or setting? (though I'd imagine this wouldn't be a simple task!)

#22

Is it possible for anybody to give a deb or a ppa for this?? pretty please :KS:KS

#23

Thanks, worked fine for me and find it very useful

#24

My solution was to install Ubuntu System Panel, screenie below. I prefer this much over the standard menu:

#25

theZoid said: My solution was to install Ubuntu System Panel, screenie below. I prefer this much over the standard menu:

Never saw that menu before. How can I get it? Link?

#26

Just finished! Thank you very much. :D

#27

JohnLau: I agree this is a bug. At the very least, this should be a (hidden) gconf option, but ideally there should be a GUI way to modify this parameter. Even better, gnome-panel should detect an appropriate value based on the size of your screen.

However, the link you posted is not to a bug report, but to this thread. Did you post the wrong link?

#28

I realise that this is an old thread, but is there any way - outside of recompiling gnome panel - to change this?

Not sure why, but these smaller things seem to incite my Computer Rage the most.

#29

Beetroot Dog said: I realise that this is an old thread, but is there any way - outside of recompiling gnome panel - to change this?

Not sure why, but these smaller things seem to incite my Computer Rage the most.

same here, anyone?

#30

I tried this, and it doesn't seem to work... This is the error I'm getting:

<code> checking for intltool >= 0.40.0... ./configure: line 4284: intltool-update: command not found found configure: error: Your intltool is too old. You need intltool 0.40.0 or later. </code>

I tried to update intltool, and it doesn't seem to be working... (My panel has been having weird problems lately, though- every time I try to add the quick-lounge-panel it crashes...)

Is it possible to somehow make a package for this, as someone else said?

#31

In case you don't wanna build gnome-panel from sources, you can simple patch it in binary!

Here is patch for Ubuntu 11.04 natty:


gnome-panel
00049D9E: 08 7F
00049FD0: 08 7F
0004A252: 08 7F

Disassembling, patching, backuping, replacing and restarting gnome-panel takes less then 5 minutes. That is how i did it.