The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

Why doesn't for_window work in i3-msg?

asked 2013-10-22 00:05:24 +0000

npostavs gravatar image

Is reloading config the only way to set for_window commands?

 i3-msg 'for_window [instance="^floatme$"] floating enable'
ERROR: Your command: for_window [instance="^floatme$"] floating enable
ERROR:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'split', 'floating', 'mark', 'resize', 'rename', 'nop', 'scratchpad', 'mode'
[{"success":false,"parse_error":true,"error":"Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'split', 'floating', 'mark', 'resize', 'rename', 'nop', 'scratchpad', 'mode'","input":"for_window [instance=\"^floatme$\"] floating enable","errorposition":"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"}]
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-10-22 10:46:14 +0000

Adaephon gravatar image

updated 2013-10-22 10:53:29 +0000

With i3-msg for_window is not needed. Just prepending the criteria is sufficient:

i3-msg '[instance="^floatme$"] floating enable'

This will enable floating mode for any matching and existing window. But it will not change the behavior of windows that are created later.

On the other hand, adding a for_window instruction to the configuration file and reloading will not change any already existing window but only affect new windows.

Depending on what your goal is, you may have to do both.

edit flag offensive delete link more


You mean 'without reloading', as per your initial question? As far as I can tell, there is indeed no way to change the configuration (as in initial settings) without reloading it from file.

Adaephon gravatar imageAdaephon ( 2013-10-22 16:45:57 +0000 )edit

Right I meant 'without'. And the system just ate my comment when I tried to edit...

npostavs gravatar imagenpostavs ( 2013-10-23 03:33:59 +0000 )edit

Question Tools


Asked: 2013-10-22 00:05:24 +0000

Seen: 555 times

Last updated: Oct 22 '13