rm dotbot; move everything to home manager
This commit is contained in:
parent
cedd2c1983
commit
c1b64baea7
39 changed files with 7 additions and 37 deletions
78
home/nvim/init.lua
Normal file
78
home/nvim/init.lua
Normal file
|
@ -0,0 +1,78 @@
|
|||
require("plugin_specs")
|
||||
|
||||
local keymap = vim.keymap
|
||||
local opt = vim.opt
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
vim.opt.termguicolors = true
|
||||
require("nvim-tree").setup()
|
||||
|
||||
require("lualine").setup {
|
||||
options = {
|
||||
theme = "auto",
|
||||
icons_enabled = true,
|
||||
globalstatus = true,
|
||||
}
|
||||
}
|
||||
|
||||
require("gitsigns").setup()
|
||||
|
||||
opt.tabstop = 2
|
||||
opt.softtabstop = 2
|
||||
opt.shiftwidth = 2
|
||||
opt.expandtab = true
|
||||
opt.relativenumber = true
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
opt.scrolloff = 3
|
||||
opt.confirm = true
|
||||
opt.history = 500
|
||||
opt.undofile = true
|
||||
opt.termguicolors = true
|
||||
opt.showmode = false
|
||||
opt.mouse = ""
|
||||
|
||||
vim.cmd.colorscheme "tokyonight-night"
|
||||
|
||||
keymap.set("n", "<space>s", require("nvim-tree.api").tree.toggle, {
|
||||
desc = "toggle nvim-tree",
|
||||
silent = true,
|
||||
})
|
||||
|
||||
-- shortcut to command mode
|
||||
keymap.set({ "n", "x" }, ";", ":", { silent = true })
|
||||
|
||||
keymap.set("n", "<space>o", "printf('m`%so<ESC>``', v:count1)", {
|
||||
expr = true,
|
||||
desc = "insert line below without moving cursor",
|
||||
})
|
||||
|
||||
keymap.set("n", "<space>O", "printf('m`%sO<ESC>``', v:count1)", {
|
||||
expr = true,
|
||||
desc = "insert line above without moving cursor",
|
||||
})
|
||||
|
||||
keymap.set("n", "/", [[/\v]])
|
||||
|
||||
keymap.set("n", "c", '"_c')
|
||||
keymap.set("n", "C", '"_C')
|
||||
keymap.set("n", "cc", '"_cc')
|
||||
keymap.set("x", "c", '"_c')
|
||||
keymap.set("x", "p", '"_c<Esc>p')
|
||||
|
||||
-- Break inserted text into smaller undo units when we insert some punctuation chars.
|
||||
local undo_ch = { ",", ".", "!", "?", ";", ":" }
|
||||
for _, ch in ipairs(undo_ch) do
|
||||
keymap.set("i", ch, ch .. "<c-g>u")
|
||||
end
|
||||
|
||||
keymap.set("i", "<C-A>", "<HOME>")
|
||||
keymap.set("i", "<C-E>", "<END>")
|
||||
|
||||
-- copilot
|
||||
vim.keymap.set('i', '<C-J>', 'copilot#Accept("\\<CR>")', {
|
||||
expr = true,
|
||||
replace_keycodes = false
|
||||
})
|
||||
vim.g.copilot_no_tab_map = true
|
24
home/nvim/lazy-lock.json
Normal file
24
home/nvim/lazy-lock.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
|
||||
"fzf-lua": { "branch": "main", "commit": "0063769312e913b5de9f2db21285d806dcf4efcb" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
|
||||
"hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "014d1d6d78df4e58f962158e6e00261d8632612c" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "fc16fd4f9c5d72b45db0f45ee275db3a9a30481a" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "db8d7ac1f524fc6f808764b29fa695c51e014aa6" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "3b8dee4293567b0b9a87360842af14669f60dd13" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "87c34abe5d1dc7c1c0a95aaaf888059c614c68ac" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "355e2842291dbf51b2c5878e9e37281bbef09783" },
|
||||
"vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" }
|
||||
}
|
21
home/nvim/lua/config/fzf.lua
Normal file
21
home/nvim/lua/config/fzf.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
local keymap = vim.keymap
|
||||
|
||||
local fzf = require("fzf-lua")
|
||||
|
||||
keymap.set("n", "<leader>ff", fzf.files, { silent = true })
|
||||
keymap.set("n", "<leader>fr", fzf.oldfiles, { silent = true })
|
||||
keymap.set("n", "<leader>fc", fzf.resume, { silent = true })
|
||||
keymap.set("n", "<leader>fs", fzf.treesitter, { silent = true })
|
||||
keymap.set("n", "<leader>fg", fzf.grep_project, { silent = true })
|
||||
|
||||
fzf.setup {
|
||||
"fzf-native",
|
||||
keymap = {
|
||||
fzf = {
|
||||
["ctrl-u"] = "half-page-up",
|
||||
["ctrl-d"] = "half-page-down",
|
||||
["ctrl-j"] = "preview-page-down",
|
||||
["ctrl-k"] = "preview-page-up",
|
||||
}
|
||||
}
|
||||
}
|
16
home/nvim/lua/config/hop.lua
Normal file
16
home/nvim/lua/config/hop.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
local hop = require('hop')
|
||||
local keymap = vim.keymap
|
||||
|
||||
hop.setup {
|
||||
case_insensitive = true;
|
||||
char2_fallback_key = "<CR>",
|
||||
quit_key = "<Esc",
|
||||
}
|
||||
|
||||
keymap.set({ 'n', 'v', 'o' }, 'f', "", {
|
||||
silent = true;
|
||||
noremap = true;
|
||||
callback = function()
|
||||
hop.hint_char2()
|
||||
end,
|
||||
})
|
75
home/nvim/lua/config/lsp.lua
Normal file
75
home/nvim/lua/config/lsp.lua
Normal file
|
@ -0,0 +1,75 @@
|
|||
local lsp = vim.lsp
|
||||
local diagnostic = vim.diagnostic
|
||||
local keymap = vim.keymap
|
||||
|
||||
keymap.set("n", "gd", lsp.buf.definition)
|
||||
keymap.set("n", "<space>rn", lsp.buf.rename)
|
||||
keymap.set("n", "gr", lsp.buf.references)
|
||||
keymap.set("n", "[d", diagnostic.goto_prev)
|
||||
keymap.set("n", "]d", diagnostic.goto_next)
|
||||
|
||||
diagnostic.config {
|
||||
signs = false,
|
||||
}
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
lspconfig.pylsp.setup { capabilities = capabilities }
|
||||
lspconfig.clangd.setup { capabilities = capabilities }
|
||||
lspconfig.vimls.setup { capabilities = capabilities }
|
||||
lspconfig.bashls.setup { capabilities = capabilities }
|
||||
lspconfig.rust_analyzer.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.gopls.setup {
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
gofumpt = true,
|
||||
}
|
||||
},
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
lspconfig.lua_ls.setup {
|
||||
capabilities = capabilities,
|
||||
on_init = function(client)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
if vim.uv.fs_stat(path..'/.luarc.json') or vim.uv.fs_stat(path..'/.luarc.jsonc') then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using
|
||||
-- (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT'
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME
|
||||
-- Depending on the usage, you might want to add additional paths here.
|
||||
-- "${3rd}/luv/library"
|
||||
-- "${3rd}/busted/library",
|
||||
}
|
||||
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
|
||||
-- library = vim.api.nvim_get_runtime_file("", true)
|
||||
}
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {}
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.nixd.setup { capabilities = capabilities }
|
||||
lspconfig.sqls.setup { capabilities = capabilities }
|
54
home/nvim/lua/config/nvim-cmp.lua
Normal file
54
home/nvim/lua/config/nvim-cmp.lua
Normal file
|
@ -0,0 +1,54 @@
|
|||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip");
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-e"] = cmp.mapping.abort(),
|
||||
|
||||
["<C-k>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
if luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
else
|
||||
cmp.confirm({
|
||||
select = true,
|
||||
})
|
||||
end
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end),
|
||||
|
||||
["<C-n>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.locally_jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<C-p>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
sources = cmp.config.sources ({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
})
|
||||
}
|
99
home/nvim/lua/plugin_specs.lua
Normal file
99
home/nvim/lua/plugin_specs.lua
Normal file
|
@ -0,0 +1,99 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
vim.g.mapleader = ","
|
||||
|
||||
local plugin_specs = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufRead", "BufNewFile" },
|
||||
config = function()
|
||||
require("config.lsp")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-omni",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
config = function()
|
||||
require("config.nvim-cmp")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "v2.*",
|
||||
build = "make install_jsregexp",
|
||||
},
|
||||
|
||||
{ "stevearc/dressing.nvim", event = "VeryLazy" },
|
||||
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"ibhagwan/fzf-lua",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("config.fzf")
|
||||
end,
|
||||
},
|
||||
|
||||
{ "windwp/nvim-autopairs", event = "InsertEnter", config = true },
|
||||
|
||||
{ "tpope/vim-commentary", event = "VeryLazy" },
|
||||
|
||||
{ "folke/tokyonight.nvim", lazy = false, priority = 1000 },
|
||||
|
||||
{ "lewis6991/gitsigns.nvim"},
|
||||
|
||||
{ "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" } },
|
||||
|
||||
{ "github/copilot.vim", lazy = false },
|
||||
|
||||
{
|
||||
'smoka7/hop.nvim',
|
||||
version = "*",
|
||||
config = function()
|
||||
require("config.hop")
|
||||
end,
|
||||
}
|
||||
}
|
||||
|
||||
require("lazy").setup({
|
||||
spec = plugin_specs,
|
||||
rocks = { enabled = true },
|
||||
})
|
158
home/rofi/config.rasi
Normal file
158
home/rofi/config.rasi
Normal file
|
@ -0,0 +1,158 @@
|
|||
configuration {
|
||||
modes: "drun,run,emoji:rofimoji,clipboard:/home/yt/.config/rofi/scripts/cliphist.sh";
|
||||
font: "hack 12";
|
||||
/* location: 0;*/
|
||||
/* yoffset: 0;*/
|
||||
/* xoffset: 0;*/
|
||||
/* fixed-num-lines: true;*/
|
||||
show-icons: true;
|
||||
terminal: "kitty";
|
||||
/* ssh-client: "ssh";*/
|
||||
/* ssh-command: "{terminal} -e {ssh-client} {host} [-p {port}]";*/
|
||||
/* run-command: "{cmd}";*/
|
||||
/* run-list-command: "";*/
|
||||
/* run-shell-command: "{terminal} -e {cmd}";*/
|
||||
/* window-command: "wmctrl -i -R {window}";*/
|
||||
/* window-match-fields: "all";*/
|
||||
icon-theme: "Papirus";
|
||||
/* drun-match-fields: "name,generic,exec,categories,keywords";*/
|
||||
/* drun-categories: ;*/
|
||||
/* drun-show-actions: false;*/
|
||||
/* drun-display-format: "{name} [<span weight='light' size='small'><i>({generic})</i></span>]";*/
|
||||
/* drun-url-launcher: "xdg-open";*/
|
||||
/* disable-history: false;*/
|
||||
/* ignored-prefixes: "";*/
|
||||
/* sort: false;*/
|
||||
/* sorting-method: "normal";*/
|
||||
/* case-sensitive: false;*/
|
||||
/* cycle: true;*/
|
||||
/* sidebar-mode: false;*/
|
||||
/* hover-select: false;*/
|
||||
/* eh: 1;*/
|
||||
/* auto-select: false;*/
|
||||
/* parse-hosts: false;*/
|
||||
/* parse-known-hosts: true;*/
|
||||
combi-modes: "window,run,calc,filebrowser";
|
||||
/* matching: "normal";*/
|
||||
/* tokenize: true;*/
|
||||
/* m: "-5";*/
|
||||
/* filter: ;*/
|
||||
/* dpi: -1;*/
|
||||
/* threads: 0;*/
|
||||
/* scroll-method: 0;*/
|
||||
/* window-format: "{w} {c} {t}";*/
|
||||
/* click-to-exit: true;*/
|
||||
/* global-kb: false;*/
|
||||
/* max-history-size: 25;*/
|
||||
/* combi-hide-mode-prefix: false;*/
|
||||
/* combi-display-format: "{mode} {text}";*/
|
||||
/* matching-negate-char: '-' /* unsupported */;*/
|
||||
/* cache-dir: ;*/
|
||||
/* window-thumbnail: false;*/
|
||||
/* drun-use-desktop-cache: false;*/
|
||||
/* drun-reload-desktop-cache: false;*/
|
||||
/* normalize-match: false;*/
|
||||
/* steal-focus: false;*/
|
||||
/* application-fallback-icon: ;*/
|
||||
/* refilter-timeout-limit: 300;*/
|
||||
/* xserver-i300-workaround: false;*/
|
||||
/* completer-mode: "recursivebrowser";*/
|
||||
/* pid: "/run/user/1000/rofi.pid";*/
|
||||
/* display-window: ;*/
|
||||
/* display-run: ;*/
|
||||
/* display-ssh: ;*/
|
||||
/* display-drun: ;*/
|
||||
/* display-combi: ;*/
|
||||
/* display-keys: ;*/
|
||||
/* display-filebrowser: ;*/
|
||||
/* display-recursivebrowser: ;*/
|
||||
/* kb-primary-paste: "Control+V,Shift+Insert";*/
|
||||
/* kb-secondary-paste: "Control+v,Insert";*/
|
||||
/* kb-secondary-copy: "Control+c";*/
|
||||
/* kb-clear-line: "Control+w";*/
|
||||
/* kb-move-front: "Control+a";*/
|
||||
/* kb-move-end: "Control+e";*/
|
||||
/* kb-move-word-back: "Alt+b,Control+Left";*/
|
||||
/* kb-move-word-forward: "Alt+f,Control+Right";*/
|
||||
/* kb-move-char-back: "Left,Control+b";*/
|
||||
/* kb-move-char-forward: "Right,Control+f";*/
|
||||
/* kb-remove-word-back: "Control+Alt+h,Control+BackSpace";*/
|
||||
/* kb-remove-word-forward: "Control+Alt+d";*/
|
||||
/* kb-remove-char-forward: "Delete,Control+d";*/
|
||||
/* kb-remove-char-back: "BackSpace,Shift+BackSpace,Control+h";*/
|
||||
/* kb-remove-to-eol: "Control+k";*/
|
||||
/* kb-remove-to-sol: "Control+u";*/
|
||||
/* kb-accept-entry: "Control+j,Control+m,Return,KP_Enter";*/
|
||||
/* kb-accept-custom: "Control+Return";*/
|
||||
/* kb-accept-custom-alt: "Control+Shift+Return";*/
|
||||
/* kb-accept-alt: "Shift+Return";*/
|
||||
/* kb-delete-entry: "Shift+Delete";*/
|
||||
/* kb-mode-next: "Shift+Right,Control+Tab";*/
|
||||
/* kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab";*/
|
||||
/* kb-mode-complete: "Control+l";*/
|
||||
/* kb-row-left: "Control+Page_Up";*/
|
||||
/* kb-row-right: "Control+Page_Down";*/
|
||||
/* kb-row-up: "Up,Control+p";*/
|
||||
/* kb-row-down: "Down,Control+n";*/
|
||||
/* kb-row-tab: "";*/
|
||||
/* kb-element-next: "Tab";*/
|
||||
/* kb-element-prev: "ISO_Left_Tab";*/
|
||||
/* kb-page-prev: "Page_Up";*/
|
||||
/* kb-page-next: "Page_Down";*/
|
||||
/* kb-row-first: "Home,KP_Home";*/
|
||||
/* kb-row-last: "End,KP_End";*/
|
||||
/* kb-row-select: "Control+space";*/
|
||||
/* kb-screenshot: "Alt+S";*/
|
||||
/* kb-ellipsize: "Alt+period";*/
|
||||
/* kb-toggle-case-sensitivity: "grave,dead_grave";*/
|
||||
/* kb-toggle-sort: "Alt+grave";*/
|
||||
/* kb-cancel: "Escape,Control+g,Control+bracketleft";*/
|
||||
/* kb-custom-1: "Alt+1";*/
|
||||
/* kb-custom-2: "Alt+2";*/
|
||||
/* kb-custom-3: "Alt+3";*/
|
||||
/* kb-custom-4: "Alt+4";*/
|
||||
/* kb-custom-5: "Alt+5";*/
|
||||
/* kb-custom-6: "Alt+6";*/
|
||||
/* kb-custom-7: "Alt+7";*/
|
||||
/* kb-custom-8: "Alt+8";*/
|
||||
/* kb-custom-9: "Alt+9";*/
|
||||
/* kb-custom-10: "Alt+0";*/
|
||||
/* kb-custom-11: "Alt+exclam";*/
|
||||
/* kb-custom-12: "Alt+at";*/
|
||||
/* kb-custom-13: "Alt+numbersign";*/
|
||||
/* kb-custom-14: "Alt+dollar";*/
|
||||
/* kb-custom-15: "Alt+percent";*/
|
||||
/* kb-custom-16: "Alt+dead_circumflex";*/
|
||||
/* kb-custom-17: "Alt+ampersand";*/
|
||||
/* kb-custom-18: "Alt+asterisk";*/
|
||||
/* kb-custom-19: "Alt+parenleft";*/
|
||||
/* kb-select-1: "Super+1";*/
|
||||
/* kb-select-2: "Super+2";*/
|
||||
/* kb-select-3: "Super+3";*/
|
||||
/* kb-select-4: "Super+4";*/
|
||||
/* kb-select-5: "Super+5";*/
|
||||
/* kb-select-6: "Super+6";*/
|
||||
/* kb-select-7: "Super+7";*/
|
||||
/* kb-select-8: "Super+8";*/
|
||||
/* kb-select-9: "Super+9";*/
|
||||
/* kb-select-10: "Super+0";*/
|
||||
/* kb-entry-history-up: "Control+Up";*/
|
||||
/* kb-entry-history-down: "Control+Down";*/
|
||||
/* ml-row-left: "ScrollLeft";*/
|
||||
/* ml-row-right: "ScrollRight";*/
|
||||
/* ml-row-up: "ScrollUp";*/
|
||||
/* ml-row-down: "ScrollDown";*/
|
||||
/* me-select-entry: "MousePrimary";*/
|
||||
/* me-accept-entry: "MouseDPrimary";*/
|
||||
/* me-accept-custom: "Control+MouseDPrimary";*/
|
||||
timeout {
|
||||
action: "kb-cancel";
|
||||
delay: 0;
|
||||
}
|
||||
filebrowser {
|
||||
directories-first: true;
|
||||
sorting-method: "name";
|
||||
}
|
||||
}
|
||||
|
||||
@theme "/nix/store/nkjjc70cidfc3wbpas7kqr7agasma59c-rofi-1.7.5+wayland3/share/rofi/themes/gruvbox-dark.rasi"
|
22
home/rofi/scripts/cliphist.sh
Executable file
22
home/rofi/scripts/cliphist.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
tmp_dir="/tmp/cliphist"
|
||||
rm -rf "$tmp_dir"
|
||||
|
||||
if [[ -n "$1" ]]; then
|
||||
cliphist decode <<<"$1" | wl-copy
|
||||
exit
|
||||
fi
|
||||
|
||||
mkdir -p "$tmp_dir"
|
||||
|
||||
read -r -d '' prog <<EOF
|
||||
/^[0-9]+\s<meta http-equiv=/ { next }
|
||||
match(\$0, /^([0-9]+)\s(\[\[\s)?binary.*(jpg|jpeg|png|bmp)/, grp) {
|
||||
system("echo " grp[1] "\\\\\t | cliphist decode >$tmp_dir/"grp[1]"."grp[3])
|
||||
print \$0"\0icon\x1f$tmp_dir/"grp[1]"."grp[3]
|
||||
next
|
||||
}
|
||||
1
|
||||
EOF
|
||||
cliphist list | gawk "$prog"
|
166
home/sway/config
Normal file
166
home/sway/config
Normal file
|
@ -0,0 +1,166 @@
|
|||
set $mod Mod4
|
||||
set $alt Mod1
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
|
||||
set $term $HOME/.config/sway/scripts/terminal.sh
|
||||
set $menu rofi -show run
|
||||
set $screenshot grim -g "$(slurp)" - | wl-copy
|
||||
set $browser chromium
|
||||
set $clipboard rofi -show clipboard -show-icons
|
||||
set $emoji rofi -show emoji
|
||||
|
||||
set $font_family DejaVu Sans Mono
|
||||
set $font_size 11
|
||||
set $bg #000000
|
||||
set $fg #ffffff
|
||||
set $fgi #888888
|
||||
|
||||
set $wallpaper $HOME/wallpapers/nixos-c-book-large.png
|
||||
set $lock swaylock -f -i $wallpaper
|
||||
output * bg $wallpaper fill
|
||||
|
||||
floating_modifier $mod normal
|
||||
default_border pixel
|
||||
smart_borders on
|
||||
focus_follows_mouse always
|
||||
mouse_warping container
|
||||
|
||||
bindsym $mod+Return exec $term
|
||||
bindsym $mod+Ctrl+q kill
|
||||
bindsym $mod+d exec $menu
|
||||
bindsym $mod+Shift+c reload
|
||||
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
|
||||
bindsym Print exec $screenshot
|
||||
bindsym $mod+comma exec $clipboard
|
||||
bindsym $mod+period exec $emoji
|
||||
|
||||
bindsym $mod+$alt+b exec $browser
|
||||
bindsym $mod+$alt+a exec anki
|
||||
bindsym $mod+$alt+f exec thunar
|
||||
bindsym $mod+$alt+p exec pomatez
|
||||
bindsym $mod+$alt+e exec evolution
|
||||
bindsym $mod+$alt+c exec korganizer
|
||||
bindsym $mod+p exec bitwarden
|
||||
bindsym $mod+$alt+m exec element-desktop
|
||||
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
|
||||
bindsym $mod+1 workspace number 1
|
||||
bindsym $mod+2 workspace number 2
|
||||
bindsym $mod+3 workspace number 3
|
||||
bindsym $mod+4 workspace number 4
|
||||
bindsym $mod+5 workspace number 5
|
||||
bindsym $mod+6 workspace number 6
|
||||
bindsym $mod+7 workspace number 7
|
||||
bindsym $mod+8 workspace number 8
|
||||
bindsym $mod+9 workspace number 9
|
||||
bindsym $mod+0 workspace number 10
|
||||
|
||||
bindsym $mod+Shift+1 move container to workspace number 1
|
||||
bindsym $mod+Shift+2 move container to workspace number 2
|
||||
bindsym $mod+Shift+3 move container to workspace number 3
|
||||
bindsym $mod+Shift+4 move container to workspace number 4
|
||||
bindsym $mod+Shift+5 move container to workspace number 5
|
||||
bindsym $mod+Shift+6 move container to workspace number 6
|
||||
bindsym $mod+Shift+7 move container to workspace number 7
|
||||
bindsym $mod+Shift+8 move container to workspace number 8
|
||||
bindsym $mod+Shift+9 move container to workspace number 9
|
||||
bindsym $mod+Shift+0 move container to workspace number 10
|
||||
|
||||
# mouse side buttons
|
||||
bindsym --whole-window BTN_EXTRA exec ~/.config/sway/scripts/remote.sh btn1
|
||||
bindsym --whole-window BTN_SIDE exec ~/.config/sway/scripts/remote.sh
|
||||
|
||||
bindsym $mod+b splith
|
||||
bindsym $mod+v splitv
|
||||
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
bindsym $mod+a focus parent
|
||||
bindsym $mod+Shift+a focus child
|
||||
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
bindsym $mod+minus scratchpad show
|
||||
|
||||
mode "resize" {
|
||||
bindsym $left resize shrink width 10px
|
||||
bindsym $down resize grow height 10px
|
||||
bindsym $up resize shrink height 10px
|
||||
bindsym $right resize grow width 10px
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
# keys to adjust volue and brightness
|
||||
bindsym --locked XF86AudioMute exec "amixer -q sset Master,0 toggle"
|
||||
bindsym --locked XF86AudioLowerVolume exec "amixer -q set Master 1%-"
|
||||
bindsym --locked XF86AudioRaiseVolume exec "amixer -q sset Master 1%+"
|
||||
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 1%-
|
||||
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 1%+
|
||||
|
||||
# lockscreen
|
||||
bindsym $mod+Control+l exec $lock
|
||||
|
||||
font pango:$font_family $font_size
|
||||
|
||||
for_window [app_id=mpv] floating enable, sticky enable, inhibit_idle open
|
||||
for_window [class="pomatez"] floating enable, sticky enable
|
||||
for_window [class="PacketTracer"] floating enable, border normal
|
||||
for_window [app_id="LibreWolf" title="^Extension"] floating enable
|
||||
for_window [floating] border csd
|
||||
for_window [app_id="org.keepassxc.KeePassXC"] floating enable
|
||||
for_window [class="Bitwarden"] floating enable
|
||||
|
||||
bar {
|
||||
swaybar_command waybar
|
||||
}
|
||||
|
||||
input "type:touchpad" {
|
||||
dwt enabled
|
||||
tap enabled
|
||||
natural_scroll enabled
|
||||
}
|
||||
|
||||
input "type:keyboard" {
|
||||
xkb_layout us
|
||||
xkb_options ctrl:nocaps
|
||||
xkb_numlock enabled
|
||||
}
|
||||
|
||||
exec wl-paste --watch cliphist store
|
||||
exec mako >> $HOME/mako.log 2>&1
|
||||
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
exec dbus-update-activation-environment --all
|
||||
|
||||
exec swayidle -w \
|
||||
timeout 300 'swaymsg "output * power off"' \
|
||||
timeout 305 $lock \
|
||||
resume 'swaymsg "output * power on"' \
|
||||
before-sleep 'playerctl pause; swaylock -f'
|
||||
|
||||
exec aw-server
|
||||
exec aw-watcher-window-wayland
|
||||
|
||||
include /etc/sway/config.d/*
|
||||
|
||||
exec system-dnotify --ready
|
27
home/sway/scripts/remote.sh
Executable file
27
home/sway/scripts/remote.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
active_window=$(swaymsg -t get_tree |jq -r '..|try select(.focused == true) |.app_id')
|
||||
|
||||
if [ "$1" = "btn1" ]; then
|
||||
if [ "$active_window" = "anki" ]; then
|
||||
wtype " "
|
||||
elif [ "$active_window" = "foot" ]; then
|
||||
wtype -M ctrl -M shift -k c -m ctrl -m shift
|
||||
elif [ "$active_window" = "chromium-browser" ]; then
|
||||
wtype -M alt -P right -p right -m alt
|
||||
else
|
||||
wtype -M ctrl -k c -m ctrl
|
||||
fi
|
||||
else
|
||||
if [ "$active_window" = "anki" ]; then
|
||||
wtype "1"
|
||||
elif [ "$active_window" = "foot" ]; then
|
||||
wtype -M ctrl -M shift -k v
|
||||
wtype -m ctrl
|
||||
elif [ "$active_window" = "chromium-browser" ]; then
|
||||
wtype -M alt -P left -p left -m alt
|
||||
else
|
||||
wtype -M ctrl -k v
|
||||
wtype -m ctrl
|
||||
fi
|
||||
fi
|
14
home/sway/scripts/terminal.sh
Executable file
14
home/sway/scripts/terminal.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
focused_workspace=$(swaymsg -t get_workspaces | jq '.[] | select(.focused == true) | .num')
|
||||
|
||||
foot_window_count=$(swaymsg -t get_tree | jq --argjson workspace $focused_workspace '[recurse(.nodes[]?) | select(.type == "workspace" and .num == $workspace) | recurse(.nodes[]?) | select(.app_id == "foot")] | length')
|
||||
|
||||
next_session=$((focused_workspace * 10))
|
||||
|
||||
if [ $foot_window_count -gt 0 ]
|
||||
then
|
||||
next_session=$((next_session + foot_window_count))
|
||||
fi
|
||||
|
||||
foot tmux new-session -A -s ${next_session}
|
81
home/waybar/config
Normal file
81
home/waybar/config
Normal file
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
"layer": "top", // Waybar on highest layer so tooltips go over windows
|
||||
"output": "eDP-1", // Set output to primary monitor
|
||||
"height": 40, // Set height to avoid jumping due to active workspace indicator
|
||||
|
||||
"margin-left": 0,
|
||||
"margin-right": 0,
|
||||
"margin-top": 0,
|
||||
"modules-left": ["sway/workspaces", "clock#time", "clock#date", "battery"], // Sets modules for the left of the bar
|
||||
"modules-center": ["sway/window"], // Set modules for the center of the bar
|
||||
"modules-right": ["tray", "temperature", "cpu", "memory", "wireplumber"], // Set modules for the right of the bar
|
||||
"clock#time": {
|
||||
"format": "<span color=\"#7aa2f7\"> </span>{:%H:%M:%S}",
|
||||
"interval": 1,
|
||||
},
|
||||
"clock#date": {
|
||||
"format": "<span color=\"#7aa2f7\"> </span>{:%Y/%m/%d}",
|
||||
"tooltip-format": "<tt>{calendar}</tt>",
|
||||
"interval": 360,
|
||||
"calendar": {
|
||||
"mode": "month",
|
||||
"mode-mon-col": 4,
|
||||
"weeks-pos": "right",
|
||||
"on-scroll": 1,
|
||||
"on-click-right": "mode",
|
||||
"format": {
|
||||
"months": "<span color='#c0caf5'><b>{}</b></span>",
|
||||
"days": "<span color='#c0caf5'><b>{}</b></span>",
|
||||
"weeks": "<span color='#7dcfff'><b>W{}</b></span>",
|
||||
"weekdays": "<span color='#ff9e64'><b>{}</b></span>",
|
||||
"today": "<span color='#f7768e'><b><u>{}</u></b></span>",
|
||||
},
|
||||
},
|
||||
},
|
||||
"battery": {
|
||||
"interval": 60,
|
||||
"states": {
|
||||
"warning": 40,
|
||||
"critical": 20,
|
||||
},
|
||||
"format": "{icon} {capacity}%",
|
||||
"format-icons": [
|
||||
"<span color=\"#f7768e\"> </span>",
|
||||
"<span color=\"#f7768e\"> </span>",
|
||||
"<span color=\"#7aa2f7\"> </span>",
|
||||
"<span color=\"#7aa2f7\"> </span>",
|
||||
"<span color=\"#7aa2f7\"> </span>",
|
||||
],
|
||||
"format-charging": "<span color=\"#e0af68\"></span> {capacity}%",
|
||||
},
|
||||
"cpu": {
|
||||
"format": "<span color=\"#7aa2f7\"> </span>{usage}%",
|
||||
"interval": 4,
|
||||
},
|
||||
"memory": {
|
||||
"format": "<span color=\"#7aa2f7\"> </span>{used}GiB",
|
||||
"interval": 4,
|
||||
},
|
||||
"temperature": {
|
||||
"hwmon-path": "/sys/class/hwmon/hwmon4/temp1_input",
|
||||
"critical-threshold": 80,
|
||||
"format": "<span color=\"#7aa2f7\"> </span>{temperatureC}°C",
|
||||
"format-critical": "<span color=\"#f7768e\"> </span>{temperatureC}°C",
|
||||
"interval": 4,
|
||||
},
|
||||
"wireplumber": {
|
||||
"scroll-step": 1, // %, can be a float
|
||||
"format": "<span color=\"#7aa2f7\">{icon} </span>{volume}%",
|
||||
"format-muted": "<span color=\"#f7768e\"> </span>Muted",
|
||||
"format-icons": ["", "", ""],
|
||||
"on-click": "pavucontrol",
|
||||
"interval": 4,
|
||||
},
|
||||
"sway/window": {
|
||||
"max-length": 64,
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 22,
|
||||
"spacing": 6,
|
||||
}
|
||||
}
|
70
home/waybar/style.css
Normal file
70
home/waybar/style.css
Normal file
|
@ -0,0 +1,70 @@
|
|||
.module,
|
||||
#clock.date,
|
||||
#clock.time,
|
||||
#workspaces button {
|
||||
background: transparent;
|
||||
padding: 0 10px;
|
||||
font-family: RobotoMono Nerd Font;
|
||||
font-weight: 900;
|
||||
font-size: 13pt;
|
||||
color: #c0caf5;
|
||||
}
|
||||
|
||||
/* main waybar */
|
||||
window#waybar {
|
||||
background: rgba(26, 27, 38, 1);
|
||||
border: 2px solid #414868;
|
||||
}
|
||||
|
||||
/* when hovering over modules */
|
||||
tooltip {
|
||||
background: #1e1e2e;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
padding-right: 100px;
|
||||
}
|
||||
|
||||
|
||||
/* Sets active workspace to have a solid line on the bottom */
|
||||
#workspaces button.focused {
|
||||
border-bottom: 2px solid #7aa2f7;
|
||||
border-radius: 0;
|
||||
margin-top: 0px;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
/* More workspace stuff for highlighting on hover */
|
||||
#workspaces button.focused {
|
||||
color: #a6adc8;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
color: #f7768e;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: #11111b;
|
||||
color: #cdd6f4;
|
||||
}
|
||||
|
||||
/* Hide window module when not focused on window or empty workspace */
|
||||
window#waybar.empty #window {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* Set up rounding to make these modules look like separate pills */
|
||||
#tray {
|
||||
margin-right: 4px;
|
||||
}
|
43
home/yt/chunk.nix
Normal file
43
home/yt/chunk.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
outputs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./common.nix
|
||||
];
|
||||
home = {
|
||||
username = "yt";
|
||||
homeDirectory = "/home/yt";
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
systemd.user.startServices = "sd-switch";
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "cy";
|
||||
userEmail = "hi@cything.io";
|
||||
delta.enable = true;
|
||||
};
|
||||
|
||||
programs.neovim.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
lua-language-server
|
||||
vim-language-server
|
||||
python312Packages.python-lsp-server
|
||||
nixd
|
||||
gopls
|
||||
bash-language-server
|
||||
llvmPackages_19.clang-tools
|
||||
rust-analyzer
|
||||
yt-dlp
|
||||
gnumake
|
||||
btop
|
||||
];
|
||||
}
|
14
home/yt/common.nix
Normal file
14
home/yt/common.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./tmux.nix
|
||||
./zsh
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
"EDITOR" = "nvim";
|
||||
};
|
||||
|
||||
xdg.configFile = {
|
||||
nvim.source = ../nvim;
|
||||
};
|
||||
}
|
52
home/yt/foot.nix
Normal file
52
home/yt/foot.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{...}: {
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
font = "RobotoMono Nerd Font:size=8";
|
||||
dpi-aware = "yes";
|
||||
};
|
||||
bell = {
|
||||
urgent = "no";
|
||||
notify = "no";
|
||||
visual = "no";
|
||||
};
|
||||
cursor = {
|
||||
style = "beam";
|
||||
blink = "yes";
|
||||
blink-rate = 500;
|
||||
beam-thickness = 1.5;
|
||||
};
|
||||
mouse = {
|
||||
hide-when-typing = "yes";
|
||||
};
|
||||
# tokyonight: https://codeberg.org/dnkl/foot/src/branch/master/themes/tokyonight-night
|
||||
colors = {
|
||||
background = "1a1b26";
|
||||
foreground = "c0caf5";
|
||||
regular0 = "15161E";
|
||||
regular1 = "f7768e";
|
||||
regular2 = "9ece6a";
|
||||
regular3 = "e0af68";
|
||||
regular4 = "7aa2f7";
|
||||
regular5 = "bb9af7";
|
||||
regular6 = "7dcfff";
|
||||
regular7 = "a9b1d6";
|
||||
bright0 = "414868";
|
||||
bright1 = "f7768e";
|
||||
bright2 = "9ece6a";
|
||||
bright3 = "e0af68";
|
||||
bright4 = "7aa2f7";
|
||||
bright5 = "bb9af7";
|
||||
bright6 = "7dcfff";
|
||||
bright7 = "c0caf5";
|
||||
};
|
||||
|
||||
key-bindings = {
|
||||
clipboard-copy = "Control+Shift+c XF86Copy";
|
||||
clipboard-paste = "Control+Shift+v XF86Paste";
|
||||
quit = "Control+q";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
33
home/yt/tmux.nix
Normal file
33
home/yt/tmux.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{pkgs, ...}: {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
baseIndex = 1;
|
||||
historyLimit = 50000;
|
||||
keyMode = "emacs";
|
||||
mouse = false;
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
yank
|
||||
tokyo-night-tmux
|
||||
{
|
||||
plugin = resurrect;
|
||||
extraConfig = "set -g @resurrect-capture-pane-contents 'on'";
|
||||
}
|
||||
{
|
||||
plugin = continuum;
|
||||
extraConfig = "set -g @continnum-restore 'on'";
|
||||
}
|
||||
];
|
||||
prefix = "C-f";
|
||||
sensibleOnTop = true;
|
||||
terminal = "tmux-256color";
|
||||
extraConfig = ''
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
bind u attach-session -c "#{pane_current_path}"
|
||||
bind v split-window -c "#{pane_current_path}" -h
|
||||
bind s split-window -c "#{pane_current_path}" -v
|
||||
'';
|
||||
};
|
||||
}
|
138
home/yt/ytnix.nix
Normal file
138
home/yt/ytnix.nix
Normal file
|
@ -0,0 +1,138 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
outputs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./common.nix
|
||||
./foot.nix
|
||||
];
|
||||
home = {
|
||||
username = "yt";
|
||||
homeDirectory = "/home/yt";
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
systemd.user.startServices = "sd-switch";
|
||||
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme.name = "gtk";
|
||||
style.name = "adwaita-dark";
|
||||
style.package = pkgs.adwaita-qt;
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
cursorTheme = {
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern";
|
||||
};
|
||||
theme = {
|
||||
package = pkgs.adw-gtk3;
|
||||
name = "adw-gtk3-dark";
|
||||
};
|
||||
iconTheme = {
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
name = "Adwaita";
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
ANKI_WAYLAND = "1";
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "cy";
|
||||
userEmail = "hi@cything.io";
|
||||
delta.enable = true;
|
||||
};
|
||||
|
||||
programs.neovim.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
firefox
|
||||
inputs.chromium.legacyPackages.${system}.ungoogled-chromium
|
||||
# ungoogled-chromium
|
||||
librewolf
|
||||
bitwarden-desktop
|
||||
bitwarden-cli
|
||||
aerc
|
||||
fastfetch
|
||||
discord
|
||||
nwg-look
|
||||
element-desktop-wayland
|
||||
kdePackages.gwenview
|
||||
kdePackages.okular
|
||||
kdePackages.qtwayland
|
||||
mpv
|
||||
yt-dlp
|
||||
signal-desktop
|
||||
azure-cli
|
||||
pavucontrol
|
||||
btop
|
||||
grim
|
||||
slurp
|
||||
rofi-wayland
|
||||
rofimoji
|
||||
cliphist
|
||||
jq
|
||||
bash-language-server
|
||||
sqlite
|
||||
usbutils
|
||||
llvmPackages_19.clang-tools
|
||||
calibre
|
||||
tor-browser
|
||||
wtype
|
||||
bat
|
||||
yarn
|
||||
rclone
|
||||
go
|
||||
rustc
|
||||
cargo
|
||||
clang_19
|
||||
rust-analyzer
|
||||
clippy
|
||||
pwgen
|
||||
lua-language-server
|
||||
gnumake
|
||||
foot
|
||||
minisign
|
||||
unzip
|
||||
lm_sensors
|
||||
sshfs
|
||||
nextcloud-client
|
||||
python312Packages.python-lsp-server
|
||||
gopls
|
||||
anki-bin
|
||||
];
|
||||
|
||||
programs.waybar.enable = true;
|
||||
programs.feh.enable = true;
|
||||
|
||||
services.mako = {
|
||||
enable = true;
|
||||
backgroundColor = "#1a1a1a";
|
||||
defaultTimeout = 5000;
|
||||
borderSize = 0;
|
||||
borderRadius = 10;
|
||||
font = "DejaVu Sans Mono 11";
|
||||
padding = "10";
|
||||
textColor = "#777777";
|
||||
extraConfig = ''
|
||||
background-color=#c00000
|
||||
border-color=#ff0000
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.configFile = {
|
||||
sway.source = ../sway;
|
||||
rofi.source = ../rofi;
|
||||
waybar.source = ../waybar;
|
||||
};
|
||||
}
|
95
home/yt/zsh/default.nix
Normal file
95
home/yt/zsh/default.nix
Normal file
|
@ -0,0 +1,95 @@
|
|||
{...}: {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
autosuggestion = {
|
||||
enable = true;
|
||||
strategy = ["history" "completion"];
|
||||
};
|
||||
syntaxHighlighting = {
|
||||
enable = true;
|
||||
highlighters = ["brackets"];
|
||||
};
|
||||
autocd = true;
|
||||
defaultKeymap = "emacs";
|
||||
antidote = {
|
||||
enable = true;
|
||||
useFriendlyNames = true; # why not?
|
||||
plugins = [
|
||||
"zsh-users/zsh-completions"
|
||||
"romkatv/powerlevel10k"
|
||||
"Aloxaf/fzf-tab"
|
||||
"ohmyzsh/ohmyzsh path:plugins/colored-man-pages"
|
||||
];
|
||||
};
|
||||
history = {
|
||||
ignoreDups = true;
|
||||
ignoreAllDups = true;
|
||||
ignoreSpace = true;
|
||||
save = 50000;
|
||||
size = 50000;
|
||||
append = true;
|
||||
};
|
||||
historySubstringSearch = {
|
||||
enable = true;
|
||||
searchUpKey = "^p";
|
||||
searchDownKey = "^n";
|
||||
};
|
||||
initExtra = ''
|
||||
source ${./p10k.zsh}
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||
zstyle ':completion:*' menu no
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls $realpath'
|
||||
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-prewview 'ls $realpath'
|
||||
'';
|
||||
shellAliases = {
|
||||
"vi" = "nvim";
|
||||
"vim" = "nvim";
|
||||
"t" = "tmux";
|
||||
"tl" = "tmux list-sessions";
|
||||
"ta" = "tmux new-session -A -s";
|
||||
"se" = "sudoedit";
|
||||
"s" = "sudo";
|
||||
"nrs" = "sudo nixos-rebuild switch --flake .";
|
||||
"nrt" = "sudo nixos-rebuild test --flake .";
|
||||
"hrs" = "home-manager switch --flake .";
|
||||
"g" = "git";
|
||||
"ga" = "git add";
|
||||
"gaa" = "git add --all";
|
||||
"gb" = "git branch";
|
||||
"gc" = "git commit --verbose";
|
||||
"gcmsg" = "git commit --message";
|
||||
"gd" = "git diff";
|
||||
"gdca" = "git diff --cached";
|
||||
"gds" = "git diff --staged";
|
||||
"gl" = "git log --stat";
|
||||
"glg" = "git log --graph";
|
||||
"glga" = "git log --graph --decorate --all";
|
||||
"glo" = "git log --oneline --decorate";
|
||||
"gp" = "git push";
|
||||
"gr" = "git remote";
|
||||
"gra" = "git remote add";
|
||||
"grv" = "git remote --verbose";
|
||||
"gs" = "git status --short";
|
||||
"gss" = "git status";
|
||||
};
|
||||
sessionVariables = {
|
||||
"FZF_DEFAULT_COMMAND" = "rg";
|
||||
};
|
||||
};
|
||||
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
options = ["--cmd cd"];
|
||||
};
|
||||
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
199
home/yt/zsh/p10k.zsh
Normal file
199
home/yt/zsh/p10k.zsh
Normal file
|
@ -0,0 +1,199 @@
|
|||
# Generated by Powerlevel10k configuration wizard on 2024-11-29 at 19:54 EST.
|
||||
# Based on romkatv/powerlevel10k/config/p10k-pure.zsh.
|
||||
# Wizard options: nerdfont-v3 + powerline, small icons, pure, original, 2 lines,
|
||||
# compact, transient_prompt, instant_prompt=verbose.
|
||||
# Type `p10k configure` to generate another config.
|
||||
#
|
||||
# Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure).
|
||||
#
|
||||
# Differences from Pure:
|
||||
#
|
||||
# - Git:
|
||||
# - `@c4d3ec2c` instead of something like `v1.4.0~11` when in detached HEAD state.
|
||||
# - No automatic `git fetch` (the same as in Pure with `PURE_GIT_PULL=0`).
|
||||
#
|
||||
# Apart from the differences listed above, the replication of Pure prompt is exact. This includes
|
||||
# even the questionable parts. For example, just like in Pure, there is no indication of Git status
|
||||
# being stale; prompt symbol is the same in command, visual and overwrite vi modes; when prompt
|
||||
# doesn't fit on one line, it wraps around with no attempt to shorten it.
|
||||
#
|
||||
# If you like the general style of Pure but not particularly attached to all its quirks, type
|
||||
# `p10k configure` and pick "Lean" style. This will give you slick minimalist prompt while taking
|
||||
# advantage of Powerlevel10k features that aren't present in Pure.
|
||||
|
||||
# Temporarily change options.
|
||||
'builtin' 'local' '-a' 'p10k_config_opts'
|
||||
[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases')
|
||||
[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob')
|
||||
[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
|
||||
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
||||
|
||||
() {
|
||||
emulate -L zsh -o extended_glob
|
||||
|
||||
# Unset all configuration options.
|
||||
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
|
||||
|
||||
# Zsh >= 5.1 is required.
|
||||
[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return
|
||||
|
||||
# Prompt colors.
|
||||
local grey='242'
|
||||
local red='1'
|
||||
local yellow='3'
|
||||
local blue='4'
|
||||
local magenta='5'
|
||||
local cyan='6'
|
||||
local white='7'
|
||||
|
||||
# Left prompt segments.
|
||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
|
||||
# =========================[ Line #1 ]=========================
|
||||
context # user@host
|
||||
dir # current directory
|
||||
vcs # git status
|
||||
command_execution_time # previous command duration
|
||||
# =========================[ Line #2 ]=========================
|
||||
newline # \n
|
||||
virtualenv # python virtual environment
|
||||
prompt_char # prompt symbol
|
||||
)
|
||||
|
||||
# Right prompt segments.
|
||||
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
|
||||
# =========================[ Line #1 ]=========================
|
||||
# command_execution_time # previous command duration
|
||||
# virtualenv # python virtual environment
|
||||
# context # user@host
|
||||
# time # current time
|
||||
# =========================[ Line #2 ]=========================
|
||||
newline # \n
|
||||
)
|
||||
|
||||
# Basic style options that define the overall prompt look.
|
||||
typeset -g POWERLEVEL9K_BACKGROUND= # transparent background
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol
|
||||
typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons
|
||||
|
||||
# Add an empty line before each prompt except the first. This doesn't emulate the bug
|
||||
# in Pure that makes prompt drift down whenever you use the Alt-C binding from fzf or similar.
|
||||
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
|
||||
|
||||
# Magenta prompt symbol if the last command succeeded.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$magenta
|
||||
# Red prompt symbol if the last command failed.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red
|
||||
# Default prompt symbol.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯'
|
||||
# Prompt symbol in command vi mode.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
|
||||
# Prompt symbol in visual vi mode is the same as in command mode.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='❮'
|
||||
# Prompt symbol in overwrite vi mode is the same as in command mode.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false
|
||||
|
||||
# Grey Python Virtual Environment.
|
||||
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$grey
|
||||
# Don't show Python version.
|
||||
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
|
||||
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
|
||||
|
||||
# Blue current directory.
|
||||
typeset -g POWERLEVEL9K_DIR_FOREGROUND=$blue
|
||||
|
||||
# Context format when root: user@host. The first part white, the rest grey.
|
||||
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE="%F{$white}%n%f%F{$grey}@%m%f"
|
||||
# Context format when not root: user@host. The whole thing grey.
|
||||
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE="%F{$grey}%n@%m%f"
|
||||
# Don't show context unless root or in SSH.
|
||||
typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION=
|
||||
|
||||
# Show previous command duration only if it's >= 5s.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=5
|
||||
# Don't show fractional seconds. Thus, 7s rather than 7.3s.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
||||
# Duration format: 1d 2h 3m 4s.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
|
||||
# Yellow previous command duration.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$yellow
|
||||
|
||||
# Grey Git prompt. This makes stale prompts indistinguishable from up-to-date ones.
|
||||
typeset -g POWERLEVEL9K_VCS_FOREGROUND=$grey
|
||||
|
||||
# Disable async loading indicator to make directories that aren't Git repositories
|
||||
# indistinguishable from large Git repositories without known state.
|
||||
typeset -g POWERLEVEL9K_VCS_LOADING_TEXT=
|
||||
|
||||
# Don't wait for Git status even for a millisecond, so that prompt always updates
|
||||
# asynchronously when Git state changes.
|
||||
typeset -g POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS=0
|
||||
|
||||
# Cyan ahead/behind arrows.
|
||||
typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan
|
||||
# Don't show remote branch, current tag or stashes.
|
||||
typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind)
|
||||
# Don't show the branch icon.
|
||||
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
|
||||
# When in detached HEAD state, show @commit where branch normally goes.
|
||||
typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@'
|
||||
# Don't show staged, unstaged, untracked indicators.
|
||||
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON=
|
||||
# Show '*' when there are staged, unstaged or untracked files.
|
||||
typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*'
|
||||
# Show '⇣' if local branch is behind remote.
|
||||
typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=':⇣'
|
||||
# Show '⇡' if local branch is ahead of remote.
|
||||
typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=':⇡'
|
||||
# Don't show the number of commits next to the ahead/behind arrows.
|
||||
typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1
|
||||
# Remove space between '⇣' and '⇡' and all trailing spaces.
|
||||
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${${P9K_CONTENT/⇣* :⇡/⇣⇡}// }//:/ }'
|
||||
|
||||
# Grey current time.
|
||||
typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey
|
||||
# Format for the current time: 09:51:02. See `man 3 strftime`.
|
||||
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
|
||||
# If set to true, time will update when you hit enter. This way prompts for the past
|
||||
# commands will contain the start times of their commands rather than the end times of
|
||||
# their preceding commands.
|
||||
typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
|
||||
|
||||
# Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt
|
||||
# when accepting a command line. Supported values:
|
||||
#
|
||||
# - off: Don't change prompt when accepting a command line.
|
||||
# - always: Trim down prompt when accepting a command line.
|
||||
# - same-dir: Trim down prompt when accepting a command line unless this is the first command
|
||||
# typed after changing current working directory.
|
||||
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
|
||||
|
||||
# Instant prompt mode.
|
||||
#
|
||||
# - off: Disable instant prompt. Choose this if you've tried instant prompt and found
|
||||
# it incompatible with your zsh configuration files.
|
||||
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
||||
# during zsh initialization. Choose this if you've read and understood
|
||||
# https://github.com/romkatv/powerlevel10k#instant-prompt.
|
||||
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
||||
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
||||
# seen the warning, or if you are unsure what this all means.
|
||||
typeset -g POWERLEVEL9K_INSTANT_PROMPT=off
|
||||
|
||||
# Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
|
||||
# For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload
|
||||
# can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you
|
||||
# really need it.
|
||||
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
|
||||
|
||||
# If p10k is already loaded, reload configuration.
|
||||
# This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
|
||||
(( ! $+functions[p10k] )) || p10k reload
|
||||
}
|
||||
|
||||
# Tell `p10k configure` which file it should overwrite.
|
||||
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
|
||||
|
||||
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
|
||||
'builtin' 'unset' 'p10k_config_opts'
|
Loading…
Add table
Add a link
Reference in a new issue