From 72c73f9b1898a81358b4400071a5dd829c0d3f0f Mon Sep 17 00:00:00 2001 From: ange Date: Fri, 27 Dec 2024 11:43:30 +0000 Subject: [PATCH] big update --- .bash_profile | 5 +++- .bashrc | 1 + .config/bash/11-docker.bash | 6 ++-- .config/git/config | 1 + .config/newsraft/feeds | 8 ----- .config/nvim/init.lua | 2 -- .config/nvim/lua/pack-lspconfig.lua | 1 + .config/nvim/lua/pack-telescope.lua | 1 - .config/nvim/lua/pack-treesitter.lua | 3 -- .config/nvim/lua/theme.lua | 1 - .config/nvim/pack/plugins/opt/telescope | 1 - .config/nvim/pack/plugins/opt/treesitter | 1 - .../nvim/pack/plugins/{opt => start}/onedark | 0 .../nvim/pack/plugins/{opt => start}/plenary | 0 .config/nvim/pack/plugins/start/telescope | 1 + .config/nvim/pack/plugins/start/treesitter | 1 + .config/suckless/dwm-6.5/config.h | 4 +-- .gitmodules | 25 +++++++++++----- .local/aur/newsraft | 1 + .local/aur/shellcheck | 1 + .local/aur/sparrow | 1 + .local/bin/ddev | 15 +++++++--- .local/bin/ffcapture | 10 +++++++ .local/bin/giteadelimg | 18 +++++++++++ .local/bin/light | 30 +++++-------------- .local/bin/sbar | 2 +- .local/bin/vm | 24 +++++++++++++++ .local/bin/vol | 2 +- .local/bin/vpn | 24 +++++++++++++++ .../.mozilla/firefox/ange/user.js | 2 +- 30 files changed, 132 insertions(+), 60 deletions(-) delete mode 160000 .config/nvim/pack/plugins/opt/telescope delete mode 160000 .config/nvim/pack/plugins/opt/treesitter rename .config/nvim/pack/plugins/{opt => start}/onedark (100%) rename .config/nvim/pack/plugins/{opt => start}/plenary (100%) create mode 160000 .config/nvim/pack/plugins/start/telescope create mode 160000 .config/nvim/pack/plugins/start/treesitter create mode 160000 .local/aur/newsraft create mode 160000 .local/aur/shellcheck create mode 160000 .local/aur/sparrow create mode 100755 .local/bin/ffcapture create mode 100755 .local/bin/giteadelimg create mode 100755 .local/bin/vm create mode 100755 .local/bin/vpn diff --git a/.bash_profile b/.bash_profile index 50d0553..c16bc6f 100644 --- a/.bash_profile +++ b/.bash_profile @@ -18,6 +18,9 @@ export KUBECACHEDIR="$XDG_CACHE_HOME/kube" export PYTHON_HISTORY="$XDG_STATE_HOME/python_history" export PYTHONPYCACHEPREFIX="$XDG_CACHE_HOME/python" +export GOPATH="$XDG_DATA_HOME/go" +export GOTELEMETRY=off + export W3M_DIR="$XDG_STATE_HOME/w3m" export PATH="$HOME/.local/bin:$XDG_DATA_HOME/flatpak/exports/bin:/var/lib/flatpak/exports/bin:$PATH" @@ -31,7 +34,7 @@ export MAKEFLAGS='-j' export PASSWORD_STORE_ENABLE_EXTENSIONS=true -export DOCKER_BUILDKIT=0 # i/o timeout +export DOCKER_BUILDKIT=0 export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock" export SSH_AUTH_SOCK; SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" diff --git a/.bashrc b/.bashrc index 0af3dfb..894f63e 100644 --- a/.bashrc +++ b/.bashrc @@ -6,6 +6,7 @@ FZF_ALT_C_OPTS=--walker=dir . /usr/share/fzf/key-bindings.bash shopt -s autocd +shopt -s globstar for f in "$XDG_CONFIG_HOME/bash"/*.bash; do # shellcheck disable=SC1090 diff --git a/.config/bash/11-docker.bash b/.config/bash/11-docker.bash index 4481c2e..9aec55f 100644 --- a/.config/bash/11-docker.bash +++ b/.config/bash/11-docker.bash @@ -4,8 +4,8 @@ compalias dk='podman' \ dkcc='podman container create' \ dkci='podman container inspect' \ dkcls='podman container ls' \ - dkclsa='podman container ls -a' \ - dkclsaq='podman container ls -a -q' \ + dkclsa='podman container ls -a --external' \ + dkclsaq='podman container ls -a -q --external' \ dkclsq='podman container ls -q' \ dkcrm!='podman container rm -f' \ dkcrm='podman container rm' \ @@ -66,7 +66,7 @@ alias dc='docker-compose' \ dcupb='docker-compose up --build' \ dcupd='docker-compose up -d' \ dcupdb='docker-compose up -d --build' \ - dcw='docker-compose watch' + dcw='docker-compose up --build -w' function dkb() { local name="${1:-${PWD##*/}}"; shift diff --git a/.config/git/config b/.config/git/config index ce5a598..d130d19 100644 --- a/.config/git/config +++ b/.config/git/config @@ -30,6 +30,7 @@ ls = ls-files m = merge p = push r = remote +rso = remote show origin -n rb = rebase rev = revert rh = reset diff --git a/.config/newsraft/feeds b/.config/newsraft/feeds index b1963df..2cdf4db 100644 --- a/.config/newsraft/feeds +++ b/.config/newsraft/feeds @@ -1,9 +1,5 @@ -@ Global - @ Entertainment https://www.youtube.com/feeds/videos.xml?channel_id=UCI4W-ck8ZLA_YljxMhlpg2g "Chess Simp" -https://www.youtube.com/feeds/videos.xml?channel_id=UCdC0An4ZPNr_YiFiYoVbwaw "Daily Dose Of Internet" -https://www.youtube.com/feeds/videos.xml?channel_id=UCf-vV5woXPFpkvZKwooWoyw "WirtualTV" @ News https://archlinux.org/feeds/news/ "ArchLinux" @@ -15,17 +11,14 @@ https://suckless.org/atom.xml "suckless.org" https://tails.net/news/index.en.rss "Tails" @ Updates -https://github.com/coturn/coturn/releases.atom "Coturn" https://github.com/vector-im/element-web/releases.atom "Element" https://github.com/go-gitea/gitea/releases.atom "Gitea" https://gitea.com/gitea/act_runner/releases.rss "Act runner" https://github.com/jellyfin/jellyfin/releases.atom "Jellyfin" -https://github.com/modoboa/modoboa/releases.atom "Modoboa" https://www.getmonero.org/feed.xml "Monero" https://github.com/nextcloud/server/releases.atom "Nextcloud" https://github.com/searxng/searxng/commits/master.atom "SearXNG" https://github.com/element-hq/synapse/releases.atom "Synapse" -https://github.com/matrix-org/dendrite/releases.atom "Dendrite" https://github.com/qbittorrent/qBittorrent/tags.atom "qBittorrent" https://github.com/ventoy/Ventoy/releases.atom "Ventoy" @@ -37,4 +30,3 @@ https://github.com/flannel-io/flannel/releases.atom "flannel" https://github.com/kubernetes/ingress-nginx/releases.atom "Ingress-NGINX" https://github.com/metallb/metallb/releases.atom "MetalLB" https://github.com/kubernetes-csi/csi-driver-nfs/releases.atom "NFS" -https://github.com/rook/rook/releases.atom "Rook" diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 567eb08..e02aaa8 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -23,8 +23,6 @@ vim.g.netrw_list_hide = "\\.o$,\\.d$,\\.gc..$" vim.opt.lazyredraw = true vim.opt.complete = vim.o.complete .. ",i" -vim.loader.enable() -vim.cmd("packadd plenary") require"theme" require"pack-lspconfig" require"pack-telescope" diff --git a/.config/nvim/lua/pack-lspconfig.lua b/.config/nvim/lua/pack-lspconfig.lua index 38faef7..49b95b7 100644 --- a/.config/nvim/lua/pack-lspconfig.lua +++ b/.config/nvim/lua/pack-lspconfig.lua @@ -24,4 +24,5 @@ local on_attach = function(_, bufnr) 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 009fc76..986c12d 100644 --- a/.config/nvim/lua/pack-telescope.lua +++ b/.config/nvim/lua/pack-telescope.lua @@ -1,4 +1,3 @@ -vim.cmd("packadd telescope") require"telescope".setup { defaults = { file_ignore_patterns = { diff --git a/.config/nvim/lua/pack-treesitter.lua b/.config/nvim/lua/pack-treesitter.lua index f327c63..3b81bc8 100644 --- a/.config/nvim/lua/pack-treesitter.lua +++ b/.config/nvim/lua/pack-treesitter.lua @@ -1,8 +1,5 @@ -vim.cmd("packadd treesitter") require"nvim-treesitter.configs".setup { auto_install = true, highlight = { enable = true }, ignore_install = { "gitcommit" }, -- broken } - -vim.cmd("TSUpdate") diff --git a/.config/nvim/lua/theme.lua b/.config/nvim/lua/theme.lua index f3d85c6..d5ec374 100644 --- a/.config/nvim/lua/theme.lua +++ b/.config/nvim/lua/theme.lua @@ -1,4 +1,3 @@ -vim.cmd("packadd onedark") local theme = require"onedark" theme.setup { style = "dark", diff --git a/.config/nvim/pack/plugins/opt/telescope b/.config/nvim/pack/plugins/opt/telescope deleted file mode 160000 index 85922dd..0000000 --- a/.config/nvim/pack/plugins/opt/telescope +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 85922dde3767e01d42a08e750a773effbffaea3e diff --git a/.config/nvim/pack/plugins/opt/treesitter b/.config/nvim/pack/plugins/opt/treesitter deleted file mode 160000 index 3742701..0000000 --- a/.config/nvim/pack/plugins/opt/treesitter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 37427012d1c77c544356bfff0c9acc88fd3256bc diff --git a/.config/nvim/pack/plugins/opt/onedark b/.config/nvim/pack/plugins/start/onedark similarity index 100% rename from .config/nvim/pack/plugins/opt/onedark rename to .config/nvim/pack/plugins/start/onedark diff --git a/.config/nvim/pack/plugins/opt/plenary b/.config/nvim/pack/plugins/start/plenary similarity index 100% rename from .config/nvim/pack/plugins/opt/plenary rename to .config/nvim/pack/plugins/start/plenary diff --git a/.config/nvim/pack/plugins/start/telescope b/.config/nvim/pack/plugins/start/telescope new file mode 160000 index 0000000..2eca9ba --- /dev/null +++ b/.config/nvim/pack/plugins/start/telescope @@ -0,0 +1 @@ +Subproject commit 2eca9ba22002184ac05eddbe47a7fe2d5a384dfc diff --git a/.config/nvim/pack/plugins/start/treesitter b/.config/nvim/pack/plugins/start/treesitter new file mode 160000 index 0000000..caba7ef --- /dev/null +++ b/.config/nvim/pack/plugins/start/treesitter @@ -0,0 +1 @@ +Subproject commit caba7ef3556079dec03407bcbb290ddc688ea06e diff --git a/.config/suckless/dwm-6.5/config.h b/.config/suckless/dwm-6.5/config.h index 9e5b7d0..d33cb99 100644 --- a/.config/suckless/dwm-6.5/config.h +++ b/.config/suckless/dwm-6.5/config.h @@ -75,8 +75,8 @@ static const char *pausecmd[] = { "playerctl", "play-pause", NULL }; static const char *prevcmd[] = { "playerctl", "previous", NULL }; static const char *nextcmd[] = { "playerctl", "next", NULL }; static const char *stopcmd[] = { "playerctl", "stop", NULL }; -static const char *lbrtcmd[] = { "light", "-10", NULL }; -static const char *rbrtcmd[] = { "light", "+10", NULL }; +static const char *lbrtcmd[] = { "light", "-1", NULL }; +static const char *rbrtcmd[] = { "light", "+1", NULL }; static const char *passselectcmd[] = { "pass", "select", NULL }; static const char *passopencmd[] = { "pass", "openurl", NULL }; static const char *passusercmd[] = { "pass", "printuser", NULL }; diff --git a/.gitmodules b/.gitmodules index ed23918..1592ea4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,21 @@ -[submodule ".config/nvim/pack/plugins/opt/onedark"] - path = .config/nvim/pack/plugins/opt/onedark +[submodule ".config/nvim/pack/plugins/start/onedark"] + path = .config/nvim/pack/plugins/start/onedark url = https://github.com/navarasu/onedark.nvim -[submodule ".config/nvim/pack/plugins/opt/plenary"] - path = .config/nvim/pack/plugins/opt/plenary +[submodule ".config/nvim/pack/plugins/start/plenary"] + path = .config/nvim/pack/plugins/start/plenary url = https://github.com/nvim-lua/plenary.nvim.git -[submodule ".config/nvim/pack/plugins/opt/telescope"] - path = .config/nvim/pack/plugins/opt/telescope +[submodule ".config/nvim/pack/plugins/start/telescope"] + path = .config/nvim/pack/plugins/start/telescope url = https://github.com/nvim-telescope/telescope.nvim.git -[submodule ".config/nvim/pack/plugins/opt/treesitter"] - path = .config/nvim/pack/plugins/opt/treesitter +[submodule ".config/nvim/pack/plugins/start/treesitter"] + path = .config/nvim/pack/plugins/start/treesitter url = https://github.com/nvim-treesitter/nvim-treesitter.git +[submodule ".local/aur/newsraft"] + path = .local/aur/newsraft + url = https://aur.archlinux.org/newsraft.git +[submodule ".local/aur/shellcheck"] + path = .local/aur/shellcheck + url = https://aur.archlinux.org/shellcheck-bin.git +[submodule ".local/aur/sparrow"] + path = .local/aur/sparrow + url = https://aur.archlinux.org/sparrow-wallet.git diff --git a/.local/aur/newsraft b/.local/aur/newsraft new file mode 160000 index 0000000..d81279f --- /dev/null +++ b/.local/aur/newsraft @@ -0,0 +1 @@ +Subproject commit d81279f291f16487757a07a4d793d271a413a547 diff --git a/.local/aur/shellcheck b/.local/aur/shellcheck new file mode 160000 index 0000000..d5a870d --- /dev/null +++ b/.local/aur/shellcheck @@ -0,0 +1 @@ +Subproject commit d5a870d66bb728e17d2e70c23025b2fa11791d1a diff --git a/.local/aur/sparrow b/.local/aur/sparrow new file mode 160000 index 0000000..780401e --- /dev/null +++ b/.local/aur/sparrow @@ -0,0 +1 @@ +Subproject commit 780401ef64b381158c8c12ba5710c8c4f4dab362 diff --git a/.local/bin/ddev b/.local/bin/ddev index 61ea561..773b673 100755 --- a/.local/bin/ddev +++ b/.local/bin/ddev @@ -2,15 +2,22 @@ declare -A aliases aliases=( - [arch]=archlinux/archlinux:base - [debian]=debian:12-slim + [arch]=docker.io/archlinux/archlinux:base + [debian]=docker.io/debian:12-slim + [kaniko]=gcr.io/kaniko-project/executor:debug ) if [ -z "$1" ]; then exit 1 fi -img="${aliases[$1]:-$1:latest}"; shift +if [ -n "${aliases[$1]}" ]; then + img="${aliases[$1]}" +else + img="docker.io/$1" + [[ "$img" == *:* ]] || img+=:latest +fi +shift set -x -podman run --rm -it -v "$PWD:/mnt/" -w /mnt/ "docker.io/$img" "$@" +podman run --rm -it -v "$PWD:/mnt/" -w /mnt/ "$img" "$@" diff --git a/.local/bin/ffcapture b/.local/bin/ffcapture new file mode 100755 index 0000000..1af64b8 --- /dev/null +++ b/.local/bin/ffcapture @@ -0,0 +1,10 @@ +#!/bin/bash -e + +output="$HOME/Videos/ffcapture$(date '+%Y%m%d_%H%M%S').mp4" + +ffmpeg \ + -framerate 30 \ + -f x11grab -i "$DISPLAY.0" -c:v libx265 \ + "$output" + +# -f pulse -i # sink diff --git a/.local/bin/giteadelimg b/.local/bin/giteadelimg new file mode 100755 index 0000000..ec5a694 --- /dev/null +++ b/.local/bin/giteadelimg @@ -0,0 +1,18 @@ +#!/bin/bash + +read -rsp "PASSWD: " PASSWD; echo +read -rp "OWNER: " OWN +read -rp "NAME: " NAME + +TOK="$(jq -rR '@uri' <<< "$PASSWD")" + +API="https://ange:$TOK@git.gmoker.com/api/v1/packages" + +PKG="$(curl "$API/$OWN" | jq -r ".[] | select(.name == \"$NAME\").version")" +echo "$PKG" +read -rp "Continue?" +while read -r pkg; do + (set -x + curl -XDELETE "$API/$OWN/container/$(jq -rR '@uri' <<< "$NAME")/$pkg" + ) +done <<< "$PKG" diff --git a/.local/bin/light b/.local/bin/light index 4d04b97..7c4d56d 100755 --- a/.local/bin/light +++ b/.local/bin/light @@ -1,32 +1,18 @@ #!/bin/bash -e -function get_current() { - local cur; cur="$(cat "$1/brightness")" - local max; max="$(cat "$1/max_brightness")" +STEPS=16 +DIR="$(printf '%s\n' /sys/class/backlight/* | head -n1)" - echo "$((cur * 100 / max))" -} - -function set_light() { - local max; max="$(cat "$1/max_brightness")" - - echo "$((CUR * max / 100))" > "$1/brightness" -} - - -DIRS=(/sys/class/backlight/*) -CUR="$(get_current "${DIRS[0]}")" +CUR="$(cat "$DIR/brightness")" +MAX=$(cat "$DIR/max_brightness") case "${1:0:1}" in '') echo "$CUR"; exit ;; - '+'|'-') CUR="$(($CUR + $1 - $CUR % $1 + $CUR % $1 * 10 / $1 / 5 * $1))" ;; + '+'|'-') CUR="$(((CUR / STEPS + $1) * STEPS))" ;; *) CUR="$1" ;; esac -echo "$CUR" -[ "$CUR" -lt 0 ] && CUR=0 -[ "$CUR" -gt 100 ] && CUR=100 +[ "$CUR" -lt 0 ] && CUR=0 +[ "$CUR" -gt "$MAX" ] && CUR="$MAX" -for d in "${DIRS[@]}"; do - set_light "$d" -done +echo "$CUR" > "$DIR/brightness" diff --git a/.local/bin/sbar b/.local/bin/sbar index 1a15238..07f03ae 100755 --- a/.local/bin/sbar +++ b/.local/bin/sbar @@ -77,7 +77,7 @@ function update_net() { } function update_time() { - time="$(TZ=Asia/Jakarta date '+%R %Z') - $(TZ=Europe/Paris date '+%R %Z') - $(TZ=Asia/Makassar date '+%R %Z') - $(date -u '+%a %m-%d %R')" + time="$(TZ=Asia/Makassar date '+%R %Z') - $(date -u '+%a %m-%d %R')" } function reload() { diff --git a/.local/bin/vm b/.local/bin/vm new file mode 100755 index 0000000..951323b --- /dev/null +++ b/.local/bin/vm @@ -0,0 +1,24 @@ +#!/bin/bash -e + +ISO="$1" +DISK="$HOME/${ISO%.*}.qcow2" +MAXMEM="$(free -g | awk '/Mem:/{print $2 - 2 * $3}')G" +OVMF_CODE=/usr/share/edk2/x64/OVMF_CODE.4m.fd +OVMF_VARS=/tmp/OVMF_VARS.4m.fd + +set -x +[ -f "$OVMF_VARS" ] || cp -f /usr/share/edk2/x64/OVMF_VARS.4m.fd "$OVMF_VARS" +[ -f "$DISK" ] || qemu-img create -f qcow2 "$DISK" 20G +qemu-system-x86_64 \ + -accel kvm \ + -M q35 \ + -monitor stdio \ + -cpu host \ + -m "2G,maxmem=$MAXMEM" \ + -vga virtio \ + -audio pipewire,model=hda \ + -nic model=virtio-net-pci,type=user \ + -drive "if=pflash,format=raw,file=$OVMF_CODE,readonly=on" \ + -drive "if=pflash,format=raw,file=$OVMF_VARS" \ + -drive "if=virtio,file=$DISK" \ + -drive "file=$ISO,media=cdrom,readonly=on" diff --git a/.local/bin/vol b/.local/bin/vol index 0a2eb60..846aaa4 100755 --- a/.local/bin/vol +++ b/.local/bin/vol @@ -20,7 +20,7 @@ function update_vol() { +*|-*) CUR="$(($CUR + $1 - $CUR % $1 + $CUR % $1 * 10 / $1 / 5 * $1))" [ "$CUR" -lt 0 ] && CUR=0 - [ "$CUR" -gt 200 ] && CUR=200 + [ "$CUR" -gt 150 ] && CUR=150 ;; *) CUR="$1" diff --git a/.local/bin/vpn b/.local/bin/vpn new file mode 100755 index 0000000..9171c51 --- /dev/null +++ b/.local/bin/vpn @@ -0,0 +1,24 @@ +#!/bin/bash -e + +function off() { + local ifs + + read -ra ifs < <(wg show interfaces) || true + for i in "${ifs[@]}"; do + wg-quick down "$i" + done +} + +[ "$EUID" != 0 ] && { pkexec bash -c "DISPLAY='$DISPLAY' XAUTHORITY='$XAUTHORITY' $0 $*"; exit; } + +[ "$1" == off ] && { off; exit; } + +if [ -n "$DISPLAY" ]; then + if="$(basename -s.conf /etc/wireguard/*.conf | /usr/local/bin/dmenu)" +else + select if in $(basename -s.conf /etc/wireguard/*.conf); do + break + done +fi +off +wg-quick up "$if" diff --git a/.var/app/org.mozilla.firefox/.mozilla/firefox/ange/user.js b/.var/app/org.mozilla.firefox/.mozilla/firefox/ange/user.js index 9f13a3d..2a4295b 100644 --- a/.var/app/org.mozilla.firefox/.mozilla/firefox/ange/user.js +++ b/.var/app/org.mozilla.firefox/.mozilla/firefox/ange/user.js @@ -23,6 +23,7 @@ user_pref("identity.fxaccounts.enabled", false); user_pref("media.videocontrols.picture-in-picture.video-toggle.enabled", false); user_pref("media.webspeech.synth.dont_notify_on_error", true); user_pref("network.proxy.socks_remote_dns", true); +user_pref("privacy.fingerprintingProtection", true); user_pref("privacy.sanitize.sanitizeOnShutdown", true); user_pref("signon.rememberSignons", false); user_pref("startup.homepage_welcome_url", ""); @@ -44,4 +45,3 @@ user_pref("media.autoplay.default", 1); user_pref("privacy.clearOnShutdown_v2.cache", false); user_pref("privacy.clearOnShutdown_v2.cookiesAndStorage", true); user_pref("privacy.clearOnShutdown_v2.historyFormDataAndDownloads", false); -user_pref("privacy.clearOnShutdown_v2.siteSettings", true);