OXWMOXWM

Window Rules

Automatically configure windows based on their properties

Window rules let you automatically configure windows based on their class, instance, title, or role.

Adding Rules

oxwm.rule.add({
    class = "firefox",
    floating = true,
})

Rule Properties

PropertyTypeDescription
classstringMatch window class
instancestringMatch window instance
titlestringMatch window title
rolestringMatch window role
floatingbooleanForce floating mode
tagintegerSend to specific tag (0-indexed)
fullscreenbooleanForce fullscreen mode

Examples

Force Floating

-- Float GIMP windows
oxwm.rule.add({ instance = "gimp", floating = true })

-- Float Firefox dialogs
oxwm.rule.add({ class = "firefox", title = "Library", floating = true })

-- Float mpv
oxwm.rule.add({ instance = "mpv", floating = true })

Send to Tag

-- Send Spotify to tag 9
oxwm.rule.add({ class = "Spotify", tag = 8 })

-- Send Discord to tag 8
oxwm.rule.add({ class = "discord", tag = 7 })

Combine Properties

oxwm.rule.add({
    class = "Steam",
    floating = true,
    tag = 5,
})

Finding Window Properties

Use xprop to find window properties. Run xprop in a terminal and click on a window.

Look for WM_CLASS(STRING) which shows both instance and class:

WM_CLASS(STRING) = "Navigator", "firefox"
                    ^instance    ^class

The first value is the instance, the second is the class.

On this page