Compare commits

...

14 Commits

22 changed files with 782 additions and 207 deletions

View File

@@ -7,9 +7,14 @@ require("plugins.auto-session")
require("plugins.colorscheme")
require("plugins.conform")
require("plugins.flash")
require("plugins.guess-indent")
require("plugins.luasnip")
require("plugins.multicursor")
require("plugins.nvim-various-textobjs")
require("plugins.oil")
require("plugins.slimline")
require("plugins.snacks")
require("plugins.telescope")
require("plugins.surround")
require("plugins.treesitter")
require("plugins.which-key")

View File

@@ -1,5 +1,12 @@
return {
cmd = 'lua-language-server',
filetypes = { 'lua' },
rootmarkers = { '.git' },
cmd = { "lua-language-server" },
filetypes = { "lua" },
root_markers = { ".luarc.json", ".git" },
settings = {
Lua = {
runtime = {
version = "LuaJIT",
},
},
},
}

View File

@@ -15,7 +15,7 @@ vim.api.nvim_create_autocmd("LspAttach", {
return { abbr = item.label:gsub("%b()", "") }
end,
})
vim.keymap.set("n", "<leader>A", vim.lsp.buf.code_action)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action)
vim.keymap.set("i", "<C-space>", vim.lsp.completion.get)
vim.keymap.set("n", "<leader>k", function()
vim.diagnostic.jump({ float = true, count = -1 })

View File

@@ -6,5 +6,8 @@ vim.g.maplocalleader = " \\"
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.signcolumn = "yes"
vim.opt.title = true
vim.opt.timeout = false
vim.o.undofile = true

View File

@@ -1,6 +1,6 @@
vim.pack.add({ "https://github.com/rmagatti/auto-session" })
vim.keymap.set("n", "<leader>a", "<cmd>AutoSession search<cr>")
vim.keymap.set("n", "<leader>wa", "<cmd>AutoSession search<cr>")
local ok, sess = pcall(require, "auto-session")
if ok then

View File

@@ -1,5 +1,5 @@
vim.pack.add({ "https://github.com/ellisonleao/gruvbox.nvim" })
vim.pack.add({ "https://github.com/EdenEast/nightfox.nvim", "https://github.com/rebelot/kanagawa.nvim" })
local cs = require("config.colorscheme")
cs.set_colorschemes("gruvbox", "gruvbox")
cs.set_colorschemes("kanagawa-wave", "dayfox")
cs.update_colorscheme()

View File

@@ -6,10 +6,30 @@ if ok then
formatters_by_ft = {
lua = { "stylua" },
},
format_on_save = {
timeout_ms = 500,
lsp_format = "fallback",
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return { timeout_ms = 500, lsp_format = "fallback" }
end,
})
vim.api.nvim_create_user_command("FormatDisable", function(args)
if args.bang then
-- FormatDisable! will disable formatting just for this buffer
vim.b.disable_autoformat = true
else
vim.g.disable_autoformat = true
end
end, {
desc = "Disable autoformat-on-save",
bang = true,
})
vim.api.nvim_create_user_command("FormatEnable", function()
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false
end, {
desc = "Re-enable autoformat-on-save",
})
else
print("plugin conform missing")

View File

@@ -0,0 +1,8 @@
vim.pack.add({ "https://github.com/NMAC427/guess-indent.nvim" })
local ok, guess_indent = pcall(require, "guess-indent")
if ok then
guess_indent.setup()
else
print("plugin guess-indent missing")
end

View File

