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

[solved]for_window qemu windows

asked May 16 '14

maximilian gravatar image

updated May 17 '14

Hi,

I'm looking for a good way to use qemu with Windows 7.

My problem: qemu + Windows 7 does not seem aware of the window size so the screen doesn't look nice at all. My display is 1440 x 900 and I'd like qemu to be in an floating 1280 x 800 window (that means 1280 x 800 available to Windows and not 1280 x 800 minus i3 boarder + stuff available to Windows). I tried

for_window [class="QEMU*"] floating enable, size 1280 x 800

in my ~/.i3/config with no effect. The window is not floating automatically and if I put it in floating mode I still have to adjust the size manually. My qemu window is named QEMU Windows (qemu parameter -name Windows)

Thank you for your suggestions. Maximilian

1 answer

Sort by » oldest newest most voted
2

answered May 16 '14

Adaephon gravatar image

This should work:

for_window [title="^QEMU \(Windows\)$"] floating enable

Explanation:

  1. If you want to match the title of a window you should use title not class. (BTW: the class of a qemu window is qemu-system-[arch] where [arch] is the emulated architecture)

  2. Criteria are specified as PCRE (Perl compatible regular expression). So if you want to match both "QEMU this" and "QEMU that" you need "QEMU.*" (Note the dot) or just "QEMU" as by default PCRE do not have to match the whole tested string. "^QEMU \(Windows\)$" matches exactly "QEMU (Windows)" (^ is the start of a string, $ its end, ( and ) are special in PCRE and have to be escaped with \)

  3. There is no size command, only resize and that does only allow changes relative to the current size. So it does not work that way.

    But: Unless you set floating_minimum_size or floating_maximum_size, i3 does not restrict programs from resizing windows in floating mode. Windows in floating mode will take their default size, usually even when they initially started in tiled mode (some programs try to keep their geometry when pushed to floating, but not that many). That means, your qemu window should be able to resize on its own. (If it works for other window managers, it should work for i3)

Comments

Thanks. It works. :)

maximilian gravatar imagemaximilian (May 17 '14)edit

Question Tools

Stats

Asked: May 16 '14

Seen: 226 times

Last updated: May 17 '14