shell .sh script to pipe xwininfo

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Anniekin
Posts: 246
Joined: Wed 25 Feb 2009, 00:15

shell .sh script to pipe xwininfo

#1 Post by Anniekin »

I need to pass the Desktop window ID to xscreensaver in order have it autostart.

Unfortunately the output of xwininfo is more than just the id so i cannot use ../xscreensaver/xxx -window-id $(`xwininfo -name Desktop'):

xwininfo: Window id: 0x1400003 "Desktop"

Absolute upper-left X: 0
Absolute upper-left Y: 0
Relative upper-left X: 0
Relative upper-left Y: 0
Width: 1280
Height: 1024
Depth: 24
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x20 (installed)
Bit Gravity State: NorthWestGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +0+0 -0+0 -0-0 +0-0
-geometry 1280x1024+0+0

Is there a way of taking just the window id "0x1400003" and passing it on to xscreensaver's command?

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#2 Post by 01micko »

I suspect you aren't using rox-desktop because "Desktop" fails for me, but if I use "ROX-Filer" it works. The principle is the same.

2 ways I know of

Code: Select all

xwininfo -name ROX-Filer | grep "ROX-Filer" | awk '{print $4}'
or

Code: Select all

xwininfo -name ROX-Filer | grep "ROX-Filer" | cut -d ' ' -f4
HTH

Cheers
Puppy Linux Blog - contact me for access

User avatar
Anniekin
Posts: 246
Joined: Wed 25 Feb 2009, 00:15

#3 Post by Anniekin »

Thanks micko,

i used xscreensaver/preferredScreensaver window-id $(xwininfo -name Desktop | awk '/Window id/ {print $4}')

this works also

Post Reply