big update

This commit is contained in:
ange 2024-12-27 11:43:30 +00:00
parent 833e967aee
commit 72c73f9b18
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
30 changed files with 132 additions and 60 deletions

View File

@ -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)"

View File

@ -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

View File

@ -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

View File

@ -30,6 +30,7 @@ ls = ls-files
m = merge
p = push
r = remote
rso = remote show origin -n
rb = rebase
rev = revert
rh = reset

View File

@ -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"

View File

@ -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"

View File

@ -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 }

View File

@ -1,4 +1,3 @@
vim.cmd("packadd telescope")
require"telescope".setup {
defaults = {
file_ignore_patterns = {

View File

@ -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")

View File

@ -1,4 +1,3 @@
vim.cmd("packadd onedark")
local theme = require"onedark"
theme.setup {
style = "dark",

@ -1 +0,0 @@
Subproject commit 85922dde3767e01d42a08e750a773effbffaea3e

@ -1 +0,0 @@
Subproject commit 37427012d1c77c544356bfff0c9acc88fd3256bc

@ -0,0 +1 @@
Subproject commit 2eca9ba22002184ac05eddbe47a7fe2d5a384dfc

@ -0,0 +1 @@
Subproject commit caba7ef3556079dec03407bcbb290ddc688ea06e

View File

@ -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 };

25
.gitmodules vendored
View File

@ -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

1
.local/aur/newsraft Submodule

@ -0,0 +1 @@
Subproject commit d81279f291f16487757a07a4d793d271a413a547

1
.local/aur/shellcheck Submodule

@ -0,0 +1 @@
Subproject commit d5a870d66bb728e17d2e70c23025b2fa11791d1a

1
.local/aur/sparrow Submodule

@ -0,0 +1 @@
Subproject commit 780401ef64b381158c8c12ba5710c8c4f4dab362

View File

@ -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" "$@"

10
.local/bin/ffcapture Executable file
View File

@ -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

18
.local/bin/giteadelimg Executable file
View File

@ -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"

View File

@ -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"

View File

@ -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() {

24
.local/bin/vm Executable file
View File

@ -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"

View File

@ -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"

24
.local/bin/vpn Executable file
View File

@ -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"

View File

@ -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);