Updated default template.
Browse files
+36 −36 templates/config.lua
| @@ -3,7 +3,7 @@ | ||
| 3 | 3 | -- OXWM Configuration File |
| 4 | 4 | ------------------------------------------------------------------------------- |
| 5 | 5 | -- This is the default configuration for OXWM, a dynamic window manager. |
| 6 | --- Edit this file and reload with Mod+Shift+R (no compilation needed!) | |
| 6 | +-- Edit this file and reload with Mod+Shift+R (no compilation needed) | |
| 7 | 7 | -- |
| 8 | 8 | -- For more information about configuring OXWM, see the documentation. |
| 9 | 9 | -- The Lua Language Server provides autocomplete and type checking. |
| @@ -21,8 +21,8 @@ | ||
| 21 | 21 | -- Modifier key: "Mod4" is the Super/Windows key, "Mod1" is Alt |
| 22 | 22 | local modkey = "Mod4" |
| 23 | 23 | |
| 24 | --- Terminal emulator command | |
| 25 | -local terminal = "st" | |
| 24 | +-- Terminal emulator command (defualts to alacritty) | |
| 25 | +local terminal = "alacritty" | |
| 26 | 26 | |
| 27 | 27 | -- Color palette - customize these to match your theme |
| 28 | 28 | local colors = { |
| @@ -48,7 +48,7 @@ local bar_font = "monospace:style=Bold:size=10" | ||
| 48 | 48 | -- Basic Settings |
| 49 | 49 | ------------------------------------------------------------------------------- |
| 50 | 50 | oxwm.set_terminal(terminal) |
| 51 | -oxwm.set_modkey(modkey) | |
| 51 | +oxwm.set_modkey(modkey) -- This is for Mod + mouse binds, such as drag/resize | |
| 52 | 52 | oxwm.set_tags(tags) |
| 53 | 53 | |
| 54 | 54 | ------------------------------------------------------------------------------- |
| @@ -63,14 +63,14 @@ oxwm.set_layout_symbol("normie", "[F]") | ||
| 63 | 63 | -- Appearance |
| 64 | 64 | ------------------------------------------------------------------------------- |
| 65 | 65 | -- Border configuration |
| 66 | -oxwm.border.set_width(2) -- Width in pixels | |
| 67 | -oxwm.border.set_focused_color(colors.blue) -- Color of focused window border | |
| 68 | -oxwm.border.set_unfocused_color(colors.grey) -- Color of unfocused window borders | |
| 66 | +oxwm.border.set_width(2) -- Width in pixels | |
| 67 | +oxwm.border.set_focused_color(colors.blue) -- Color of focused window border | |
| 68 | +oxwm.border.set_unfocused_color(colors.grey) -- Color of unfocused window borders | |
| 69 | 69 | |
| 70 | 70 | -- Gap configuration (space between windows and screen edges) |
| 71 | -oxwm.gaps.set_enabled(true) -- Enable or disable gaps | |
| 72 | -oxwm.gaps.set_inner(5, 5) -- Inner gaps (horizontal, vertical) in pixels | |
| 73 | -oxwm.gaps.set_outer(5, 5) -- Outer gaps (horizontal, vertical) in pixels | |
| 71 | +oxwm.gaps.set_enabled(true) -- Enable or disable gaps | |
| 72 | +oxwm.gaps.set_inner(5, 5) -- Inner gaps (horizontal, vertical) in pixels | |
| 73 | +oxwm.gaps.set_outer(5, 5) -- Outer gaps (horizontal, vertical) in pixels | |
| 74 | 74 | |
| 75 | 75 | ------------------------------------------------------------------------------- |
| 76 | 76 | -- Status Bar Configuration |
| @@ -80,8 +80,8 @@ oxwm.bar.set_font(bar_font) | ||
| 80 | 80 | |
| 81 | 81 | -- Bar color schemes (for workspace tag display) |
| 82 | 82 | -- Parameters: foreground, background, border |
| 83 | -oxwm.bar.set_scheme_normal(colors.fg, colors.bg, "#444444") -- Unoccupied tags | |
| 84 | -oxwm.bar.set_scheme_occupied(colors.cyan, colors.bg, colors.cyan) -- Occupied tags | |
| 83 | +oxwm.bar.set_scheme_normal(colors.fg, colors.bg, "#444444") -- Unoccupied tags | |
| 84 | +oxwm.bar.set_scheme_occupied(colors.cyan, colors.bg, colors.cyan) -- Occupied tags | |
| 85 | 85 | oxwm.bar.set_scheme_selected(colors.cyan, colors.bg, colors.purple) -- Currently selected tag |
| 86 | 86 | |
| 87 | 87 | ------------------------------------------------------------------------------- |
| @@ -96,39 +96,39 @@ oxwm.bar.set_scheme_selected(colors.cyan, colors.bg, colors.purple) -- Currently | ||
| 96 | 96 | -- Common keys: Return, Space, Tab, Escape, Backspace, Delete, Left, Right, Up, Down |
| 97 | 97 | |
| 98 | 98 | -- Basic window management |
| 99 | -oxwm.key.bind({ modkey }, "Return", oxwm.spawn(terminal)) -- Spawn terminal | |
| 100 | -oxwm.key.bind({ modkey }, "D", oxwm.spawn({ "sh", "-c", "dmenu_run -l 10" })) -- Application launcher | |
| 101 | -oxwm.key.bind({ modkey }, "S", oxwm.spawn({ "sh", "-c", "maim -s | xclip -selection clipboard -t image/png" })) -- Screenshot selection | |
| 102 | -oxwm.key.bind({ modkey }, "Q", oxwm.client.kill()) -- Close focused window | |
| 99 | +oxwm.key.bind({ modkey }, "Return", oxwm.spawn(terminal)) -- Spawn terminal | |
| 100 | +oxwm.key.bind({ modkey }, "D", oxwm.spawn({ "sh", "-c", "dmenu_run -l 10" })) -- Application launcher | |
| 101 | +oxwm.key.bind({ modkey }, "S", oxwm.spawn({ "sh", "-c", "maim -s | xclip -selection clipboard -t image/png" })) -- Screenshot selection | |
| 102 | +oxwm.key.bind({ modkey }, "Q", oxwm.client.kill()) -- Close focused window | |
| 103 | 103 | |
| 104 | 104 | -- Keybind overlay - Shows important keybindings on screen |
| 105 | 105 | oxwm.key.bind({ modkey, "Shift" }, "Slash", oxwm.show_keybinds()) |
| 106 | 106 | |
| 107 | 107 | -- Window state toggles |
| 108 | -oxwm.key.bind({ modkey, "Shift" }, "F", oxwm.client.toggle_fullscreen()) -- Toggle fullscreen | |
| 109 | -oxwm.key.bind({ modkey, "Shift" }, "Space", oxwm.client.toggle_floating()) -- Toggle floating mode | |
| 108 | +oxwm.key.bind({ modkey, "Shift" }, "F", oxwm.client.toggle_fullscreen()) -- Toggle fullscreen | |
| 109 | +oxwm.key.bind({ modkey, "Shift" }, "Space", oxwm.client.toggle_floating()) -- Toggle floating mode | |
| 110 | 110 | |
| 111 | 111 | -- Layout management |
| 112 | -oxwm.key.bind({ modkey }, "F", oxwm.layout.set("normie")) -- Set floating layout | |
| 113 | -oxwm.key.bind({ modkey }, "C", oxwm.layout.set("tiling")) -- Set tiling layout | |
| 114 | -oxwm.key.bind({ "Mod1" }, "N", oxwm.layout.cycle()) -- Cycle through layouts | |
| 112 | +oxwm.key.bind({ modkey }, "F", oxwm.layout.set("normie")) -- Set floating layout | |
| 113 | +oxwm.key.bind({ modkey }, "C", oxwm.layout.set("tiling")) -- Set tiling layout | |
| 114 | +oxwm.key.bind({ modkey }, "N", oxwm.layout.cycle()) -- Cycle through layouts | |
| 115 | 115 | |
| 116 | 116 | -- Gaps toggle |
| 117 | -oxwm.key.bind({ modkey }, "A", oxwm.toggle_gaps()) -- Toggle gaps on/off | |
| 117 | +oxwm.key.bind({ modkey }, "A", oxwm.toggle_gaps()) -- Toggle gaps on/off | |
| 118 | 118 | |
| 119 | 119 | -- Window manager controls |
| 120 | -oxwm.key.bind({ modkey, "Shift" }, "Q", oxwm.quit()) -- Quit OXWM | |
| 121 | -oxwm.key.bind({ modkey, "Shift" }, "R", oxwm.restart()) -- Restart OXWM (reloads config) | |
| 120 | +oxwm.key.bind({ modkey, "Shift" }, "Q", oxwm.quit()) -- Quit OXWM | |
| 121 | +oxwm.key.bind({ modkey, "Shift" }, "R", oxwm.restart()) -- Restart OXWM (reloads config) | |
| 122 | 122 | |
| 123 | 123 | -- Focus movement (vim keys) |
| 124 | -oxwm.key.bind({ modkey }, "H", oxwm.client.focus_direction("left")) -- Focus window to the left | |
| 125 | -oxwm.key.bind({ modkey }, "J", oxwm.client.focus_direction("down")) -- Focus window below | |
| 126 | -oxwm.key.bind({ modkey }, "K", oxwm.client.focus_direction("up")) -- Focus window above | |
| 127 | -oxwm.key.bind({ modkey }, "L", oxwm.client.focus_direction("right")) -- Focus window to the right | |
| 124 | +oxwm.key.bind({ modkey }, "H", oxwm.client.focus_direction("left")) -- Focus window to the left | |
| 125 | +oxwm.key.bind({ modkey }, "J", oxwm.client.focus_direction("down")) -- Focus window below | |
| 126 | +oxwm.key.bind({ modkey }, "K", oxwm.client.focus_direction("up")) -- Focus window above | |
| 127 | +oxwm.key.bind({ modkey }, "L", oxwm.client.focus_direction("right")) -- Focus window to the right | |
| 128 | 128 | |
| 129 | 129 | -- Multi-monitor support |
| 130 | -oxwm.key.bind({ modkey }, "Comma", oxwm.focus_monitor(-1)) -- Focus previous monitor | |
| 131 | -oxwm.key.bind({ modkey }, "Period", oxwm.focus_monitor(1)) -- Focus next monitor | |
| 130 | +oxwm.key.bind({ modkey }, "Comma", oxwm.focus_monitor(-1)) -- Focus previous monitor | |
| 131 | +oxwm.key.bind({ modkey }, "Period", oxwm.focus_monitor(1)) -- Focus next monitor | |
| 132 | 132 | |
| 133 | 133 | -- Workspace (tag) navigation |
| 134 | 134 | -- Switch to workspace N (tags are 0-indexed, so tag "1" is index 0) |
| @@ -154,10 +154,10 @@ oxwm.key.bind({ modkey, "Shift" }, "8", oxwm.tag.move_to(7)) | ||
| 154 | 154 | oxwm.key.bind({ modkey, "Shift" }, "9", oxwm.tag.move_to(8)) |
| 155 | 155 | |
| 156 | 156 | -- Swap windows in direction (vim keys with Shift) |
| 157 | -oxwm.key.bind({ modkey, "Shift" }, "H", oxwm.client.swap_direction("left")) -- Swap with window to the left | |
| 158 | -oxwm.key.bind({ modkey, "Shift" }, "J", oxwm.client.swap_direction("down")) -- Swap with window below | |
| 159 | -oxwm.key.bind({ modkey, "Shift" }, "K", oxwm.client.swap_direction("up")) -- Swap with window above | |
| 160 | -oxwm.key.bind({ modkey, "Shift" }, "L", oxwm.client.swap_direction("right")) -- Swap with window to the right | |
| 157 | +oxwm.key.bind({ modkey, "Shift" }, "H", oxwm.client.swap_direction("left")) -- Swap with window to the left | |
| 158 | +oxwm.key.bind({ modkey, "Shift" }, "J", oxwm.client.swap_direction("down")) -- Swap with window below | |
| 159 | +oxwm.key.bind({ modkey, "Shift" }, "K", oxwm.client.swap_direction("up")) -- Swap with window above | |
| 160 | +oxwm.key.bind({ modkey, "Shift" }, "L", oxwm.client.swap_direction("right")) -- Swap with window to the right | |
| 161 | 161 | |
| 162 | 162 | ------------------------------------------------------------------------------- |
| 163 | 163 | -- Advanced: Keychords |
| @@ -183,9 +183,9 @@ oxwm.key.chord({ | ||
| 183 | 183 | -- separator: Whether to add space after this block |
| 184 | 184 | |
| 185 | 185 | oxwm.bar.add_block("Ram: {used}/{total} GB", "Ram", nil, 5, colors.light_blue, true) |
| 186 | -oxwm.bar.add_block(" │ ", "Static", " │ ", 999999999, colors.lavender, false) | |
| 186 | +oxwm.bar.add_block(" │ ", "Static", "", 999999999, colors.lavender, false) | |
| 187 | 187 | oxwm.bar.add_block("Kernel: {}", "Shell", "uname -r", 999999999, colors.red, true) |
| 188 | -oxwm.bar.add_block(" │ ", "Static", " │ ", 999999999, colors.lavender, false) | |
| 188 | +oxwm.bar.add_block(" │ ", "Static", "", 999999999, colors.lavender, false) | |
| 189 | 189 | oxwm.bar.add_block("{}", "DateTime", "%a, %b %d - %-I:%M %P", 1, colors.cyan, true) |
| 190 | 190 | |
| 191 | 191 | -- Uncomment to add battery status (useful for laptops) |