giovedì 26 agosto 2010

Dock extension for the GNOME Shell

This is a task bar drop in as a small example of an extension for the GNOME Shell.
Writing extensions for the shell is great fun, there is a lot of nice code to learn from in the shell sources.

Download

Get it here.
Unpack to ~./local/share/gnome-shell/extensions/ and restart your shell (alt+f2, type r and press enter).


Make your own

This is basically the app well from the overview but tucked to the right side of the screen.

In order to write one yourself, merge the AppWell and WellGrid from appDisplay.js.
Rewrite the _allocate and _redisplay functions to layout icons in one column and position the dock.
Subclass the AppIconMenu and make it expand to the left.
Add your dock to the interface using Main.chrome.addActor(dock_actor, { visibleInOverview: false }).
Fill in stylesheet.css.
Instantiate your dock in the main function of extension.js.

9 commenti:

Unknown ha detto...

I am making a package of this for the Arch User Repository for wide testing. Two questions:

1) What should I list as the version number? 0.1, 1.0, 0.5?

2) What license is this under? GPL?

torb ha detto...

Hi!

1) I think it really deserves a 0.1 version number;)

2) The code is to a large extent copy paste from the shell sources, so it should keep the original GPL v2 license.

Cheers

Unknown ha detto...

Thank you very much! I found an error with your archive, though. There appears to be an empty file or something in the archive, preventing it from opening correctly. I have corrected the archive and made it available here: http://dl.dropbox.com/u/807039/dock-0.1.tar.gz

torb ha detto...

Thanks, didn't spot that.

Unknown ha detto...

Package finished! It can be found here if you use Arch Linux: http://aur.archlinux.org/packages.php?ID=40337. By the way, I love your dock! It works very nice, and it uses very little memory! You did a great job at making a proof of concept. Thanks very much!

torb ha detto...

Glad you like it! Thanks for the package.

flashplay ha detto...

Works well. Would it be possible to have a version integrated in the panel? I mean, there is lots of empty room in the panel

joedoe47 ha detto...

is it possible to change the position of the dock, if so where an I find it(I have tried but with no success). also does it have an option to "autohide" or as docky fans would say "intellihide"(if not how or where would I start to help or add that my self)?

Paul d'Aoust ha detto...

Nice extension! I find that going to the overview is a bit annoying.

I've been trying to get it to delay a bit before popping up, like the Unity dock. I tried wrapping this._showDock in Mainloop.timeout_add(), but it didn't seem to do anything. And anyway, I realised afterwards that that would cause the dock to always display, but after a certain delay.

So that wouldn't work -- I only want it to appear only after I've hovered for a certain time. I suppose timeout.add() would still work, if I added a conditional to check whether leave-event had been triggered after the timeout... but I dunno. I'm pretty new to all this! Any suggestions?