On Thu, Oct 29, 2009 at 08:39:51PM +0100, Dieter Plaetinck wrote: > > On Thu, 29 Oct 2009 20:04:57 +0100 > Tadeusz Sośnierz <tadzi...@gmail.com> wrote: > > > On 29-10-2009 19:59:17, markus schnalke wrote: > > > Surf is able to interface all kinds of programs through xprop, but > > > not in an easy/flexible enough way. The large number of user > > > scripts that extend uzbl is not the result of the larger community, > > > but the result of the interface that makes you want to write > > > ``handler'' scripts. > > > > > > Instead of staying hooked to xprop, surf should create a fifo for > > > input and write stuff to stdout in order to make it easier/more > > > flexible to combine it with helper scripts. This would improve surf > > > much. > > > > > > Here (possibly) more code leads to less complexity combined with > > > more flexibility. > > > > > > > > > It's not enough to just offer possibilities; important is to > > > encourage to use them ... by design. In this point surf fails, > > > whereas uzbl does it right. > > > > > > > > > meillo > > > > Agreed. As now the looks like the only place in which surf uses xprop > > is actually this uri and find handling. It's not really useful for > > setting the address remotely, as we have better or worse patches for > > bookmarks, we can open new surf instances in tabbed, etc. > > Regards, > > Ted > > > > i always think of 'uzbl & surf' as 'wmii and dwm'. > > basically they both encourage you to write things to interact/integrate > with, but wmii and uzbl recommend doing it with separate programs by > providing interfaces such as fifo/socket/virtual filesystem etc. > > whereas dwm and surf recommend you to change the source code to provide > the behaviour you want. > > both are fine approach, both have pros and cons and both appeal to > different people. > but IMHO they both provide a means to change the behavior of the program > as a whole > > (note i haven't actually looked at surf's source code yet, but i > suspect that's how it works) > > Dieter > > How long is the spawn function in surf? I'd say ~ less than two weeks in tip and not yet in stable. So it seems normal that it doesn't give yet a lot of script, let's see how it will be later.
Before the spawn function was in surf, it was harder. But now I can clean all the crapy scripts I had for surf. Don't have to launch surf with -x anymore just to make it write his id somewhere until I get it in a cumbersome way. Just have to use the spawn function with the winid argument or the xprop when I need it. It is as simple as : #define ADDBMK { .v = (char *[]){ "/bin/sh", "-c", \ "bookmark $0", winid, NULL } } { MODKEY, GDK_b, spawn, ADDBMK }, If I need the id in my sh script, $1 in the script gives it to me, whatever surf window I have launched the script from. For more complex task, I understand that one wishes also other interface but I'm also sure that the actual possibility aren't fully exploited yet.