From 6254abbb347309dcb96fc19f0df4698d3dc970d7 Mon Sep 17 00:00:00 2001 From: Adam Cooper Date: Sun, 8 Dec 2024 17:47:54 -0500 Subject: [PATCH] Lots of changes, some consequential --- awesome/autorun.sh | 16 +++-- awesome/rc.lua | 17 +++++- bin/autoreply/autoreply.sh | 15 +++-- bin/start-tuis.sh | 10 ++- bin/{zoom-scaled.sh => zoom-smaller.sh} | 0 mail/aerc/aerc.conf | 25 +++++++- neovim/init-dap.lua | 6 +- neovim/init.lua | 81 +++++++++++++++---------- newsboat/.newsboat/history.search | 6 ++ vim/.vimrc | 3 +- 10 files changed, 128 insertions(+), 51 deletions(-) rename bin/{zoom-scaled.sh => zoom-smaller.sh} (100%) diff --git a/awesome/autorun.sh b/awesome/autorun.sh index 2f9af70..c31e9be 100755 --- a/awesome/autorun.sh +++ b/awesome/autorun.sh @@ -7,15 +7,23 @@ run() { fi } -/usr/sbin/alacritty --socket "$XDG_RUNTIME_DIR/alacritty-main.sock" --title awesome-startup & -/usr/sbin/alacritty --title bottom --option font.size=6.5 --command btm --battery & +# /usr/sbin/alacritty --socket "$XDG_RUNTIME_DIR/alacritty-main.sock" --title awesome-startup & +# /usr/sbin/alacritty --title bottom --option font.size=6.5 --command btm --battery & +# /usr/sbin/alacritty --title btop --command btop & +/usr/sbin/wezterm start & run "cbatticon" run "blueman-applet" run "nm-applet" run "nextcloud --background" run "pasystray" +run "mullvad-vpn" run "xscreensaver -no-splash" -run "sleep 4" -run "wmctrl -r bottom -t 8" run "keepassxc" +# run "sleep 4" +/usr/sbin/sleep 4 + +# This seems to broken specifically for wezterm & btop at startup +/usr/sbin/wezterm cli spawn --new-window -- /usr/sbin/btop +/usr/sbin/sleep 2 +/usr/sbin/wmctrl -r btop -t 8 diff --git a/awesome/rc.lua b/awesome/rc.lua index b5c4412..aef4902 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -51,7 +51,8 @@ end beautiful.init(gears.filesystem.get_configuration_dir() .. "mytheme.lua") -- This is used later as the default terminal and editor to run. --- terminal = "alacritty" +-- local terminal = "wezterm" +--[[ terminal = function() local is_running = os.execute("pgrep alacritty") if is_running == nil then @@ -60,8 +61,18 @@ terminal = function() return "/usr/sbin/alacritty msg --socket /run/user/1000/alacritty-main.sock create-window" end end -editor = os.getenv("EDITOR") or "nano" -editor_cmd = terminal() .. " -e " .. editor +]]-- +local terminal = function() + local is_running = os.execute("pgrep wezterm") + if is_running == nil then + return "/usr/sbin/wezterm start" + else + return "/usr/sbin/wezterm cli spawn --new-window" + end +end +local editor = os.getenv("EDITOR") or "nano" +local editor_cmd = terminal() .. " -- " .. editor +-- local editor_cmd = terminal .. " -e " .. editor -- Default modkey. -- Usually, Mod4 is the key with a logo between Control and Alt. diff --git a/bin/autoreply/autoreply.sh b/bin/autoreply/autoreply.sh index 029721f..ebd20bb 100755 --- a/bin/autoreply/autoreply.sh +++ b/bin/autoreply/autoreply.sh @@ -41,7 +41,7 @@ while IFS= read -r -d '' thread ; do # Parse out the reply headers and original message body temporary_reply=$(mktemp /tmp/notmuch-reply-XXXXX) echo "[debug] Temporary reply: $temporary_reply" - notmuch reply --format=json thread:$thread_id > $temporary_reply + notmuch reply --reply-to=sender --format=json thread:$thread_id > $temporary_reply subject="$(jq -r '."reply-headers".Subject' $temporary_reply)" sender="$(jq -r '."reply-headers".From' $temporary_reply)" recipient="$(jq -r '."reply-headers".To' $temporary_reply)" @@ -49,15 +49,20 @@ while IFS= read -r -d '' thread ; do references="$(jq -r '."reply-headers".References' $temporary_reply)" orig_sender="$(jq -r '.original.headers.From' $temporary_reply)" date="$(jq -r '.original.headers.Date' $temporary_reply)" - orig_body="$(jq -r '.original.body[0].content[] | select(."content-type" == "text/plain") | .content' $temporary_reply)" + + # We have to check for multipart messages. + orig_body="$(jq -r '.original.body[] | select( ."content-type" == "text/plain" ) | .content' $temporary_reply)" + if [[ -z $orig_body ]] ; then + orig_body="$(jq -r '.original.body[] | select( ."content-type" == "multipart/alternative" ) | .content[] | select( ."content-type" == "text/plain" ) | .content' $temporary_reply)" + fi # Copy canned message to temporary file - printf "From: %s\nSubject: %s\nTo: %s\nDate: $(date +'%a, %d %b %Y %R %z')\nIn-Reply-To: %s\nReferences: %s\n\n" "$sender" "$subject" "$recipient" "$in_reply_to" "$references" >> "$temporary_file" + printf "From: %s\nSubject: %s\nTo: %s\nCc: amcooper@gmail.com\nDate: $(date +'%a, %d %b %Y %R %z')\nIn-Reply-To: %s\nReferences: %s\n\n" "$sender" "$subject" "$recipient" "$in_reply_to" "$references" >> "$temporary_file" cat /home/adam/dotfiles/bin/autoreply/misdirected_email_autoreply.txt >> "$temporary_file" printf "\n\nOn %s, %s wrote:\n" "$date" "$orig_sender" >> "$temporary_file" - # Append email body to temporary file - printf "%s\n" "$orig_body" >> "$temporary_file" + # Append email body to temporary file (with prefixed quote marker `> `) + echo "$orig_body" | sed 's/^/\> /g' >> "$temporary_file" # Send the email! printf "[debug] Outgoing mail:\n%s\n" "$(cat $temporary_file)" diff --git a/bin/start-tuis.sh b/bin/start-tuis.sh index 59fb8e2..f837a9d 100755 --- a/bin/start-tuis.sh +++ b/bin/start-tuis.sh @@ -4,6 +4,10 @@ # # Convenience script to start up my usual TUIs -alacritty msg create-window --title joplin --command /home/adam/.config/nvm/versions/node/v20.11.1/bin/joplin -alacritty msg create-window --title newsboat --command newsboat -alacritty msg create-window --title aerc --command aerc +# alacritty msg create-window --title joplin --command /home/adam/.config/nvm/versions/node/v20.11.1/bin/joplin +# alacritty msg create-window --title newsboat --command newsboat +# alacritty msg create-window --title aerc --command aerc +wezterm cli spawn -- /home/adam/.config/nvm/versions/node/v20.11.1/bin/joplin +wezterm cli set-tab-title 'joplin' +wezterm cli spawn -- newsboat +wezterm cli spawn -- aerc diff --git a/bin/zoom-scaled.sh b/bin/zoom-smaller.sh similarity index 100% rename from bin/zoom-scaled.sh rename to bin/zoom-smaller.sh diff --git a/mail/aerc/aerc.conf b/mail/aerc/aerc.conf index ba985c0..0dfd8ee 100644 --- a/mail/aerc/aerc.conf +++ b/mail/aerc/aerc.conf @@ -74,7 +74,7 @@ next-message-on-delete=true fuzzy-complete=true stylesets-dirs=~/.config/aerc/ -styleset-name=dracula +# styleset-name=dracula [ui:folder=Sent] # index-format=%D %-25.25r %Z %s @@ -174,6 +174,29 @@ text/html=/usr/local/share/aerc/filters/html text/*=awk -f /usr/local/share/aerc/filters/plaintext image/*=catimg -w $(tput cols) - +[openers] +# +# Openers allow you to specify the command to use for the :open and :open-link +# actions on a per-MIME-type basis. The :open-link URL scheme is used to +# determine the MIME type as follows: x-scheme-handler/. +# +# {} is expanded as the temporary filename or URL to be opened with proper +# shell quoting. If it is not encountered in the command, the filename/URL will +# be appended to the end of the command. The command will then be executed with +# `sh -c`. +# +# Like [filters], openers support basic shell globbing. The first opener which +# matches the part's MIME type (or URL scheme handler MIME type) will be used, +# so order them from most to least specific. +# +# Examples: +# x-scheme-handler/irc=hexchat +# x-scheme-handler/http*=printf '%s' {} | wl-copy +# text/html=surf -dfgms +# text/plain=gvim {} +125 +# message/rfc822=thunderbird +text/html=librewolf + [triggers] # # Triggers specify commands to execute when certain events occur. diff --git a/neovim/init-dap.lua b/neovim/init-dap.lua index df7d5e8..bf27c8f 100644 --- a/neovim/init-dap.lua +++ b/neovim/init-dap.lua @@ -19,8 +19,12 @@ require("lazy").setup({ { "rcarriga/nvim-dap-ui", event = "VeryLazy", - requires = "mfussenegger/nvim-dap" + requires = { + "mfussenegger/nvim-dap", + "nvim-neotest/nvim-nio", + }, }, + "nvim-neotest/nvim-nio", { "mfussenegger/nvim-dap", event = "VeryLazy", diff --git a/neovim/init.lua b/neovim/init.lua index 89fd0cb..c6380a7 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -95,6 +95,7 @@ vim.opt.rtp:prepend(lazypath) local js_based_languages = { "javascript", "typescript" } require("lazy").setup({ + --[[ { url = "https://git.theadamcooper.com/adam/dracula-vim.git", branch = "adamc-main", @@ -105,6 +106,18 @@ require("lazy").setup({ vim.cmd.colorscheme("dracula") end, }, + --]] + { + "miikanissi/modus-themes.nvim", + priority = 1000, + }, + { + "afair/vibrantink2", + priority = 1000, + config = function() + vim.cmd.colorscheme("vibrantink2") + end + }, "nvim-lualine/lualine.nvim", "nvim-tree/nvim-web-devicons", { "echasnovski/mini.nvim", version = false }, @@ -123,11 +136,11 @@ require("lazy").setup({ { "folke/which-key.nvim", event = "VeryLazy", - init = function() - vim.o.timeout = true - -- N.B. Setting `timeoutlen` to 0 seems to break the plugin - vim.o.timeoutlen = 300 -- 0? 500? 300? - end, + -- init = function() + -- vim.o.timeout = true + -- -- N.B. Setting `timeoutlen` to 0 seems to break the plugin + -- vim.o.timeoutlen = 300 -- 0? 500? 300? + -- end, opts = { win = { border = "single", @@ -236,12 +249,12 @@ require("lazy").setup({ prompt = "Enter URL: ", default = "http://localhost:3000", }, function(url) - if url == nil or url == "" then - return - else - coroutine.resume(co, url) - end - end) + if url == nil or url == "" then + return + else + coroutine.resume(co, url) + end + end) end) end, webRoot = vim.fn.getcwd(), @@ -316,7 +329,7 @@ require("lazy").setup({ "microsoft/vscode-js-debug", -- After install, build it and rename the dist directory to out build = - "npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out", + "npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out", version = "1.*", }, { @@ -373,7 +386,7 @@ require("lazy").setup({ { "nvim-telescope/telescope-fzf-native.nvim", build = - "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", + "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", }, }, }, @@ -417,6 +430,7 @@ require("lazy").setup({ require('render-markdown').setup({}) end, }, + { "jparise/vim-graphql" }, }) --[[ mason @@ -460,12 +474,6 @@ nvim-cmp is a text completion engine. local cmp = require 'cmp' -cmp.setup({ - sources = { - { name = 'nvim_lsp_signature_help' } - } -}) - cmp.setup({ snippet = { -- REQUIRED - you must specify a snippet engine @@ -488,8 +496,9 @@ cmp.setup({ { name = 'nvim_lsp' }, { name = 'vsnip' }, -- For vsnip users. }, { - { name = 'buffer' }, - }) + { name = 'buffer' }, + { name = 'nvim_lsp_signature_help' }, + }) }) -- Set configuration for specific filetype. @@ -497,8 +506,8 @@ cmp.setup.filetype('gitcommit', { sources = cmp.config.sources({ { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). }, { - { name = 'buffer' }, - }) + { name = 'buffer' }, + }) }) -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). @@ -515,8 +524,8 @@ cmp.setup.cmdline(':', { sources = cmp.config.sources({ { name = 'path' } }, { - { name = 'cmdline' } - }) + { name = 'cmdline' } + }) }) --[[ nvim-lspconfig @@ -553,7 +562,8 @@ local lspconfig = require('lspconfig') lspconfig.gopls.setup { capabilities = capabilities } lspconfig.lua_ls.setup(lua_ls_setup) lspconfig.pyright.setup { capabilities = capabilities } -lspconfig.tsserver.setup { capabilities = capabilities } +-- lspconfig.tsserver.setup { capabilities = capabilities } +lspconfig.ts_ls.setup { capabilities = capabilities } lspconfig.rust_analyzer.setup { -- Server-specific settings. See `:help lspconfig-setup` capabilities = capabilities, @@ -671,9 +681,8 @@ require('gitsigns').setup({ row = 0, col = 1 }, - yadm = { - enable = false - }, + -- [2024-09-10] This is invalid, suddenly. + -- yadm = { enable = false }, on_attach = function(bufnr) local gs = package.loaded.gitsigns @@ -781,7 +790,13 @@ require('nvim-treesitter.configs').setup({ enable = true, module_path = "nvim-treesitter.indent", }, - ensure_installed = { "bash", "comment", "html", "javascript", "json", "lua", "typescript", "yaml" }, + -- [nvim-orgmode] NOTE: If you are using nvim-treesitter with ~ensure_installed = "all"~ option + -- add ~org~ to ignore_install + -- require('nvim-treesitter.configs').setup({ + -- ensure_installed = 'all', + -- ignore_install = { 'org' }, + -- }) + ensure_installed = { "bash", "comment", "go", "html", "javascript", "json", "lua", "python", "typescript", "yaml" }, sync_install = false, auto_install = false, ignore_install = {}, @@ -838,9 +853,9 @@ vim.api.nvim_create_autocmd( vim.g.nvlime_cl_impl = "ros" vim.cmd([[ function! NvlimeBuildServerCommandFor_ros(nvlime_loader, nvlime_eval) - return ["ros", "run", - \ "--load", a:nvlime_loader, - \ "--eval", a:nvlime_eval] + return ["ros", "run", + \ "--load", a:nvlime_loader, + \ "--eval", a:nvlime_eval] endfunction ]]) diff --git a/newsboat/.newsboat/history.search b/newsboat/.newsboat/history.search index f8fe771..31bbc3a 100644 --- a/newsboat/.newsboat/history.search +++ b/newsboat/.newsboat/history.search @@ -11,3 +11,9 @@ leak wolff baffler Assange +barrett +Barrett Brown +Bangladesh +mercenaries +guarani +rust diff --git a/vim/.vimrc b/vim/.vimrc index dcd2157..5ac0297 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -82,7 +82,8 @@ Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' Plug 'tpope/vim-fugitive' Plug 'dense-analysis/ale' -Plug 'Valloric/YouCompleteMe' +" Disabling YCM as it's a little broken at the moment +" Plug 'Valloric/YouCompleteMe' Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } Plug 'pangloss/vim-javascript' Plug 'MaxMEllon/vim-jsx-pretty'