On Sat, Oct 31, 2009 at 11:34:08PM +0100, Paweł Zuzelski wrote:
> On Sat, 31 Oct 2009, Gerry LaMontagne wrote:
> 
> > I was wondering if anyone knew off the top of their head if it's possible 
> > to create pop-up prompt boxes?  I'm guessing yes, but I haven't
> > looked into it thoroughly yet and, yes, I'm being lazy coming here to see 
> > if anyone has done it or knows if it can be done.  If it's
> > possible, I think it would make for a useful means of controlling uzbl.
> 
> I use kdialog for that purpose. I have such entry in uzbl
> configuration:
> 
> bind    G         = sh 'kdialog --inputbox URL: "$6" | sed "s/^/set uri=/" > 
> $4'
> 
> BTW obvious prompt obviously seems to be more awesome solution.
> 
> I'm using uzbl with awesome for few months. I have some scripts that
> help me to find proper uzbl window. I think it is more usable
> (faster!) then firefox-style tabs.
> 
> I bind following function to Modkey+w. It displays dmenu with titles
> of all uzbl windows. It raises window that I choose from dmenu.
> 
> function goto_uzbl()
>   awful.tag.viewonly(uzbl_tag)
>   awful.util.spawn("/home/users/z/.config/awesome/something-like-tabs")
> end
> 
> something-like-tabs is following shell+awk+lua oneliner script:
> 
> #!/bin/sh
> xwininfo -int -root -children \
>   | awk -vFS='"' '/Uzbl browser/ {
>                            gsub("^     ", "");
>                          sub("^", "'"'"'", $2);
>                          sub("$", "'"'"'", $2);
>                          print $2
>                        }' \
>   | dmenu -b -i -l 30 \
>   | awk '{
>       print "a=clientfind({name="$0"})\n\
>       awful.client.movetotag(uzbl_tag, a)\n\
>       client.focus=a\n\
>       a:raise()"
>     }' \
>   | awesome-client
> 
> -------
> 
> Another useful uzbl-related awesome function in my rc.lua is
> function, that spwans new uzbl instance on url from selection:
> 
> function web_clip()
>   awful.tag.viewonly(uzbl_tag)
>   awful.util.spawn_with_shell("uzbl" .. " --uri=" .. selection() )
> end
> 
> -- 
> Regards,
> Paweł
> 

Thanks- cool stuff.  I'll check out kdialog while I'm at it.

I'd actually tied awesome's pop-menu stuff into uzbl along with a
favorites file.  The following loop will build a menu based on a file
with name-url pairs per line, each in quotes.

for lines in io.lines(file) do
  local t = {}
  local label, url = string.match(line, "^\"(.+)\"%s+\"(.+)\"$" )

  table.insert(t, site)
  table.insert(t, "uzbl " .. url)
  table.insert(wwwmenu_t, t)
end

You can then just bind a keypress to launch a menu using wwwmenu_t.

Regards-
Gerry LaMontagne

-- 
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.

Reply via email to