6

I am trying to get the PID of a window "A : Fluid Flow (Fluent) - Meshing" on the right side of this image. The commands that I have found are below. They don't work after I have clicked on the window. I want to kill the right side window which comes from the left side window "Test02 - workbench" without killing both windows. The right side window is obtained by double clicking on Mesh which is located between Geometry and Setup of the right side window. However, I am able to get the PID of the left side window.

$ xprop _NET_WM_PID
_NET_WM_PID:  not found.

$ xprop _NET_WM_PID | cut -d' ' -f3
not

$ xprop
_NET_WM_ICON_GEOMETRY(CARDINAL) = 5, 694, 54, 54
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 28, 0
WM_STATE(WM_STATE):
        window state: Normal
        icon window: 0x0
_NET_WM_DESKTOP(CARDINAL) = 0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT
WM_CLASS(STRING) = "Ansyswbu.exe", "MainWin"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
 specified location: 706, 52
        program specified location: 706, 52
        user specified size: 660 by 716
        program specified size: 660 by 716
        program specified minimum size: 2 by 2
        program specified maximum size: 1356 by 734
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, WM_STATE, WM_CLASS, _MOTIF_WM_MESSAGES
WM_HINTS(WM_HINTS):
        Client accepts input or input focus: True
        Initial state is Normal State.
        bitmap id # to use for icon: 0x4600122
        bitmap id # of mask for icon: 0x4600120
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_STICK, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW
WM_ICON_NAME(STRING) = "A : Fluid Flow (Fluent) - Meshing [ANSYS Academic Research]"
WM_NAME(STRING) = "A : Fluid Flow (Fluent) - Meshing [ANSYS Academic Research]"
_MW_WINDOW_HANDLE_0027d74c_v2(STRING) = "\002", "\003\013"


$ wmctrl -mlpx
...
0x0380000f  0 5159   .                        mymachine   Test02 - Workbench
0x046000a4  0 0      Ansyswbu.exe.MainWin     N/A         A : Fluid Flow        (Fluent) - Meshing [ANSYS Academic Research]
...

With the last command wmctrl -mlpx, it seems that the PID is 5159 for the left side window and 0 for the right side window. How could it be 0?

Thanks.

3
  • 1
    Try a different tool xwininfo. It should say something like xwininfo: Window id: 0x5600004 "A: Fluid Flow . . ." Mar 12, 2017 at 23:51
  • Here is what I get but there is no PID to kill the window. $ xwininfo xwininfo: Please select the window about which you would like information by clicking the mouse in that window. xwininfo: Window id: 0x46000a4 "A : Fluid Flow (Fluent) - Meshing [ANSYS Academic Research]" ...
    – MisterX
    Mar 13, 2017 at 0:00
  • It works with wmctrl and the window id: $ wmctrl -ic 0x046000a4
    – MisterX
    Mar 13, 2017 at 2:00

2 Answers 2

4

It works with wmctrl and the window id.

First, install wmctrl if you don't have it:

sudo apt-get install wmctrl

Second, find the window id with:

$ wmctrl -mlpx
...
0x046000a4  0 0      Ansyswbu.exe.MainWin    N/A    A : Fluid Flow (Fluent) - Meshing [ANSYS Academic Research]
...

Last, kill the beast with a null PID wmctrl:

wmctrl -ic 0x046000a4
1

The command you want is:

xprop | grep _NET_WM_PID
4
  • It gives no results.
    – MisterX
    Mar 12, 2017 at 23:29
  • @MisterX Does a simple xprop give any results?
    – Seth
    Mar 12, 2017 at 23:30
  • Just thought about it. I was editing the post at the same time. Lol
    – MisterX
    Mar 12, 2017 at 23:44
  • @waltinator You missed telling to use the _NET_WM_PID number with kill command: $ xprop | grep _NET_WM_PID _NET_WM_PID(CARDINAL) = 4238 $ kill 4238
    – LobaLuna
    Mar 23, 2019 at 3:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .