You are not logged in.
Pages: 1
well the story is that im working on a script in a virtual machine and my nature is to write a basic script that does some of the main gaols and doesn't loop untill i get it running smoothly. and i have this script that i can copy and paste into the terminal and it works like a charm but when i run it at the same termal via ./windows7windows i get
$ ./windows7windows
./windows7windows: line 7: /2: syntax error: operand expected (error token is "/2")
./windows7windows: line 8: /2: syntax error: operand expected (error token is "/2")
The -e option expects a list of comma separated integers: "gravity,X,Y,width,height"
the script is
#!/bin/bash
screenx=xrandr |grep current | awk '{print $8}'
screeny=xrandr |grep current | awk '{print $10}'
# screeny=768
posx=$screenx
posy=${screeny%%,}
xpos=$(($posx/2))
ypos=$(($posy/2))
# xpos=$((1024/2))
# ypos=$((768/2))
ak=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)" )
akib=$(echo $ak |awk '{print $5}'|sed 's/0x/0x0/g')
wmctrl -r $akib -i -e 0,0,$ypos,$xpos,$screeny # -b add,maximized_vert
also were i commented out the hard numerical values it worked great but i want it to be dynammic since this will l probbly be packed into a live DVD for some friends of mine. also if there is a better way to do some of this please tell also please note that this is going to be part of a bigger script if i ever get this problem worked out
thanks
Last edited by monkeyslayer56 (2010-03-10 02:34:03)
Offline
Lines 2 and 3 need fixed... something like:
screenx=$(xrandr |grep current | awk '{print $8}')
Offline
thanks alot that did it
Offline
Pages: 1