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 2014-05-16 00:56:41 +0000

maximilian gravatar image

updated 2014-05-17 19:33:38 +0000

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-05-16 14:36:03 +0000

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)

edit flag offensive delete link more

Comments

Thanks. It works. :)

maximilian gravatar imagemaximilian ( 2014-05-17 19:33:08 +0000 )edit

Question Tools

Stats

Asked: 2014-05-16 00:56:41 +0000

Seen: 226 times

Last updated: May 17 '14