Question

I'll start by saying I know absolutely nothing about java, so this might very well be a very stupid question.

Anyway I have the following bookmarklet to add the current page to Google Bookmarks

javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open("http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+c(b.location)+"&title="+c(b.title),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=420px,width=550px,resizable=1,alwaysRaised=1");a.setTimeout(function(){d.focus()},300)})();

This works and everything, but I use the xmonad tiling window manager which assigns actions (float, ignore, goto another workspace, etc.) based on a window's WM_CLASS and WM_NAME (found using 'xprop' in terminal then clicking on a window) and for whatever reason the popup that this bookmarklet creates ignores the settings I have for it and tiles itself with the other windows (I'd like it to popup/float... the way it does by default in non-tiling WMs).

So my question is, is there something in this code that's doing this and/or anything that can be added/omitted to make it do what I want?

Thanks

Edit:

Was it helpful?

Solution

You can't really rely on the title being set correctly at the time a window is created. You may have to play around with other properties to find some that are set correctly from the beginning. You might try something like isInProperty "WM_WINDOW_ROLE" "pop-up" instead of title =? "Google - Bookmarks - Chromium" or similar.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top