retrieve url of focused browser?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

retrieve url of focused browser?

Eric Abrahamsen-2
All this renewed activity has reminded me I have a few StumpWM utilities
that I've been meaning to finish. One is an extension to emacs org-mode,
letting StumpWM call in to the org-mode capture process.

One thing I'd really like to have working for that is the ability to
extract a url from the focused web browser. From what I can tell, that
information isn't present as part of the xlib window data. So it's
sounding a bit iffy.

Does anyone have any bright ideas in this direction? I'd be willing to
write multiple browser-specific implementations, but I'm not even sure
where to start. Perhaps sending a fake keypress to highlight the URL
bar, and getting the x selection...?

Thanks!
Eric


_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: retrieve url of focused browser?

Alex Kost
Eric Abrahamsen (2014-02-01 08:18 +0400) wrote:

> All this renewed activity has reminded me I have a few StumpWM utilities
> that I've been meaning to finish. One is an extension to emacs org-mode,
> letting StumpWM call in to the org-mode capture process.
>
> One thing I'd really like to have working for that is the ability to
> extract a url from the focused web browser. From what I can tell, that
> information isn't present as part of the xlib window data. So it's
> sounding a bit iffy.
>
> Does anyone have any bright ideas in this direction? I'd be willing to
> write multiple browser-specific implementations, but I'm not even sure
> where to start. Perhaps sending a fake keypress to highlight the URL
> bar, and getting the x selection...?

Not all browsers have URL bar.  IMHO this is the task for the browser
itself, not the WM.

(Not related, but may be useful for someone) To make conkeror (the
browser I use) create org-mode links I use the recipe from
<http://emacs-fu.blogspot.ru/2010/12/conkeror-web-browsing-emacs-way.html>

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

retrieve url of focused browser?

Michael Raskin-3
In reply to this post by Eric Abrahamsen-2
>All this renewed activity has reminded me I have a few StumpWM utilities
>that I've been meaning to finish. One is an extension to emacs org-mode,
>letting StumpWM call in to the org-mode capture process.
>
>One thing I'd really like to have working for that is the ability to
>extract a url from the focused web browser. From what I can tell, that
>information isn't present as part of the xlib window data. So it's
>sounding a bit iffy.
>
>Does anyone have any bright ideas in this direction? I'd be willing to
>write multiple browser-specific implementations, but I'm not even sure
>where to start. Perhaps sending a fake keypress to highlight the URL
>bar, and getting the x selection...?

There are some funny problems for that…

I do have an implementation for that as a shell script for Firefox. But
if you run it synchronously inside StumpWM key binding handler, you will
have a problem that the keyboard is still grabbed by StumpWM itself.




_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: retrieve url of focused browser?

Feng Shu
In reply to this post by Eric Abrahamsen-2
Eric Abrahamsen <[hidden email]> writes:

> All this renewed activity has reminded me I have a few StumpWM utilities
> that I've been meaning to finish. One is an extension to emacs org-mode,
> letting StumpWM call in to the org-mode capture process.

I use org-capture with stumpwm too:

My stumpwm configure: https://github.com/tumashu/stumpwm-config
My emacs configure: https://github.com/tumashu/emacs-helper

Could you share your extension?


>
> One thing I'd really like to have working for that is the ability to
> extract a url from the focused web browser. From what I can tell, that
> information isn't present as part of the xlib window data. So it's
> sounding a bit iffy.
>
> Does anyone have any bright ideas in this direction? I'd be willing to
> write multiple browser-specific implementations, but I'm not even sure
> where to start. Perhaps sending a fake keypress to highlight the URL
> bar, and getting the x selection...?
>
> Thanks!
> Eric

--


_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: retrieve url of focused browser?

Matt Carroll
You're probably better off using browser extensions for this. I use Vimperator because I like programming lisp in vim because I'm stupid like that, and it's literally just a case of pressing y to yank the URL into the clipboard. I'm sure there are greasemonkey scripts or extensions that do the same thing with a lot less effort than trying to get the window manager to do it


On 1 February 2014 00:47, Feng Shu <[hidden email]> wrote:
Eric Abrahamsen <[hidden email]> writes:

> All this renewed activity has reminded me I have a few StumpWM utilities
> that I've been meaning to finish. One is an extension to emacs org-mode,
> letting StumpWM call in to the org-mode capture process.

I use org-capture with stumpwm too:

My stumpwm configure: https://github.com/tumashu/stumpwm-config
My emacs configure: https://github.com/tumashu/emacs-helper

Could you share your extension?


>
> One thing I'd really like to have working for that is the ability to
> extract a url from the focused web browser. From what I can tell, that
> information isn't present as part of the xlib window data. So it's
> sounding a bit iffy.
>
> Does anyone have any bright ideas in this direction? I'd be willing to
> write multiple browser-specific implementations, but I'm not even sure
> where to start. Perhaps sending a fake keypress to highlight the URL
> bar, and getting the x selection...?
>
> Thanks!
> Eric

--


_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel


_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
Reply | Threaded
Open this post in threaded view
|

Re: retrieve url of focused browser?

Eric Abrahamsen-2
In reply to this post by Alex Kost
Alex Kost <[hidden email]> writes:

> Eric Abrahamsen (2014-02-01 08:18 +0400) wrote:
>
>> All this renewed activity has reminded me I have a few StumpWM utilities
>> that I've been meaning to finish. One is an extension to emacs org-mode,
>> letting StumpWM call in to the org-mode capture process.
>>
>> One thing I'd really like to have working for that is the ability to
>> extract a url from the focused web browser. From what I can tell, that
>> information isn't present as part of the xlib window data. So it's
>> sounding a bit iffy.
>>
>> Does anyone have any bright ideas in this direction? I'd be willing to
>> write multiple browser-specific implementations, but I'm not even sure
>> where to start. Perhaps sending a fake keypress to highlight the URL
>> bar, and getting the x selection...?
>
> Not all browsers have URL bar.  IMHO this is the task for the browser
> itself, not the WM.
>
> (Not related, but may be useful for someone) To make conkeror (the
> browser I use) create org-mode links I use the recipe from
> <http://emacs-fu.blogspot.ru/2010/12/conkeror-web-browsing-emacs-way.html>

Thanks to all responses! Looks like the consensus is: "get the url on
the clipboard however you can, and go from there." I think that's fine
-- the only regret is not having both the url and the HTML page title
together.

I actually use conkeror, and had seen that link above, and have been
considering using it for a bit. But in the end I'd like to be able to
capture TODOs and events and arbitrary text from anywhere, so I decided
to base the operation in StumpWM.

I'll post a link to a file when it's working...

Thanks,
Eric


_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel