On Wed, 9 Jan 2013 13:52:04 +0100
Aaron Digulla <
adig...@gmail.com> wrote:
| The output of this gem looks promising:
|
| for id in $(xprop -root|grep '_NET_CLIENT_LIST_STACKING(WINDOW)'|cut
| "-d#" -f2|sed -e 's/,//g') ; do xwininfo -id $id | gawk '/^xwininfo/ {
| id=$4; title=$0; gsub(/^[^"]+/, "", title);} /-geometry/ { geo=$2; }
| END { print id" "geo" "title }' ; done
|
| I keep the title to make it easier to debug problems in the script.
|
| 2013/1/9 Nazri Ramliy <
ayie...@gmail.com>:
| > On Tue, Jan 8, 2013 at 5:37 PM, Aaron Digulla <
adig...@gmail.com> wrote:
| >> I want to be able to save/restore all top level windows on my desktop. How
| >> would I do that with xdotool?
| >
| > You might be able to do what you want using xprop:
| >
| > xprop -root|grep '_NET_CLIENT_LIST_STACKING(WINDOW)'
| > _NET_CLIENT_LIST_STACKING(WINDOW): window id # 0x3c0008e, 0x2400024,
| > 0x3600024, 0x3800024, 0x2800024
| >
| > It gives you the window ids which you can then use in your script to
| > save/restore their geometries.
| >
| > nazri
|
|
|
You may also like to look at my basic notes on X window ID handling
http://www.ict.griffith.edu.au/anthony/info/X/WindowID.hints
Especially note the section on 'Search Speed' which shows some very
large (order of magnitude) differences in window searches.
NOTE: the xprop search only lists the active (stacking) windows
on my current display it listed 11 windows, as did "wmctrl -l"
but "xlsclients" listed 16 windows
xlsclients -l | perl -e '
$EOR = "Window ";
local $/ = "\n$EOR";
while(<>) {
s/\A/$EOR/ unless $.==1; # clean up start of record
s/$EOR\Z//; # clean up end of record.
print "--- $. ---\n$_";
}
print "--- Total $. Windows ---\n";
'
Anthony Thyssen ( System Programmer ) <
A.Th...@griffith.edu.au>
--------------------------------------------------------------------------
"You are now leaving the emergency airlock!
Thank you for observing all safety precautions." announced the computer.
"Yoh Ho Hoo" as Selby was ejected into space without a jetpack.
-- Classic SciFi Movie "DarkStar", 1974