From b423014b0e51a8324e7ff0fb925d7e7c4000cd45 Mon Sep 17 00:00:00 2001 From: yuzu-eva Date: Mon, 30 Oct 2023 14:11:13 +0100 Subject: update for new system --- .config/neofetch/config.conf | 30 ++++++++--------- .config/nvim/init.lua | 1 + .config/nvim/lua/user/keymaps.lua | 8 +++++ .config/nvim/lua/user/options.lua | 49 +++++++++++++-------------- .config/nvim/lua/user/plugins.lua | 1 - .config/nvim/lua/user/plugins/lspconfig.lua | 51 +++++++++++------------------ .config/nvim/plugin/packer_compiled.lua | 41 ++++++++++------------- .config/shell/aliasrc | 31 ++++++++++++------ .config/x11/xinitrc | 16 ++++----- 9 files changed, 116 insertions(+), 112 deletions(-) (limited to '.config') diff --git a/.config/neofetch/config.conf b/.config/neofetch/config.conf index a3c25ce..342ef76 100644 --- a/.config/neofetch/config.conf +++ b/.config/neofetch/config.conf @@ -4,19 +4,19 @@ print_info() { info title # prin "\n \n " "$(curl wttr.in/?0?q?T | awk '/°(C|F)/ {printf $(NF-1) $(NF) " ("a")"} /,/ {a=$0}')" prin "${cl9}┌────────────────────────────────────────────────────┐" - info "\n \n  " distro - info "\n \n  " model - info "\n \n  " kernel - info "\n \n  " uptime - info "\n \n  " packages - info "\n \n  " shell - info "\n \n  " resolution - info "\n \n  " wm - info "\n \n  " term - info "\n \n  " cpu - info "\n \n  " gpu - info "\n \n  " memory - info "\n \n  " disk + info "\n \n OS" distro + info "\n \n Host" model + info "\n \n Kernel" kernel + info "\n \n Uptime" uptime + info "\n \n Packages" packages + info "\n \n Shell" shell + info "\n \n Screens" resolution + info "\n \n WM" wm + info "\n \n Terminal" term + info "\n \n CPU" cpu + info "\n \n GPU" gpu + info "\n \n Memory" memory + info "\n \n " disk prin "${cl9}└─────────────────────────────────── $(color 1) $(color 2) $(color 3) $(color 4) $(color 5) $(color 6) $(color 7) $(color 8) ${cl9}┘" prin "\n" } @@ -388,7 +388,7 @@ disk_show=('/' '/home' '/dev/sda1' '/dev/sdb1') # none: 'Disk: 74G / 118G (66%)' # 'Disk: 74G / 118G (66%)' # 'Disk: 74G / 118G (66%)' -disk_subtitle="none" +disk_subtitle="dir" # Disk percent. # Show/Hide disk percent. @@ -537,7 +537,7 @@ underline_char="-" # Example: # separator="->": 'Shell-> bash' # separator=" =": 'WM = dwm' -separator=" " +separator=":" # Color Blocks diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index f71bdb7..49556fb 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -10,5 +10,6 @@ require('user.options') require('user.plugins') require('user.keymaps') require('user.misc') +-- require('user.dvorak') --vim: nospell diff --git a/.config/nvim/lua/user/keymaps.lua b/.config/nvim/lua/user/keymaps.lua index b174f65..777d099 100644 --- a/.config/nvim/lua/user/keymaps.lua +++ b/.config/nvim/lua/user/keymaps.lua @@ -2,6 +2,7 @@ local keymap = require 'lib.utils'.keymap vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' +vim.g.tmux_navigator_no_mappings=1 keymap('n', 'Q', ':bufdo bdelete') @@ -23,3 +24,10 @@ keymap('i', 'jj', '') keymap('n', 'cd', ':cd %:p:h:pwd') keymap('n', 'E', ':EslintFixAll') + +-- Change tmux-navigator keybinds +keymap('n', '', ':TmuxNavigateLeft') +keymap('n', '', ':TmuxNavigateDown') +keymap('n', '', ':TmuxNavigateUp') +keymap('n', '', ':TmuxNavigateRight') +keymap('n', '', ':TmuxNavigatePrevious') diff --git a/.config/nvim/lua/user/options.lua b/.config/nvim/lua/user/options.lua index 53fbe43..510485f 100644 --- a/.config/nvim/lua/user/options.lua +++ b/.config/nvim/lua/user/options.lua @@ -1,24 +1,25 @@ -vim.o.guicursor = 'a:block' -vim.o.expandtab = true -vim.o.shiftwidth = 4 -vim.o.tabstop = 4 -vim.o.signcolumn = 'yes:2' -vim.o.relativenumber = true -vim.o.number = true -vim.o.termguicolors = true -vim.o.ignorecase = true -vim.o.smartcase = true -vim.o.wildmode = 'longest:full,full' -vim.o.wrap = false -vim.o.scrolloff = 8 -vim.o.sidescrolloff = 8 -vim.o.cursorline = 1 -vim.o.splitright = 1 -vim.o.splitbelow = 1 -vim.o.clipboard = 'unnamedplus' -- Use Linux system clipboard -vim.o.updatetime = 250 -- Decrease CursorHold delay -vim.o.redrawtime = 10000 -- Allow more time for loading syntax -vim.o.foldmethod = "expr" -vim.o.foldlevelstart = 10 -vim.o.foldexpr = "nvim_treesitter#foldexpr()" -vim.o.hlsearch = 0 +vim.o.guicursor='a:block' +vim.o.expandtab=true +vim.o.shiftwidth=4 +vim.o.softtabstop=4 +vim.o.tabstop=4 +vim.o.signcolumn='yes:2' +vim.o.relativenumber=true +vim.o.number=true +vim.o.termguicolors=true +vim.o.ignorecase=true +vim.o.smartcase=true +vim.o.wildmode='longest:full,full' +vim.o.wrap=false +vim.o.scrolloff=8 +vim.o.sidescrolloff=8 +vim.o.cursorline=true +vim.o.splitright=true +vim.o.splitbelow=true +vim.o.clipboard='unnamedplus' +vim.o.updatetime=250 +vim.o.redrawtime=10000 +vim.o.foldmethod="expr" +vim.o.foldlevelstart=10 +vim.o.foldexpr="nvim_treesitter#foldexpr()" +vim.o.hlsearch=false diff --git a/.config/nvim/lua/user/plugins.lua b/.config/nvim/lua/user/plugins.lua index 07f8f42..ae21e4f 100644 --- a/.config/nvim/lua/user/plugins.lua +++ b/.config/nvim/lua/user/plugins.lua @@ -3,7 +3,6 @@ require('packer').startup(function() use { 'tpope/vim-commentary' } use { 'tpope/vim-surround' } use { 'tpope/vim-eunuch' } - use { 'tpope/vim-sleuth' } use { 'christoomey/vim-tmux-navigator' } use { diff --git a/.config/nvim/lua/user/plugins/lspconfig.lua b/.config/nvim/lua/user/plugins/lspconfig.lua index 39f27c3..67d82a7 100644 --- a/.config/nvim/lua/user/plugins/lspconfig.lua +++ b/.config/nvim/lua/user/plugins/lspconfig.lua @@ -59,38 +59,27 @@ require 'lspconfig'.emmet_ls.setup { filetypes = { 'html', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact', 'eruby' } } -local runtime_path = vim.split(package.path, ';') -table.insert(runtime_path, "lua/?.lua") -table.insert(runtime_path, "lua/?/init.lua") -require 'lspconfig'.lua_ls.setup { - on_attach = on_attach, - capabilities = capabilities, - flags = { - debounce_text_changes = 150, - }, - cmd = { "/home/cafebabe/.local/share/lua-language-server/bin/lua-language-server", "-E", "/home/cafebabe/.local/share/lua-language-server/bin/main.lua" }; - settings = { - Lua = { - runtime = { - -- Tell language server which version of lua is used. - version = 'LuaJIT', - -- Setup lua path - path = runtime_path, - }, - diagnostics = { - -- Recognize globals - globals = { 'vim', 'use', 'parse' }, - }, - workspace = { - -- Make server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - -- Do not send telemetry data - telemetry = { - enable = false, - }, +require'lspconfig'.lua_ls.setup { + on_init = function(client) + local path = client.workspace_folders[1].name + if not vim.loop.fs_stat(path..'/.luarc.json') and not vim.loop.fs_stat(path..'/.luarc.jsonc') then + client.config.settings = 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 = { + library = { vim.env.VIMRUNTIME } + -- or pull in all of 'runtimepath'. NOTE: this is a lot slower + -- library = vim.api.nvim_get_runtime_file("", true) + } + }) + + client.notify("workspace/didChangeConfiguration", { settings = client.config.settings }) + end + return true + end } require 'lspconfig'.bashls.setup { diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua index d97b824..a009beb 100644 --- a/.config/nvim/plugin/packer_compiled.lua +++ b/.config/nvim/plugin/packer_compiled.lua @@ -49,8 +49,8 @@ local function save_profiles(threshold) end time([[Luarocks path setup]], true) -local package_path_str = "/home/cafebabe/.cache/nvim/packer_hererocks/2.1.1692616192/share/lua/5.1/?.lua;/home/cafebabe/.cache/nvim/packer_hererocks/2.1.1692616192/share/lua/5.1/?/init.lua;/home/cafebabe/.cache/nvim/packer_hererocks/2.1.1692616192/lib/luarocks/rocks-5.1/?.lua;/home/cafebabe/.cache/nvim/packer_hererocks/2.1.1692616192/lib/luarocks/rocks-5.1/?/init.lua" -local install_cpath_pattern = "/home/cafebabe/.cache/nvim/packer_hererocks/2.1.1692616192/lib/lua/5.1/?.so" +local package_path_str = "/home/cafebabe/.cache/nvim/packer_hererocks/2.1.1697887905/share/lua/5.1/?.lua;/home/cafebabe/.cache/nvim/packer_hererocks/2.1.1697887905/share/lua/5.1/?/init.lua;/home/cafebabe/.cache/nvim/packer_hererocks/2.1.1697887905/lib/luarocks/rocks-5.1/?.lua;/home/cafebabe/.cache/nvim/packer_hererocks/2.1.1697887905/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/cafebabe/.cache/nvim/packer_hererocks/2.1.1697887905/lib/lua/5.1/?.so" if not string.find(package.path, package_path_str, 1, true) then package.path = package.path .. ';' .. package_path_str end @@ -229,11 +229,6 @@ _G.packer_plugins = { path = "/home/cafebabe/.local/share/nvim/site/pack/packer/start/vim-eunuch", url = "https://github.com/tpope/vim-eunuch" }, - ["vim-sleuth"] = { - loaded = true, - path = "/home/cafebabe/.local/share/nvim/site/pack/packer/start/vim-sleuth", - url = "https://github.com/tpope/vim-sleuth" - }, ["vim-surround"] = { loaded = true, path = "/home/cafebabe/.local/share/nvim/site/pack/packer/start/vim-surround", @@ -247,14 +242,18 @@ _G.packer_plugins = { } time([[Defining packer_plugins]], false) --- Config for: nvim-ts-autotag -time([[Config for nvim-ts-autotag]], true) -try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20nvim-ts-autotag\frequire\0", "config", "nvim-ts-autotag") -time([[Config for nvim-ts-autotag]], false) +-- Config for: nvim-autopairs +time([[Config for nvim-autopairs]], true) +try_loadstring("\27LJ\2\n<\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs") +time([[Config for nvim-autopairs]], false) -- Config for: nvim-lspconfig time([[Config for nvim-lspconfig]], true) try_loadstring("\27LJ\2\n6\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\27user.plugins.lspconfig\frequire\0", "config", "nvim-lspconfig") time([[Config for nvim-lspconfig]], false) +-- Config for: nvim-ts-autotag +time([[Config for nvim-ts-autotag]], true) +try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20nvim-ts-autotag\frequire\0", "config", "nvim-ts-autotag") +time([[Config for nvim-ts-autotag]], false) -- Config for: lualine.nvim time([[Config for lualine.nvim]], true) try_loadstring("\27LJ\2\n4\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\25user.plugins.lualine\frequire\0", "config", "lualine.nvim") @@ -263,26 +262,22 @@ time([[Config for lualine.nvim]], false) time([[Config for nvim-tree.lua]], true) try_loadstring("\27LJ\2\n6\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\27user.plugins.nvim-tree\frequire\0", "config", "nvim-tree.lua") time([[Config for nvim-tree.lua]], false) --- Config for: nvim-treesitter -time([[Config for nvim-treesitter]], true) -try_loadstring("\27LJ\2\n]\0\0\3\0\4\0\t6\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\0016\0\0\0'\2\3\0B\0\2\1K\0\1\0\28user.plugins.treesitter\nsetup\16spellsitter\frequire\0", "config", "nvim-treesitter") -time([[Config for nvim-treesitter]], false) --- Config for: nvim-cmp -time([[Config for nvim-cmp]], true) -try_loadstring("\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21user.plugins.cmp\frequire\0", "config", "nvim-cmp") -time([[Config for nvim-cmp]], false) -- Config for: LuaSnip time([[Config for LuaSnip]], true) try_loadstring("\27LJ\2\n4\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\25user.plugins.luasnip\frequire\0", "config", "LuaSnip") time([[Config for LuaSnip]], false) --- Config for: nvim-autopairs -time([[Config for nvim-autopairs]], true) -try_loadstring("\27LJ\2\n<\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs") -time([[Config for nvim-autopairs]], false) +-- Config for: nvim-treesitter +time([[Config for nvim-treesitter]], true) +try_loadstring("\27LJ\2\n]\0\0\3\0\4\0\t6\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\0016\0\0\0'\2\3\0B\0\2\1K\0\1\0\28user.plugins.treesitter\nsetup\16spellsitter\frequire\0", "config", "nvim-treesitter") +time([[Config for nvim-treesitter]], false) -- Config for: telescope.nvim time([[Config for telescope.nvim]], true) try_loadstring("\27LJ\2\n6\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\27user.plugins.telescope\frequire\0", "config", "telescope.nvim") time([[Config for telescope.nvim]], false) +-- Config for: nvim-cmp +time([[Config for nvim-cmp]], true) +try_loadstring("\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21user.plugins.cmp\frequire\0", "config", "nvim-cmp") +time([[Config for nvim-cmp]], false) -- Config for: dracula time([[Config for dracula]], true) try_loadstring("\27LJ\2\n4\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\25user.plugins.dracula\frequire\0", "config", "dracula") diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index abf8ebb..4358402 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -4,25 +4,24 @@ alias reboot='sudo reboot' alias poweroff='sudo poweroff' alias refresh='. $ZDOTDIR/.zshrc' +alias zzz='sudo zzz' alias fuck='sudo $(fc -Lln -1)' alias open='xdg-open' -alias mutt='pushd ~/.mutt/attachments; mutt; popd' +alias mutt='cd ~/.mutt/attachments; mutt; cd -' alias jpwine='LANG=ja_JP.UTF-8 WINEDEBUG=-all wine' -alias emacsd='/usr/bin/emacs --daemon &' +alias emacsd='/usr/local/bin/emacs --daemon &' +alias em='emacsclient -c -a "emacs"' alias vi='$EDITOR' alias z='zathura' alias nnn='nnn -Hde' alias cn='clear;neofetch' alias ea='vi ~/.config/shell/aliasrc' alias ez='vi ~/.config/zsh/.zshrc' -alias eq='equery' alias sr='su - root' alias cam='mpv --profile=low-latency --untimed /dev/video0' alias df='df -h' alias tma='tmux a -t' - -# need to sign hid-nintendo.ko with every kernel update -alias signmod='sudo /usr/src/linux/scripts/sign-file sha512 /usr/src/linux/certs/signing_key.pem /usr/src/linux/certs/signing_key.x509' +alias tmn='tmux new-session -s' # rename files in pwd in their current order to 4-digit numbers alias ofn='/bin/ls | cat -n | while read n f; do perl-rename "s/${f%.*}/$(printf "%04d" "$n")/" "$f"; done' @@ -32,6 +31,7 @@ alias ofn='/bin/ls | cat -n | while read n f; do perl-rename "s/${f%.*}/$(printf # set my preferred keyboard options alias setkeys='xset r rate 250 30 && setxkbmap -layout us,us -variant dvorak, -option "ctrl:nocaps,lv3:rwin_switch,grp:alt_space_toggle"' +alias setus='setxkbmap -layout us,us -option "ctrl:nocaps"' # pad numbers in filenames with zeros alias padz='perl-rename "s/\d+/sprintf(\"%02d\",$&)/e"' @@ -81,9 +81,9 @@ alias rmdr='xrandr --auto --output HDMI-A-0 --mode 1920x1080 --primary' alias lmlr='xrandr --auto --output DisplayPort-2 --mode 640x480 --left-of HDMI-A-0' alias lmmr='xrandr --auto --output DisplayPort-2 --mode 800x600 --left-of HDMI-A-0' alias lmdr='xrandr --auto --output DisplayPort-2 --mode 1600x900 --left-of HDMI-A-0' -alias mbl='sudo ddcutil --display 1 setvcp 10 0 && doas ddcutil --display 2 setvcp 10 0' -alias mbm='sudo ddcutil --display 1 setvcp 10 50 && doas ddcutil --display 2 setvcp 10 50' -alias mbh='sudo ddcutil --display 1 setvcp 10 80 && doas ddcutil --display 2 setvcp 10 80' +alias mbl='sudo ddcutil --display 1 setvcp 10 0 && sudo ddcutil --display 2 setvcp 10 0' +alias mbm='sudo ddcutil --display 1 setvcp 10 50 && sudo ddcutil --display 2 setvcp 10 50' +alias mbh='sudo ddcutil --display 1 setvcp 10 80 && sudo ddcutil --display 2 setvcp 10 80' # function for timer and stopwatch timer() { @@ -125,7 +125,7 @@ date-reverse() { # convert video files to webm mkwebm() { - ffmpeg -i "${1}" -c:v libvpx-vp9 -crf 1 -b:v 1M -c:a libvorbis "${1%.*}".webm + ffmpeg -i "${1}" -c:v libvpx-vp9 -crf 32 -b:v 300K -c:a libvorbis "${1%.*}".webm } ## GIT @@ -143,3 +143,14 @@ alias push='git push origin' alias dfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME' alias dcomm='dfiles commit -m' alias dpush='dfiles push origin' + +# package manager +alias pacin='sudo pacman -S' +alias pacrm='sudo pacman -Rns' +alias pacup='sudo pacman -Syu' +alias pacsr='pacman -Ss' +alias pacbr='pacman -Slq | fzf --preview "pacman -Si {}" --layout=reverse' +alias yayin='yay -S' +alias yayrm='yay -Rns' +alias yayup='yay -Syu' +alias yaysr='yay -Ss' diff --git a/.config/x11/xinitrc b/.config/x11/xinitrc index 5150125..b879037 100644 --- a/.config/x11/xinitrc +++ b/.config/x11/xinitrc @@ -4,23 +4,23 @@ # eval $(dbus-launch --sh-syntax --exit-with-session) # fi -eval "$(gpg-agent --daemon --allow-preset-passphrase)" +# eval "$(gpg-agent --daemon --allow-preset-passphrase)" eval "$(ssh-agent)" +xrandr --auto --output HDMI-A-0 --mode 1920x1080 --primary +xrandr --auto --output DisplayPort-2 --mode 1600x900 --left-of HDMI-A-0 + xset r rate 200 20 xset s off -dpms setxkbmap -layout us,us -variant dvorak, -option "ctrl:nocaps,lv3:rwin_switch,grp:alt_space_toggle" - -xrandr --auto --output HDMI-A-0 --mode 1920x1080 --primary -xrandr --auto --output DisplayPort-2 --mode 1600x900 --left-of HDMI-A-0 +xrdb -merge ~/.Xresources ~/.local/bin/set-wallpaper & # /usr/bin/emacs --daemon & +urxvtd -q -o -f & pipewire & -otd-daemon & -mpd & picom & -statusbar & +mpd & -exec dwm +exec i3 -- cgit v1.2.3