@@ -0,0 +1,48 @@
vim.api.nvim_create_autocmd("PackChanged", {
group = vim.api.nvim_create_augroup("luasnip-update", { clear = true }),
callback = function(ev)
local name, kind = ev.data.spec.name, ev.data.kind
if name == "luasnip" and (kind == "install" or kind == "update") then
vim.system({ "make install_jsregexp" }, { cwd = ev.data.path }):wait()
print("luasnip make done.")
end
end,
})
vim.pack.add({ { src = "https://github.com/L3MON4D3/LuaSnip", version = vim.version.range("^2.0.0") } })
local ok, ls = pcall(require, "luasnip")
if ok then
vim.keymap.set({ "i" }, "<C-K>", function()
ls.expand()
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-L>", function(fallback)
if ls.locally_jumpable() then
ls.jump(1)
else
local key = vim.api.nvim_replace_termcodes("<C-L>", true, false, true)
vim.api.nvim_feedkeys(key, "n", false)
end
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-J>", function()
if ls.locally_jumpable() then
ls.jump(-1)
else
local key = vim.api.nvim_replace_termcodes("<C-J>", true, false, true)
vim.api.nvim_feedkeys(key, "n", false)
end
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-E>", function()
if ls.choice_active() then
ls.change_choice(1)
else
local key = vim.api.nvim_replace_termcodes("<C-E>", true, false, true)
vim.api.nvim_feedkeys(key, "n", false)
end
end, { silent = true })
require("luasnip.loaders.from_lua").load({ paths = vim.fs.joinpath(vim.fn.stdpath("config"), "lua", "snippets") })
else
print("plugin luasnip missing")
end

View File

@@ -0,0 +1,8 @@
vim.pack.add({ "https://github.com/sschleemilch/slimline.nvim" })
local ok, slimline = pcall(require, "slimline")
if ok then
slimline.setup()
else
print("plugin slimline missing")
end

View File

