On Mon, 18 Nov 2013 22:05:20 +0100
Josip Deanovic <[email protected]> wrote:
> Richard, I have just checked the script above and I don't think it
> would work as expected.
It's a Q&D script :) And it works for me :)
> For example $$ would return the PID of the
> current shell and not the PID of your evince process.
> However there is a special parameter $! which would expand to the PID
> of the most recently executed background command and then you could
> write something like this:
You've got a point! :)
> #!/bin/dash
>
> HPOS=64
> VPOS=64
> HSIZE=1280
> VSIZE=960
>
> /usr/bin/evince "$1" &
> sleep 1
> PID=$!
That's better indeed :)
> WNAME=$(wmctrl -lp | awk '/'${PID}'/ {print $1}')
> wmctrl -ir ${WNAME} -e "0,${HPOS},${VPOS},${HSIZE},${VSIZE}"
>
>
> As you can see I have also used window window ID related to the evince
> PID instead of the window name. This makes it somewhat easier to
> target the window.
Start two instances of evince and see hat happens! ;-)
For the moment it doesn't work, the WNAME is parsed succesfully, but no
resizing takes place. I'll have a look at it.
R.
--
___________________________________________________________________
It is better to remain silent and be thought a fool, than to speak
aloud and remove all doubt.
+------------------------------------------------------------------+
| Richard Lucassen, Utrecht |
+------------------------------------------------------------------+
--
To unsubscribe, send mail to [email protected].