commit aa657d0ae663464a97346c6f6595498569606877 Author: Light3039 Date: Sat Jun 4 16:59:05 2022 +0430 Initial Commit Add install.sh Add .zshrc add: nvim configs add: toggleterm, alpha update update Create README.md major changes major changes add picom updated dot files update shit diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..500c98a --- /dev/null +++ b/.zshrc @@ -0,0 +1,115 @@ +################################################################ +## ZSH CONFIGURATIONS +HISTFILE=~/.zshhist # Save history file +HISTSIZE=2048 # Save history zsh max lines +SAVEHIST=4096 # Save history file max lines +setopt autocd # Automatically change directory if only a path was provided +unsetopt beep notify # No bells! +bindkey -v # Use VI Keybindings +PROMPT="%F{green}%n@%m%f %~ $ " # The prompt + +################################################################ +## EXPORTS +export PATH="${PATH}:/home/light/.local/bin:/home/light/scripts/" +export LC_ALL="C" + +################################################################ +## ALIASES +alias icat='kitty +kitten icat' +alias zsrc='source ~/.zshrc' + +alias v='~/downloads/nvim/nvim-linux64/bin/nvim' +alias vv='neovide --multigrid --noidle --neovim-bin ~/downloads/nvim/nvim-linux64/bin/nvim && exit' + +alias vpn='expressvpn' + +alias q='exit' +alias :q='exit' +alias :wq='exit' +alias :qa='exit' + +alias wacom='xsetwacom --set 9 Area 15200 8550 0 0' + +alias bitch='sudo' +alias please='sudo' +alias communistify='chmod +777' + +alias bg='cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=DEBUG' +alias b='cmake --build build -j`nproc`' +alias b1='cmake --build build' + +# list +alias l='\colorls -l --sf' + +# list all +alias la='\colorls -lA --sf' + +# list simple +alias ls='\colorls --sf' + +# list simple all +alias lsa='\colorls -A --sf' + +alias ~="c ~" + +alias ..='c ../' +alias ...='c ../../' +alias ....='c ../../../' +alias .....='c ../../../../' +alias ......='c ../../../../../' + +alias randwall='feh --bg-fill --randomize ~/pictures/wallpapers/' +alias setwall='feh --bg-fill' + +alias mpv='mpv --input-ipc-server='/tmp/mpvsocket'' + +alias poweroff='sudo -v ; mpv --no-terminal ~/.config/xmonad/poweroff.wav ; sudo poweroff' + +pomodoro_work() +{ + sleep 1h + mpv ~/.config/xmonad/beep.mp3 --loop --volume=120 +} + +pomodoro_rest() +{ + sleep 10m + mpv ~/.config/xmonad/beep.mp3 --loop --volume=120 +} + +c() +{ + cd ${1:-.} ; clear ; l +} + +ca() +{ + cd ${1:-.} ; clear ; la +} + +cs() +{ + cd ${1:-.} ; clear ; ls +} + +csa() +{ + cd ${1:-.} ; clear ; lsa +} + +cn() +{ + cd ${1:-.} ; clear ; neofetch +} + +cgs() +{ + cd ${1:-.} ; clear ; git status +} + +picomadd() # add exception to opacity +{ + sed -i '/# OPACITY_RULE/i ,"100:name *= '\'$1\''"' ~/.config/picom/picom.conf +} + +fortune | cowsay | lolcat diff --git a/kitty/current-theme.conf b/kitty/current-theme.conf new file mode 100644 index 0000000..b93d4a8 --- /dev/null +++ b/kitty/current-theme.conf @@ -0,0 +1,32 @@ +## name: Gruvbox Dark +## author: Pavel Pertsev +## license: MIT/X11 +## upstream: https://raw.githubusercontent.com/gruvbox-community/gruvbox-contrib/master/kitty/gruvbox-dark.conf + +selection_foreground #ebdbb2 +selection_background #d65d0e + +background #282828 +foreground #ebdbb2 + +color0 #3c3836 +color1 #cc241d +color2 #98971a +color3 #d79921 +color4 #458588 +color5 #b16286 +color6 #689d6a +color7 #a89984 +color8 #928374 +color9 #fb4934 +color10 #b8bb26 +color11 #fabd2f +color12 #83a598 +color13 #d3869b +color14 #8ec07c +color15 #fbf1c7 + +cursor #bdae93 +cursor_text_color #665c54 + +url_color #458588 diff --git a/kitty/kitty.conf b/kitty/kitty.conf new file mode 100644 index 0000000..71ee57b --- /dev/null +++ b/kitty/kitty.conf @@ -0,0 +1,21 @@ +font_family JetbrainsMono Nerd Font +bold_font auto +italic_font auto +bold_italic_font auto +font_size 14 + +tab_bar_style hidden + +map ctrl+shift+l next_tab +map ctrl+shift+h previous_tab + +# tab_activity_symbol λ +active_tab_font_style normal +active_tab_font_style bold-italic +inactive_tab_font_style normal +enable_audio_bell no +disable_ligatures never +strip_trailing_spaces smart +placement_strategy center + +include current-theme.conf diff --git a/kitty/kitty.conf.bak b/kitty/kitty.conf.bak new file mode 100644 index 0000000..fbb64af --- /dev/null +++ b/kitty/kitty.conf.bak @@ -0,0 +1,80 @@ + +font_family JetbrainsMono Nerd Font +bold_font auto +italic_font auto +bold_italic_font auto +font_size 14 + +tab_bar_style powerline +tab_bar_edge top + +map ctrl+shift+l next_tab +map ctrl+shift+h previous_tab + +tab_activity_symbol λ +active_tab_font_style normal +active_tab_font_style bold-italic +inactive_tab_font_style normal +enable_audio_bell no +disable_ligatures never +strip_trailing_spaces smart +placement_strategy center + +# remove open link with mouse click +clear_all_mouse_actions yes +mouse_map left press ungrabbed mouse_selection normal +window_padding_width 0 +# cursor #928374 +# cursor_text_color background +# url_color #83a598 +# visual_bell_color #8ec07c +# bell_border_color #8ec07c +# active_border_color #d3869b +# inactive_border_color #665c54 +# foreground #ebdbb2 +# background #282828 +# selection_foreground #928374 +# selection_background #ebdbb2 +# active_tab_foreground #fbf1c7 +# active_tab_background #665c54 +# inactive_tab_foreground #a89984 +# inactive_tab_background #3c3836 + +# black (bg3/bg4) +# color0 #665c54 +# color8 #7c6f64 + +# red +# color1 #cc241d +# color9 #fb4934 + +#: green +# color4 #689d6a +# color12 #8ec07c + + +# yellow +# color3 #d79921 +# color11 #fabd2f + +# blue +# color2 #98971a +# color10 #b8bb26 + +# purple +# color5 #b16286 +# color13 #d3869b + +# aqua +# color6 #458588 +# color14 #83a598 + +# white (fg4/fg3) +# color7 #a89984 +# color15 #bdae93 + + +# BEGIN_KITTY_THEME +# Gruvbox Dark Hard +include current-theme.conf +# END_KITTY_THEME \ No newline at end of file diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..1adcce5 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,21 @@ +-- Core +require("_options") +require("_keymaps") +require("_plugins") + +-- Editing +require("_lsp") +require("_cmp") +require("_autopairs") + +-- Navigation +require("_telescope") +require("_nvim_tree") + +-- Aesthetics +require("_alpha") +require("_lualine") +require("_gitsigns") +require("_indentline") +require("_treesitter") +require("_gruvbox") diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..ac74023 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,23 @@ +{ + "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "gitsigns.nvim": { "branch": "main", "commit": "ee7e50dfbdf49e3acfa416fd3ad3abbdb658582c" }, + "gruvbox.nvim": { "branch": "main", "commit": "a933d8666dad9363dc6908ae72cfc832299c2f59" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, + "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-tree.lua": { "branch": "master", "commit": "be5b788f2dc1522c73fb7afad9092331c8aebe80" }, + "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, + "nvim-web-devicons": { "branch": "master", "commit": "68f70df44652d310d2adedf181b174c33a693665" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "telescope-args.nvim": { "branch": "main", "commit": "995072920fae8e1bf31daed015114bd54617079a" }, + "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" } +} diff --git a/nvim/lsp/clangd.lua b/nvim/lsp/clangd.lua new file mode 100644 index 0000000..0b4be1d --- /dev/null +++ b/nvim/lsp/clangd.lua @@ -0,0 +1,154 @@ +local function lsp_highlight_document(client) + if client.server_capabilities.document_highlight then + vim.api.nvim_exec( + [[ + augroup lsp_document_highlight + autocmd! * + autocmd CursorHold lua vim.lsp.buf.document_highlight() + autocmd CursorMoved lua vim.lsp.buf.clear_references() + augroup END + ]], + false + ) + end +end + +local function lsp_keymaps(bufnr) + local opts = { noremap = true, silent = true } + + vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "lua vim.lsp.buf.implementation()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "", "lua vim.lsp.buf.signature_help()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", 'lua vim.diagnostic.goto_prev({border="rounded"})', opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", 'lua vim.diagnostic.goto_next({border="rounded"})', opts) + + vim.api.nvim_buf_set_keymap(bufnr, "n", "lr", "lua vim.lsp.buf.rename()", opts) + + vim.api.nvim_buf_set_keymap(bufnr, "n", "q", "lua vim.diagnostic.setloclist()", opts) + + vim.api.nvim_buf_set_keymap( + bufnr, + "n", + "td", + "lua require 'telescope.builtin'.diagnostics()", + opts + ) + vim.api.nvim_buf_set_keymap( + bufnr, + "n", + "tr", + "lua require 'telescope.builtin'.lsp_references()", + opts + ) +end + +local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") +if not status_ok then + print("Failed to require cmp_nvim_lsp") + return +end + +local client_capabilities = vim.lsp.protocol.make_client_capabilities() +local capabilities = cmp_nvim_lsp.default_capabilities(client_capabilities) +capabilities.offsetEncoding = { "utf-8", "utf-16" } +capabilities.textDocument.completion.editsNearCursor = true + +---@brief +--- +--- https://clangd.llvm.org/installation.html +--- +--- - **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lspconfig/issues/23). +--- - If `compile_commands.json` lives in a build directory, you should +--- symlink it to the root of your source tree. +--- ``` +--- ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ +--- ``` +--- - clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) +--- specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson + +-- https://clangd.llvm.org/extensions.html#switch-between-sourceheader +local function switch_source_header(bufnr) + local method_name = 'textDocument/switchSourceHeader' + local client = vim.lsp.get_clients({ bufnr = bufnr, name = 'clangd' })[1] + if not client then + return vim.notify(('method %s is not supported by any servers active on the current buffer'):format(method_name)) + end + local params = vim.lsp.util.make_text_document_params(bufnr) + client.request(method_name, params, function(err, result) + if err then + error(tostring(err)) + end + if not result then + vim.notify('corresponding file cannot be determined') + return + end + vim.cmd.edit(vim.uri_to_fname(result)) + end, bufnr) +end + +local function symbol_info() + local bufnr = vim.api.nvim_get_current_buf() + local clangd_client = vim.lsp.get_clients({ bufnr = bufnr, name = 'clangd' })[1] + if not clangd_client or not clangd_client.supports_method 'textDocument/symbolInfo' then + return vim.notify('Clangd client not found', vim.log.levels.ERROR) + end + local win = vim.api.nvim_get_current_win() + local params = vim.lsp.util.make_position_params(win, clangd_client.offset_encoding) + clangd_client.request('textDocument/symbolInfo', params, function(err, res) + if err or #res == 0 then + -- Clangd always returns an error, there is not reason to parse it + return + end + local container = string.format('container: %s', res[1].containerName) ---@type string + local name = string.format('name: %s', res[1].name) ---@type string + vim.lsp.util.open_floating_preview({ name, container }, '', { + height = 2, + width = math.max(string.len(name), string.len(container)), + focusable = false, + focus = false, + border = 'single', + title = 'Symbol Info', + }) + end, bufnr) +end + +return { + cmd = { 'clangd' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto' }, + root_markers = { + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', -- AutoTools + '.git', + }, + capabilities = capabilities, + on_attach = function(client, bufnr) + lsp_keymaps(bufnr) + lsp_highlight_document(client) + + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + vim.lsp.buf.format() + end, + }) + end + + vim.api.nvim_buf_create_user_command(0, 'LspClangdSwitchSourceHeader', function() + switch_source_header(0) + end, { desc = 'Switch between source/header' }) + + vim.api.nvim_buf_create_user_command(0, 'LspClangdShowSymbolInfo', function() + symbol_info() + end, { desc = 'Show symbol info' }) + end, +} diff --git a/nvim/lsp/lua_ls.lua b/nvim/lsp/lua_ls.lua new file mode 100644 index 0000000..2fa7340 --- /dev/null +++ b/nvim/lsp/lua_ls.lua @@ -0,0 +1,176 @@ +local function lsp_highlight_document(client) + if client.server_capabilities.document_highlight then + vim.api.nvim_create_augroup("lsp_document_highlight", { clear = true }) + + vim.api.nvim_create_autocmd("CursorHold", { + group = "lsp_document_highlight", + buffer = 0, + callback = function() + vim.lsp.buf.document_highlight() + end, + }) + + vim.api.nvim_create_autocmd("CursorMoved", { + group = "lsp_document_highlight", + buffer = 0, + callback = function() + vim.lsp.buf.clear_references() + end, + }) + end +end + +local function lsp_keymaps(bufnr) + local opts = { noremap = true, silent = true } + + vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "lua vim.lsp.buf.implementation()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "", "lua vim.lsp.buf.signature_help()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", 'lua vim.diagnostic.goto_prev({border="rounded"})', opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", 'lua vim.diagnostic.goto_next({border="rounded"})', opts) + + vim.api.nvim_buf_set_keymap(bufnr, "n", "lr", "lua vim.lsp.buf.rename()", opts) + + vim.api.nvim_buf_set_keymap(bufnr, "n", "q", "lua vim.diagnostic.setloclist()", opts) + + vim.api.nvim_buf_set_keymap( + bufnr, + "n", + "td", + "lua require 'telescope.builtin'.diagnostics()", + opts + ) + vim.api.nvim_buf_set_keymap( + bufnr, + "n", + "tr", + "lua require 'telescope.builtin'.lsp_references()", + opts + ) +end + +local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") +if not status_ok then + print("Failed to require cmp_nvim_lsp") + return +end + +local client_capabilities = vim.lsp.protocol.make_client_capabilities() +local capabilities = cmp_nvim_lsp.default_capabilities(client_capabilities) +capabilities.offsetEncoding = { "utf-8", "utf-16" } +capabilities.textDocument.completion.editsNearCursor = true + +---@brief +--- +--- https://github.com/luals/lua-language-server +--- +--- Lua language server. +--- +--- `lua-language-server` can be installed by following the instructions [here](https://luals.github.io/#neovim-install). +--- +--- The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. +--- +--- If you primarily use `lua-language-server` for Neovim, and want to provide completions, +--- analysis, and location handling for plugins on runtime path, you can use the following +--- settings. +--- +--- ```lua +--- vim.lsp.config('lua_ls', { +--- on_init = function(client) +--- if client.workspace_folders then +--- local path = client.workspace_folders[1].name +--- if path ~= vim.fn.stdpath('config') and (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 and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189) +--- -- library = vim.api.nvim_get_runtime_file("", true) +--- } +--- }) +--- end, +--- settings = { +--- Lua = {} +--- } +--- }) +--- ``` +--- +--- See `lua-language-server`'s [documentation](https://luals.github.io/wiki/settings/) for an explanation of the above fields: +--- * [Lua.runtime.path](https://luals.github.io/wiki/settings/#runtimepath) +--- * [Lua.workspace.library](https://luals.github.io/wiki/settings/#workspacelibrary) +--- +return { + cmd = { 'lua-language-server' }, + filetypes = { 'lua' }, + root_markers = { + '.luarc.json', + '.luarc.jsonc', + '.luacheckrc', + '.stylua.toml', + 'stylua.toml', + 'selene.toml', + 'selene.yml', + '.git', + }, + + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using + -- (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT' + }, + + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" }, + }, + + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + library = vim.api.nvim_get_runtime_file("", true) + }, + + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + } + }, + + capabilities = capabilities, + on_attach = function(client, bufnr) + lsp_keymaps(bufnr) + lsp_highlight_document(client) + + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + vim.lsp.buf.format() + end, + }) + end + end, +} diff --git a/nvim/lua/_alpha.lua b/nvim/lua/_alpha.lua new file mode 100644 index 0000000..eef2d2f --- /dev/null +++ b/nvim/lua/_alpha.lua @@ -0,0 +1,12 @@ +local status_ok, alpha = pcall(require, "alpha") +if not status_ok then + return +end + +local dashboard = require("alpha.themes.dashboard") +dashboard.section.header.val = {} +dashboard.section.buttons.val = {} +dashboard.section.footer.val = "An idiot admires complexity, a genius admires simplicity. -- Terry A. Davis" +dashboard.opts.opts.noautocmd = true + +alpha.setup(dashboard.opts) diff --git a/nvim/lua/_autopairs.lua b/nvim/lua/_autopairs.lua new file mode 100644 index 0000000..5121307 --- /dev/null +++ b/nvim/lua/_autopairs.lua @@ -0,0 +1,36 @@ +local status_ok, npairs = pcall(require, "nvim-autopairs") +if not status_ok then + return +end + +npairs.setup { + check_ts = true, + ts_config = { + lua = { "string", "source" }, + javascript = { "string","template_string"}, + java = false, + }, + + disable_filetype = { "TelescopePrompt", "spectre_panel" }, + fast_wrap = { + map = "", + chars = { "{", "[", "(", '"', "'" }, + pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), + offset = 0, -- Offset from pattern match + end_key = "$", + keys = "qwertyuiopzxcvbnmasdfghjkl", + check_comma = true, + highlight = "PmenuSel", + highlight_grey = "LineNr", + }, + +} + +local cmp_autopairs = require("nvim-autopairs.completion.cmp") +local cmp_status_ok, cmp = pcall(require, "cmp") + +if not cmp_status_ok then + return +end + +cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done() ) diff --git a/nvim/lua/_cmp.lua b/nvim/lua/_cmp.lua new file mode 100644 index 0000000..5db15a8 --- /dev/null +++ b/nvim/lua/_cmp.lua @@ -0,0 +1,133 @@ +local cmp = require 'cmp' + +local snip_status_ok, luasnip = pcall(require, "luasnip") +if not snip_status_ok then + return +end + +require("luasnip/loaders/from_vscode").lazy_load() + +local check_backspace = function() + local col = vim.fn.col "." - 1 + return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" +end + +local kind_icons = { + Text = "", + Method = "󰆧", + Function = "󰊕", + Constructor = "", + Field = "󰇽", + Variable = "󰂡", + Class = "󰠱", + Interface = "", + Module = "", + Property = "󰜢", + Unit = "", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈙", + Reference = "", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "", + Event = "", + Operator = "󰆕", + TypeParameter = "󰅲", +} + +-- find more here: https://www.nerdfonts.com/cheat-sheet +-- +cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = { + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), + [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. + [""] = cmp.mapping { + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }, + -- Accept currently selected item. If none selected, `select` first item. + -- Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.confirm { select = false }, + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif check_backspace() then + fallback() + else + fallback() + end + end, { + "i", + "s", + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { + "i", + "s", + }), + }, + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + -- Kind icons + -- vim_item.kind = string.format("%s", kind_icons[vim_item.kind] or vim_item.kind) + vim_item.kind = string.format('%s', kind_icons[vim_item.kind] or vim_item.kind) + vim_item.menu = ({ + nvim_lsp = "[LSP]", + nvim_lua = "[NVIM_LUA]", + luasnip = "[Snippet]", + buffer = "[Buffer]", + path = "[Path]", + })[entry.source.name] + return vim_item + end, + }, + sources = { + { name = "nvim_lsp" }, + { name = "nvim_lua" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }, + confirm_opts = { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + window = { + documentation = cmp.config.window.bordered(), + completion = cmp.config.window.bordered(), + }, + experimental = { + ghost_text = true, + native_menu = false, + }, +} + +local cmp_autopairs = require('nvim-autopairs.completion.cmp') + +cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) diff --git a/nvim/lua/_gitsigns.lua b/nvim/lua/_gitsigns.lua new file mode 100644 index 0000000..87b3eed --- /dev/null +++ b/nvim/lua/_gitsigns.lua @@ -0,0 +1,55 @@ +local status_ok, gitsigns = pcall(require, "gitsigns") +if not status_ok then + return +end + +gitsigns.setup { + signs = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged_enable = true, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true + }, + auto_attach = true, + attach_to_untracked = false, + current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + virt_text_priority = 100, + use_focus = true, + }, + current_line_blame_formatter = ', - ', + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, +} diff --git a/nvim/lua/_gruvbox.lua b/nvim/lua/_gruvbox.lua new file mode 100644 index 0000000..37df958 --- /dev/null +++ b/nvim/lua/_gruvbox.lua @@ -0,0 +1,8 @@ +require("gruvbox").setup({ + overrides = { + SignColumn = { bg = "#282828" } + }, + transparent_mode = true, +}) +vim.o.background = "dark" +vim.cmd([[colorscheme gruvbox]]) diff --git a/nvim/lua/_indentline.lua b/nvim/lua/_indentline.lua new file mode 100644 index 0000000..6da9419 --- /dev/null +++ b/nvim/lua/_indentline.lua @@ -0,0 +1,3 @@ +local hooks = require "ibl.hooks" +hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level) +require("ibl").setup() diff --git a/nvim/lua/_keymaps.lua b/nvim/lua/_keymaps.lua new file mode 100644 index 0000000..6b2eefa --- /dev/null +++ b/nvim/lua/_keymaps.lua @@ -0,0 +1,135 @@ +local opts = { noremap = true, silent = true } +local term_opts = { silent = true } +local keymap = vim.api.nvim_set_keymap + +-- Set leader to space +keymap("", "", "", opts) +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +keymap("n", "e", "NvimTreeToggle", opts) + +-- Old config... + +ZenActive = true + +local function toggle_zen() + if not ZenActive then + ZenActive = true + + vim.cmd("set nonumber") + vim.cmd("set norelativenumber") + vim.lsp.inlay_hint.enable(false) + else + ZenActive = false + + vim.cmd("set relativenumber") + vim.cmd("set number") + vim.lsp.inlay_hint.enable(true) + end +end + +vim.api.nvim_create_user_command("ToggleZen", toggle_zen, {}) + +keymap("n", "", "ToggleZen", opts) +keymap("n", "h", "nohl", opts) + +-- Modes +-- normal_mode = "n", +-- insert_mode = "i", +-- visual_mode = "v", +-- visual_block_mode = "x", +-- term_mode = "t", +-- command_mode = "c", + +keymap("n", "", "h", opts) +keymap("n", "", "j", opts) +keymap("n", "", "k", opts) +keymap("n", "", "l", opts) +keymap("n", "", "%bd|e#|bd#", opts) + + +keymap("n", "", ":resize +2", opts) +keymap("n", "", ":resize -2", opts) +keymap("n", "", ":vertical resize -2", opts) +keymap("n", "", ":vertical resize +2", opts) + +-- Navigate buffers +keymap("n", "", ":bnext", opts) +keymap("n", "", ":bprevious", opts) + +-- Visual -- +-- Stay in indent mode +keymap("v", "<", "", ">gv", opts) +keymap("v", "p", '"_dP', opts) + +-- Move text up and down +keymap("x", "", ":move '>+1gv-gv", opts) +keymap("x", "", ":move '<-2gv-gv", opts) + +keymap( + "n", + "tm", + "lua require 'telescope.builtin'.lsp_document_symbols({ symbols = { 'method', 'function' } })", + opts +) + +keymap( + "n", + "f", + "lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))", + opts +) +keymap("n", "tg", "Telescope live_grep", opts) + + +keymap("n", "w", "w", opts) +keymap("n", "c", "bdelete", opts) + +keymap( + "n", + "", + [[set so=999 /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/jjj^0 nohl set so=6]], + opts +) + +keymap( + "n", + "", + [[set so=999 ?\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/nnjjj^0 nohl set so=6]], + opts +) + +vim.g.font_size = 10 +vim.o.guifont = "JetbrainsMono Nerd Font:h" .. vim.g.font_size + +keymap("n", "", "5", opts) + +vim.keymap.set( + "n", + "", + [[lua vim.g.font_size = vim.g.font_size - 1lua vim.o.guifont='JetbrainsMono Nerd Font:h'..vim.g.font_size]] +) + +vim.keymap.set( + "n", + "", + [[lua vim.g.font_size = vim.g.font_size + 1lua vim.o.guifont='JetbrainsMono Nerd Font:h'..vim.g.font_size]] +) +keymap("n", "\\", "ToggleTerm", opts) +keymap("t", "\\", "ToggleTerm", opts) + +vim.api.nvim_set_keymap( + "v", + "re", + [[ lua require('refactoring').refactor('Extract Function')]], + { noremap = true, silent = true, expr = false } +) + +vim.api.nvim_set_keymap( + "v", + "rf", + [[ lua require('refactoring').refactor('Extract Function To File')]], + { noremap = true, silent = true, expr = false } +) diff --git a/nvim/lua/_lsp.lua b/nvim/lua/_lsp.lua new file mode 100644 index 0000000..4e3991c --- /dev/null +++ b/nvim/lua/_lsp.lua @@ -0,0 +1,36 @@ +vim.lsp.enable({ + 'clangd', + 'lua_ls' +}) + +local config = { + virtual_text = true, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = '', + [vim.diagnostic.severity.WARN] = '', + [vim.diagnostic.severity.INFO] = '', + [vim.diagnostic.severity.HINT] = '', + } + }, + update_in_insert = true, + underline = true, + severity_sort = true, + float = { + focusable = false, + style = "normal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, +} + +vim.diagnostic.config(config) + +vim.lsp.buf.hover({ border = "rounded" }) +vim.lsp.buf.signature_help({ border = "rounded" }) +vim.lsp.enable({ + 'clangd', + 'luals' +}) diff --git a/nvim/lua/_lualine.lua b/nvim/lua/_lualine.lua new file mode 100644 index 0000000..f455fc9 --- /dev/null +++ b/nvim/lua/_lualine.lua @@ -0,0 +1,103 @@ +local status_ok, lualine = pcall(require, "lualine") +if not status_ok then + return +end + +local branch = { + "branch", + icons_enabled = true, + icon = "", +} + +local diff = { + "diff", + colored = false, + symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols +} + +local location = { + "location", + padding = 0, +} + +local colors = { + blue = "#458588", + green = "#98971a", + purple = "#b16286", + cyan = "#83a598", + red1 = "#cc241d", + yellow = "#d79921", + fg = "#ebdbb2", + bg = "#282828", + gray1 = "#928374", + gray2 = "#7c6f64", + gray3 = "#665c54", +} + +local gruvbox = { + normal = { + a = { fg = colors.bg, bg = colors.blue, gui = "bold" }, + c = { fg = colors.bg, bg = colors.blue, gui = "bold" }, + z = { fg = colors.bg, bg = colors.blue, gui = "bold" }, + }, + command = { + a = { fg = colors.bg, bg = colors.yellow, gui = "bold" }, + c = { fg = colors.bg, bg = colors.yellow, gui = "bold" }, + z = { fg = colors.bg, bg = colors.yellow, gui = "bold" }, + }, + insert = { + a = { fg = colors.bg, bg = colors.green, gui = "bold" }, + c = { fg = colors.bg, bg = colors.green, gui = "bold" }, + z = { fg = colors.bg, bg = colors.green, gui = "bold" }, + }, + visual = { + a = { fg = colors.bg, bg = colors.purple, gui = "bold" }, + c = { fg = colors.bg, bg = colors.purple, gui = "bold" }, + z = { fg = colors.bg, bg = colors.purple, gui = "bold" }, + }, + terminal = { + a = { fg = colors.bg, bg = colors.cyan, gui = "bold" }, + c = { fg = colors.bg, bg = colors.cyan, gui = "bold" }, + z = { fg = colors.bg, bg = colors.cyan, gui = "bold" }, + }, + replace = { + a = { fg = colors.bg, bg = colors.red1, gui = "bold" }, + c = { fg = colors.bg, bg = colors.red1, gui = "bold" }, + z = { fg = colors.bg, bg = colors.red1, gui = "bold" }, + }, + inactive = { + a = { fg = colors.gray1, bg = colors.bg, gui = "bold" }, + c = { fg = colors.gray1, bg = colors.bg, gui = "bold" }, + z = { fg = colors.gray1, bg = colors.bg, gui = "bold" }, + }, +} + +lualine.setup({ + options = { + icons_enabled = true, + theme = gruvbox, + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { "dashboard", "NvimTree", "Outline" }, + always_divide_middle = true, + }, + sections = { + lualine_a = { "filename" }, + lualine_b = { { "diagnostics", colored = false }}, + lualine_c = {}, + lualine_x = {branch, diff}, + lualine_y = { }, + lualine_z = { }, + }, + inactive_sections = { + lualine_a = { "filename" }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = {}, +}) + diff --git a/nvim/lua/_nvim_tree.lua b/nvim/lua/_nvim_tree.lua new file mode 100644 index 0000000..bf5300c --- /dev/null +++ b/nvim/lua/_nvim_tree.lua @@ -0,0 +1,75 @@ +local status_ok, nvim_tree = pcall(require, "nvim-tree") +if not status_ok then + return +end + +local function my_on_attach(bufnr) + local api = require "nvim-tree.api" + + local function opts(desc) + return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } + end + + -- default mappings + api.config.mappings.default_on_attach(bufnr) + + -- custom mappings + vim.keymap.set('n', '', api.tree.change_root_to_parent, opts('Up')) + vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help')) +end + +nvim_tree.setup({ + on_attach = my_on_attach, + actions = { + open_file = { + quit_on_open = true, + }, + }, + + update_focused_file = { + enable = true, + update_cwd = false, + }, + renderer = { + root_folder_modifier = ":t", + icons = { + glyphs = { + default = "", + symlink = "", + folder = { + arrow_open = "", + arrow_closed = "", + default = "", + open = "", + empty = "", + empty_open = "", + symlink = "", + symlink_open = "", + }, + git = { + unstaged = "", + staged = "S", + unmerged = "", + renamed = "➜", + untracked = "U", + deleted = "", + ignored = "◌", + }, + }, + }, + }, + diagnostics = { + enable = false, + show_on_dirs = true, + icons = { + hint = "", + info = "", + warning = "", + error = "", + }, + }, + view = { + width = 84, + side = "right", + }, +}) diff --git a/nvim/lua/_options.lua b/nvim/lua/_options.lua new file mode 100644 index 0000000..d125501 --- /dev/null +++ b/nvim/lua/_options.lua @@ -0,0 +1,41 @@ +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 +vim.opt.clipboard = "unnamedplus" +vim.opt.completeopt = "menuone,noselect" +vim.opt.fileencoding = "utf-32" +vim.opt.ignorecase = true +vim.opt.pumheight = 12 +vim.opt.splitbelow = true +vim.opt.splitright = true +vim.opt.swapfile = false +vim.opt.termguicolors = true +vim.opt.undofile = true +vim.opt.updatetime = 300 +vim.opt.signcolumn = "yes" +vim.opt.wrap = false +vim.opt.scrolloff = 6 +vim.opt.sidescrolloff = 6 +vim.opt.showmode = false +vim.opt.colorcolumn = "100" +vim.opt.expandtab = true +vim.opt.shiftwidth = 4 +vim.opt.tabstop = 4 +vim.opt.autoindent = true +vim.opt.showtabline = 0 +vim.opt.cursorline = false +vim.opt.numberwidth = 4 +vim.opt.shortmess:append("c") +vim.opt.laststatus = 1 +vim.cmd('let g:neovide_cursor_vfx_mode = "pixiedust"') +vim.cmd("let g:neovide_cursor_vfx_particle_density = 32.0") + +-- lastplace +vim.api.nvim_create_autocmd('BufReadPost', { + callback = function() + local mark = vim.api.nvim_buf_get_mark(0, '"') + local lcount = vim.api.nvim_buf_line_count(0) + if mark[1] > 0 and mark[1] <= lcount then + vim.api.nvim_win_set_cursor(0, mark) + end + end +}) diff --git a/nvim/lua/_plugins.lua b/nvim/lua/_plugins.lua new file mode 100644 index 0000000..6d5064d --- /dev/null +++ b/nvim/lua/_plugins.lua @@ -0,0 +1,34 @@ +require("_plugins_bootstrap") +require("lazy").setup({ + spec = { + -- Core + { 'nvim-lua/plenary.nvim' }, + + -- Navigation + { "kyazdani42/nvim-tree.lua" }, + { 'nvim-telescope/telescope.nvim' }, + { "slarwise/telescope-args.nvim" }, + + -- Aesthetics + { "lukas-reineke/indent-blankline.nvim" }, + { "nvim-treesitter/nvim-treesitter", }, + { "kyazdani42/nvim-web-devicons" }, + { "nvim-lualine/lualine.nvim" }, + { "ellisonleao/gruvbox.nvim" }, + { "lewis6991/gitsigns.nvim" }, + { "goolord/alpha-nvim" }, + + -- Auto-complete + { "hrsh7th/nvim-cmp" }, + { "hrsh7th/cmp-nvim-lsp" }, + { "hrsh7th/cmp-nvim-lua" }, + { "hrsh7th/cmp-buffer" }, + { "hrsh7th/cmp-path" }, + { "hrsh7th/cmp-cmdline" }, + { "saadparwaiz1/cmp_luasnip" }, + { "windwp/nvim-autopairs" }, + { "L3MON4D3/LuaSnip" }, + }, + install = { colorscheme = { "gruvbox" } }, + checker = { enabled = true }, +}) diff --git a/nvim/lua/_plugins_bootstrap.lua b/nvim/lua/_plugins_bootstrap.lua new file mode 100644 index 0000000..59dc9f0 --- /dev/null +++ b/nvim/lua/_plugins_bootstrap.lua @@ -0,0 +1,17 @@ +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 = " " +vim.g.maplocalleader = "\\" diff --git a/nvim/lua/_telescope.lua b/nvim/lua/_telescope.lua new file mode 100644 index 0000000..d595ae0 --- /dev/null +++ b/nvim/lua/_telescope.lua @@ -0,0 +1,98 @@ +local status_ok, telescope = pcall(require, "telescope") +if not status_ok then + return +end + +telescope.load_extension("args") +local actions = require("telescope.actions") + +telescope.setup({ + defaults = { + + file_ignore_patterns = { "doxygen", "^build", "^tests/assets", ".*\\.png$" }, + prompt_prefix = " ", + selection_caret = " ", + path_display = { "truncate" }, + + mappings = { + i = { + [""] = actions.cycle_history_next, + [""] = actions.cycle_history_prev, + + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + + [""] = actions.close, + + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + + [""] = actions.select_default, + [""] = actions.select_horizontal, + [""] = actions.select_vertical, + [""] = actions.select_tab, + + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, + + [""] = actions.results_scrolling_up, + [""] = actions.results_scrolling_down, + + [""] = actions.toggle_selection + actions.move_selection_worse, + [""] = actions.toggle_selection + actions.move_selection_better, + [""] = actions.send_to_qflist + actions.open_qflist, + [""] = actions.send_selected_to_qflist + actions.open_qflist, + [""] = actions.complete_tag, + [""] = actions.which_key, -- keys from pressing + }, + + n = { + [""] = actions.close, + [""] = actions.select_default, + [""] = actions.select_horizontal, + [""] = actions.select_vertical, + [""] = actions.select_tab, + + [""] = actions.toggle_selection + actions.move_selection_worse, + [""] = actions.toggle_selection + actions.move_selection_better, + [""] = actions.send_to_qflist + actions.open_qflist, + [""] = actions.send_selected_to_qflist + actions.open_qflist, + + ["j"] = actions.move_selection_next, + ["k"] = actions.move_selection_previous, + ["H"] = actions.move_to_top, + ["M"] = actions.move_to_middle, + ["L"] = actions.move_to_bottom, + + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + ["gg"] = actions.move_to_top, + ["G"] = actions.move_to_bottom, + + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, + + [""] = actions.results_scrolling_up, + [""] = actions.results_scrolling_down, + + ["?"] = actions.which_key, + }, + }, + }, + pickers = { + -- Default configuration for builtin pickers goes here: + -- picker_name = { + -- picker_config_key = value, + -- ... + -- } + -- Now the picker_config_key will be applied every time you call this + -- builtin picker + }, + extensions = { + -- Your extension configuration goes here: + -- extension_name = { + -- extension_config_key = value, + -- } + -- please take a look at the readme of the extension you want to configure + }, +}) diff --git a/nvim/lua/_treesitter.lua b/nvim/lua/_treesitter.lua new file mode 100644 index 0000000..4c4853b --- /dev/null +++ b/nvim/lua/_treesitter.lua @@ -0,0 +1,20 @@ +local configs = require("nvim-treesitter.configs") + +configs.setup({ + ensure_installed = "all", + sync_install = false, + ignore_install = { "" }, + autopairs = { + enable = true, + }, + context_commenting = { + enable = true, + enable_autocmd = false, + }, + highlight = { + enable = true, + disable = { "" }, + additional_vim_regex_highlighting = true, + }, + -- indent = { enable = true, disable = { "yaml" } }, +}) diff --git a/nvim/spell/en.utf-8.add b/nvim/spell/en.utf-8.add new file mode 100644 index 0000000..106310c --- /dev/null +++ b/nvim/spell/en.utf-8.add @@ -0,0 +1,28 @@ +intranquility +uv +shader +rasterizer +rasterization +applesthepi +rasterize +#OLINR +NOLINT +NOLINR/! +glm +mat4 +skybox +TransformComponent +param +swapchain +struct +readonly +writeonly +samplerCueb +samplerCube +Vulkan +accessor +const +cmd +str +RDB +Rasterized diff --git a/nvim/spell/en.utf-8.add.spl b/nvim/spell/en.utf-8.add.spl new file mode 100644 index 0000000..206b0fb Binary files /dev/null and b/nvim/spell/en.utf-8.add.spl differ diff --git a/pacman.conf b/pacman.conf new file mode 100644 index 0000000..f4f091a --- /dev/null +++ b/pacman.conf @@ -0,0 +1,97 @@ +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto +ILoveCandy + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +#NoProgressBar +CheckSpace +#VerbosePkgLists +ParallelDownloads = 8 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +#[core-testing] +#Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +#[extra-testing] +#Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# If you want to run 32 bit applications on your x86_64 system, +# enable the multilib repositories as required here. + +#[multilib-testing] +#Include = /etc/pacman.d/mirrorlist + +[multilib] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/picom/picom.conf b/picom/picom.conf new file mode 100644 index 0000000..aee839c --- /dev/null +++ b/picom/picom.conf @@ -0,0 +1,182 @@ +#========================= Corners =========================# +corner-radius = 16; +rounded-corners-exclude = [ + "class_g ?= 'tint2'", + "class_g ?= 'polybar'" +]; + +round-borders = 2; +round-borders-exclude = [ +]; + +round-borders-rule = [ +]; + +#========================= Shadows =========================# +shadow = true; +shadow-radius = 24; +shadow-opacity = 0.78; +shadow-offset-x = -13; +shadow-offset-y = -13; +shadow-exclude = [ + # "class_g = 'Cairo-clock'", + # "class_g = 'CoverGloobus'", + # "class_g = 'Tilda'", + "class_g = 'Polybar'", + # "name ?= 'gnome-pie'", + # "class_g ?= 'Plank'", + # "name *= 'recordmydesktop'", + # "name = 'Notification'", + # "name = 'Docky'", + # "name = 'Kupfer'", + # "name = 'xfce4-notifyd'", + # "name *= 'VLC'", + # "name *= 'Chromium'", + # "name *= 'Chrome'", + # "class_g = 'Conky'", + # "class_g = 'Kupfer'", + # "class_g = 'Synapse'", + # "class_g ?= 'Notify-osd'", + # "class_g ?= 'Cairo-dock'", + # "class_g ?= 'Xfce4-notifyd'", + # "class_g ?= 'Xfce4-power-manager'", + # "_GTK_FRAME_EXTENTS@:c", + # "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" +]; + +#========================= Fading =========================# + +fading = true; +fade-in-step = 0.093; +fade-out-step = 0.093; +fade-delta = 10; +fade-exclude = [ + "class_g = 'slop'" # maim +] +no-fading-openclose = false +no-fading-destroyed-argb = false + +#========================= Opacity =========================# + +inactive-opacity = 0.76; +frame-opacity = 1.0; +inactive-opacity-override = true; +active-opacity = 0.86; +# focus-exclude = [ +# "class_g = 'Cairo-clock'", +# "class_g = 'Bar'", +# "class_g = 'slop'" +# ]; +#opacity-rule = [ + # "100:class_g = 'Bar'", + # "100:class_g = 'slop'", + # "100:class_g = 'XTerm'", + # "100:class_g = 'URxvt'", + # "100:class_g = 'kitty'", + # "100:class_g = 'Alacritty'", + # "100:class_g = 'Polybar'", + # "100:class_g = 'code-oss'", + # "100:class_g = 'Meld'", + # "100:class_g = 'TelegramDesktop'", + # "100:class_g = 'Joplin'", + # "100:class_g = 'firefox'", + # "100:class_g = 'Chromium'", + # "100:class_g = 'Thunderbird'", + # "100:class_g = 'Thunar'", + # "100:class_g = 'Nitrogen'", + # "100:class_g = 'Code'" +#]; + +opacity-rule = [ + "100:name *= '>_<'", + "100:name *= 'Blender'", + "100:name *= 'HuraWatch'", + "100:name *= 'Aseprite'", + "100:name *= 'Unreal Editor'", + "100:name *= 'Aseprite'", + "100:name *= 'Pinterest'", + "100:name *= 'PureRef'", + "100:name *= 'Inkscape'", + "100:name *= 'Dota 2'", + "100:name *= 'Gogoanime'", + "100:name *= '.jpg'" +,"86:class_g = 'Polybar'", +,"100:name *= '.gif'" +,"100:name *= '.png'" +,"100:name *= 'mpv'" +,"100:name *= 'LibreOffice'" +,"100:name *= 'God of War'" +,"100:name *= 'Sololearn'" +,"100:name *= 'Kdenlive'" +,"100:name *= 'GIMP'" +,"100:name *= 'cubic-bezier.com'" +,"100:name *= 'Fretastic'" +,"100:name *= 'Mirror'" +,"100:name *= 'LearnOpenGL'" +,"100:name *= 'YouTube'" +,"100:name *= 'bilbili'" +,"100:name *= 'bilibili'" +,"100:name *= 'Krita'" +,"100:name *= 'Subnautica'" +,"100:name *= 'Code'" + # OPACITY_RULE +]; + + +#========================= Blurring =========================# + +blur: { + method = "dual_kawase"; + strength = 3; + kern = "3x3box"; + background = false; + background-fixed = false; +} +# blur-method = "kernel" +# blur-strength= 10 +# blur-kern = "3x3box" +# blur-deviation = false +# blur-background = false + +# blur-background-exclude = [ +# "window_type = 'dock'", +# "window_type = 'desktop'", +# "class_g = 'Plank'", +# "class_g = 'polybar'", +# "class_g = 'slop'", +# "class_g = 'Chromium'", +# "_GTK_FRAME_EXTENTS@:c", +# ]; + +#========================= General Settings =========================# + +backend = "glx"; +vsync = true; +mark-wmwin-focused = true; +mark-ovredir-focused = false; +detect-rounded-corners = true; +detect-client-opacity = true; +refresh-rate = 0; +detect-transient = true; +detect-client-leader = true; +glx-no-stencil = true; +glx-copy-from-font = false +use-damage = true; +log-level = "info"; +animations = true +animation-for-transient-window = "zoom" +animation-for-open-window = "zoom" +animation-for-unmap-window = "zoom" +animation-stiffness = 350 +animation-dampening = 20 +animation-window-mass = 0.5 +animation-delta = 8 +animation-clamping = false + +wintypes: +{ + tooltip = { fade=true; shadow=true; opacity=0.95; focus=true; full-shadow=false; }; + popup_menu = { opacity=1.0; } + dropdown_menu = { opacity=1.0; } + utility = { shadow=false; opacity=1.0; } +}; diff --git a/rofi/config.rasi b/rofi/config.rasi new file mode 100644 index 0000000..9a0ea86 --- /dev/null +++ b/rofi/config.rasi @@ -0,0 +1,297 @@ +/*Dracula theme based on the Purple official rofi theme*/ + +* { + /* Theme settings */ + font: "Jetbrains Mono 24"; + highlight: bold italic; + scrollbar: true; + + /* Gruvbox dark colors */ + gruvbox-dark-bg0: #282828; + gruvbox-dark-bg0-soft: #32302f; + gruvbox-dark-bg3: #665c54; + gruvbox-dark-fg0: #fbf1c7; + gruvbox-dark-fg1: #ebdbb2; + gruvbox-dark-red-dark: #cc241d; + gruvbox-dark-red-light: #fb4934; + gruvbox-dark-yellow-dark: #d79921; + gruvbox-dark-yellow-light: #fabd2f; + gruvbox-dark-gray: #a89984; + + /* Theme colors */ + background: @gruvbox-dark-bg0; + background-color: @background; + foreground: @gruvbox-dark-fg1; + border-color: @gruvbox-dark-gray; + separatorcolor: @border-color; + scrollbar-handle: @border-color; + + normal-background: @background; + normal-foreground: @foreground; + alternate-normal-background: @gruvbox-dark-bg0-soft; + alternate-normal-foreground: @foreground; + selected-normal-background: @gruvbox-dark-bg3; + selected-normal-foreground: @gruvbox-dark-fg0; + + active-background: @gruvbox-dark-yellow-dark; + active-foreground: @background; + alternate-active-background: @active-background; + alternate-active-foreground: @active-foreground; + selected-active-background: @gruvbox-dark-yellow-light; + selected-active-foreground: @active-foreground; + + urgent-background: @gruvbox-dark-red-dark; + urgent-foreground: @background; + alternate-urgent-background: @urgent-background; + alternate-urgent-foreground: @urgent-foreground; + selected-urgent-background: @gruvbox-dark-red-light; + selected-urgent-foreground: @urgent-foreground; +} + +window { + background-color: @background; + border: 2; + padding: 2; +} + +mainbox { + border: 0; + padding: 0; +} + +message { + border: 2px 0 0; + border-color: @separatorcolor; + padding: 1px; +} + +textbox { + highlight: @highlight; + text-color: @foreground; +} + +listview { + border: 2px solid 0 0; + padding: 2px 0 0; + border-color: @separatorcolor; + spacing: 2px; + scrollbar: @scrollbar; +} + +element { + border: 0; + padding: 2px; +} + +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} + +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} + +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} + +scrollbar { + width: 4px; + border: 0; + handle-color: @scrollbar-handle; + handle-width: 8px; + padding: 0; +} + +sidebar { + border: 2px 0 0; + border-color: @separatorcolor; +} + +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 2px; + children: [ prompt, textbox-prompt-sep, entry, case-indicator ]; +} + +case-indicator, +entry, +prompt, +button { + spacing: 0; + text-color: @normal-foreground; +} + +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +textbox-prompt-sep { + expand: false; + str: ":"; + text-color: @normal-foreground; + margin: 0 0.3em 0 0; +} + +/* +* { + font: "Jetbrains Mono 24"; + foreground: #f8f8f2; + background-color: #282a36; + active-background: #6272a4; + urgent-background: #ff5555; + urgent-foreground: #282a36; + selected-background: @active-background; + selected-urgent-background: @urgent-background; + selected-active-background: @active-background; + separatorcolor: @active-background; + bordercolor: @active-background; +} + +#window { + background-color: @background-color; + border: 1; + border-radius: 6; + border-color: @bordercolor; + padding: 5; +} +#mainbox { + border: 0; + padding: 0; +} +#message { + border: 1px dash 0px 0px ; + border-color: @separatorcolor; + padding: 1px ; +} +#textbox { + text-color: @foreground; +} +#listview { + fixed-height: 0; + border: 2px dash 0px 0px ; + border-color: @bordercolor; + spacing: 2px ; + scrollbar: false; + padding: 2px 0px 0px ; +} +#element { + border: 0; + padding: 1px ; +} +#element.normal.normal { + background-color: @background-color; + text-color: @foreground; +} +#element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +#element.normal.active { + background-color: @active-background; + text-color: @foreground; +} +#element.selected.normal { + background-color: @selected-background; + text-color: @foreground; +} +#element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @foreground; +} +#element.selected.active { + background-color: @selected-active-background; + text-color: @foreground; +} +#element.alternate.normal { + background-color: @background-color; + text-color: @foreground; +} +#element.alternate.urgent { + background-color: @urgent-background; + text-color: @foreground; +} +#element.alternate.active { + background-color: @active-background; + text-color: @foreground; +} +#scrollbar { + width: 2px ; + border: 0; + handle-width: 8px ; + padding: 0; +} +#sidebar { + border: 2px dash 0px 0px ; + border-color: @separatorcolor; +} +#button.selected { + background-color: @selected-background; + text-color: @foreground; +} +#inputbar { + spacing: 0; + text-color: @foreground; + padding: 1px ; +} +#case-indicator { + spacing: 0; + text-color: @foreground; +} +#entry { + spacing: 0; + text-color: @foreground; +} +#prompt { + spacing: 0; + text-color: @foreground; +} +#inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +#textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em ; + text-color: @foreground; +} +element-text, element-icon { + background-color: inherit; + text-color: inherit; +} +*/ diff --git a/rofi/test.rasi b/rofi/test.rasi new file mode 100644 index 0000000..55c1375 --- /dev/null +++ b/rofi/test.rasi @@ -0,0 +1,151 @@ +configuration { +/* modes: "window,drun,run,ssh";*/ +/* font: "mono 12";*/ +/* location: 0;*/ +/* yoffset: 0;*/ +/* xoffset: 0;*/ +/* fixed-num-lines: true;*/ +/* show-icons: false;*/ +/* terminal: "rofi-sensible-terminal";*/ +/* 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: ;*/ +/* drun-match-fields: "name,generic,exec,categories,keywords";*/ +/* drun-categories: ;*/ +/* drun-show-actions: false;*/ +/* drun-display-format: "{name} [({generic})]";*/ +/* 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";*/ +/* matching: "normal";*/ +/* tokenize: true;*/ +/* m: "-5";*/ +/* filter: ;*/ +/* dpi: -1;*/ +/* threads: 0;*/ +/* scroll-method: 0;*/ +/* window-format: "{w} {c} {t}";*/ +/* click-to-exit: true;*/ +/* 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: 8192;*/ +/* xserver-i300-workaround: false;*/ +/* pid: "/run/user/1000/rofi.pid";*/ +/* display-window: ;*/ +/* display-windowcd: ;*/ +/* display-run: ;*/ +/* display-ssh: ;*/ +/* display-drun: ;*/ +/* display-combi: ;*/ +/* display-keys: ;*/ +/* display-filebrowser: ;*/ +/* kb-primary-paste: "Control+V,Shift+Insert";*/ +/* kb-secondary-paste: "Control+v,Insert";*/ +/* 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";*/ +/* 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"; + } +} diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..e3fee1d --- /dev/null +++ b/update.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +rm -rv ./kitty ; cp -rv ~/.config/kitty . +rm -rv ./xmonad; cp -rv ~/.config/xmonad . +rm -rv ./nvim; cp -rv ~/.config/nvim . +rm -rv ./rofi; cp -rv ~/.config/rofi . +rm -rv ./picom; cp -rv ~/.config/picom . +rm -rv ./zshrc.sh; cp -rv ~/.zshrc ./zshrc.sh +rm -rv ./wallpapers; cp -rv ~/pictures/wallpapers . +rm ./pacman.conf; cp -rv /etc/pacman.conf . + diff --git a/wallpapers/1.jpg b/wallpapers/1.jpg new file mode 100644 index 0000000..dbf45ee Binary files /dev/null and b/wallpapers/1.jpg differ diff --git a/wallpapers/2.jpg b/wallpapers/2.jpg new file mode 100644 index 0000000..0d2a730 Binary files /dev/null and b/wallpapers/2.jpg differ diff --git a/wallpapers/3.jpg b/wallpapers/3.jpg new file mode 100644 index 0000000..4fb1f8f Binary files /dev/null and b/wallpapers/3.jpg differ diff --git a/wallpapers/4.jpg b/wallpapers/4.jpg new file mode 100644 index 0000000..1342927 Binary files /dev/null and b/wallpapers/4.jpg differ diff --git a/wallpapers/5.jpg b/wallpapers/5.jpg new file mode 100644 index 0000000..b06c4e7 Binary files /dev/null and b/wallpapers/5.jpg differ diff --git a/wallpapers/6.jpg b/wallpapers/6.jpg new file mode 100644 index 0000000..6e8ff15 Binary files /dev/null and b/wallpapers/6.jpg differ diff --git a/wallpapers/README.md b/wallpapers/README.md new file mode 100644 index 0000000..bf4b7df --- /dev/null +++ b/wallpapers/README.md @@ -0,0 +1,2 @@ +I DO NOT OWN ANY OF THE PICTURES IN THIS DIRECTORY, I SIMPLY DOWNLOADED THEM FROM THE INTERNET +CREDIT GOES TO THEIR RESPECTIVE OWNERS diff --git a/wallpapers/a.jpg b/wallpapers/a.jpg new file mode 100644 index 0000000..497b5a6 Binary files /dev/null and b/wallpapers/a.jpg differ diff --git a/wallpapers/a.png b/wallpapers/a.png new file mode 100644 index 0000000..dadf6a3 Binary files /dev/null and b/wallpapers/a.png differ diff --git a/wallpapers/am.jpg b/wallpapers/am.jpg new file mode 100644 index 0000000..a846524 Binary files /dev/null and b/wallpapers/am.jpg differ diff --git a/wallpapers/b.jpg b/wallpapers/b.jpg new file mode 100644 index 0000000..22f6ea0 Binary files /dev/null and b/wallpapers/b.jpg differ diff --git a/wallpapers/bb.jpg b/wallpapers/bb.jpg new file mode 100644 index 0000000..8e75eca Binary files /dev/null and b/wallpapers/bb.jpg differ diff --git a/wallpapers/c.jpg b/wallpapers/c.jpg new file mode 100644 index 0000000..455ee0e Binary files /dev/null and b/wallpapers/c.jpg differ diff --git a/wallpapers/cm.jpg b/wallpapers/cm.jpg new file mode 100644 index 0000000..99c180a Binary files /dev/null and b/wallpapers/cm.jpg differ diff --git a/wallpapers/d.jpg b/wallpapers/d.jpg new file mode 100644 index 0000000..7ad0497 Binary files /dev/null and b/wallpapers/d.jpg differ diff --git a/wallpapers/d.png b/wallpapers/d.png new file mode 100644 index 0000000..e98567f Binary files /dev/null and b/wallpapers/d.png differ diff --git a/wallpapers/deathnote_01.jpg b/wallpapers/deathnote_01.jpg new file mode 100644 index 0000000..a25810c Binary files /dev/null and b/wallpapers/deathnote_01.jpg differ diff --git a/wallpapers/drow.jpg b/wallpapers/drow.jpg new file mode 100644 index 0000000..841ef28 Binary files /dev/null and b/wallpapers/drow.jpg differ diff --git a/wallpapers/e.jpg b/wallpapers/e.jpg new file mode 100644 index 0000000..3696b1d Binary files /dev/null and b/wallpapers/e.jpg differ diff --git a/wallpapers/f.png b/wallpapers/f.png new file mode 100644 index 0000000..3bfcf0c Binary files /dev/null and b/wallpapers/f.png differ diff --git a/wallpapers/fav/1.jpg b/wallpapers/fav/1.jpg new file mode 100644 index 0000000..6a0978a Binary files /dev/null and b/wallpapers/fav/1.jpg differ diff --git a/wallpapers/fav/2.jpg b/wallpapers/fav/2.jpg new file mode 100644 index 0000000..9f0940c Binary files /dev/null and b/wallpapers/fav/2.jpg differ diff --git a/wallpapers/fav/3.jpg b/wallpapers/fav/3.jpg new file mode 100644 index 0000000..7dc30e3 Binary files /dev/null and b/wallpapers/fav/3.jpg differ diff --git a/wallpapers/girl_01.jpg b/wallpapers/girl_01.jpg new file mode 100644 index 0000000..d76f5e1 Binary files /dev/null and b/wallpapers/girl_01.jpg differ diff --git a/wallpapers/girl_02.jpg b/wallpapers/girl_02.jpg new file mode 100644 index 0000000..f00cd55 Binary files /dev/null and b/wallpapers/girl_02.jpg differ diff --git a/wallpapers/girl_03.jpg b/wallpapers/girl_03.jpg new file mode 100644 index 0000000..9f0940c Binary files /dev/null and b/wallpapers/girl_03.jpg differ diff --git a/wallpapers/girl_04.jpg b/wallpapers/girl_04.jpg new file mode 100644 index 0000000..3367724 Binary files /dev/null and b/wallpapers/girl_04.jpg differ diff --git a/wallpapers/girl_05.jpg b/wallpapers/girl_05.jpg new file mode 100644 index 0000000..679c980 Binary files /dev/null and b/wallpapers/girl_05.jpg differ diff --git a/wallpapers/girl_06.jpg b/wallpapers/girl_06.jpg new file mode 100644 index 0000000..308cfb2 Binary files /dev/null and b/wallpapers/girl_06.jpg differ diff --git a/wallpapers/girl_07.jpg b/wallpapers/girl_07.jpg new file mode 100644 index 0000000..6e015a6 Binary files /dev/null and b/wallpapers/girl_07.jpg differ diff --git a/wallpapers/girl_08.jpg b/wallpapers/girl_08.jpg new file mode 100644 index 0000000..cd2f75e Binary files /dev/null and b/wallpapers/girl_08.jpg differ diff --git a/wallpapers/girl_09.jpeg b/wallpapers/girl_09.jpeg new file mode 100644 index 0000000..1ea2a9b Binary files /dev/null and b/wallpapers/girl_09.jpeg differ diff --git a/wallpapers/girl_10.jpg b/wallpapers/girl_10.jpg new file mode 100644 index 0000000..6a0978a Binary files /dev/null and b/wallpapers/girl_10.jpg differ diff --git a/wallpapers/gruvbox/flower-1.jpg b/wallpapers/gruvbox/flower-1.jpg new file mode 100644 index 0000000..2f1e2d5 Binary files /dev/null and b/wallpapers/gruvbox/flower-1.jpg differ diff --git a/wallpapers/gruvbox/greek.png b/wallpapers/gruvbox/greek.png new file mode 100644 index 0000000..f41e730 Binary files /dev/null and b/wallpapers/gruvbox/greek.png differ diff --git a/wallpapers/gruvbox/gruvbox_01 b/wallpapers/gruvbox/gruvbox_01 new file mode 100644 index 0000000..5a449c8 Binary files /dev/null and b/wallpapers/gruvbox/gruvbox_01 differ diff --git a/wallpapers/gruvbox/gruvbox_minimalistic_01 b/wallpapers/gruvbox/gruvbox_minimalistic_01 new file mode 100644 index 0000000..18aa262 Binary files /dev/null and b/wallpapers/gruvbox/gruvbox_minimalistic_01 differ diff --git a/wallpapers/gruvbox/gruvbox_minimalistic_02 b/wallpapers/gruvbox/gruvbox_minimalistic_02 new file mode 100644 index 0000000..207a8c5 Binary files /dev/null and b/wallpapers/gruvbox/gruvbox_minimalistic_02 differ diff --git a/wallpapers/gruvbox/gruvbox_minimalistic_03 b/wallpapers/gruvbox/gruvbox_minimalistic_03 new file mode 100644 index 0000000..cb4f073 Binary files /dev/null and b/wallpapers/gruvbox/gruvbox_minimalistic_03 differ diff --git a/wallpapers/gruvbox/house-garden.png b/wallpapers/gruvbox/house-garden.png new file mode 100644 index 0000000..916fc90 Binary files /dev/null and b/wallpapers/gruvbox/house-garden.png differ diff --git a/wallpapers/gruvbox/houses.png b/wallpapers/gruvbox/houses.png new file mode 100644 index 0000000..63ef2ff Binary files /dev/null and b/wallpapers/gruvbox/houses.png differ diff --git a/wallpapers/gruvbox/kanagawa.jpg b/wallpapers/gruvbox/kanagawa.jpg new file mode 100644 index 0000000..33df907 Binary files /dev/null and b/wallpapers/gruvbox/kanagawa.jpg differ diff --git a/wallpapers/gruvbox/pacman-ghosts.png b/wallpapers/gruvbox/pacman-ghosts.png new file mode 100644 index 0000000..021abeb Binary files /dev/null and b/wallpapers/gruvbox/pacman-ghosts.png differ diff --git a/wallpapers/gruvbox/platform.jpg b/wallpapers/gruvbox/platform.jpg new file mode 100644 index 0000000..7f25bcf Binary files /dev/null and b/wallpapers/gruvbox/platform.jpg differ diff --git a/wallpapers/gruvbox/spaceman.png b/wallpapers/gruvbox/spaceman.png new file mode 100644 index 0000000..1136b38 Binary files /dev/null and b/wallpapers/gruvbox/spaceman.png differ diff --git a/wallpapers/gruvbox/sushi.jpg b/wallpapers/gruvbox/sushi.jpg new file mode 100644 index 0000000..2de6284 Binary files /dev/null and b/wallpapers/gruvbox/sushi.jpg differ diff --git a/wallpapers/gruvbox/wallpapers.zip b/wallpapers/gruvbox/wallpapers.zip new file mode 100644 index 0000000..79ceccc Binary files /dev/null and b/wallpapers/gruvbox/wallpapers.zip differ diff --git a/wallpapers/gruvbox/wave.jpg b/wallpapers/gruvbox/wave.jpg new file mode 100644 index 0000000..3b9d312 Binary files /dev/null and b/wallpapers/gruvbox/wave.jpg differ diff --git a/wallpapers/gruvbox/wolf.jpg b/wallpapers/gruvbox/wolf.jpg new file mode 100644 index 0000000..661d973 Binary files /dev/null and b/wallpapers/gruvbox/wolf.jpg differ diff --git a/wallpapers/jakir.jpg b/wallpapers/jakir.jpg new file mode 100644 index 0000000..3e52ab5 Binary files /dev/null and b/wallpapers/jakir.jpg differ diff --git a/wallpapers/lina.jpg b/wallpapers/lina.jpg new file mode 100644 index 0000000..8087454 Binary files /dev/null and b/wallpapers/lina.jpg differ diff --git a/wallpapers/looking_at_viewer/blue_hair.jpg b/wallpapers/looking_at_viewer/blue_hair.jpg new file mode 100644 index 0000000..98b3701 Binary files /dev/null and b/wallpapers/looking_at_viewer/blue_hair.jpg differ diff --git a/wallpapers/looking_at_viewer/blue_hair_centered.jpg b/wallpapers/looking_at_viewer/blue_hair_centered.jpg new file mode 100644 index 0000000..3b9a131 Binary files /dev/null and b/wallpapers/looking_at_viewer/blue_hair_centered.jpg differ diff --git a/wallpapers/looking_at_viewer/mirana.webp b/wallpapers/looking_at_viewer/mirana.webp new file mode 100644 index 0000000..0bf9661 Binary files /dev/null and b/wallpapers/looking_at_viewer/mirana.webp differ diff --git a/wallpapers/looking_at_viewer/triss.jpg b/wallpapers/looking_at_viewer/triss.jpg new file mode 100644 index 0000000..9da81ae Binary files /dev/null and b/wallpapers/looking_at_viewer/triss.jpg differ diff --git a/wallpapers/luna.jpg b/wallpapers/luna.jpg new file mode 100644 index 0000000..1b25a1b Binary files /dev/null and b/wallpapers/luna.jpg differ diff --git a/wallpapers/marci.jpg b/wallpapers/marci.jpg new file mode 100644 index 0000000..7dc30e3 Binary files /dev/null and b/wallpapers/marci.jpg differ diff --git a/wallpapers/megumin.jpg b/wallpapers/megumin.jpg new file mode 100644 index 0000000..3ec9918 Binary files /dev/null and b/wallpapers/megumin.jpg differ diff --git a/wallpapers/mikasa_01.jpg b/wallpapers/mikasa_01.jpg new file mode 100644 index 0000000..d86d274 Binary files /dev/null and b/wallpapers/mikasa_01.jpg differ diff --git a/wallpapers/nezuko_01.jpg b/wallpapers/nezuko_01.jpg new file mode 100644 index 0000000..13fc649 Binary files /dev/null and b/wallpapers/nezuko_01.jpg differ diff --git a/wallpapers/nezuko_02.jpg b/wallpapers/nezuko_02.jpg new file mode 100644 index 0000000..2abc582 Binary files /dev/null and b/wallpapers/nezuko_02.jpg differ diff --git a/wallpapers/nezuko_03.jpg b/wallpapers/nezuko_03.jpg new file mode 100644 index 0000000..c7024d6 Binary files /dev/null and b/wallpapers/nezuko_03.jpg differ diff --git a/wallpapers/nezuko_04.jpg b/wallpapers/nezuko_04.jpg new file mode 100644 index 0000000..55c4bcd Binary files /dev/null and b/wallpapers/nezuko_04.jpg differ diff --git a/wallpapers/nezuko_05.jpg b/wallpapers/nezuko_05.jpg new file mode 100644 index 0000000..103c669 Binary files /dev/null and b/wallpapers/nezuko_05.jpg differ diff --git a/wallpapers/nezuko_06.jpg b/wallpapers/nezuko_06.jpg new file mode 100644 index 0000000..67b9022 Binary files /dev/null and b/wallpapers/nezuko_06.jpg differ diff --git a/wallpapers/qop.jpg b/wallpapers/qop.jpg new file mode 100644 index 0000000..c38fe34 Binary files /dev/null and b/wallpapers/qop.jpg differ diff --git a/wallpapers/rubick.jpg b/wallpapers/rubick.jpg new file mode 100644 index 0000000..89e2cf3 Binary files /dev/null and b/wallpapers/rubick.jpg differ diff --git a/wallpapers/shinobu_01.jpg b/wallpapers/shinobu_01.jpg new file mode 100644 index 0000000..334bf58 Binary files /dev/null and b/wallpapers/shinobu_01.jpg differ diff --git a/wallpapers/shinobu_02.jpg b/wallpapers/shinobu_02.jpg new file mode 100644 index 0000000..6e4a892 Binary files /dev/null and b/wallpapers/shinobu_02.jpg differ diff --git a/wallpapers/shinobu_02f.jpg b/wallpapers/shinobu_02f.jpg new file mode 100644 index 0000000..84e5ce1 Binary files /dev/null and b/wallpapers/shinobu_02f.jpg differ diff --git a/wallpapers/shinobu_03.jpg b/wallpapers/shinobu_03.jpg new file mode 100644 index 0000000..656d76f Binary files /dev/null and b/wallpapers/shinobu_03.jpg differ diff --git a/wallpapers/shinobu_03.theme b/wallpapers/shinobu_03.theme new file mode 100644 index 0000000..e69de29 diff --git a/wallpapers/shinobu_04.jpg b/wallpapers/shinobu_04.jpg new file mode 100644 index 0000000..5b7fa81 Binary files /dev/null and b/wallpapers/shinobu_04.jpg differ diff --git a/wallpapers/shinobu_05.jpg b/wallpapers/shinobu_05.jpg new file mode 100644 index 0000000..0daf31d Binary files /dev/null and b/wallpapers/shinobu_05.jpg differ diff --git a/wallpapers/shinobu_06.jpg b/wallpapers/shinobu_06.jpg new file mode 100644 index 0000000..8ace329 Binary files /dev/null and b/wallpapers/shinobu_06.jpg differ diff --git a/wallpapers/shinobu_07.jpg b/wallpapers/shinobu_07.jpg new file mode 100644 index 0000000..a154c8d Binary files /dev/null and b/wallpapers/shinobu_07.jpg differ diff --git a/wallpapers/shinobu_08.jpg b/wallpapers/shinobu_08.jpg new file mode 100644 index 0000000..85e088d Binary files /dev/null and b/wallpapers/shinobu_08.jpg differ diff --git a/wallpapers/shinobu_09.jpg b/wallpapers/shinobu_09.jpg new file mode 100644 index 0000000..2bbd4aa Binary files /dev/null and b/wallpapers/shinobu_09.jpg differ diff --git a/wallpapers/shinobu_10.jpg b/wallpapers/shinobu_10.jpg new file mode 100644 index 0000000..10ce3db Binary files /dev/null and b/wallpapers/shinobu_10.jpg differ diff --git a/wallpapers/shinobu_11.jpg b/wallpapers/shinobu_11.jpg new file mode 100644 index 0000000..7a4d58e Binary files /dev/null and b/wallpapers/shinobu_11.jpg differ diff --git a/wallpapers/suzusha_01.jpg b/wallpapers/suzusha_01.jpg new file mode 100644 index 0000000..bc90c44 Binary files /dev/null and b/wallpapers/suzusha_01.jpg differ diff --git a/wallpapers/ta.jpg b/wallpapers/ta.jpg new file mode 100644 index 0000000..9fd8329 Binary files /dev/null and b/wallpapers/ta.jpg differ diff --git a/wallpapers/ta2.jpg b/wallpapers/ta2.jpg new file mode 100644 index 0000000..22018d6 Binary files /dev/null and b/wallpapers/ta2.jpg differ diff --git a/wallpapers/tanjiro.jpg b/wallpapers/tanjiro.jpg new file mode 100644 index 0000000..b8f5bd9 Binary files /dev/null and b/wallpapers/tanjiro.jpg differ diff --git a/wallpapers/tornado_01.jpg b/wallpapers/tornado_01.jpg new file mode 100644 index 0000000..c79a730 Binary files /dev/null and b/wallpapers/tornado_01.jpg differ diff --git a/wallpapers/veng.jpg b/wallpapers/veng.jpg new file mode 100644 index 0000000..041648a Binary files /dev/null and b/wallpapers/veng.jpg differ diff --git a/wallpapers/wind.jpg b/wallpapers/wind.jpg new file mode 100644 index 0000000..29ad368 Binary files /dev/null and b/wallpapers/wind.jpg differ diff --git a/wallpapers/windranger.png b/wallpapers/windranger.png new file mode 100644 index 0000000..73743a3 Binary files /dev/null and b/wallpapers/windranger.png differ diff --git a/wallpapers/z.jpg b/wallpapers/z.jpg new file mode 100644 index 0000000..6f3c6a9 Binary files /dev/null and b/wallpapers/z.jpg differ diff --git a/xmonad/.Xresources b/xmonad/.Xresources new file mode 100644 index 0000000..db71673 --- /dev/null +++ b/xmonad/.Xresources @@ -0,0 +1,9 @@ +Xft.dpi: 192 + +! These might also be useful depending on your monitor and personal preference: +Xft.autohint: 0 +Xft.lcdfilter: lcddefault +Xft.hintstyle: hintfull +Xft.hinting: 1 +Xft.antialias: 1 +Xft.rgba: rgb diff --git a/xmonad/README.md b/xmonad/README.md new file mode 100644 index 0000000..baa43b2 Binary files /dev/null and b/xmonad/README.md differ diff --git a/xmonad/beep.mp3 b/xmonad/beep.mp3 new file mode 100644 index 0000000..bfbd9bb Binary files /dev/null and b/xmonad/beep.mp3 differ diff --git a/xmonad/cyclops_all.mp3 b/xmonad/cyclops_all.mp3 new file mode 100644 index 0000000..7e7da87 Binary files /dev/null and b/xmonad/cyclops_all.mp3 differ diff --git a/xmonad/duck_search.sh b/xmonad/duck_search.sh new file mode 100755 index 0000000..e7e6eb7 --- /dev/null +++ b/xmonad/duck_search.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ -n "${1}" ]; then + echo ${1} >> ~/.cache/duck_history + librewolf "https://duckduckgo.com/?q=${1}" + exit 0 +else + tail /home/light/.cache/duck_history | tac +fi diff --git a/xmonad/envs.sh b/xmonad/envs.sh new file mode 100755 index 0000000..006fab4 --- /dev/null +++ b/xmonad/envs.sh @@ -0,0 +1,2 @@ +export QT_AUTO_SCREEN_SCALE_FACTOR=2 +export QT_ENABLE_HIGHDPI_SCALING=2 diff --git a/xmonad/poweroff.wav b/xmonad/poweroff.wav new file mode 100644 index 0000000..fe23d51 Binary files /dev/null and b/xmonad/poweroff.wav differ diff --git a/xmonad/toggle_picom.sh b/xmonad/toggle_picom.sh new file mode 100755 index 0000000..e1e4c18 --- /dev/null +++ b/xmonad/toggle_picom.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if pgrep -x 'picom'; then + killall 'picom' +else + picom -b +fi + +exit diff --git a/xmonad/toggle_polybar.sh b/xmonad/toggle_polybar.sh new file mode 100755 index 0000000..01d8ad3 --- /dev/null +++ b/xmonad/toggle_polybar.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +if pgrep -x 'polybar'; then + killall 'polybar' +else + if type "xrandr"; then + for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar test_bar --reload & + MONITOR=$m polybar ws_terminal --reload & + MONITOR=$m polybar ws_browser --reload & + MONITOR=$m polybar ws_music --reload & + MONITOR=$m polybar ws_messages --reload & + MONITOR=$m polybar window_title --reload & + done + else + polybar --reload & + fi +fi + +exit diff --git a/xmonad/welcome.wav b/xmonad/welcome.wav new file mode 100644 index 0000000..c3183ff Binary files /dev/null and b/xmonad/welcome.wav differ diff --git a/xmonad/ws_bar.sh b/xmonad/ws_bar.sh new file mode 100755 index 0000000..28ed0b1 --- /dev/null +++ b/xmonad/ws_bar.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +while inotifywait -qqe close_write /tmp/.xmonad-workspace-log; do + echo ' ' +done + diff --git a/xmonad/ws_browser.sh b/xmonad/ws_browser.sh new file mode 100755 index 0000000..13efc72 --- /dev/null +++ b/xmonad/ws_browser.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +BAR_PIDS=() + +ws=$(tail -n 6 /tmp/.xmonad-workspace-log | grep -i '') +echo ${ws} + +for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar ws_browser_border & + BAR_PIDS+=( "$!" ) +done + +if [[ "$ws" == *"F#CC241D"* ]]; then + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd show >> ~/debug + done +else + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd hide >> ~/debug + done +fi + +while inotifywait -qqe close_write /tmp/.xmonad-workspace-log; do + ws=$(tail -n 6 /tmp/.xmonad-workspace-log | grep -i '') + echo ${ws} + + if [[ "$ws" == *"F#CC241D"* ]]; then + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd show >> ~/debug + done + else + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd hide >> ~/debug + done + fi +done + diff --git a/xmonad/ws_messages.sh b/xmonad/ws_messages.sh new file mode 100755 index 0000000..dbe62f1 --- /dev/null +++ b/xmonad/ws_messages.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +BAR_PIDS=() + +ws=$(tail -n 6 /tmp/.xmonad-workspace-log | grep '') +echo ${ws} + +for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar ws_messages_border & + BAR_PIDS+=( "$!" ) +done + +if [[ "$ws" == *"F#CC241D"* ]]; then + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd show >> ~/debug + done +else + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd hide >> ~/debug + done +fi + +while inotifywait -qqe close_write /tmp/.xmonad-workspace-log; do + ws=$(tail -n 6 /tmp/.xmonad-workspace-log | grep '') + echo ${ws} + + if [[ "$ws" == *"F#CC241D"* ]]; then + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd show >> ~/debug + done + else + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd hide >> ~/debug + done + fi +done + + diff --git a/xmonad/ws_music.sh b/xmonad/ws_music.sh new file mode 100755 index 0000000..c1da895 --- /dev/null +++ b/xmonad/ws_music.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +BAR_PIDS=() + +ws=$(tail -n 6 /tmp/.xmonad-workspace-log | grep '') +echo ${ws} + +for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar ws_messages_border & + BAR_PIDS+=( "$!" ) +done + +if [[ "$ws" == *"F#CC241D"* ]]; then + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd show >> ~/debug + done +else + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd hide >> ~/debug + done +fi + +while inotifywait -qqe close_write /tmp/.xmonad-workspace-log; do + ws=$(tail -n 6 /tmp/.xmonad-workspace-log | grep '') + echo ${ws} + + if [[ "$ws" == *"F#CC241D"* ]]; then + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd show >> ~/debug + done + else + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd hide >> ~/debug + done + fi +done + diff --git a/xmonad/ws_terminal.sh b/xmonad/ws_terminal.sh new file mode 100755 index 0000000..d1b8b4e --- /dev/null +++ b/xmonad/ws_terminal.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +BAR_PIDS=() + +ws=$(tail -n 6 /tmp/.xmonad-workspace-log | grep -i '' | head -n 1) +echo ${ws} + +for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar ws_terminal_border & + BAR_PIDS+=( "$!" ) +done + +if [[ "$ws" == *"F#CC241D"* ]]; then + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd show >> ~/debug + done +else + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd hide >> ~/debug + done +fi + +while inotifywait -qqe close_write /tmp/.xmonad-workspace-log; do + ws=$(tail -n 6 /tmp/.xmonad-workspace-log | grep -i '' | head -n 1) + echo ${ws} + + if [[ "$ws" == *"F#CC241D"* ]]; then + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd show >> ~/debug + done + else + for PID in "${BAR_PIDS[@]}"; do + polybar-msg -p $PID cmd hide >> ~/debug + done + fi +done + + diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs new file mode 100644 index 0000000..cfc5b9f --- /dev/null +++ b/xmonad/xmonad.hs @@ -0,0 +1,101 @@ +import XMonad + +import XMonad.Actions.SpawnOn +import XMonad.Actions.CycleWS +import XMonad.Actions.WorkspaceNames + +import XMonad.Hooks.WorkspaceHistory +import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP + +import XMonad.Layout.ThreeColumns +import XMonad.Layout.Gaps +import XMonad.Layout.Spacing + +import XMonad.Util.NamedWindows (getName) +import XMonad.Util.SpawnOnce +import XMonad.Util.EZConfig +import qualified XMonad.StackSet as W + +import Control.Monad (forM_, join) + +import Data.List (sortBy) +import Data.Function (on) + +my_startup_hook :: X() + +my_startup_hook = do + spawnOnce "source /home/light/.config/xmonad/envs.sh" + spawnOnce "xrdb -merge /home/light/.config/xmonad/.Xresources" + spawnOnce "feh --bg-fill --randomize ~/wallpapers/" + spawnOnce "sudo wpa_supplicant -B -i wlp0s20f3 -c /home/light/.config/wpa_configs/home_wifi" + spawnOnce "/home/light/.config/xmonad/toggle_picom.sh" + spawnOnce "/home/light/.config/xmonad/toggle_polybar.sh" + spawnOnce "setxkbmap -model pc104 -layout us,ir -variant , -option grp:rctrl_rshift_toggle" + spawnOnce "mpv --no-video --no-terminal ~/.config/xmonad/welcome.wav" + +main :: IO () +main = xmonad $ ewmh $ xmobarProp $ my_conf + +my_conf + = def + { + + layoutHook = spacingWithEdge 16 $ my_layout + , startupHook = my_startup_hook + , manageHook = manageDocks <+> manageSpawn <+> manageHook def + , logHook = workspaceHistoryHook <+> polybar_hook + , focusedBorderColor = "#fe8019" + , normalBorderColor = "#928374" + , workspaces = ["1\59285", "2\62057", "3\57879", "4\61441", "5\59285", "6\59138"] + } + `additionalKeysP` + [ ("M-", toggleWS) + + , ("M-k", spawn "kitty") + + , ("M-`", spawn "rofi -show run -m 2") + , ("M-c", spawn "rofi -show calc -modi calc -no-show-match -no-sort") + + , ("M-s", spawn "flameshot gui") + , ("M-w", spawn "feh --bg-fill --randomize ~/pictures/wallpapers/") + , ("M-p", spawn "~/.config/xmonad/toggle_picom.sh &> /dev/null &") + , ("M-d", spawn "~/.config/xmonad/toggle_polybar.sh &> /dev/null &") + , ("M-\\", spawn "rofi -show Search -modes 'Search:/home/light/.config/xmonad/duck_search.sh'") + , ("M-|", spawn "killall matching_engine -9 ; killall risk_engine_cpp -9") + + , ("", spawn "amixer -q -D pulse sset Master toggle") + , ("", spawn "amixer -q -D pulse sset Master on ; amixer -q -D pulse sset Master 2%-") + , ("", spawn "amixer -q -D pulse sset Master on ; amixer -q -D pulse sset Master 2%+") + , ("", spawn "echo 'playlist-next weak' | socat - '/tmp/mpvsocket'") + , ("", spawn "echo 'playlist-prev weak' | socat - '/tmp/mpvsocket'") + , ("", spawn "echo 'cycle pause' | socat - '/tmp/mpvsocket'") + , ("", spawn "lux -a 10%") + , ("", spawn "lux -s 10%")] + +my_layout = tiled ||| Mirror tiled ||| Full ||| threeCol + where + threeCol = ThreeColMid nmaster delta ratio + tiled = Tall nmaster delta ratio + nmaster = 1 -- Default number of windows in the master pane + ratio = 1/2 -- Default propoetion of screen occupied by master pane + delta = 3/100 -- Percent of screen to increment when resizing panes + + +polybar_hook = do + winset <- gets windowset + title <- maybe (return "") (fmap show . getName) . W.peek $ winset + let currWs = W.currentTag winset + let wss = map W.tag $ W.workspaces winset + + io $ appendFile "/tmp/.xmonad-title-log" (title ++ "\n") + io $ appendFile "/tmp/.xmonad-workspace-log" ( wsStr currWs wss) + + where + fmt currWs ws + | currWs == ws = "%{F#CC241D}" ++ drop 1 ws ++ "\n" + | otherwise = "%{F#FBF1C7}" ++ drop 1 ws ++ "\n" + wsStr currWs wss = join $ map (fmt currWs) $ sortBy (compare `on` (!! 0)) wss diff --git a/zshrc.sh b/zshrc.sh new file mode 100644 index 0000000..9ae7e58 --- /dev/null +++ b/zshrc.sh @@ -0,0 +1,48 @@ +setxkbmap -option caps:escape +################################################################ +## ZSH CONFIGURATIONS +HISTFILE=~/.zshhist # Save history file +HISTSIZE=2048 # Save history zsh max lines +SAVEHIST=4096 # Save history file max lines +setopt autocd # Automatically change directory if only a path was provided +unsetopt beep notify # No bells! +bindkey -v # Use VI Keybindings +PROMPT="%F{green}%n@%m%f %~ $ " # The prompt + +################################################################ +## EXPORTS +export PATH="${PATH}:/home/light/.local/bin:/home/light/scripts/:/opt/cuda/bin:/home/light/dev/meshoptimizer" +export LC_ALL="C" +export CC="/usr/bin/clang" +export CXX="/usr/bin/clang++" +export CPM_SOURCE_CACHE="${HOME}/.cache/CPM" +export GTEST_COLOR="yes" +export GPG_TTY=$(tty) + +################################################################ +## ALIASES +alias v='nvim' +alias wifi='sudo wpa_supplicant -B -i wlp0s20f3 -c /home/light/.config/wpa_configs/home_wifi' +alias icat='kitty +kitten icat' +alias cat='bat' +alias zsrc='source ~/.zshrc' +alias clip="xclip -selection c" +alias val='valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt' +alias q='exit' +alias pirate='aria2c --seed-time=0 --split=8' +alias ryali='ssh root@5.75.207.117' +alias l='\eza --icons --sort type -TL1' +alias la='\eza --icons --sort type -T1' # all +alias ~="c ~" +alias ..='c ../' +alias ...='c ../../' +alias ....='c ../../../' +alias .....='c ../../../../' +alias ......='c ../../../../../' +alias gs='cgs' + +c () { cd ${1:-.} ; clear ; l } +ca () { cd ${1:-.} ; clear ; la } +cn () { cd ${1:-.} ; clear ; neofetch } +cgs() { cd ${1:-.} ; clear ; git status } +picomadd() { sed -i '/# OPACITY_RULE/i ,"100:name *= '\'$1\''"' ~/.config/picom/picom.conf }