@@ -11,115 +11,51 @@ end
local set = vim.keymap.set
set("n", "<leader><space>", function()
Snacks.picker.smart()
end, { desc = "Smart Find Files" })
set("n", "<leader>b", function()
Snacks.picker.buffers()
end, { desc = "Buffers" })
set("n", "<leader>e", function()
set("n", "<leader>ea", function()
Snacks.explorer()
end, { desc = "File Explorer" })
set("n", "<leader>r", function()
Snacks.picker.recent()
end, { desc = "Recent files" })
set("n", "<leader>R", function()
Snacks.picker.resume()
end, { desc = "Resume" })
set("n", "<leader>p", function()
Snacks.picker.projects()
end, { desc = "Projects" })
set("n", "<leader>l", function()
Snacks.picker.lines()
end, { desc = "Buffer lines" })
set("n", "<leader>L", function()
Snacks.picker.grep_buffers()
end, { desc = "Grep Open Buffers" })
set("n", "<leader>F", function()
Snacks.picker.files()
end, { desc = "Find Files" })
set("n", "<leader>S", function()
Snacks.picker.grep()
end, { desc = "Grep" })
set("n", "<leader>B", function()
Snacks.picker.git_branches()
end, { desc = "Git Branches" })
set({ "n", "v" }, "<leader>xB", function()
Snacks.gitbrowse()
end, { desc = "Git Browse" })
set("n", "<leader>i", function()
Snacks.picker.git_log_line()
end, { desc = "Git Log Line" })
set("n", "<leader>I", function()
Snacks.picker.git_log()
end, { desc = "Git Log" })
set("n", "<leader>t", function()
Snacks.picker.git_status()
end, { desc = "Git Status" })
set("n", "<leader>H", function()
Snacks.picker.git_diff()
end, { desc = "Git Diff (Hunks)" })
set("n", "<leader>xS", function()
Snacks.picker.git_stash()
end, { desc = "Git Stash" })
set("n", "<leader>f", function()
Snacks.picker.git_files()
end, { desc = "Find Git Files" })
set("n", "<leader>s", function()
Snacks.picker.git_grep()
end, { desc = "Git Grep" })
set({ "n", "v" }, "<leader>o", function()
Snacks.picker.grep_word()
end, { desc = "Grep Visual Selection or Word" })
set("n", "<leader>g", function()
set("n", "<leader>ga", function()
Snacks.lazygit()
end, { desc = "Lazygit" })
set("n", "<leader>G", function()
set("n", "<leader>gh", function()
Snacks.picker.git_diff()
end, { desc = "Git Diff (Hunks)" })
set("n", "<leader>gl", function()
Snacks.picker.git_log_line()
end, { desc = "Git Log Line" })
set("n", "<leader>gL", function()
Snacks.picker.git_log()
end, { desc = "Git Log" })
set("n", "<leader>gr", function()
Snacks.lazygit.log_file()
end, { desc = "Git Log File" })
end, { desc = "Git Log File (reflog)" })
set("n", "<leader>m", function()
Snacks.picker.marks()
end, { desc = "Marks" })
set({ "n", "v" }, "<leader>gw", function()
Snacks.picker.grep_word()
end, { desc = "Grep Visual Selection or Word" })
set("n", "<leader>M", function()
Snacks.picker.man()
end, { desc = "Man pages" })
set({ "n", "v" }, "<leader>gx", function()
Snacks.gitbrowse()
end, { desc = "Git Browse" })
set("n", "<leader>xr", function()
Snacks.picker.recent()
end, { desc = "Recent files" })
set("n", "<leader>xR", function()
Snacks.picker.resume()
end, { desc = "Resume" })
set("n", "<leader>U", function()
Snacks.picker.undo()
end, { desc = "Undo History" })
set("n", "<leader>q", function()
Snacks.picker.qflist()
end, { desc = "Quickfix list" })
set("n", "<leader>Q", function()
Snacks.picker.loclist()
end, { desc = "Location List" })
set("n", "<leader>xs", function()
set("n", "<leader>xC", function()
Snacks.picker.colorschemes()
end, { desc = "Colorschemes" })
@@ -131,26 +67,6 @@ set("n", "<leader>N", function()
Snacks.picker.notifications()
end, { desc = "Notifications" })
set("n", "<leader>xC", function()
Snacks.picker.commands()
end, { desc = "Commands" })
set("n", "<leader>h", function()
Snacks.picker.keymaps()
end, { desc = "Keymaps" })
set("n", "<leader>xh", function()
Snacks.picker.highlights()
end, { desc = "Hightlights" })
set("n", "<leader>xc", function()
Snacks.picker.command_history()
end, { desc = "Command History" })
set("n", '<leader>"', function()
Snacks.picker.registers()
end, { desc = "Registers" })
set("n", "<leader>$", function()
Snacks.rename.rename_file()
end, { desc = "Rename File" })
@@ -169,42 +85,10 @@ end, { desc = "Select Scratch Buffer" })
-- LSP
set("n", "gd", function()
Snacks.picker.lsp_definitions()
end, { desc = "Goto Definition" })
set("n", "gD", function()
Snacks.picker.lsp_declarations()
end, { desc = "Goto Declaration" })
set("n", "grr", function()
Snacks.picker.lsp_references()
end, { desc = "References" })
set("n", "gI", function()
Snacks.picker.lsp_implementations()
end, { desc = "Goto Implementation" })
set("n", "gy", function()
Snacks.picker.lsp_type_definitions()
end, { desc = "Goto T[y]pe Definition" })
set("n", "<leader>w", function()
Snacks.picker.lsp_symbols()
end, { desc = "LSP Symbols" })
set("n", "<leader>d", function()
Snacks.picker.diagnostics_buffer()
end, { desc = "Buffer Diagnostics" })
set("n", "<leader>D", function()
Snacks.picker.diagnostics()
end, { desc = "Diagnostics" })
set("n", "<leader>W", function()
Snacks.picker.lsp_workspace_symbols()
end, { desc = "LSP Workspace Symbols" })
-- Terminal
set({ "n", "t" }, "<c-/>", function()

View File

@@ -0,0 +1,99 @@
vim.api.nvim_create_autocmd("PackChanged", {
group = vim.api.nvim_create_augroup("telescope-fzf-native-update", { clear = true }),
callback = function(ev)
local name, kind = ev.data.spec.name, ev.data.kind
if name == "telescope-fzf-native.nvim" and (kind == "install" or kind == "update") then
vim.system({ "make" }, { cwd = ev.data.path }):wait()
print("telescope-fzf-native make done.")
end
end,
})
vim.pack.add({
{ src = "https://github.com/nvim-telescope/telescope.nvim", version = "v0.2.1" },
"https://github.com/nvim-lua/plenary.nvim",
"https://github.com/nvim-telescope/telescope-fzf-native.nvim",
"https://gitlab.com/davvid/telescope-git-grep.nvim",
{ src = "https://github.com/nvim-telescope/telescope-frecency.nvim", version = vim.version.range("^1.0.0") },
})
local ok, builtin = pcall(require, "telescope.builtin")
if ok then
require("telescope").setup({
defaults = require("telescope.themes").get_ivy(),
})
local set = vim.keymap.set
require("telescope").load_extension("fzf")
require("telescope").load_extension("git_grep")
require("telescope").load_extension("frecency")
set("n", "<leader><space>", function()
require("telescope-frecency").start()
end, { desc = "Telescope frecency" })
set("n", "<leader>;", function()
require("telescope-frecency").start({ workspace = "CWD" })
end, { desc = "Telescope frecency" })
set("n", "<leader>b", builtin.buffers, { desc = "Telescope buffers" })
set("n", "<leader>cc", builtin.commands, { desc = "Telescope commands" })
set("n", "<leader>ch", builtin.command_history, { desc = "Telescope command history" })
set("n", "<leader>cH", builtin.highlights, { desc = "Telescope highlights" })
set("n", "<leader>da", builtin.diagnostics, { desc = "Telescope diagnostics" })
set("n", "<leader>ec", function()
builtin.find_files({ cwd = vim.fn.stdpath("config") })
end, { desc = "Telescope nvim config files" })
set("n", "<leader>ep", function()
builtin.find_files({ cwd = vim.fs.joinpath(vim.fn.stdpath("data"), "site") })
end, { desc = "Telescope find files" })
set("n", "<leader>fa", builtin.git_files, { desc = "Telescope nvim package files" })
set("n", "<leader>F", builtin.find_files, { desc = "Telescope find files" })
set("n", "<leader>fh", function()
builtin.find_files({ hidden = true })
end, { desc = "Telescope find files (hidden)" })
set("n", "<leader>gB", builtin.git_branches, { desc = "Telescope git branches" })
set("n", "<leader>gc", builtin.git_bcommits, { desc = "Telescope git buffer commits" })
set("n", "<leader>gC", builtin.git_commits, { desc = "Telescope git commits" })
set("n", "<leader>gs", builtin.git_status, { desc = "Telescope git status" })
set("n", "<leader>gS", builtin.git_stash, { desc = "Telescope git stash" })
set("n", "<leader>ha", builtin.help_tags, { desc = "Telescope help tags" })
set("n", "<leader>hk", builtin.keymaps, { desc = "Telescope keymaps" })
set("n", "<leader>l", builtin.current_buffer_fuzzy_find, { desc = "Telescope current buffer fuzzy find" })
set("n", "<leader>L", function()
builtin.live_grep({ grep_open_files = true })
end, { desc = "Telescope grep open files" })
set("n", "<leader>m", builtin.marks, { desc = "Telescope marks" })
set("n", "<leader>M", builtin.man_pages, { desc = "Telescope man pages" })
set("n", "<leader>o", builtin.oldfiles, { desc = "Telescope oldfiles" })
set("n", "<leader>qa", builtin.quickfix, { desc = "Telescope quickfix" })
set("n", "<leader>qh", builtin.quickfixhistory, { desc = "Telescope quickfix history" })
set("n", "<leader>ql", builtin.loclist, { desc = "Telescope loclist" })
set("n", "<leader>r", builtin.resume, { desc = "Telescope resume" })
set("n", "<leader>t", builtin.treesitter, { desc = "Telescope treesitter symbols" })
set("n", "<leader>R", builtin.registers, { desc = "Telescope registers" })
set("n", "<leader>sa", function()
require("git_grep").live_grep()
end, { desc = "Telescope git live grep" })
set("n", "<leader>S", builtin.live_grep, { desc = "Telescope live grep" })
set("n", "<leader>sh", builtin.search_history, { desc = "Telescope search history" })
set("n", "<leader>so", function()
builtin.grep_string({ grep_open_files = true })
end, { desc = "Telescope grep open files" })
set({ "n", "v" }, "<leader>sw", function()
require("git_grep").grep()
end, { desc = "Telescope git grep word" })
set("n", "<leader>wd", builtin.lsp_document_symbols, { desc = "Telescope document symbols" })
set("n", "<leader>wp", builtin.lsp_workspace_symbols, { desc = "Telescope workspace symbols" })
set("n", "<leader>ws", function()
require("git_grep").workspace_live_grep()
end, { desc = "Telescope workspace git live grep" })
set("n", "<leader>wy", function()
require("git_grep").workspace_grep()
end, { desc = "Telescope workspace git grep word" })
set("n", "<leader>:", builtin.builtin, { desc = "Telescope builtin" })
set("n", "gd", builtin.lsp_definitions, { desc = "Goto Definition" })
set("n", "grr", builtin.lsp_references, { desc = "References" })
set("n", "gI", builtin.lsp_implementations, { desc = "Goto Implementation" })
set("n", "gy", builtin.lsp_type_definitions, { desc = "Goto T[y]pe Definition" })
else
print("plugin builtin missing")
end

View File

@@ -0,0 +1,8 @@
vim.pack.add({ "https://github.com/folke/which-key.nvim" })
local ok, whichkey = pcall(require, "which-key")
if ok then
whichkey.setup({ preset = "helix", delay = 1000 })
else
print("plugin whichkey missing")
end

View File

@@ -0,0 +1,43 @@
return {
s(
"ife",
fmt(
[[
if err != nil {
<>
}
]],
{
i(0),
},
{ delimiters = "<>" }
)
),
s(
"ifse",
fmt(
[[
if <><>err = <>; err != nil {
<>
}
]],
{
i(1),
f(function(args)
local a = args[1][1]
if string.sub(a, -2) == ", " or a == "" then
return ""
elseif string.sub(a, -1) == "," then
return " "
else
return ", "
end
end, { 1 }),
i(2),
i(0),
},
{ delimiters = "<>" }
)
),
}

View File

@@ -1,5 +1,10 @@
{
"plugins": {
"LuaSnip": {
"rev": "5a1e39223db9a0498024a77b8441169d260c8c25",
"src": "https://github.com/L3MON4D3/LuaSnip",
"version": "2.0.0 - 3.0.0"
},
"arrow.nvim": {
"rev": "6e0f726f55f99332dd726a53effd6813786b6d49",
"src": "https://github.com/otavioschwanck/arrow.nvim"
@@ -9,22 +14,30 @@
"src": "https://github.com/rmagatti/auto-session"
},
"conform.nvim": {
"rev": "5420c4b5ea0aeb99c09cfbd4fd0b70d257b44f25",
"rev": "8314f4c9e205e7f30b62147069729f9a1227d8bf",
"src": "https://github.com/stevearc/conform.nvim"
},
"flash.nvim": {
"rev": "fcea7ff883235d9024dc41e638f164a450c14ca2",
"src": "https://github.com/folke/flash.nvim"
},
"gruvbox.nvim": {
"rev": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437",
"src": "https://github.com/ellisonleao/gruvbox.nvim"
"guess-indent.nvim": {
"rev": "84a4987ff36798c2fc1169cbaff67960aed9776f",
"src": "https://github.com/NMAC427/guess-indent.nvim"
},
"kanagawa.nvim": {
"rev": "aef7f5cec0a40dbe7f3304214850c472e2264b10",
"src": "https://github.com/rebelot/kanagawa.nvim"
},
"multicursor.nvim": {
"rev": "993c6eda70077c5619388900dcffefff73b40c96",
"src": "https://github.com/jake-stewart/multicursor.nvim",
"version": "'1.0'"
},
"nightfox.nvim": {
"rev": "ba47d4b4c5ec308718641ba7402c143836f35aa9",
"src": "https://github.com/EdenEast/nightfox.nvim"
},
"nvim-surround": {
"rev": "1098d7b3c34adcfa7feb3289ee434529abd4afd1",
"src": "https://github.com/kylechui/nvim-surround",
@@ -41,16 +54,46 @@
"version": "'master'"
},
"nvim-various-textobjs": {
"rev": "c472b634058ec9cd4a2dc4f6340022d9deae0adb",
"rev": "1532de4649c81b88ee0b4e53bdd17e551dd4589a",
"src": "https://github.com/chrisgrieser/nvim-various-textobjs"
},
"oil.nvim": {
"rev": "756dec855b4811f2d27f067a3aca477f368d99f5",
"rev": "81b8a91735ad5cd24a6b3137f14a89f19176364f",
"src": "https://github.com/stevearc/oil.nvim"
},
"plenary.nvim": {
"rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509",
"src": "https://github.com/nvim-lua/plenary.nvim"
},
"slimline.nvim": {
"rev": "b23d6239ae06d7b422b30b227756971348ffcd68",
"src": "https://github.com/sschleemilch/slimline.nvim"
},
"snacks.nvim": {
"rev": "fe7cfe9800a182274d0f868a74b7263b8c0c020b",
"src": "https://github.com/folke/snacks.nvim"
},
"telescope-frecency.nvim": {
"rev": "d4f1bb2a939cc02720bceb635095246751db144f",
"src": "https://github.com/nvim-telescope/telescope-frecency.nvim",
"version": "1.0.0 - 2.0.0"
},
"telescope-fzf-native.nvim": {
"rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c",
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
},
"telescope-git-grep.nvim": {
"rev": "0936967941a6e7b3875d1b1bfff41b8bcd75bdf5",
"src": "https://gitlab.com/davvid/telescope-git-grep.nvim"
},
"telescope.nvim": {
"rev": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179",
"src": "https://github.com/nvim-telescope/telescope.nvim",
"version": "'v0.2.1'"
},
"which-key.nvim": {
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
"src": "https://github.com/folke/which-key.nvim"
}
}
}

View File

@@ -0,0 +1,5 @@
{
"workspace.library" : [
"/usr/local/share/oxwm"
]
}

View File

@@ -0,0 +1,321 @@
---@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 = false,
}),
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 = false,
}),
-- 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 = false,
-- }),
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 = false,
}),
}
-------------------------------------------------------------------------------
-- 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)
--
function shell_quote(s)
return '"' .. string.gsub(s, '[$"!`\\]', "\\%1") .. '"'
end
-------------------------------------------------------------------------------
-- 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 -fn " .. shell_quote(bar_font) .. " -nb " .. shell_quote(colors.bg) .. " -nf " .. shell_quote(
colors.fg
) .. " -sb " .. shell_quote(colors.orange) .. " -sf " .. shell_quote(colors.black),
})
)
-- 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" },
{ {}, "F" },
}, oxwm.spawn({ "firefox" }))
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")

