summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2026-01-10 13:30:44 +0000
committerDavid T. Sadler <davidtsadler@googlemail.com>2026-01-24 13:29:44 +0000
commit580dccb54de412a673b0f6131fdf49996bb9e7d4 (patch)
tree91256aa3f05639a79ff1ac04e7ccc723237bbc6b
parentb5b7bafdd9a8bae7211a0f916751ce021da57761 (diff)
Stow oxwm
-rw-r--r--oxwm/.config/oxwm/config.lua299
1 files changed, 299 insertions, 0 deletions
diff --git a/oxwm/.config/oxwm/config.lua b/oxwm/.config/oxwm/config.lua
new file mode 100644
index 0000000..dca2b0b
--- /dev/null
+++ b/oxwm/.config/oxwm/config.lua
@@ -0,0 +1,299 @@
+---@meta
+-------------------------------------------------------------------------------
+-- OXWM Configuration File
+-------------------------------------------------------------------------------
+-- This is the default configuration for OXWM, a dynamic window manager.
+-- Edit this file and reload with Mod+Shift+R (no compilation needed)
+--
+-- For more information about configuring OXWM, see the documentation.
+-- The Lua Language Server provides autocomplete and type checking.
+-------------------------------------------------------------------------------
+
+---Load type definitions for LSP
+---@module 'oxwm'
+
+-------------------------------------------------------------------------------
+-- Variables
+-------------------------------------------------------------------------------
+-- Define your variables here for easy customization throughout the config.
+-- This makes it simple to change keybindings, colors, and settings in one place.
+
+-- Modifier key: "Mod4" is the Super/Windows key, "Mod1" is Alt
+local modkey = "Mod4"
+
+-- Terminal emulator command (defualts to alacritty)
+local terminal = "alacritty"
+
+-- Color palette - customize these to match your theme
+-- Alternatively you can import other files in here, such as
+-- local colors = require("colors.lua") and make colors.lua a file
+-- in the ~/.config/oxwm directory
+local colors = {
+ fg = "#d8dee9",
+ red = "#bf616a",
+ bg = "#2e3440",
+ cyan = "#88c0d0",
+ green = "#a3be8c",
+ lavender = "#b48ead",
+ light_blue = "#88c0d0",
+ grey = "#4c566a",
+ blue = "#81a1c1",
+ purple = "#b48ead",
+ sep = "#434c5e",
+}
+
+-- Workspace tags - can be numbers, names, or icons (requires a Nerd Font)
+local tags = { "", "", "3", "4", "5", "6", "7", "8", "9" }
+-- local tags = { "", "󰊯", "", "", "󰙯", "󱇤", "", "󱘶", "󰧮" } -- Example of nerd font icon tags
+
+-- Font for the status bar (use "fc-list" to see available fonts)
+local bar_font = "JetBrainsMono Nerd Font:style=Bold:size=10"
+
+-- Define your blocks
+-- Similar to widgets in qtile, or dwmblocks
+local blocks = {
+ oxwm.bar.block.ram({
+ format = "Ram: {used}/{total} GB",
+ interval = 5,
+ color = colors.light_blue,
+ underline = true,
+ }),
+ oxwm.bar.block.static({
+ text = " │ ",
+ interval = 999999999,
+ color = colors.lavender,
+ underline = false,
+ }),
+ oxwm.bar.block.datetime({
+ format = "{}",
+ date_format = "%a, %b %d - %H:%M",
+ interval = 1,
+ color = colors.cyan,
+ underline = true,
+ }),
+ oxwm.bar.block.static({
+ text = " │ ",
+ interval = 999999999,
+ color = colors.lavender,
+ underline = false,
+ }),
+ oxwm.bar.block.battery({
+ format = "Bat: {}%",
+ charging = "⚡ Bat: {}%",
+ discharging = "- Bat: {}%",
+ full = "✓ Bat: {}%",
+ interval = 30,
+ color = colors.green,
+ underline = true,
+ }),
+};
+
+-------------------------------------------------------------------------------
+-- Basic Settings
+-------------------------------------------------------------------------------
+oxwm.set_terminal(terminal)
+oxwm.set_modkey(modkey) -- This is for Mod + mouse binds, such as drag/resize
+oxwm.set_tags(tags)
+
+-------------------------------------------------------------------------------
+-- Layouts
+-------------------------------------------------------------------------------
+-- Set custom symbols for layouts (displayed in the status bar)
+-- Available layouts: "tiling", "normie" (floating), "grid", "monocle", "tabbed"
+oxwm.set_layout_symbol("tiling", "[T]")
+oxwm.set_layout_symbol("normie", "[F]")
+oxwm.set_layout_symbol("tabbed", "[=]")
+
+-------------------------------------------------------------------------------
+-- Appearance
+-------------------------------------------------------------------------------
+-- Border configuration
+
+-- Width in pixels
+oxwm.border.set_width(0)
+-- Color of focused window border
+oxwm.border.set_focused_color(colors.blue)
+-- Color of unfocused window borders
+oxwm.border.set_unfocused_color(colors.grey)
+
+-- Smart Enabled = No border if 1 window
+oxwm.gaps.set_smart(enabled)
+-- Inner gaps (horizontal, vertical) in pixels
+oxwm.gaps.set_inner(0, 0)
+-- Outer gaps (horizontal, vertical) in pixels
+oxwm.gaps.set_outer(0, 0)
+
+-------------------------------------------------------------------------------
+-- Window Rules
+-------------------------------------------------------------------------------
+-- Rules allow you to automatically configure windows based on their properties
+-- You can match windows by class, instance, title, or role
+-- Available properties: floating, tag, fullscreen, etc.
+--
+-- Common use cases:
+-- - Force floating for certain applications (dialogs, utilities)
+-- - Send specific applications to specific workspaces
+-- - Configure window behavior based on title or class
+
+-- Examples (uncomment to use):
+-- oxwm.rule.add({ instance = "gimp", floating = true })
+oxwm.rule.add({ class = "firefox", title = "Library", floating = true })
+oxwm.rule.add({ class = "firefox", tag = 2 })
+-- oxwm.rule.add({ instance = "mpv", floating = true })
+
+-- To find window properties, use xprop and click on the window
+-- WM_CLASS(STRING) shows both instance and class (instance, class)
+
+-------------------------------------------------------------------------------
+-- Status Bar Configuration
+-------------------------------------------------------------------------------
+-- Font configuration
+oxwm.bar.set_font(bar_font)
+
+-- Set your blocks here (defined above)
+oxwm.bar.set_blocks(blocks)
+
+-- Bar color schemes (for workspace tag display)
+-- Parameters: foreground, background, border
+
+-- Unoccupied tags
+oxwm.bar.set_scheme_normal(colors.fg, colors.bg, "#444444")
+-- Occupied tags
+oxwm.bar.set_scheme_occupied(colors.cyan, colors.bg, colors.cyan)
+-- Currently selected tag
+oxwm.bar.set_scheme_selected(colors.cyan, colors.bg, colors.purple)
+
+-------------------------------------------------------------------------------
+-- Keybindings
+-------------------------------------------------------------------------------
+-- Keybindings are defined using oxwm.key.bind(modifiers, key, action)
+-- Modifiers: {"Mod4"}, {"Mod1"}, {"Shift"}, {"Control"}, or combinations like {"Mod4", "Shift"}
+-- Keys: Use uppercase for letters (e.g., "Return", "H", "J", "K", "L")
+-- Actions: Functions that return actions (e.g., oxwm.spawn(), oxwm.client.kill())
+--
+-- A list of available keysyms can be found in the X11 keysym definitions.
+-- Common keys: Return, Space, Tab, Escape, Backspace, Delete, Left, Right, Up, Down
+
+-- Basic window management
+
+oxwm.key.bind({ modkey }, "Return", oxwm.spawn_terminal())
+-- Launch Dmenu
+oxwm.key.bind({ modkey }, "D", oxwm.spawn({ "sh", "-c", "dmenu_run -l 10" }))
+-- Copy screenshot to clipboard
+-- oxwm.key.bind({ modkey }, "S", oxwm.spawn({ "sh", "-c", "maim -s | xclip -selection clipboard -t image/png" }))
+oxwm.key.bind({ modkey }, "Q", oxwm.client.kill())
+
+-- Keybind overlay - Shows important keybindings on screen
+oxwm.key.bind({ modkey, "Shift" }, "Slash", oxwm.show_keybinds())
+
+-- Window state toggles
+oxwm.key.bind({ modkey, "Shift" }, "F", oxwm.client.toggle_fullscreen())
+oxwm.key.bind({ modkey, "Shift" }, "Space", oxwm.client.toggle_floating())
+
+-- Layout management
+oxwm.key.bind({ modkey }, "F", oxwm.layout.set("normie"))
+oxwm.key.bind({ modkey }, "C", oxwm.layout.set("tiling"))
+-- Cycle through layouts
+oxwm.key.bind({ modkey }, "N", oxwm.layout.cycle())
+
+-- Master area controls (tiling layout)
+
+-- Decrease/Increase master area width
+oxwm.key.bind({ modkey }, "H", oxwm.set_master_factor(-5))
+oxwm.key.bind({ modkey }, "L", oxwm.set_master_factor(5))
+-- Increment/Decrement number of master windows
+oxwm.key.bind({ modkey }, "I", oxwm.inc_num_master(1))
+oxwm.key.bind({ modkey }, "P", oxwm.inc_num_master(-1))
+
+-- Gaps toggle
+oxwm.key.bind({ modkey }, "A", oxwm.toggle_gaps())
+
+-- Window manager controls
+oxwm.key.bind({ modkey, "Shift" }, "Q", oxwm.quit())
+oxwm.key.bind({ modkey, "Shift" }, "R", oxwm.restart())
+
+-- Focus movement [1 for up in the stack, -1 for down]
+oxwm.key.bind({ modkey }, "J", oxwm.client.focus_stack(1))
+oxwm.key.bind({ modkey }, "K", oxwm.client.focus_stack(-1))
+
+-- Window movement (swap position in stack)
+oxwm.key.bind({ modkey, "Shift" }, "J", oxwm.client.move_stack(1))
+oxwm.key.bind({ modkey, "Shift" }, "K", oxwm.client.move_stack(-1))
+
+-- Multi-monitor support
+
+-- Focus next/previous Monitors
+oxwm.key.bind({ modkey }, "Comma", oxwm.monitor.focus(-1))
+oxwm.key.bind({ modkey }, "Period", oxwm.monitor.focus(1))
+-- Move window to next/previous Monitors
+oxwm.key.bind({ modkey, "Shift" }, "Comma", oxwm.monitor.tag(-1))
+oxwm.key.bind({ modkey, "Shift" }, "Period", oxwm.monitor.tag(1))
+
+-- Workspace (tag) navigation
+-- Switch to workspace N (tags are 0-indexed, so tag "1" is index 0)
+oxwm.key.bind({ modkey }, "1", oxwm.tag.view(0))
+oxwm.key.bind({ modkey }, "2", oxwm.tag.view(1))
+oxwm.key.bind({ modkey }, "3", oxwm.tag.view(2))
+oxwm.key.bind({ modkey }, "4", oxwm.tag.view(3))
+oxwm.key.bind({ modkey }, "5", oxwm.tag.view(4))
+oxwm.key.bind({ modkey }, "6", oxwm.tag.view(5))
+oxwm.key.bind({ modkey }, "7", oxwm.tag.view(6))
+oxwm.key.bind({ modkey }, "8", oxwm.tag.view(7))
+oxwm.key.bind({ modkey }, "9", oxwm.tag.view(8))
+
+-- Move focused window to workspace N
+oxwm.key.bind({ modkey, "Shift" }, "1", oxwm.tag.move_to(0))
+oxwm.key.bind({ modkey, "Shift" }, "2", oxwm.tag.move_to(1))
+oxwm.key.bind({ modkey, "Shift" }, "3", oxwm.tag.move_to(2))
+oxwm.key.bind({ modkey, "Shift" }, "4", oxwm.tag.move_to(3))
+oxwm.key.bind({ modkey, "Shift" }, "5", oxwm.tag.move_to(4))
+oxwm.key.bind({ modkey, "Shift" }, "6", oxwm.tag.move_to(5))
+oxwm.key.bind({ modkey, "Shift" }, "7", oxwm.tag.move_to(6))
+oxwm.key.bind({ modkey, "Shift" }, "8", oxwm.tag.move_to(7))
+oxwm.key.bind({ modkey, "Shift" }, "9", oxwm.tag.move_to(8))
+
+-- Combo view (view multiple tags at once) {argos_nothing}
+-- Example: Mod+Ctrl+2 while on tag 1 will show BOTH tags 1 and 2
+oxwm.key.bind({ modkey, "Control" }, "1", oxwm.tag.toggleview(0))
+oxwm.key.bind({ modkey, "Control" }, "2", oxwm.tag.toggleview(1))
+oxwm.key.bind({ modkey, "Control" }, "3", oxwm.tag.toggleview(2))
+oxwm.key.bind({ modkey, "Control" }, "4", oxwm.tag.toggleview(3))
+oxwm.key.bind({ modkey, "Control" }, "5", oxwm.tag.toggleview(4))
+oxwm.key.bind({ modkey, "Control" }, "6", oxwm.tag.toggleview(5))
+oxwm.key.bind({ modkey, "Control" }, "7", oxwm.tag.toggleview(6))
+oxwm.key.bind({ modkey, "Control" }, "8", oxwm.tag.toggleview(7))
+oxwm.key.bind({ modkey, "Control" }, "9", oxwm.tag.toggleview(8))
+
+-- Multi tag (window on multiple tags)
+-- Example: Mod+Ctrl+Shift+2 puts focused window on BOTH current tag and tag 2
+oxwm.key.bind({ modkey, "Control", "Shift" }, "1", oxwm.tag.toggletag(0))
+oxwm.key.bind({ modkey, "Control", "Shift" }, "2", oxwm.tag.toggletag(1))
+oxwm.key.bind({ modkey, "Control", "Shift" }, "3", oxwm.tag.toggletag(2))
+oxwm.key.bind({ modkey, "Control", "Shift" }, "4", oxwm.tag.toggletag(3))
+oxwm.key.bind({ modkey, "Control", "Shift" }, "5", oxwm.tag.toggletag(4))
+oxwm.key.bind({ modkey, "Control", "Shift" }, "6", oxwm.tag.toggletag(5))
+oxwm.key.bind({ modkey, "Control", "Shift" }, "7", oxwm.tag.toggletag(6))
+oxwm.key.bind({ modkey, "Control", "Shift" }, "8", oxwm.tag.toggletag(7))
+oxwm.key.bind({ modkey, "Control", "Shift" }, "9", oxwm.tag.toggletag(8))
+
+-------------------------------------------------------------------------------
+-- Advanced: Keychords
+-------------------------------------------------------------------------------
+-- Keychords allow you to bind multiple-key sequences (like Emacs or Vim)
+-- Format: {{modifiers}, key1}, {{modifiers}, key2}, ...
+-- Example: Press Mod4+Space, then release and press T to spawn a terminal without auto starting zellij
+oxwm.key.chord({
+ { { modkey }, "Space" },
+ { {}, "T" }
+}, oxwm.spawn({ "alacritty", "-e", "bash" }))
+
+-------------------------------------------------------------------------------
+-- Autostart
+-------------------------------------------------------------------------------
+-- Commands to run once when OXWM starts
+-- Uncomment and modify these examples, or add your own
+
+-- oxwm.autostart("picom")
+-- oxwm.autostart("feh --bg-scale ~/wallpaper.jpg")
+-- oxwm.autostart("dunst")
+-- oxwm.autostart("nm-applet")