diff --git a/.config/bash/00-compalias.bash b/.config/bash/00-compalias.bash index f5e94c4..ffb91a6 100644 --- a/.config/bash/00-compalias.bash +++ b/.config/bash/00-compalias.bash @@ -1,4 +1,4 @@ -function _compalias() { +_compalias() { local name val valarr fn name="${COMP_WORDS[0]}" val="${BASH_ALIASES[$name]}" @@ -15,7 +15,7 @@ function _compalias() { "$fn" "${COMP_WORDS[0]}" "${COMP_WORDS[-1]}" "${COMP_WORDS[-2]}" } -function compalias() { +compalias() { alias "$@" complete -o nospace -F _compalias "${@%%=*}" } diff --git a/.config/bash/10-aliases.bash b/.config/bash/10-aliases.bash index b6d8e38..72ea7e7 100644 --- a/.config/bash/10-aliases.bash +++ b/.config/bash/10-aliases.bash @@ -1,4 +1,4 @@ -function am() { +am() { local name dev lsblk while true; do @@ -22,36 +22,45 @@ function am() { done } -function bat() { +bat() { if [ -z "$1" ]; then return 1 fi TERM='tty' $EDITOR --cmd "set lines=$(grep -c '' "$1")" +redraw +q "$1" } -function bd() { +bd() { echo "$@" | base64 -d; echo } -function gi() { +gi() { curl -fL "https://www.toptal.com/developers/gitignore/api/$(printf '%s\n' "$@" | sort -u | paste -sd,)" } -function update() { +update() { $TERM --hold -e "$SHELL" -xc "sudo pacman -Syu && echo $'\e[32mDONE'" & $TERM --hold -e "$SHELL" -xc "git --git-dir='$HOME/.dotfiles/' --work-tree='$HOME' submodule update --remote --recursive && echo $'\e[32mDONE'" & } -function tmp() { +tmp() { cd -- "$(mktemp -d /tmp/"$1"XXX)" || return } -function venv() { +tz() { + local tz src + + tz="$(cat "$XDG_RUNTIME_DIR/sbar/tz")" + src="$(find /usr/share/zoneinfo/ -maxdepth 2 -iname "$1*" -printf '%P' -quit)" + TZ="$tz" date -d "TZ=\"$src\" ${2:-now}" "+%R%:::z $tz" + TZ="$src" date -d "TZ=\"$tz\" ${2:-now}" "+%R%:::z ${src:-UTC}" +} + +venv() { local venv="${1:-.venv}" local bin="$venv/bin/activate" if ! [ -f "$bin" ]; then - python -m venv "$venv" + python -m venv --system-site-packages "$venv" fi # shellcheck disable=SC1090 . "$bin" diff --git a/.config/bash/11-docker.bash b/.config/bash/11-docker.bash index 9f0afa5..70ade33 100644 --- a/.config/bash/11-docker.bash +++ b/.config/bash/11-docker.bash @@ -57,25 +57,33 @@ compalias dc='docker-compose' \ dcupb='docker-compose up --build' \ dcupd='docker-compose up -d' \ dcupdb='docker-compose up -d --build' \ - dcw='docker-compose up --build -w' + dcw='docker-compose up -w' -function dkb() { +dkb() { local name="${1:-${PWD##*/}}"; shift podman build . -t "$name" "$@" } -function dkr() { +dkr() { if [ -z "$1" ]; then set -- "${PWD##*/}" fi podman run -i -t "$@" } -function dkila() { +dkila() { while read -r img id; do if [[ "$img" != localhost/* ]] && new_id="$(podman pull "$img")" && [ "$new_id" != "$id" ]; then podman image rm "$id" fi done < <(podman image list --format json | jq -r '.[] | "\(.Names[]) \(.Id)"') } + +dcdev() { + OPT=() + if [ -f compose-dev.yaml ]; then + OPT+=(-f compose-dev.yaml) + fi + docker-compose "${OPT[@]}" up -w -V +} diff --git a/.config/bash/11-k8s.bash b/.config/bash/11-k8s.bash index 327f1a3..6868b95 100644 --- a/.config/bash/11-k8s.bash +++ b/.config/bash/11-k8s.bash @@ -1,4 +1,4 @@ -function _kctxns() { +_kctxns() { local conf="${KUBECONFIG:-"$HOME/.kube/config"}" local tmp cache file="$1" func="$2"; shift 2 @@ -27,10 +27,10 @@ function _kctxns() { echo -e "$1\n$2" > "$file" } -function _kns_get() { +_kns_get() { kubectl config view --minify -ojsonpath='{..namespace}' } -function _kns_set() { +_kns_set() { if ! kubectl get namespace -oname | grep -q "^namespace/$1\$"; then echo "error: no namespace exists with the name: \"$1\"" >&2 return 1 @@ -38,17 +38,17 @@ function _kns_set() { kubectl config set-context --current --namespace "$1" > /dev/null echo "Switched to namespace \"$1\"." } -function kns() { +kns() { local dir="$XDG_CACHE_HOME/kns" mkdir -p "$dir" > /dev/null _kctxns "$dir/$(kctx)" kns "$@" } -function _kctx_get() { kubectl config current-context ; } -function _kctx_set() { kubectl config use-context "$1" ; } +_kctx_get() { kubectl config current-context ; } +_kctx_set() { kubectl config use-context "$1" ; } # shellcheck disable=SC2120 -function kctx() { _kctxns "$XDG_CACHE_HOME/kctx" kctx "$@" ; } +kctx() { _kctxns "$XDG_CACHE_HOME/kctx" kctx "$@" ; } alias kga='kubectl get "$(kubectl api-resources --verbs=list --namespaced -oname | grep -v event | paste -sd,)"' \ kgaoname='kubectl get "$(kubectl api-resources --verbs=list --namespaced -oname | grep -v event | paste -sd,)" -oname' \ @@ -67,7 +67,7 @@ compalias k=kubectl \ kpf='kubectl port-forward' \ krm='kubectl delete' \ -function _k8salias() { +_k8salias() { local n s a for a in '' "${@/=/= }"; do diff --git a/.config/bash/20-theme.bash b/.config/bash/20-theme.bash index 2813f34..5aeb0aa 100644 --- a/.config/bash/20-theme.bash +++ b/.config/bash/20-theme.bash @@ -1,4 +1,4 @@ -function man() { +man() { env GROFF_NO_SGR=1 \ LESS_TERMCAP_mb=$'\e[01;31m' \ LESS_TERMCAP_md=$'\e[01;31m' \ @@ -18,7 +18,7 @@ GIT_PS1_SHOWCOLORHINTS=1 VIRTUAL_ENV_DISABLE_PROMPT=1 PROMPT_COMMAND=precmd -function precmd() { +precmd() { local ctx err="${PIPESTATUS[*]}" ctx="$(kctx)" diff --git a/.config/bookmarks b/.config/bookmarks index 34ca621..4f859d2 100644 --- a/.config/bookmarks +++ b/.config/bookmarks @@ -1,9 +1,9 @@ # vim: tabstop=8 nowrap # TODO -https://github.com/agusbudi/isar_crud +https://www.seek.com.au/devops-jobs/remote?worktype=245%2C244 +https://www.sncf-connect.com/app/catalogue/description/carte-avantage-jeune https://anubis.techaro.lol/docs/admin/installation -https://nomads.com https://wiki.nftables.org/wiki-nftables/index.php/Scripting https://tech.yahoo.com/articles/mozilla-vpns-per-controls-too-182238290.html https://help.gnome.org/users/zenity/stable/notification.html.en @@ -11,8 +11,8 @@ https://serverfault.com/questions/1150627/bind9-behind-nginx-reverse-proxy-doh/1 https://www.grepular.com/Automatically_Encrypting_all_Incoming_Email https://www.grepular.com/Protecting_a_Laptop_from_Simple_and_Sophisticated_Attacks https://www.rtcsec.com/article/slack-webrtc-turn-compromise-and-bug-bounty -https://www.youtube.com/playlist?list=PLjAJj2LotlkOzOgp1xXJkbF73ZrQeDE7j + comm/discord https://discord.com/app comm/whatsapp https://web.whatsapp.com games/lichess https://lichess.org @@ -33,6 +33,8 @@ media/ytmusic https://music.youtube.com/playlist?list=PLXd8_JG tools/crypto/coingecko https://www.coingecko.com tools/crypto/mempool https://mempool.space tools/deepl https://www.deepl.com +tools/gmaps https://www.google.com/maps +tools/gtranslate https://translate.google.com tools/nix/archwiki https://wiki.archlinux.org tools/nix/crontab https://crontab.guru tools/nix/debwiki https://wiki.debian.org @@ -40,6 +42,7 @@ tools/nix/fedowiki https://docs.fedoraproject.org tools/nix/gentoowiki https://wiki.gentoo.org tools/regex101 https://regex101.com tools/speedtest https://www.speedtest.net +tools/xe https://www.xe.com adm/facture.net https://www.facture.net games/chess.com https://www.chess.com @@ -83,8 +86,9 @@ tools/iso/fedora https://torrent.fedoraproject.org tools/iso/gmoker https://files.ovh.maby.dev/ISOs tools/iso/gparted https://gparted.org/download.php tools/iso/tails https://tails.net/install/download-iso/index.en.html -tools/iso/win11iotltsc https://www.microsoft.com/en-us/evalcenter/download-windows-11-iot-enterprise-ltsc-eval -tools/iso/win2k25 https://www.microsoft.com/en-us/evalcenter/download-windows-server-2025 +tools/iso/win11iotltsc https://massgrave.dev/windows_ltsc_links +tools/iso/win2k25 https://massgrave.dev/windows_server_links +tools/localhost http://127.0.0.1 tools/memtest https://www.memtest.org tools/namecheap https://www.namecheap.com tools/nix/quickemu https://github.com/quickemu-project/quickemu @@ -92,6 +96,7 @@ tools/nix/virtio-win https://github.com/virtio-win/virtio-win-pkg-scr tools/nix/winapps https://github.com/winapps-org/winapps tools/nix/winfsp https://github.com/winfsp/winfsp tools/nperf https://www.nperf.com +tools/router http://192.168.1.1 tools/semver https://semver.org tools/ventoy https://github.com/ventoy/Ventoy/releases tools/win/adwcleaner https://www.malwarebytes.com/adwcleaner diff --git a/.config/git/config b/.config/git/config index 25bc2a2..b87a243 100644 --- a/.config/git/config +++ b/.config/git/config @@ -19,6 +19,7 @@ bs = bisect c = commit --verbose ca = commit --verbose --all cl = clone +cl1 = clone --depth 1 co = checkout cp = cherry-pick d = diff @@ -30,11 +31,11 @@ ls = ls-files m = merge p = push r = remote -rso = remote show origin -n rb = rebase rev = revert rh = reset rs = restore +rso = remote show origin -n st = status sta = stash vi = difftool diff --git a/.config/mimeapps.list b/.config/mimeapps.list index 34049b0..1bdedbf 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -11,12 +11,12 @@ image/tiff=feh.desktop image/webp=feh.desktop # firefox -application/xhtml+xml=org.mozilla.firefox.desktop -text/html=org.mozilla.firefox.desktop -text/mml=org.mozilla.firefox.desktop -text/xml=org.mozilla.firefox.desktop -x-scheme-handler/http=org.mozilla.firefox.desktop -x-scheme-handler/https=org.mozilla.firefox.desktop +application/xhtml+xml=firefox.desktop +text/html=firefox.desktop +text/mml=firefox.desktop +text/xml=firefox.desktop +x-scheme-handler/http=firefox.desktop +x-scheme-handler/https=firefox.desktop # mpv audio/3gpp2=mpv.desktop diff --git a/.config/newsraft/config b/.config/newsraft/config index 81cf07a..34ee7aa 100644 --- a/.config/newsraft/config +++ b/.config/newsraft/config @@ -2,7 +2,6 @@ set menu-feed-sorting unread-desc set menu-item-sorting unread-desc set notification-command '' set reload-period 60 -set item-limit 100 bind V exec mpv "%l" bind q quit-hard diff --git a/.config/nvim/ftplugin/dart.lua b/.config/nvim/ftplugin/dart.lua deleted file mode 100644 index 413a354..0000000 --- a/.config/nvim/ftplugin/dart.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.opt_local.shiftwidth = 2 -vim.opt_local.tabstop = 2 diff --git a/.config/nvim/ftplugin/htmldjango.lua b/.config/nvim/ftplugin/htmldjango.lua deleted file mode 100644 index 413a354..0000000 --- a/.config/nvim/ftplugin/htmldjango.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.opt_local.shiftwidth = 2 -vim.opt_local.tabstop = 2 diff --git a/.config/nvim/ftplugin/htmldjango.lua b/.config/nvim/ftplugin/htmldjango.lua new file mode 120000 index 0000000..551c0bf --- /dev/null +++ b/.config/nvim/ftplugin/htmldjango.lua @@ -0,0 +1 @@ +json.lua \ No newline at end of file diff --git a/.config/nvim/ftplugin/json.lua b/.config/nvim/ftplugin/json.lua index 413a354..03deadf 100644 --- a/.config/nvim/ftplugin/json.lua +++ b/.config/nvim/ftplugin/json.lua @@ -1,2 +1,3 @@ vim.opt_local.shiftwidth = 2 vim.opt_local.tabstop = 2 +vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ " diff --git a/.config/nvim/ftplugin/markdown.lua b/.config/nvim/ftplugin/markdown.lua deleted file mode 100644 index e69de29..0000000 diff --git a/.config/nvim/ftplugin/tex.lua b/.config/nvim/ftplugin/tex.lua index 3beef62..53822ca 100644 --- a/.config/nvim/ftplugin/tex.lua +++ b/.config/nvim/ftplugin/tex.lua @@ -1,5 +1,6 @@ vim.opt_local.shiftwidth = 2 vim.opt_local.tabstop = 2 +vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ " vim.opt_local.spell = true diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index a986b9e..54c6deb 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,41 +1,44 @@ vim.g.mapleader = " " vim.opt.expandtab = true vim.opt.smartindent = true -vim.opt.shiftwidth = 4 +vim.opt.shiftwidth = 0 vim.opt.tabstop = 4 vim.opt.cino = "(s" vim.g.python_indent = { open_paren = "shiftwidth()" } vim.opt.list = true -vim.opt.listchars = { tab = "> ", trail = "-", nbsp = "+" } +vim.opt.listchars = { + leadmultispace = "│ ", + nbsp = "+", + tab = "> ", + trail = "-", +} vim.opt.number = true vim.opt.relativenumber = true vim.opt.laststatus = 3 vim.opt.guicursor = "" vim.opt.mousemodel = "extend" vim.opt.path = vim.o.path .. ",**" -vim.opt.suffixes = vim.o.suffixes .. ",.pyc,.hi" vim.opt.foldmethod = "indent" vim.opt.foldlevel = 99 vim.opt.scrolloff = 2 vim.opt.colorcolumn = "80" vim.g.netrw_banner = 0 -vim.g.netrw_list_hide = "\\.o$,\\.d$,\\.gc..$" vim.opt.lazyredraw = true vim.opt.complete = vim.o.complete .. ",i" +vim.opt.hlsearch = false vim.g.go_recommended_style = 0 require"theme" -require"pack-lspconfig" +require"lsp" require"pack-telescope" require"pack-treesitter" vim.keymap.set("n", "e", ".w !$SHELL") -vim.keymap.set("n", "f", "%s/\\s\\+$//e") +vim.keymap.set("n", "s", "%s/\\s\\+$//e") -vim.api.nvim_create_autocmd({ "BufWinEnter" }, { callback = function() - vim.opt_local.listchars = vim.o.listchars .. - ",leadmultispace:│" .. string.rep(" ", vim.o.shiftwidth - 1) -end }) +vim.keymap.set("v", "t", function() + local sep = string.char(vim.fn.getchar()) -vim.keymap.set("x", " ", "'<,'>!tr -s ' ' | column -t -s '|' -o '|'") + return ":!column -t -s'" .. sep .. "' -o'" .. sep .. "'" +end, {expr = true}) diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua new file mode 100644 index 0000000..2dedf4c --- /dev/null +++ b/.config/nvim/lua/lsp.lua @@ -0,0 +1,6 @@ +vim.lsp.enable({"bashls", "gopls", "pyright"}) + +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next) +vim.keymap.set('n', 'gD', vim.lsp.buf.declaration) +vim.keymap.set('n', 'gd', vim.lsp.buf.definition) diff --git a/.config/nvim/lua/pack-lspconfig.lua b/.config/nvim/lua/pack-lspconfig.lua deleted file mode 100644 index 49b95b7..0000000 --- a/.config/nvim/lua/pack-lspconfig.lua +++ /dev/null @@ -1,28 +0,0 @@ -local lspconfig = require"lspconfig" - -local on_attach = function(_, bufnr) - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - - local opts = { buffer = bufnr, noremap = true, silent = true } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, opts) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, opts) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) - vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) - vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) - vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) - vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) -end - -lspconfig["bashls"].setup { on_attach = on_attach } -lspconfig["gopls"].setup { on_attach = on_attach } -lspconfig["pyright"].setup { on_attach = on_attach } diff --git a/.config/nvim/lua/pack-telescope.lua b/.config/nvim/lua/pack-telescope.lua index 986c12d..1b566b2 100644 --- a/.config/nvim/lua/pack-telescope.lua +++ b/.config/nvim/lua/pack-telescope.lua @@ -1,14 +1,5 @@ -require"telescope".setup { - defaults = { - file_ignore_patterns = { - "\\.o$", "\\.d$", "\\.gc..$" - } - } -} +local t = require("telescope.builtin") -local builtin = require("telescope.builtin") - -vim.keymap.set("n", "tf", builtin.find_files, {}) -vim.keymap.set("n", "tg", builtin.live_grep, {}) -vim.keymap.set("n", "tb", builtin.buffers, {}) -vim.keymap.set("n", "th", builtin.help_tags, {}) +vim.keymap.set("n", "ff", t.find_files) +vim.keymap.set("n", "fg", t.live_grep) +vim.keymap.set("n", "fb", t.buffers) diff --git a/.config/nvim/lua/theme.lua b/.config/nvim/lua/theme.lua index d5ec374..81cc5b6 100644 --- a/.config/nvim/lua/theme.lua +++ b/.config/nvim/lua/theme.lua @@ -1,4 +1,5 @@ local theme = require"onedark" + theme.setup { style = "dark", transparent = true diff --git a/.local/aur/newsraft b/.local/aur/newsraft index 98a7402..c819ff1 160000 --- a/.local/aur/newsraft +++ b/.local/aur/newsraft @@ -1 +1 @@ -Subproject commit 98a740254775ad32b62a9760565e3a472b325a5d +Subproject commit c819ff1192867d5d1c9927d2995fb65c4e5c4a58 diff --git a/.local/aur/sparrow b/.local/aur/sparrow index a6f3bde..29ff98e 160000 --- a/.local/aur/sparrow +++ b/.local/aur/sparrow @@ -1 +1 @@ -Subproject commit a6f3bde7efc9eae6500b35d5e5cc51971ae9a331 +Subproject commit 29ff98e2d84221630f5f76550a38fa1b5272d4b8 diff --git a/.local/bin/bookmarks b/.local/bin/bookmarks index 6d27671..dc852fc 100755 --- a/.local/bin/bookmarks +++ b/.local/bin/bookmarks @@ -15,7 +15,7 @@ if [ -z "$q" ]; then elif [[ "$q" == *://* ]]; then url="${q/*+( )/}" - exec xdg-open "$url" + exec $BROWSER "$url" fi if [[ "$q" =~ ^[^[:space:]]+(\.[^[:space:]]+)+$ ]]; then exec $BROWSER "$q" diff --git a/.local/bin/crypto b/.local/bin/crypto index a49ba5c..865ca51 100755 --- a/.local/bin/crypto +++ b/.local/bin/crypto @@ -23,7 +23,7 @@ def main(): FORMAT.format( symbol=j["symbol"].upper(), price=j["market_data"]["current_price"][CURRENCY], - trend=j["market_data"]["price_change_percentage_24h"], + trend=j["market_data"]["price_change_percentage_7d"], ) ) diff --git a/.local/bin/ddev b/.local/bin/ddev index d9c23f5..2d0999a 100755 --- a/.local/bin/ddev +++ b/.local/bin/ddev @@ -1,6 +1,6 @@ #!/bin/bash -function dkr() { +dkr() { local ep="$1"; shift (set -x @@ -10,9 +10,8 @@ function dkr() { } declare -A aliases=( - [arch]=docker.io/archlinux/archlinux:base + [arch]=quay.io/archlinux/archlinux:base [debian]=docker.io/debian:12-slim - [flutter]=git.gmoker.com/icing/flutter:main [kaniko]=gcr.io/kaniko-project/executor:debug ) diff --git a/.local/bin/ffcapture b/.local/bin/ffcapture index 1af64b8..fad3eb2 100755 --- a/.local/bin/ffcapture +++ b/.local/bin/ffcapture @@ -2,9 +2,18 @@ output="$HOME/Videos/ffcapture$(date '+%Y%m%d_%H%M%S').mp4" -ffmpeg \ - -framerate 30 \ - -f x11grab -i "$DISPLAY.0" -c:v libx265 \ - "$output" +video=( + -f x11grab + -i "$DISPLAY.0" +) -# -f pulse -i # sink +audio=( + -f pulse + -i default +) + +ffmpeg \ + -framerate 10 \ + "${video[@]}" \ + "${audio[@]}" \ + "$output" diff --git a/.local/bin/firefox b/.local/bin/firefox index 424c16a..28f86ea 100755 --- a/.local/bin/firefox +++ b/.local/bin/firefox @@ -9,7 +9,7 @@ sites=( 'https://web.whatsapp.com' ) -function update() { +update() { local start='^/\*---- USER PREFERENCES ----\*/$' local end='^/\*---- END USER PREFERENCES ----\*/$' local af userpref diff --git a/.local/bin/sbar b/.local/bin/sbar index a41e54f..965cfad 100755 --- a/.local/bin/sbar +++ b/.local/bin/sbar @@ -1,20 +1,20 @@ #!/bin/bash -function scrypto() { +scrypto() { local tmp tmp="$(crypto 2> /dev/null)" && echo "$tmp" > crypto } -function scpu() { +scpu() { echo " $(awk '{print $1}' /proc/loadavg)" > cpu } -function smemory() { +smemory() { echo " $(free -h | awk '/^Mem:/{print $3}')" > memory } -function sbat() { +sbat() { local cap; cap="$(cat /sys/class/power_supply/BAT0/capacity)" if grep -qv Discharging /sys/class/power_supply/BAT0/status; then @@ -24,7 +24,7 @@ function sbat() { fi > bat } -function svol() { +svol() { local st v m vol=('' ' ') mut=('🔇' ' ') mapfile -t st <<< "$(wpctl status | sed -n 's/.*\*.*\[vol: \(.*\)]/\1/p')" @@ -41,7 +41,7 @@ function svol() { done > vol } -function snet() { +snet() { local dev j ssid sig dev="$(ip route | grep -oP 'default.*dev\s+\K[^\s]+')" @@ -66,7 +66,7 @@ function snet() { esac > net } -function svpn() { +svpn() { local v; v="$(ip -br link show type wireguard | awk '{print $1}')" if [ -n "$v" ]; then @@ -74,22 +74,22 @@ function svpn() { fi > vpn } -function stz() { +stz() { local tmp ip; ip="$(ip route | grep -oP '^default.*src\s+\K[^\s]+')" - if [ "$ip" != "$(cat ip)" ]; then + if ! [ -s tz ] || [ "$ip" != "$(cat ip)" ]; then tmp="$(curl -s --interface wlan0 'https://ipapi.co/timezone')" \ && echo "$tmp" > tz echo "$ip" > ip fi } -function stime() { +stime() { # shellcheck disable=SC2238 TZ="$(cat tz)" date '+%a %m-%d %R%:::z' > time } -function display() { +display() { for f in *; do local - "$f"="$(cat "$f")" done diff --git a/.local/bin/vol b/.local/bin/vol index dfb1226..c94b226 100755 --- a/.local/bin/vol +++ b/.local/bin/vol @@ -6,7 +6,7 @@ case "$1" in *) exit 1 ;; esac -function update_vol() { +update_vol() { # shellcheck disable=SC2017 case "$1" in +*|-*) CUR=$((CUR + $1 - CUR % $1 + CUR % $1 * 10 / $1 / 5 * $1)) ;; diff --git a/.local/bin/wpdef b/.local/bin/wpdef index 2f2b35c..89b8743 100755 --- a/.local/bin/wpdef +++ b/.local/bin/wpdef @@ -3,18 +3,18 @@ json="$(pw-dump)" fmt='"\(.id) \(.info.props."node.nick")"' -function _jq() { +_jq() { jq -r "$*" <<< "$json" } -function getdev() { +getdev() { local d d="$(_jq ".[].metadata | select(.)[] | select(.key == \"default.configured.audio.$1\").value.name")" _jq ".[] | select(.info.props.\"node.name\" == \"$d\") | $fmt" } -function getdevs() { +getdevs() { _jq ".[] | select(.info.props.\"media.class\" == \"Audio/$1\") | $fmt" } @@ -25,7 +25,11 @@ case "$1" in esac dev="$(getdev "${CLASS,,}")" -devs="$(getdevs "$CLASS" | grep -v "$dev")"$'\n'"* $dev" +if [ -n "$dev" ]; then + devs="$(getdevs "$CLASS" | grep -v "$dev")"$'\n'"* $dev" +else + devs="$(getdevs "$CLASS")" +fi read -r id <<< "$(dmenu -l 16 <<< "$devs" | sed 's/*//')" wpctl set-default "$id" diff --git a/.local/share/bash-completion/completions/ddev b/.local/share/bash-completion/completions/ddev index b6166a9..cf414f5 100644 --- a/.local/share/bash-completion/completions/ddev +++ b/.local/share/bash-completion/completions/ddev @@ -1,6 +1,6 @@ # vim: ft=bash -function _ddev() { +_ddev() { cache="/tmp/${FUNCNAME[0]}" if ! [ -f "$cache" ]; then diff --git a/.local/share/bash-completion/completions/gi b/.local/share/bash-completion/completions/gi index c531edb..f2237ab 100644 --- a/.local/share/bash-completion/completions/gi +++ b/.local/share/bash-completion/completions/gi @@ -1,6 +1,6 @@ # vim: ft=bash -function _gi() { +_gi() { cache="/tmp/${FUNCNAME[0]}" if ! [ -f "$cache" ]; then diff --git a/.local/share/bash-completion/completions/kctx b/.local/share/bash-completion/completions/kctx index 6f5ecfd..1b76d69 100644 --- a/.local/share/bash-completion/completions/kctx +++ b/.local/share/bash-completion/completions/kctx @@ -1,6 +1,6 @@ # vim: ft=bash -function _kctx() { +_kctx() { [ "$COMP_CWORD" -ne 1 ] && return mapfile -t COMPREPLY < <(compgen -W \ "$(kubectl config get-contexts -o name)" \ diff --git a/.local/share/bash-completion/completions/kns b/.local/share/bash-completion/completions/kns index d6c8e0a..5631f52 100644 --- a/.local/share/bash-completion/completions/kns +++ b/.local/share/bash-completion/completions/kns @@ -1,6 +1,6 @@ # vim: ft=bash -function _kns() { +_kns() { [ "$COMP_CWORD" -ne 1 ] && return mapfile -t COMPREPLY < <(compgen -W \ "$(kubectl get namespace -o jsonpath='{..metadata.name}')" \ diff --git a/.mozilla/firefox/ange/user.js b/.mozilla/firefox/ange/user.js index a7db69e..7c760d1 100644 --- a/.mozilla/firefox/ange/user.js +++ b/.mozilla/firefox/ange/user.js @@ -1256,6 +1256,7 @@ user_pref("browser.tabs.hoverPreview.showThumbnails", false); user_pref("browser.tabs.inTitlebar", 0); user_pref("browser.toolbars.bookmarks.visibility", "never"); user_pref("browser.uiCustomization.state", "{\"placements\":{\"nav-bar\":[\"back-button\",\"forward-button\",\"stop-reload-button\",\"urlbar-container\",\"downloads-button\",\"ublock0_raymondhill_net-browser-action\",\"unified-extensions-button\"],\"toolbar-menubar\":[\"menubar-items\"],\"TabsToolbar\":[\"tabbrowser-tabs\"]},\"currentVersion\":21}"); +user_pref("browser.urlbar.suggest.openpage", false); user_pref("browser.urlbar.suggest.topsites", false); user_pref("browser.zoom.siteSpecific", false); user_pref("extensions.formautofill.addresses.enabled", false); diff --git a/.ssh/known_hosts b/.ssh/known_hosts index b2cfe4c..7a85ab1 100644 --- a/.ssh/known_hosts +++ b/.ssh/known_hosts @@ -1,4 +1,5 @@ # vim: nowrap +cashier.cocoonlovina.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPcWvRwzoeGGTZ4hEhHo1IHxUIKsnpnEx5AUudGnq+ZN git.gmoker.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDgTtgsVL6fT12EJXUtuGfQra/jG8411Bm8n0kxqt+z8ELNSmaAXMQ5J9WZpK96fU1EaOwBRYJr885Cj7z9hjNkyadbO058huleEI5my91Vtk9lsB1DpdjG1V07uvPyOqrxy2dk/BtRzvzTUrf3B1oAnNJu6ntz73c7t2IiEfsm6z8KqTOKtgbU6D7BnskovVSRP3lS1phSFjzJWKfkGfxyQlOVH/woTSp5G4cYDI6pz+aG3ideHaWE6Ls8yC+76KbVjnUAPHCGk4zUWrqCp2iVVek+13hl7oyp3fwSOIyGzW+x6288PvAgkVTmgRBuTU0VXUgjxJImVAqZFqz0h9X44F2y2quBRXra0f8NXb5uPID1jmP73dudJC3wXie/QW+aQTF6rKAVq750HseQum7HZoD+s8Qg8t1ROxyVqYkes35JjblkRm1+Mips1mZozjwYuAsX8P24z/u2R07Y1fACYr0gX4iIGQSU+ie42n1/33xK2W1HGb4zrsu3RptxQp2rpNsYZ+9NO3VWqaWUbhIyFfyd+jEh8tzCbUvRySSmK5kTSGzTU07flhLehqgKWeWiI+Q4xrg0SLpLLFZJKHc0+935xD9jRNW+FXhOU1ud7nUCRnBlvo0Wp/yKjcU1ycJKt7cmaAwprHGg5KnOAzszAvRVMWAzw6ICyTQmTSY/fQ== git.maby.dev ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCy6Vljjd9lVRmXjwhxuRopFTALb18I1rVzeyr8X6g1BIvl8PE8EBBeWgJ673pmzdA1KMFbJ5uMah5Cz5oqeXJi/cqneKW5sFiIlRB+/epOGPBHbfDNQOsv+vR1qt+N++SjuP59E2846JEM5G7380eb4iOTSzkPwgv4zEPIIWYzMO4jmHytrsmKU7mKOqbaRYXAc9pqJBJ3K0uvsCBSydCVwICv6ykfex+kPyBxU2o52NgHvrq7vgn4eREy1Fnt4HG8GT46/3H48HOr6zbB43sS3JiMxVNWK2YU3IBGeuo5PMkUBzuWx/GB33W5Pc2GTARoW11T63SZ/EBlJQyRozwD4UzJkJJRtYn//WZLimz9KFMV50Wc9o+Lcfz/xshTfgCn0B9rac1XzsBjJ0riMqyx+6UWjizrrtJtkhhEfobKcws1wRi/I+lWJM08th8DKUMKT599CjjiESFqX1QvfABYt56FDDORskYZRLi2AYeIPsLmLYxmjh9NVu3CcNNPsFmu2xqCWp5Symd6DMSpzejnwL0rWdm1kdPBLLRaOnp/EmwaRVFt98K4XaFA7hHd10NxAoQlG50yUfTo0fsngedpWYKwMsLjatgozjoB6eQAxkVGs4MaGgSwYyn5jrmYnFeAzLPCWL6kzd4dmnvrDi2SCcOWRL0+LNF1ltOw/+U7sw== github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl