Ask Your Question
0

How to get window ID of gnome-terminal

asked 2017-10-04 14:56:21 -0600

powergame gravatar image

updated 2017-10-04 14:57:05 -0600

I need the window id of gnome-terminal to pass to recordmydesktop for recording, but I cannot get it using xwininfo. Does anyone know of a way I can get the window id of gnome-terminal in which I am entering commands and which I am going to record?
Note: in the below image you see that xwindow waits for a window to be clicked, but it does not do anything when I click the current gnome-terminal window.

image description

edit retag flag offensive close merge delete

Comments

1

What if you run xwininfo in different terminal window, than the one you're going to check?

ozeszty gravatar imageozeszty ( 2017-10-04 15:34:29 -0600 )edit

I cannot open two gnome-terminal windows simultaneously

powergame gravatar imagepowergame ( 2017-10-04 16:23:04 -0600 )edit

That doesn't sound right. I don't use Gnome, and haven't since before Gnome 3 came out, but I do know that you should be able to open more than one instance at a time.

sideburns gravatar imagesideburns ( 2017-10-04 16:35:17 -0600 )edit

You can open a new Gnome Terminal in two ways: 1) On the dashboard click the terminal icon with you second mouse button and select New Window 2) On an existing Gnomw Terminal select from the menu bar File -> Open Terminal or simply press Shift+Ctrl+N

jmt gravatar imagejmt ( 2017-10-04 19:55:20 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-10-05 14:02:10 -0600

masteroman gravatar image

There'a an xprop utility. You start it in some other terminal, then point the + sign to the window and click on it. You should get back something like the one below. From that you should be able to extract needed info. Is that what you're looking for?

[ivan@kirk ~]$ xprop 
_NET_WM_ICON_GEOMETRY(CARDINAL) = 2447, 1049, 166, 30
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE
_KDE_NET_WM_FRAME_STRUT(CARDINAL) = 5, 5, 23, 5
_NET_FRAME_EXTENTS(CARDINAL) = 5, 5, 23, 5
_NET_WM_DESKTOP(CARDINAL) = 0
_KDE_NET_WM_ACTIVITIES(STRING) = "48eb0451-943e-4664-8062-ce4488d444f8"
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
_NET_WM_STATE(ATOM) = 
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                Initial state is Normal State.
                bitmap id # to use for icon: 0x880000a
                bitmap id # of mask for icon: 0x8800015
                window id # of group leader: 0x8800001
_GTK_THEME_VARIANT(UTF8_STRING) = "dark"
XdndAware(ATOM) = BITMAP
_NET_WM_ICON(CARDINAL) =        Icon (32 x 32):

_GTK_APP_MENU_OBJECT_PATH(UTF8_STRING) = "/org/gnome/Terminal/menus/appmenu"
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 531114972
_GTK_WINDOW_OBJECT_PATH(UTF8_STRING) = "/org/gnome/Terminal/window/1"
_GTK_APPLICATION_OBJECT_PATH(UTF8_STRING) = "/org/gnome/Terminal"
_GTK_UNIQUE_BUS_NAME(UTF8_STRING) = ":1.1273"
_GTK_APPLICATION_ID(UTF8_STRING) = "org.gnome.Terminal"
_NET_WM_OPAQUE_REGION(CARDINAL) = 3, 0, 1090, 3, 0, 3, 1096, 745
_NET_STARTUP_ID(UTF8_STRING) = "kirk.tomica.lan;1507229953;504725;641_TIME531114715"
_NET_WM_USER_TIME(CARDINAL) = 531124297
WM_WINDOW_ROLE(STRING) = "gnome-terminal-window-bc1c5585-997c-4775-bca0-060815758c8d"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 142606344, 142606345
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x8800007
WM_CLIENT_LEADER(WINDOW): window id # 0x8800001
_NET_WM_PID(CARDINAL) = 24486
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "kirk.tomica.lan"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                program specified minimum size: 281 by 60
                program specified resize increment: 9 by 18
                program specified base size: 16 by 28
                window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "gnome-terminal-server", "Gnome-terminal"
WM_ICON_NAME(STRING) = "ivan@kirk:~"
_NET_WM_ICON_NAME(UTF8_STRING) = "ivan@kirk:~"
WM_NAME(STRING) = "ivan@kirk:~"
_NET_WM_NAME(UTF8_STRING) = "ivan@kirk:~"
edit flag offensive delete link more

Comments

Thanks, but this does not capture Gnome Terminal windows. It only does other windows Like Firefox, etc.

powergame gravatar imagepowergame ( 2017-10-09 22:08:52 -0600 )edit

Hmm, but as you can see from my output above, I've managed to catch it...

Are you sure you're running X session and not the default Wayland one?

masteroman gravatar imagemasteroman ( 2017-10-16 07:17:12 -0600 )edit

Not sure, how can I check that?‌ I guess it's the default one!

powergame gravatar imagepowergame ( 2017-10-16 10:05:28 -0600 )edit

While logging into the system, click on the gear icon. If it is GNOME then wayland is used, and properties are different then. GNOME on Xorg option should use X11 session.

masteroman gravatar imagemasteroman ( 2017-10-16 14:16:46 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-10-04 14:56:21 -0600

Seen: 552 times

Last updated: Oct 05 '17