View File

@@ -0,0 +1,14 @@
return {
fg = "#aaaaaa",
red = "#f7768e",
bg = "#1a1b26",
black = "#1a1b26",
cyan = "#0db9d7",
green = "#9ece6a",
lavender = "#a9b1d6",
light_blue = "#7aa2f7",
grey = "#737373",
blue = "#6dade3",
purple = "#ad8ee6",
orange = "#bd6628",
}

View File

@@ -0,0 +1,14 @@
return {
fg = "#1a1b26",
red = "#b94646",
bg = "#dddddd",
black = "#1a1b26",
cyan = "#4d8080",
green = "#9ece6a",
lavender = "#a9b1d6",
light_blue = "#7aa2f7",
grey = "#bbbbbb",
blue = "#6dade3",
purple = "#ad8ee6",
orange = "#d78042",
}

View File

@@ -58,50 +58,95 @@ XTerm.vt100.color15: #ECEFF4
st.font: FiraCode Nerd Font:size=10
! gruvebox colors from https://github.com/morhetz/gruvbox-contrib/tree/master/deepin-terminal
! kanagawa wave colors from https://github.com/rebelot/kanagawa.nvim/blob/master/extras/alacritty/kanagawa_wave.toml
! dayfox colors from https://github.com/edeneast/nightfox.nvim/raw/main/extra/dayfox/alacritty.toml
Zutty.font: monaspaceneon
Zutty.fontpath: /usr/share/fonts:HOME/.local/share/fonts
Zutty.fontsize: 20
#ifdef THEME_DARK
st.lightmode: 0
st.background: #282828
st.foreground: #d5c4a1
st.cursorColor: #bf8040
st.reverse-cursor: #1f212e
st.color0: #282828
st.color1: #cc241d
st.color2: #98971a
st.color3: #d79921
st.color4: #458588
st.color5: #b16286
st.color6: #689d6a
st.color7: #a89984
st.color8: #928374
st.color9: #fb4934
st.color10: #b8bb26
st.color11: #fabd2f
st.color12: #83a598
st.color13: #d3869b
st.color14: #8ec07c
st.color15: #ebdbb2
st.background: #1f1f28
st.foreground: #dcd7ba
st.cursorColor: #cbd9d8
st.reverse-cursor: #e6eaea
st.color0: #090618
st.color1: #c34043
st.color2: #76946a
st.color3: #c0a36e
st.color4: #7e9cd8
st.color5: #957fb8
st.color6: #6a9589
st.color7: #c8c093
st.color8: #727169
st.color9: #e82424
st.color10: #98bb6c
st.color11: #e6c384
st.color12: #7fb4ca
st.color13: #938aa9
st.color14: #7aa89f
st.color15: #dcd7ba
Zutty.bg: #1f1f28
Zutty.fg: #dcd7ba
Zutty.cr: #cbd9d8
Zutty.color0: #090618
Zutty.color1: #c34043
Zutty.color2: #76946a
Zutty.color3: #c0a36e
Zutty.color4: #7e9cd8
Zutty.color5: #957fb8
Zutty.color6: #6a9589
Zutty.color7: #c8c093
Zutty.color8: #727169
Zutty.color9: #e82424
Zutty.color10: #98bb6c
Zutty.color11: #e6c384
Zutty.color12: #7fb4ca
Zutty.color13: #938aa9
Zutty.color14: #7aa89f
Zutty.color15: #dcd7ba
#else
st.lightmode: 1
st.background: #fbf1c7
st.foreground: #3c3836
st.cursorColor: #bf8040
st.reverse-cursor: #1f212e
st.color0: #282828
st.color1: #cc241d
st.color2: #98971a
st.color3: #d79921
st.color4: #458588
st.color5: #b16286
st.color6: #689d6a
st.color7: #7c6f64
st.color8: #928374
st.color9: #9d0006
st.color10: #79740e
st.color11: #b57614
st.color12: #076678
st.color13: #8f3f71
st.color14: #427b58
st.color15: #3c3836
st.background: #f6f2ee
st.foreground: #3d2b5a
st.cursorColor: #643f61
st.reverse-cursor: #3d2b5a
st.color0: #352c24
st.color1: #a5222f
st.color2: #396847
st.color3: #ac5402
st.color4: #2848a9
st.color5: #6e33ce
st.color6: #287980
st.color7: #f2e9e1
st.color8: #534c45
st.color9: #b3434e
st.color10: #577f63
st.color11: #b86e28
st.color12: #4863b6
st.color13: #8452d5
st.color14: #488d93
st.color15: #f4ece6
Zutty.bg: #f6f2ee
Zutty.fg: #3d2b5a
Zutty.cr: #643f61
Zutty.color0: #352c24
Zutty.color1: #a5222f
Zutty.color2: #396847
Zutty.color3: #ac5402
Zutty.color4: #2848a9
Zutty.color5: #6e33ce
Zutty.color6: #287980
Zutty.color7: #f2e9e1
Zutty.color8: #534c45
Zutty.color9: #b3434e
Zutty.color10: #577f63
Zutty.color11: #b86e28
Zutty.color12: #4863b6
Zutty.color13: #8452d5
Zutty.color14: #488d93
Zutty.color15: #f4ece6
#endif

View File

@@ -8,7 +8,7 @@ xset b off
xrandr --auto
xrandr --output DP-0 --left-of DP-2 --primary
xrandr --output HDMI-0 --left-of DP-0
xrdb -merge ~/.Xresources
xrdb -merge ~/.Xresources -DHOME="$HOME"
setxkbmap pl -option ctrl:nocaps
if [ -x ~/.fehbg ]; then

View File

@@ -30,7 +30,7 @@ if [ -n "$XRES" ]; then
elif [ "$THEME" = light ]; then
sed -i 's/^#define THEME_DARK/#undef THEME_DARK/' "$XRES"
fi
xrdb -merge "$XRES"
xrdb -merge "$XRES" -DHOME="$HOME"
pkill -USR1 '^st$'
fi