Re: openbox Digest, Vol 111, Issue 9
Anthony Thyssen <[email protected]> Mon, 3 Dec 2018 09:26:48 +1000
| Newsgroups | gmane.comp.window-managers.openbox |
|---|---|
| Message-ID | <CAHtp78EPzp-2JiVkFE7w7kwnvDX_yKj=Po57PQbsD+LO5rNr0w@mail.gmail.com> |
--===============4773507274096857722==
Content-Type: multipart/alternative; boundary="000000000000f3d665057c125fe1"
--000000000000f3d665057c125fe1
Content-Type: text/plain; charset="UTF-8"
You can discover and figure out the different windows without needing
openbox to do it.
This is especially relevant to the web browsers, which as Gary pointed out
do not differentiate themselves on start up.
How I handle such applications is to use a start up script (in my case
part of the ".xinitrc" but can be any client start up script, or direct
command call).
For this I have a 'wait for window' script "xwin_find"
http://www.ict.griffith.edu.au/anthony/software/#xwin_find
This essentially a loop that looks for a specific window using "xwininfo"
With it I can then do things like...
google-chrome &
if id=`xwin_find 60 "Anthony.* - Google Chrome"`; then
echo "Chrome Window Found (id=$id)"
sleep 1 # pause a moment
xwit -iconify -id $id
else
echo "ERROR: Chrome Window NOT FOUND\!"
fi
This will wait (up to a full minute) for the specified window to appear (
and load the appropriate startup page to identify it), then minimize
(iconify) the window, but you can also resize, position, or move to a
specific window manager desktop, using the appropriate tools.
It works with chrome, firefox, or other tools too.
Alternatively, if you don't mind not having a timeout, you can use "wmctrl"
while :; do
wmctrl -l | grep -q "$string" || continue
: do what you need
break
done
Or even "xdotool" using its "search -sync" function
firefox &
xdotool search --sync --onlyvisible --class Firefox \
windowsize %@ 900 900 windowminimize %@
I hope this helps.
Anthony
On Mon, Dec 3, 2018 at 2:10 AM Gary <[email protected]> wrote:
> All of the _OB_APP_ items for a Firefox window are the same for all
> Firefox windows, making it impossible to have Openbox configure each
> Firefox window uniquely. However, _NET_WM_VISIBLE_NAME is unique for each
> Firefox window that is opening a specific webpage, in that it displays the
> text from the window's title bar. If I understand correctly, that
> information was not available to Openbox when the Firefox window opened.
> Chromium does display unique information for each window, in the form of
> the path to the profile specified on the Chromium command line, so it looks
> like I'll have to keep using Chromium and avoid using Firefox.
>
>
>
--000000000000f3d665057c125fe1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div di=
r=3D"ltr"><div dir=3D"ltr">You can discover and figure out the different wi=
ndows without needing openbox to do it.<div>This is especially relevant to =
the web browsers, which as Gary pointed out do not differentiate themselves=
on start up.</div><div><br></div><div>How I handle such applications is to=
use a start up script=C2=A0 (in my case part of the ".xinitrc" b=
ut can be any client start up script, or direct command call).</div><div><b=
r></div><div>For this I have a 'wait for window' script=C2=A0 "=
;xwin_find"</div><div>=C2=A0 =C2=A0<a href=3D"http://www.ict.griffith.=
edu.au/anthony/software/#xwin_find">http://www.ict.griffith.edu.au/anthony/=
software/#xwin_find</a><br><div dir=3D"ltr">This essentially a loop that lo=
oks for a specific window using "xwininfo"</div><div dir=3D"ltr">=
<br></div><div dir=3D"ltr">With it I can then do things like...</div><div d=
ir=3D"ltr"><br></div><div dir=3D"ltr"><div dir=3D"ltr"><font face=3D"monosp=
ace, monospace">=C2=A0 google-chrome &</font></div><div dir=3D"ltr"><fo=
nt face=3D"monospace, monospace">=C2=A0 if id=3D`xwin_find 60 "Anthony=
.* - Google Chrome"`; then</font></div><div dir=3D"ltr"><font face=3D"=
monospace, monospace">=C2=A0 =C2=A0 echo "Chrome Window Found (id=3D$i=
d)"</font></div><div dir=3D"ltr"><font face=3D"monospace, monospace">=
=C2=A0 =C2=A0 sleep 1=C2=A0 # pause a moment</font></div><div dir=3D"ltr"><=
font face=3D"monospace, monospace">=C2=A0 =C2=A0 xwit -iconify -id $id</fon=
t></div><div dir=3D"ltr"><font face=3D"monospace, monospace">=C2=A0 else</f=
ont></div><div dir=3D"ltr"><font face=3D"monospace, monospace">=C2=A0 =C2=
=A0 echo "ERROR: Chrome Window NOT FOUND\!"</font></div><div dir=
=3D"ltr"><font face=3D"monospace, monospace">=C2=A0 fi</font></div><div><br=
></div><div>This will wait (up to a full minute) for the specified window t=
o appear ( and load the appropriate startup page to identify it), then mini=
mize (iconify) the window,=C2=A0 but you can also resize, position, or move=
to a specific window manager desktop, using the appropriate tools.</div><d=
iv><br></div><div>It works with chrome, firefox, or other tools too.</div><=
div><br></div><div>Alternatively, if you don't mind not having a timeou=
t, you can use "wmctrl"</div><div><br></div><div><div><font face=
=3D"monospace, monospace">=C2=A0 =C2=A0while :; do</font></div><div><font f=
ace=3D"monospace, monospace">=C2=A0 =C2=A0 =C2=A0wmctrl -l | grep -q "=
$string" || continue</font></div><div><font face=3D"monospace, monospa=
ce">=C2=A0 =C2=A0 =C2=A0: do what you need<br>=C2=A0 =C2=A0 =C2=A0break</fo=
nt></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0done</font><=
/div></div><div><br></div></div><div>Or even "xdotool" using its=
=C2=A0"search -sync" function</div><div><br></div><div><div><font=
face=3D"monospace, monospace">=C2=A0 =C2=A0firefox &</font></div><div>=
<font face=3D"monospace, monospace">=C2=A0 =C2=A0 =C2=A0xdotool search --sy=
nc --onlyvisible --class Firefox \</font></div><div><font face=3D"monospace=
, monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0windowsize %@ =
900 900 windowminimize %@</font></div><div><br></div></div><div>I hope this=
helps.</div><div><br></div><div>Anthony</div><div dir=3D"ltr"><br><br><div=
class=3D"gmail_quote"><div dir=3D"ltr">On Mon, Dec 3, 2018 at 2:10 AM Gary=
<<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>>=
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div sty=
le=3D"font-size:12pt;font-family:Tahoma,Arial,Helvetica,sans-serif">
<p>All of the _OB_APP_ items for a Firefox window are the same for all Fire=
fox windows, making it impossible to have Openbox configure each Firefox wi=
ndow uniquely. However, _NET_WM_VISIBLE_NAME is unique for each Firefox win=
dow that is opening a specific webpage, in that it displays the text from t=
he window's title bar. If I understand correctly, that information was =
not available to Openbox when the Firefox window opened. Chromium does disp=
lay unique information for each window, in the form of the path to the prof=
ile specified on the Chromium command line, so it looks like I'll have =
to keep using Chromium and avoid using Firefox.</p>
<p><br></p>
</div></blockquote></div></div></div></div></div></div></div></div></div>
--000000000000f3d665057c125fe1--
--===============4773507274096857722==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18Kb3BlbmJveCBt
YWlsaW5nIGxpc3QKb3BlbmJveEBpY2N1bHVzLm9yZwpodHRwOi8vaWNjdWx1cy5vcmcvbWFpbG1h
bi9saXN0aW5mby9vcGVuYm94
--===============4773507274096857722==--