Reputation: 2812
i need to bring a window in foreground by specifying its process ID. i tried to use xdotool
window_id=xdotool search --class rdesktop
and here i am getting the window ID of the rdesktop process eg : 41943382
and then i use xdotool activewindow 41943382 and this will bring the window to top and make it active
but here if i use more than one process of same rdesktop it is giving all of its window ID and i wan to know which process ID is associated with with window ID
i tried for xdotool search --pid 4535
but this gives an error as many of the xwindow system doesn't support it,
So is there any other way that i can get the window ID and bring it in foreground for shell . If from c also ok but i am not that much good in c so i try in shell script
Upvotes: 2
Views: 2095
Reputation: 1498
That's pretty tricky! X is pretty abstracted from PID, because you may have clients from multiple hosts with duplicate PIDs. I'd try using the window title and embedding identifying information in it. rdesktop allows setting the title with the -T option.
Upvotes: 2