From 1c5ae0ca00f0d1daa31b2af0f29d81623c258ab1 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Wed, 20 Nov 2024 10:21:26 -0500 Subject: [PATCH] Update many things --- home/.config/Code/User/settings.json | 10 ++++--- home/.config/mimeapps.list | 22 ++++++-------- home/.config/nvim/coc-settings.json | 21 ++++++++++++-- home/.config/nvim/init.vim | 29 +++++++++++++++++-- home/.gitconfig | 6 +++- home/.xbindkeysrc | 4 ++- home/.xlaunch.d/{dunst => 0-dunst} | 4 +++ .../.xlaunch.d/{0-dpi_scale => 000-dpi_scale} | 1 + home/.xlaunch.d/pista | 4 +-- home/.xlaunch.d/xbindkeys | 2 +- home/.xlaunch.d/xscreensaver | 4 +++ home/bin/dunst_beep_critical | 2 +- home/bin/dunst_beep_normal | 2 +- home/bin/mpplay | 4 +-- home/lib/login_aliases.sh | 7 +++++ home/lib/login_functions.sh | 23 ++++++++++++++- home/lib/login_variables.sh | 1 + 17 files changed, 115 insertions(+), 31 deletions(-) rename home/.xlaunch.d/{dunst => 0-dunst} (83%) rename home/.xlaunch.d/{0-dpi_scale => 000-dpi_scale} (93%) diff --git a/home/.config/Code/User/settings.json b/home/.config/Code/User/settings.json index cfa54af..baa2463 100644 --- a/home/.config/Code/User/settings.json +++ b/home/.config/Code/User/settings.json @@ -12,13 +12,15 @@ ], "editor.inlineSuggest.enabled": true, "github.copilot.enable": { - "*": false, - "yaml": false, + "*": true, "plaintext": true, - "markdown": false + "markdown": false, + "scminput": false, + "yaml": false }, "editor.fontSize": 13, "debug.console.fontSize": 13, "markdown.preview.fontSize": 13, - "terminal.integrated.fontSize": 13 + "terminal.integrated.fontSize": 13, + "lldb.suppressUpdateNotifications": true } \ No newline at end of file diff --git a/home/.config/mimeapps.list b/home/.config/mimeapps.list index 7138d4d..6ba8e6c 100644 --- a/home/.config/mimeapps.list +++ b/home/.config/mimeapps.list @@ -12,7 +12,7 @@ audio/vnd.audible.aax=vlc.desktop; audio/x-m4a=vlc.desktop;mpv.desktop; image/bmp=sxiv.desktop; image/gif=sxiv.desktop; -image/jpeg=sxiv.desktop; +image/jpeg=sxiv.desktop;feh.desktop; image/png=sxiv.desktop; image/tiff=sxiv.desktop; inode/symlink=caja.desktop; @@ -28,17 +28,10 @@ x-scheme-handler/https=userapp-Firefox-FY7R00.desktop; x-scheme-handler/tg=userapp-Telegram Desktop-Q1EZH1.desktop;userapp-Telegram Desktop-NYSNT1.desktop;org.telegram.desktop.desktop; x-scheme-handler/trash=caja.desktop text/x-verilog=gvim.desktop; -audio/flac=mpv.desktop; -audio/x-flac=mpv.desktop; -audio/mpeg=mpv.desktop; -application/vnd.oasis.opendocument.text=libreoffice-writer.desktop; -application/rtf=libreoffice-writer.desktop; -application/msword=libreoffice-writer.desktop; -application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop; -application/vnd.oasis.opendocument.spreadsheet=libreoffice-calc.desktop; -application/vnd.ms-excel=libreoffice-calc.desktop; -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=libreoffice-calc.desktop; application/vnd.sqlite3=anki.desktop; +image/heif=eom.desktop;feh.desktop; +application/xml=gvim.desktop; +x-scheme-handler/tonsite=org.telegram.desktop.desktop; [Default Applications] application/illustrator=gimp.desktop @@ -59,10 +52,10 @@ audio/x-vorbis+ogg=mpv.desktop audio/x-wav=mpv.desktop image/bmp=eom.desktop image/gif=eom.desktop -image/jpeg=eom.desktop +image/jpeg=feh.desktop image/png=eom.desktop image/tiff=eom.desktop -inode/directory=caja.desktop +inode/directory=pcmanfm.desktop inode/symlink=caja.desktop message/rfc822=thunderbird.desktop text/csv=gvim.desktop @@ -105,3 +98,6 @@ application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoff application/vnd.oasis.opendocument.spreadsheet=libreoffice-calc.desktop application/vnd.ms-excel=libreoffice-calc.desktop application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=libreoffice-calc.desktop +image/heif=feh.desktop +application/xml=gvim.desktop +x-scheme-handler/tonsite=org.telegram.desktop.desktop diff --git a/home/.config/nvim/coc-settings.json b/home/.config/nvim/coc-settings.json index 8265119..c31bc4f 100644 --- a/home/.config/nvim/coc-settings.json +++ b/home/.config/nvim/coc-settings.json @@ -21,6 +21,7 @@ "filetypes": ["c", "cc", "cpp", "c++", "objc", "objcpp"] } }, + "markdownlint.config": { // Allow mixed usage of both styles of heading indicators. // (i.e. leading hashes (###) for level 3+ after @@ -29,6 +30,22 @@ // - https://github.com/fannheyward/coc-markdownlint // - https://github.com/DavidAnson/markdownlint/blob/main/doc/md003.md // - https://github.com/DavidAnson/markdownlint/blob/3561fc3f38b05b3c55f44e371c2cd9bda194598a/doc/md003.md - "MD003": { "style": "setext_with_atx" } - } + "MD003": { "style": "setext_with_atx" }, + + // Allow different list item markers (-, +, *) in unordered lists, as + // long as each level uses the same one. + // Ref: https://github.com/DavidAnson/markdownlint/blob/main/doc/md004.md + "MD004": { "style": "sublist" }, + + // Allow duplicate headings with different parents. + // Ref: https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md + "MD024": { "siblings_only": true } + }, + + // FIXME These rust-analyzer settings do not seem to work. Why? + // Ref: https://github.com/fannheyward/coc-rust-analyzer + // "rust-analyzer.inlayHints.typeHints.enable": false, + // "rust-analyzer.inlayHints.maxLength": 0, + // "rust-analyzer.inlayHints.parameterHints.enable": false + "rust-analyzer.cargo.features": "all" } diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim index 6a4e197..73871ec 100644 --- a/home/.config/nvim/init.vim +++ b/home/.config/nvim/init.vim @@ -9,6 +9,8 @@ " Run :PlugInstall after adding a new plugin call plug#begin() +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' Plug 'z0mbix/vim-shfmt', { 'for': 'sh' } Plug 'dense-analysis/ale' " Syntastic's spiritual succesor Plug 'preservim/nerdtree' @@ -33,6 +35,15 @@ Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'simrat39/symbols-outline.nvim' +" Typst stuff: +Plug 'kaarmu/typst.vim' +" https://typst.app/ +" https://github.com/typst/typst +" https://github.com/typst/typst/issues/175 +" https://github.com/kaarmu/typst.vim +" https://github.com/chomosuke/typst-preview.nvim +" https://github.com/SeniorMars/typst.nvim + call plug#end() " END Vim-Plug @@ -49,10 +60,13 @@ let NERDTreeShowLineNumbers=1 " rust.vim let g:rustfmt_autosave = 1 +"let g:rustfmt_options = '--edition 2021' " XXX Without specifying edition, + " presence of async in file prevents + " it from being formatted on save. " shfmt let g:shfmt_extra_args = '--indent 4 --language-dialect bash' -" let g:shfmt_fmt_on_save = 1 " on-save probably to invasive to mod existing scripts. +" let g:shfmt_fmt_on_save = 1 " on-save probably too invasive to mod existing scripts. "============================================================================== " Defaults @@ -81,7 +95,18 @@ set spelllang=en,ru " lightline set laststatus=2 set noshowmode -let g:lightline = {'colorscheme': 'seoul256'} +let g:lightline = { + \ 'colorscheme': 'seoul256', + \ 'component_function': { + \ 'filename': 'LightlineFilename' + \ } +\} + +function! LightlineFilename() + let l:filename = expand('%:t') + let l:parentdir = expand('%:h:t') + return l:parentdir . '/' . l:filename +endfunction "------------------------------------------------------------------------------ " Color diff --git a/home/.gitconfig b/home/.gitconfig index 3e84c52..2cfd719 100644 --- a/home/.gitconfig +++ b/home/.gitconfig @@ -8,8 +8,12 @@ ui = true [cola] spellcheck = false + [init] - defaultBranch = electus + # As in "electus ramus" - "the chosen branch". + # The One, which was arbitrarily chosen to serve as default. + defaultBranch = electus + #[filter "lfs"] # required = true # clean = git-lfs clean -- %f diff --git a/home/.xbindkeysrc b/home/.xbindkeysrc index 19639d1..a7b3db5 100644 --- a/home/.xbindkeysrc +++ b/home/.xbindkeysrc @@ -166,6 +166,8 @@ "cd ~/doc/drafts && gvim $(draft ~/doc/drafts/adhoc)" Mod4 + d +"cd ~/doc/notes/job-search-2024 && gvim README.md" + Mod4 + j "cd ~/doc/notes && notes_prepend && gvim -c NERDTreeFind notes.md" Mod4 + n + Shift "cd ~/doc/notes && gvim $(draft ~/doc/notes/adhoc)" @@ -196,7 +198,7 @@ "notify_status" Mod4 + s -"notify_time-in-zones" +"notify-send -u low 'time in zones' "$(tiz UTC US/Pacific US/Mountain US/Eastern Europe/Warsaw Europe/Kyiv Europe/Moscow Europe/Samara Asia/Manila NZ)"" Mod4 + z # MPD diff --git a/home/.xlaunch.d/dunst b/home/.xlaunch.d/0-dunst similarity index 83% rename from home/.xlaunch.d/dunst rename to home/.xlaunch.d/0-dunst index fb39ad2..7713dd9 100755 --- a/home/.xlaunch.d/dunst +++ b/home/.xlaunch.d/0-dunst @@ -21,5 +21,9 @@ ps -eo pid,cmd | awk '$2 ~ /\/usr\/bin\/dunst\>/ {print $1}' | xargs -I% kill % # Hope this is enough for hidpi stuff to finish setting. sleep 1 +# XXX mate-settings-daemon, on which we rely on for hidpi settings, starts +# mate-notification-daemon and interferes with our start. +pkill mate-notificati || true + # Now dunst should start scaled: dunst --startup_notification diff --git a/home/.xlaunch.d/0-dpi_scale b/home/.xlaunch.d/000-dpi_scale similarity index 93% rename from home/.xlaunch.d/0-dpi_scale rename to home/.xlaunch.d/000-dpi_scale index bd5cd39..51a89ff 100755 --- a/home/.xlaunch.d/0-dpi_scale +++ b/home/.xlaunch.d/000-dpi_scale @@ -32,5 +32,6 @@ set -e # #main +# sleep 1 # XXX Slow down to let dunst and xscreensaver win the start-up race. # /usr/libexec/mate-settings-daemon --replace --debug /usr/libexec/mate-settings-daemon --replace diff --git a/home/.xlaunch.d/pista b/home/.xlaunch.d/pista index 7633f65..f047813 100755 --- a/home/.xlaunch.d/pista +++ b/home/.xlaunch.d/pista @@ -1,7 +1,7 @@ #! /bin/sh -set -e +# set -e # pistactl --config ~/.pistactl."$(hostname)" restart # pistactl --config ~/.pistactl.toml restart -pistactl restart +# pistactl restart diff --git a/home/.xlaunch.d/xbindkeys b/home/.xlaunch.d/xbindkeys index 2bba2da..35e895f 100755 --- a/home/.xlaunch.d/xbindkeys +++ b/home/.xlaunch.d/xbindkeys @@ -6,4 +6,4 @@ set -e # 1. not using killall; # 2. using "command" (or "cmd") instead of "comm". ps -eo pid,command | awk '$2 ~ "^xbindkeys" {print $1}' | xargs -I% kill % -xbindkeys -n -v +xbindkeys -n #-v diff --git a/home/.xlaunch.d/xscreensaver b/home/.xlaunch.d/xscreensaver index 7e202a2..9762d77 100755 --- a/home/.xlaunch.d/xscreensaver +++ b/home/.xlaunch.d/xscreensaver @@ -2,4 +2,8 @@ set -e +# XXX mate-settings-daemon, on which we rely on for hidpi settings, starts +# mate-screensaver and interferes with our start. +pkill mate-screensave || true + xscreensaver diff --git a/home/bin/dunst_beep_critical b/home/bin/dunst_beep_critical index d169409..3a2e41b 100755 --- a/home/bin/dunst_beep_critical +++ b/home/bin/dunst_beep_critical @@ -3,5 +3,5 @@ #play -q -n synth 0.5 sin 750 for i in $(seq 3) do - play -q -n synth 0.1 sin 115 + play -q -n synth 0.1 sin 300 done diff --git a/home/bin/dunst_beep_normal b/home/bin/dunst_beep_normal index 3b6ac8c..1f8aa2f 100755 --- a/home/bin/dunst_beep_normal +++ b/home/bin/dunst_beep_normal @@ -1,3 +1,3 @@ #! /bin/sh -play -q -n synth 0.1 sin 115 +play -q -n synth 0.1 sin 300 diff --git a/home/bin/mpplay b/home/bin/mpplay index 1782f0e..4eaa4a6 100755 --- a/home/bin/mpplay +++ b/home/bin/mpplay @@ -4,5 +4,5 @@ set -e set -o pipefail mpc listall | khomenu | mpc insert -mpc play -st -e ncmpc +# mpc play +# st -e ncmpc diff --git a/home/lib/login_aliases.sh b/home/lib/login_aliases.sh index a2716a9..74bfa2c 100644 --- a/home/lib/login_aliases.sh +++ b/home/lib/login_aliases.sh @@ -28,3 +28,10 @@ alias quotes='cd ~/doc/quotations && vim quotations.md' alias bitcoin='nc ticker.bitcointicker.co 10080' # https://github.com/chubin/awesome-console-services#Money alias weather='cat ~/.pista-out/weather-summary' alias sccache-restart='sccache --stop-server; sccache --start-server' +alias nightshift=sct +alias links='vim ~/arc/doc/links/"$(date +%F)"' +alias gh-clone-repo=gh_clone_repo +alias gh-clone-user=gh_clone_user +alias gh-clone-org=gh_clone_org +alias j=jobs +alias t='tiz UTC US/Pacific US/Mountain US/Eastern Europe/Warsaw Europe/Kyiv Europe/Moscow Europe/Samara Asia/Manila NZ' diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index f28666d..e518135 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -15,6 +15,22 @@ emoji() { khomenu < ~/emoji.txt | awk '{print $1}' | xsel --input --clipboard } +links_aggregate_md() { + printf 'Daily Links\n' + printf '%s\n' "$(bar 78 '=')" + find ~/arc/doc/links -maxdepth 1 -mindepth 1 -type f \ + | sort -r \ + | while read -r file_path; do + printf '\n' + basename $file_path + printf '%s\n' "$(bar 78 '-')" + printf '\n' + while read -r url; do + printf '- <%s>\n' "$url" + done < "$file_path" + done +} + ## notify_done : unit -> unit notify_done() { local -r _status_code="$?" @@ -322,7 +338,8 @@ _yt() { local -r uri="$2" local -r opts="$3" - local -r yt=youtube-dl + # local -r yt=youtube-dl + local -r yt=yt-dlp local -r id=$("$yt" --get-id "$uri") local -r title=$("$yt" --get-title "$uri" | sed 's/[^А-Яа-яA-Za-z0-9._-]/_/g') local -r dir="${base_dir}/${title}--${id}" @@ -935,3 +952,7 @@ loggers() { | bar_gauge -v num=1 -v ch_right=' ' -v ch_left=' ' -v ch_blank=' ' \ | column -t } + +load() { + awk -v n="$(nproc)" 'NR == 1 {printf "%.2f %.2f %.2f\n", $1 / n, $2 / n, $3 / n}' /proc/loadavg +} diff --git a/home/lib/login_variables.sh b/home/lib/login_variables.sh index 7904ae7..00826c9 100644 --- a/home/lib/login_variables.sh +++ b/home/lib/login_variables.sh @@ -35,6 +35,7 @@ ERL_AFLAGS="+pc unicode" ERL_AFLAGS="$ERL_AFLAGS -kernel shell_history enabled" ERL_AFLAGS="$ERL_AFLAGS -kernel shell_history_path '\"$HOME/.erl_history\"'" export ERL_AFLAGS +. /home/xand/.kerl/installations/25.3.2.13/activate # Rust / cargo export PATH=$PATH:$HOME/.cargo/bin -- 2.20.1