The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

is it possible to focus a window by name / id using i3-msg?

asked 2012-12-13 16:56:12 +0000

ingo gravatar image

Hi,

is it possible to focus a specific application window by internal id / name, using i3-msg?

I've tried:

i3-msg '[id="135748312"] focus'

which gives

[{"success":true}]

but the window is not focused (or at least not shown). It is a window on the same workspace, I would like to be able to switch workspaces at the same time.

(I know that

i3-msg workspace 9 focus

works)

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2012-12-14 20:54:03 +0000

Michael gravatar image

As http://i3wm.org/docs/userguide.html#c... explains:

id Compares the X11 window ID, which you can get via xwininfo for example.

con_id Compares the i3-internal container ID, which you can get via the IPC interface. Handy for scripting.

So, just use i3-msg '[con_id="135748312"] focus'

edit flag offensive delete link more

Comments

Thanks, that's it :-)

ingo gravatar imageingo ( 2012-12-16 11:32:59 +0000 )edit

Question Tools

Stats

Asked: 2012-12-13 16:56:12 +0000

Seen: 2,101 times

Last updated: Dec 14 '12