LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-23-2005, 05:55 AM   #1
Ynot Irucrem
Member
 
Registered: Apr 2005
Location: Perth, Western Australia
Distribution: Debian
Posts: 233

Rep: Reputation: 30
how to get id of a window?


how can i get the id of the current window for use in xwd -id <id>?
 
Old 08-24-2005, 12:44 AM   #2
flower.Hercules
Member
 
Registered: Aug 2005
Distribution: Gentoo
Posts: 228

Rep: Reputation: 31
`xwininfo`

then click the window. I am thinking you would like to use this in a script, though?

Also, `xwd -id pick` will allow you to click it and it will automagically put the window id in for you of the clicked window. What do you plan on using this for? I could answer it better if I knew If you are using FVWM, there are commands built-in for grabbing the current ID, other window managers have similar features.

Last edited by flower.Hercules; 08-24-2005 at 01:00 AM.
 
Old 08-24-2005, 01:22 AM   #3
flower.Hercules
Member
 
Registered: Aug 2005
Distribution: Gentoo
Posts: 228

Rep: Reputation: 31
echo $WINDOWID

in the terminal prints the window id. I'm not sure if that helps either.

Something like:

Code:
#! /bin/sh

declare -r WINNAME=$(xprop -id $WINDOWID WM_NAME | cut -d'"' -f2)
declare -r WINID=$(xwininfo -name $WINNAME | grep xwininfo | cut -d' ' -f4)

exit
stores the `proper` window id in the variable $WINID.

HTH

Last edited by flower.Hercules; 08-24-2005 at 01:24 AM.
 
Old 08-24-2005, 01:38 AM   #4
Ynot Irucrem
Member
 
Registered: Apr 2005
Location: Perth, Western Australia
Distribution: Debian
Posts: 233

Original Poster
Rep: Reputation: 30
Thanks both of you for replying.

EDIT: haha lol i'm an idiot. i didn't look at the name on the second post.

yeah i already saw the xwininfo command, but I wanted something that doesn't require user input because, yes, it is to be used in a script. I wanted it to just get the id of the active window. I'm using fluxbox. I can't seem to find anything in the fluxbox docs about this. I'm at school now so I'll have to wait to test that $WINDOWID thing.

Last edited by Ynot Irucrem; 08-24-2005 at 01:39 AM.
 
Old 08-24-2005, 08:12 AM   #5
flower.Hercules
Member
 
Registered: Aug 2005
Distribution: Gentoo
Posts: 228

Rep: Reputation: 31
We are both happy to try and help I will continue to search; I would like to write a script, after seeing your post, that does similar things with the current window (get id), it was much too late last night and everything was blurring on the monitor

There is a glutGetWindow, or similar, that get's the window id in a glut script. I don't know how this could be integrated into your script. Good luck!
 
Old 08-24-2005, 12:39 PM   #6
Ynot Irucrem
Member
 
Registered: Apr 2005
Location: Perth, Western Australia
Distribution: Debian
Posts: 233

Original Poster
Rep: Reputation: 30
I don't know what a glut script is, I looked up glutGetWindow, and it seems to be an OpenGL function, but I don't know OpenGL (I'm not even that good with C yet), and I wouldn't know how to integrate that anyway. I saw a similar function in GTK, but again, the problem of integration.

The $WINDOWID variable seems to only exist in an xterm.

Damn, I thought this would have a simple "here, type this:" solution Maybe I should have posted in the programming forum.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why mandriva 10.2 gnome2.8 system freezes upon resizing/opening window/new window skaramanger Mandriva 8 08-30-2005 11:22 AM
why mandriva 10.2 gnome2.8 system freezes upon resizing/opening window/new window skaramanger Mandriva 2 08-15-2005 05:38 PM
Window Managers vs Window Shell Environments DJOtaku Linux - General 7 08-09-2005 01:43 PM
Javascript - what to use rather than window.close() then window.open() davee Programming 2 04-11-2005 09:28 AM
creating a window in linux with a 'window' variable??! (openCV) vmok82 Programming 1 02-28-2005 04:38 PM


All times are GMT -5. The time now is 02:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration