oxwm github discord tonybtw.com

Theming

Colors

Anywhere oxwm takes a color you can pass a hex string or a number. These are all the same color:

oxwm.border.set_focused_color("#6dade3")
oxwm.border.set_focused_color("0x6dade3")
oxwm.border.set_focused_color(0x6dade3)

Most configs keep a palette in a table and refer to it by name:

local colors = {
    bg = "#1a1b26",
    fg = "#bbbbbb",
    blue = "#6dade3",
    cyan = "#0db9d7",
    purple = "#ad8ee6",
    red = "#f7768e",
}

Borders

oxwm.border.set_width(2)
oxwm.border.set_focused_color(colors.blue)
oxwm.border.set_unfocused_color("#444444")

The width is in pixels. Set it to 0 for no borders.

Gaps

oxwm.gaps.set_enabled(true)
oxwm.gaps.set_inner(5, 5)
oxwm.gaps.set_outer(5, 5)
oxwm.gaps.set_smart(true)
Function What it sets
set_inner(horizontal, vertical) Space between windows, in pixels
set_outer(horizontal, vertical) Space between windows and the screen edge
set_smart(enabled) Drop the outer gaps when a tag has one window
set_enabled(enabled) Turn all gaps on or off

oxwm.gaps.enable() and oxwm.gaps.disable() are shorthand for set_enabled. To flip gaps from the keyboard, bind oxwm.toggle_gaps():

oxwm.key.bind({ modkey }, "A", oxwm.toggle_gaps())

Gaps are on by default at 5 pixels all round.

Floating windows

New floating windows open in the middle of the screen. To move that:

oxwm.set_floating_position("top-right")

The positions are top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center and bottom-right.

Tag colors

The colors of the tags in the bar are set with schemes. Those are covered on the status bar page.

Splitting the config

config.lua is ordinary Lua, and oxwm adds the config directory to the Lua search path. A theme can live in its own file next to the config:

local colors = require("colors")

~/.config/oxwm/colors.lua just returns a table:

return {
    bg = "#000000",
    fg = "#e5e5e5",
    blue = "#7aa2f7",
}