You are not logged in.

#1 2011-08-20 11:03:44

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

[SOLVED] Getting Uzbl to integrate with Gnome-Shell

I guess I'm one of the few who really appreciates the workflow offered by Gnome Shell. One thing that I've found is really great about it is that it renders tabbed-browsing obsolete (*in my opinion*...I don't intend to start an argument about the merits of this statement): tabbed browsing was developed to alleviate task bar clutter. Gnome Shell lacks a task bar and so basically you end up just recapitulating the task bar clutter problem inside a browser. Instead, lately I've been using Epiphany as my main browser with the tab bar turned off and I open all links in new browsers. I then either use the Activities overview or, more frequently, use Alt-` to switch between all the Epiphany windows. Either way I get a thumbnail image of the browser and I see the full title, which is more informative than a favicon and a couple characters followed by an ellipsis in a squashed tab.

That said, I've had some problems with Epiphany so I decided to give Uzbl and Luakit a try. While Luakit can fit with this kind of browsing workflow,  Uzbl ended up being more to my liking. Unfortunately, I can't get Uzbl to work with this workflow. This is due to the fact that new windows are launched from a shell command, and in Gnome Shell, shell commands are treated as separate applications, so with multiple Uzbl windows open, they all reside separately on the Alt-Tab dialog, rather than together under one icon on Alt-Tab, so I can use Alt-` to switch between them.

I created an uzbl.desktop item:

#!/usr/bin/env xdg-open

[Desktop Entry]
Exec=uzbl-browser -g 'maximized'
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=/usr/share/uzbl/examples/data/uzbl.png
Name[en_US]=Uzbl
Name=Uzbl
Icon=/usr/share/uzbl/examples/data/uzbl.png
Categories=Network;GTK;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;

If I launch multiple Uzbl instances from the Gnome Shell Activities overlay, I get what I want: multiple instances all grouped under one application icon. However, since the in-application command for opening a new window (ie the default 'w' and 'W' commands) still use a shell command, any windows opened by that method are counted as separate applications. So, I need a way to launch Uzbl in a Gnome-y way from the terminal.

I discovered xdg-open, which uses the default application to open a URI. I used

xdg-settings set default-web-browser uzbl.desktop

to set Uzbl as the default web browser. However, using xdg-open still opens URIs with Epiphany. If I go to System Settings -> System -> Default Applications, only Epiphany and Firefox are available in the drop-down menu. If I use gconf-editor and go to desktop.gnome.applications.browser, Uzbl is set there as  the command to run. I can't find any equivalent in dconf-editor.

I think the solution will be to use xdg-open to launch new windows in Uzbl, but I need to get Gnome Shell to recognize Uzbl as a possible default browser. Does anyone have any idea how to do this? I added the MimeType to the .desktop file but it still doesn't recognize it. Any tips?

ps - I highly recommend to anyone willing to experiment with their browsing workflow to give this method a try...it won't be for everyone, especially not the 50-tab-open-at-all-times people, but it might appeal to some.

Last edited by jakobcreutzfeldt (2011-08-20 19:53:52)

Offline

#2 2011-08-20 11:05:05

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [SOLVED] Getting Uzbl to integrate with Gnome-Shell

BTW, for what it's worth, Gnome Shell won't recognize Luakit as a potential default browser either

Offline

#3 2011-08-20 11:07:15

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED] Getting Uzbl to integrate with Gnome-Shell

jakobcreutzfeldt wrote:

BTW, for what it's worth, Gnome Shell won't recognize Luakit as a potential default browser either

have you set the default browser to luakit/uzbl after adding the MimeTypes from System Settings->System Info-> Default apps?


Give what you have. To someone, it may be better than you dare to think.

Offline

#4 2011-08-20 11:09:52

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [SOLVED] Getting Uzbl to integrate with Gnome-Shell

wonder wrote:
jakobcreutzfeldt wrote:

BTW, for what it's worth, Gnome Shell won't recognize Luakit as a potential default browser either

have you set the default browser to luakit/uzbl after adding the MimeTypes from System Settings->System Info-> Default apps?

Yes, like I said, only Epiphany and Firefox are available there.

Offline

#5 2011-08-20 11:13:08

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED] Getting Uzbl to integrate with Gnome-Shell

i guess is not there because your uzbl.desktop is not valid.try to delete the top extra lines before [Desktop Entry] and place it in /usr/share/applications and run as root  update-desktop-database -q


Give what you have. To someone, it may be better than you dare to think.

Offline

#6 2011-08-20 11:29:52

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [SOLVED] Getting Uzbl to integrate with Gnome-Shell

Well, what you said worked as far as getting Uzbl to be a default browser.

Unfortunately, it looks like using xdg-open from a shell doesn't solve the bigger problem of how to get all open Uzbl instances to be counted as one application by Gnome Shell as if they were all launched from the activities overlay.

I see two other possible options, both involving a lot more work than a simple terminal command:
1) build a gnome-centric version of Uzbl to make it play nicer with Gnome's window management
2) make a clever script that handles this either through some kind of forking or maybe through abuse of Uzbl's sockets, but I'll be honest and say that I don't even know where to start with this. I tried making a simple Python client/server script, in which a server instance forks child threads that launch Uzbl, but it didn't solve the problem.

Offline

#7 2011-08-20 19:03:40

keis
Member
Registered: 2011-08-20
Posts: 1

Re: [SOLVED] Getting Uzbl to integrate with Gnome-Shell

Hi.

a search turned up this http://live.gnome.org/GnomeShell/ApplicationBased which says
"To ensure the GNOME 3 Shell will track your application, you can also set the WM_CLASS X window property to be the same as your application's .desktop file name, without the .desktop extension (n.b. case is not important)."
and for uzbl the wm class is 'uzbl-core' so the name would be uzbl-core.desktop

if you do it this way you could get around having a odd way of launching uzbl, I think

it also talks about startup notifications which I think is not gnome specific. Could make some sense to have in uzbl if you can find some small library to do it.

Offline

#8 2011-08-20 19:53:35

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [SOLVED] Getting Uzbl to integrate with Gnome-Shell

YES!!

It works. I also had to change the name of the application in the .desktop file to also be Uzbl-core. And you're right, I didn't have to  do any kind of weird launching like with xdg-open.

Thanks!!! Now I can finally get back to customizing the hell out of it.

Here's the final uzbl-core.desktop file, for anyone who's curious. I still just have it in my ~/.local/share/applications directory.

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=/usr/share/uzbl/examples/data/uzbl.png
Name[en_US]=Uzbl-core
Exec=uzbl-browser -g 'maximized'
Name=Uzbl-core
Icon=/usr/share/uzbl/examples/data/uzbl.png
Categories=Network;GNOME;GTK;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=True

Last edited by jakobcreutzfeldt (2011-08-20 19:54:14)

Offline

Board footer

Powered by FluxBB