If you want to resize the firefox window that has the keyboard focus:
for nw in `xdotool search --classname Navigator`; do
test "$fw" = "$nw" && xdotool windowsize "$fw" 800 600
Notice that this will not work if you're typing the script in a terminal; in that case it's the terminal that has the focus. You can use
getactivewindow instead of
getwindowfocus if your window manager supports
If instead you want to resize the top-first firefox window:
nw=`xdotool search --classname Navigator | tail -1`
test "$nw" && xdotool windowsize "$nw" 800 600
If you're using
dwm, then please consider this (from the dwm's homepage):
dwm is customized through editing its source code, which makes it
extremely fast and secure - it does not process any input data which
isn’t known at compile time, except window titles and status text read
from the root window’s name. You don’t have to learn Lua/sh/ruby or
some weird configuration file format (like X resource files), beside
C, to customize it for your needs: you only have to learn C (at least
in order to edit the header file).
Because dwm is customized through
editing its source code, it’s pointless to make binary packages of it.
This keeps its userbase small and elitist. No novices asking stupid
This means that calling an external script is simply not going to work.
You're supposed to resize windows, check their class, etc from
C, by modifying
dwm's source code.