Here`s the code, could solve problems with getting variables into gtkdialog from functions:
Code: Select all
guiPOS() {
G=($(xwininfo -name "$1" |sed '4,9!d')) # get size and pos. for GUI
((X=G[3]-G[11], Y=G[7]-G[15], W=G[17], H=G[19]))
((X<1)) && ((X=0)); ((Y<1)) && ((Y=0)) ; echo "X=$X,Y=$Y,W=$W,H=$H"
}
overPOS() {
((`guiPOS $1`)) # get main GUI Left and top
popX=$(($X+$offX)) ; popY=$(($Y+$offY)) # get X and Y position offsets
}
The evaluation parentheses take "," instead of Bashes taking ";" for evaluation separators.
How to "can" this in a library? Another words, make it call just like a function does now.
A fix for Bash`s function, call it like a normal function and get back evaluated variables.
Sort of like having the ". " run in the same shell for functions, I`d call this a big fix.