linux - How to check which program runs inside gnome-terminal -
I want to write a program that prints the currently focused window name and if it is a gnome terminal The program running inside the current gnome-terminal tab (for example, if there is a Vim session running)
To get the current focused window name, I used:
EXPOP-ROT | Grep "_NET_ACTIVE_WINDOW (WINDOW)"
XProp -id 0x220ad5a | Grep "WM_CLASS (STRING)"
If the current window is a GNOME terminal, it will return 'gnome-terminal'
but how do I specify gnome- Can know the program running within the terminal (more accurate: inside the current gnome-terminal tab)? I thought about using dbus but the GNOME-terminal does not support it.
Obtain the GNOME Terminal PID, and check that in which process this number is PPID.
I have a few days ago, see this link for details.
Comments
Post a Comment