add oxwm
This commit is contained in:
5
oxwm/.config/oxwm/.luarc.json
Normal file
5
oxwm/.config/oxwm/.luarc.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"workspace.library" : [
|
||||||
|
"/usr/local/share/oxwm"
|
||||||
|
]
|
||||||
|
}
|
||||||
298
oxwm/.config/oxwm/config.lua
Normal file
298
oxwm/.config/oxwm/config.lua
Normal file
@@ -0,0 +1,298 @@
|
|||||||
|
---@meta
|
||||||
|
|
||||||
|
---Load type definitions for LSP
|
||||||
|
---@module 'oxwm'
|
||||||
|
|
||||||
|
-- Modifier key: "Mod4" is the Super/Windows key, "Mod1" is Alt
|
||||||
|
local modkey = "Mod4"
|
||||||
|
|
||||||
|
-- Terminal emulator command (defaults to alacritty)
|
||||||
|
local terminal = "st"
|
||||||
|
|
||||||
|
local colors
|
||||||
|
local f = io.open(os.getenv("HOME") .. "/.lightmode")
|
||||||
|
if f ~= nil then
|
||||||
|
io.close(f)
|
||||||
|
colors = require("light")
|
||||||
|
else
|
||||||
|
colors = require("dark")
|
||||||
|
end
|
||||||
|
os.execute("hsetroot -solid '" .. colors.bg .. "'")
|
||||||
|
|
||||||
|
-- Workspace tags - can be numbers, names, or icons (requires a Nerd Font)
|
||||||
|
local tags = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }
|
||||||
|
|
||||||
|
-- Font for the status bar (use "fc-list" to see available fonts)
|
||||||
|
local bar_font = "monospace: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.shell({
|
||||||
|
format = "{}",
|
||||||
|
command = "uname -r",
|
||||||
|
interval = 999999999,
|
||||||
|
color = colors.red,
|
||||||
|
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,
|
||||||
|
}),
|
||||||
|
-- Uncomment to add battery status (useful for laptops)
|
||||||
|
-- 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(3)
|
||||||
|
-- Color of focused window border
|
||||||
|
oxwm.border.set_focused_color(colors.orange)
|
||||||
|
-- Color of unfocused window borders
|
||||||
|
oxwm.border.set_unfocused_color(colors.grey)
|
||||||
|
|
||||||
|
-- Smart Enabled = No border if 1 window
|
||||||
|
oxwm.gaps.set_smart(true)
|
||||||
|
-- Inner gaps (horizontal, vertical) in pixels
|
||||||
|
oxwm.gaps.set_inner(5, 5)
|
||||||
|
-- Outer gaps (horizontal, vertical) in pixels
|
||||||
|
oxwm.gaps.set_outer(5, 5)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
-- 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 = "Alacritty", tag = 9, focus = 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.orange, colors.bg, colors.orange)
|
||||||
|
-- Urgent tags (windows requesting attention)
|
||||||
|
oxwm.bar.set_scheme_urgent(colors.red, colors.bg, colors.red)
|
||||||
|
|
||||||
|
-- Hide tags that have no windows and are not selected
|
||||||
|
-- oxwm.bar.set_hide_vacant_tags(true)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
-- 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 }, "P", 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 }, "X", 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 }, "F", oxwm.client.toggle_fullscreen())
|
||||||
|
oxwm.key.bind({ modkey, "Shift" }, "Space", oxwm.client.toggle_floating())
|
||||||
|
|
||||||
|
-- Layout management
|
||||||
|
oxwm.key.bind({ modkey, "Shift" }, "F", oxwm.layout.set("normie"))
|
||||||
|
oxwm.key.bind({ modkey }, "T", oxwm.layout.set("tiling"))
|
||||||
|
oxwm.key.bind({ modkey }, "G", oxwm.layout.set("grid"))
|
||||||
|
oxwm.key.bind({ modkey }, "M", oxwm.layout.set("monocle"))
|
||||||
|
oxwm.key.bind({ modkey }, "B", oxwm.layout.set("tabbed"))
|
||||||
|
oxwm.key.bind({ modkey, "Shift" }, "S", oxwm.layout.set("scrolling"))
|
||||||
|
oxwm.key.bind({ modkey }, "N", oxwm.layout.cycle())
|
||||||
|
|
||||||
|
oxwm.key.bind({ modkey, "Shift" }, "T", oxwm.spawn({ "lupan-set-theme", "toggle" }))
|
||||||
|
|
||||||
|
-- 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, "Shift" }, "I", 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
|
||||||
|
oxwm.key.chord({
|
||||||
|
{ { modkey }, "Space" },
|
||||||
|
{ {}, "T" },
|
||||||
|
}, oxwm.spawn_terminal())
|
||||||
|
oxwm.key.chord({
|
||||||
|
{ { modkey }, "Space" },
|
||||||
|
{ {}, "L" },
|
||||||
|
}, oxwm.spawn({ "slock" }))
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
-- 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")
|
||||||
13
oxwm/.config/oxwm/dark.lua
Normal file
13
oxwm/.config/oxwm/dark.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
fg = "#bbbbbb",
|
||||||
|
red = "#f7768e",
|
||||||
|
bg = "#1a1b26",
|
||||||
|
cyan = "#0db9d7",
|
||||||
|
green = "#9ece6a",
|
||||||
|
lavender = "#a9b1d6",
|
||||||
|
light_blue = "#7aa2f7",
|
||||||
|
grey = "#bbbbbb",
|
||||||
|
blue = "#6dade3",
|
||||||
|
purple = "#ad8ee6",
|
||||||
|
orange = "#d78042",
|
||||||
|
}
|
||||||
13
oxwm/.config/oxwm/light.lua
Normal file
13
oxwm/.config/oxwm/light.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
fg = "#1a1b26",
|
||||||
|
red = "#b94646",
|
||||||
|
bg = "#dddddd",
|
||||||
|
cyan = "#4d8080",
|
||||||
|
green = "#9ece6a",
|
||||||
|
lavender = "#a9b1d6",
|
||||||
|
light_blue = "#7aa2f7",
|
||||||
|
grey = "#bbbbbb",
|
||||||
|
blue = "#6dade3",
|
||||||
|
purple = "#ad8ee6",
|
||||||
|
orange = "#d78042",
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user