This commit is contained in:
ange 2025-07-21 13:08:28 +00:00
parent 17b03778ac
commit 5f1b118ff3
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
26 changed files with 164 additions and 160 deletions

View File

@ -3,12 +3,11 @@ export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state" export XDG_STATE_HOME="$HOME/.local/state"
export XDG_CONFIG_DIRS=/etc/xdg export XDG_CONFIG_DIRS=/etc/xdg
export XDG_DATA_DIRS="$XDG_DATA_HOME/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share" export XDG_DATA_DIRS="/usr/local/share:/usr/share"
export HISTFILE="$XDG_STATE_HOME/bash_history" export HISTFILE="$XDG_STATE_HOME/bash_history"
export HISTCONTROL=ignorespace:erasedups export HISTCONTROL=ignorespace:erasedups
export HISTSIZE=65536 export HISTSIZE=1024
export SAVEHIST=8192
export LESSHISTFILE='-' export LESSHISTFILE='-'
@ -18,12 +17,14 @@ export KUBECACHEDIR="$XDG_CACHE_HOME/kube"
export PYTHON_HISTORY="$XDG_STATE_HOME/python_history" export PYTHON_HISTORY="$XDG_STATE_HOME/python_history"
export PYTHONPYCACHEPREFIX="$XDG_CACHE_HOME/python" export PYTHONPYCACHEPREFIX="$XDG_CACHE_HOME/python"
export SQLITE_HISTORY=$XDG_STATE_HOME/sqlite_history
export GOPATH="$XDG_DATA_HOME/go" export GOPATH="$XDG_DATA_HOME/go"
export GOTELEMETRY=off export GOTELEMETRY=off
export W3M_DIR="$XDG_STATE_HOME/w3m" export W3M_DIR="$XDG_STATE_HOME/w3m"
export PATH="$HOME/.local/bin:$XDG_DATA_HOME/flatpak/exports/bin:/var/lib/flatpak/exports/bin:$PATH" export PATH="$HOME/.local/bin:$PATH"
export BROWSER=firefox export BROWSER=firefox
export EDITOR=nvim export EDITOR=nvim
@ -38,9 +39,6 @@ export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"
export SSH_AUTH_SOCK; SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" export SSH_AUTH_SOCK; SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
# shellcheck disable=SC2046
systemctl --user import-environment PATH
[ -z "$DISPLAY" ] && [ "$XDG_VTNR" = 1 ] && { [ -z "$DISPLAY" ] && [ "$XDG_VTNR" = 1 ] && {
GUILOG="$HOME/.local/state/gui.log" GUILOG="$HOME/.local/state/gui.log"

View File

@ -5,4 +5,4 @@ background = "#101010"
size = 9 size = 9
[window] [window]
opacity = 0.90 opacity = 0.9

View File

@ -1,5 +1,5 @@
_compalias() { _compalias() {
local name val valarr fn local name val valarr
name="${COMP_WORDS[0]}" name="${COMP_WORDS[0]}"
val="${BASH_ALIASES[$name]}" val="${BASH_ALIASES[$name]}"
@ -11,8 +11,8 @@ _compalias() {
COMP_LINE="${COMP_LINE//$name/$val}" COMP_LINE="${COMP_LINE//$name/$val}"
COMP_CWORD=$((${#COMP_WORDS[@]} - 1)) COMP_CWORD=$((${#COMP_WORDS[@]} - 1))
COMP_POINT="${#COMP_LINE}" COMP_POINT="${#COMP_LINE}"
fn="$(complete -p "${COMP_WORDS[0]}" | grep -Po -- '-F\s+\K\w+')" $(complete -p "${COMP_WORDS[0]}" | grep -Po -- '-F\s+\K\w+') \
"$fn" "${COMP_WORDS[0]}" "${COMP_WORDS[-1]}" "${COMP_WORDS[-2]}" "${COMP_WORDS[0]}" "${COMP_WORDS[-1]}" "${COMP_WORDS[-2]}"
} }
compalias() { compalias() {

View File

@ -14,7 +14,9 @@ am() {
if mount | grep -q "$name"; then if mount | grep -q "$name"; then
umount "$name" umount "$name"
else else
cd -- "$(udisksctl mount -b "$name" | awk '{print $NF}')" (cd -- "$(udisksctl mount -b "$name" | awk '{print $NF}')"
bash
)
return return
fi fi
break break
@ -47,7 +49,7 @@ md2html() {
update() { update() {
$TERM --hold -e "$SHELL" -xc "sudo pacman -Syu && echo $'\e[32mDONE'" & $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'" & $TERM --hold -e "$SHELL" -xc "git --git-dir='$HOME/.dotfiles/' --work-tree='$HOME' submodule update --remote && echo $'\e[32mDONE'" &
} }
tmp() { tmp() {
@ -82,6 +84,7 @@ alias -- \
...='../..' \ ...='../..' \
c='git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"' \ c='git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"' \
cp='cp -vi' \ cp='cp -vi' \
df='df -x efivarfs -x tmpfs' \
diff='diff --color' \ diff='diff --color' \
feh='feh --auto-zoom --scale-down' \ feh='feh --auto-zoom --scale-down' \
g=git \ g=git \
@ -93,13 +96,12 @@ alias -- \
ls='ls --color' \ ls='ls --color' \
mail=aerc \ mail=aerc \
mkdir='mkdir -v' \ mkdir='mkdir -v' \
mkisofs='xorriso -as mkisofs -iso-level 3 -full-iso9660-filenames -joliet -joliet-long -rational-rock -output' \
mv='mv -vi' \ mv='mv -vi' \
neofetch=fastfetch \
qcp='qcp -o tabsize=4' \ qcp='qcp -o tabsize=4' \
qmv='qmv -o tabsize=4' \ qmv='qmv -o tabsize=4' \
rm='rm -vI' \ rm='rm -vI' \
rss=newsraft \ rss=newsraft \
rsync='rsync -P' \
ssh='TERM=xterm-256color ssh' \ ssh='TERM=xterm-256color ssh' \
sudo='sudo ' \ sudo='sudo ' \
vi='$EDITOR' \ vi='$EDITOR' \

View File

@ -1,9 +1,11 @@
# vim: tabstop=8 nowrap # vim: tabstop=8 nowrap
# TODO # TODO
https://www.themoviedb.org/person/86543-david-attenborough
https://www.service-public.fr/particuliers/vosdroits/R65687
https://wiki.archlinux.org/title/Systemd#systemd.mount_-_mounting
https://anubis.techaro.lol/docs/admin/installation https://anubis.techaro.lol/docs/admin/installation
https://tech.yahoo.com/articles/mozilla-vpns-per-controls-too-182238290.html https://tech.yahoo.com/articles/mozilla-vpns-per-controls-too-182238290.html
https://help.gnome.org/users/zenity/stable/notification.html.en
https://www.grepular.com/Automatically_Encrypting_all_Incoming_Email https://www.grepular.com/Automatically_Encrypting_all_Incoming_Email
https://www.grepular.com/Protecting_a_Laptop_from_Simple_and_Sophisticated_Attacks https://www.grepular.com/Protecting_a_Laptop_from_Simple_and_Sophisticated_Attacks

View File

@ -1,8 +0,0 @@
[general]
temp-day=5000
temp-night=3500
location-provider=manual
[manual]
lat=-8.65
lon=115

View File

@ -1,2 +0,0 @@
[Settings]
gtk-theme-name = Materia-dark

View File

@ -1 +0,0 @@
map D delete

View File

@ -67,5 +67,8 @@ video/ogg=mpv.desktop
video/quicktime=mpv.desktop video/quicktime=mpv.desktop
video/webm=mpv.desktop video/webm=mpv.desktop
# nvim
inode/directory=nvim.desktop
# zathura # zathura
application/pdf=org.pwmt.zathura-pdf-poppler.desktop application/pdf=org.pwmt.zathura-pdf-poppler.desktop

View File

@ -7,22 +7,15 @@ https://suckless.org/atom.xml "su
https://tails.net/news/index.en.rss "Tails" https://tails.net/news/index.en.rss "Tails"
@ Updates @ Updates
https://gitea.com/gitea/act_runner/releases.rss "Act runner" https://gitea.com/gitea/act_runner/releases.rss "Act runner"
https://github.com/arkenfox/user.js/releases.atom "arkenfox" https://github.com/arkenfox/user.js/releases.atom "arkenfox"
https://github.com/vector-im/element-web/releases.atom "Element" < item-rule "title NOT LIKE '%-rc._'"
https://github.com/go-gitea/gitea/releases.atom "Gitea" < item-rule "title NOT LIKE '%-rc_' AND title NOT LIKE '%-dev%'"
https://github.com/jellyfin/jellyfin/releases.atom "Jellyfin"
https://www.getmonero.org/feed.xml "Monero" < item-rule "title NOT LIKE 'Monero GUI%released'"
https://github.com/nextcloud/server/releases.atom "Nextcloud" < item-rule "title NOT LIKE '%rc_' AND title NOT LIKE '%beta_'"
https://github.com/qbittorrent/qBittorrent/tags.atom "qBittorrent" < item-rule "title NOT LIKE '%rc_' AND title NOT LIKE '%beta_'"
https://github.com/searxng/searxng/commits/master.atom "SearXNG"
https://github.com/element-hq/synapse/releases.atom "Synapse" < item-rule "title NOT LIKE '%rc%'"
https://github.com/ventoy/Ventoy/releases.atom "Ventoy"
@ K8S
https://github.com/kubernetes/kubernetes/releases.atom "Kubernetes" < item-rule "title NOT LIKE '%-rc._' AND title NOT LIKE '%-alpha._' AND title NOT LIKE '%-beta._'"
https://github.com/cert-manager/cert-manager/releases.atom "cert-manager" < item-rule "title NOT LIKE 'cmd/ctl/%' AND title NOT LIKE '%-alpha._' AND title NOT LIKE '%-beta._'" https://github.com/cert-manager/cert-manager/releases.atom "cert-manager" < item-rule "title NOT LIKE 'cmd/ctl/%' AND title NOT LIKE '%-alpha._' AND title NOT LIKE '%-beta._'"
https://github.com/cloudnative-pg/cloudnative-pg/releases.atom "CloudNativePG" < item-rule "title NOT LIKE '%-rc_'" https://github.com/cloudnative-pg/cloudnative-pg/releases.atom "CloudNativePG" < item-rule "title NOT LIKE '%-rc_'"
https://github.com/flannel-io/flannel/releases.atom "flannel" https://github.com/go-gitea/gitea/releases.atom "Gitea" < item-rule "title NOT LIKE '%-rc_' AND title NOT LIKE '%-dev%'"
https://github.com/jellyfin/jellyfin/releases.atom "Jellyfin"
https://github.com/kubernetes/ingress-nginx/releases.atom "Ingress-NGINX" < item-rule "title LIKE 'controller-%' AND title NOT LIKE '%-beta._'" https://github.com/kubernetes/ingress-nginx/releases.atom "Ingress-NGINX" < item-rule "title LIKE 'controller-%' AND title NOT LIKE '%-beta._'"
https://github.com/metallb/metallb/releases.atom "MetalLB" < item-rule "title NOT LIKE 'metallb-chart-%'" https://github.com/nextcloud/server/releases.atom "Nextcloud" < item-rule "title NOT LIKE '%rc_' AND title NOT LIKE '%beta_'"
https://github.com/kubernetes-csi/csi-driver-nfs/releases.atom "NFS" https://github.com/qbittorrent/qBittorrent/tags.atom "qBittorrent" < item-rule "title NOT LIKE '%rc_' AND title NOT LIKE '%beta_'"
https://github.com/searxng/searxng/commits/master.atom "SearXNG"
https://github.com/ventoy/Ventoy/releases.atom "Ventoy"
https://www.getmonero.org/feed.xml "Monero" < item-rule "title NOT LIKE 'Monero GUI%released'"

View File

@ -1,3 +1,3 @@
vim.opt_local.shiftwidth = 2 vim.opt_local.shiftwidth = 2
vim.opt_local.tabstop = 2 vim.opt_local.tabstop = 2
vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ " vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ "

View File

@ -1 +1,3 @@
vim.opt_local.spell = true vim.opt_local.spell = true
vim.opt_local.textwidth = 79
vim.opt_local.linebreak = true

View File

@ -1,6 +1,6 @@
vim.opt_local.shiftwidth = 2 vim.opt_local.shiftwidth = 2
vim.opt_local.tabstop = 2 vim.opt_local.tabstop = 2
vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ " vim.opt_local.listchars = vim.o.listchars .. ",leadmultispace:│ "
vim.opt_local.spell = true vim.opt_local.spell = true

View File

@ -3,7 +3,7 @@ vim.opt.expandtab = true
vim.opt.smartindent = true vim.opt.smartindent = true
vim.opt.shiftwidth = 0 vim.opt.shiftwidth = 0
vim.opt.tabstop = 4 vim.opt.tabstop = 4
vim.opt.cino = "(s" vim.opt.cinoptions = "(s"
vim.g.python_indent = { open_paren = "shiftwidth()" } vim.g.python_indent = { open_paren = "shiftwidth()" }
vim.opt.list = true vim.opt.list = true
vim.opt.listchars = { vim.opt.listchars = {
@ -26,7 +26,6 @@ vim.g.netrw_banner = 0
vim.opt.lazyredraw = true vim.opt.lazyredraw = true
vim.opt.complete = vim.o.complete .. ",i" vim.opt.complete = vim.o.complete .. ",i"
vim.opt.hlsearch = false vim.opt.hlsearch = false
vim.opt.linebreak = true
vim.g.go_recommended_style = 0 vim.g.go_recommended_style = 0
@ -37,6 +36,15 @@ require"pack-treesitter"
vim.keymap.set("n", "<Leader>e", "<cmd>.w !$SHELL<CR>") vim.keymap.set("n", "<Leader>e", "<cmd>.w !$SHELL<CR>")
vim.keymap.set("n", "<Leader>s", "<cmd>%s/\\s\\+$//e<CR>") vim.keymap.set("n", "<Leader>s", "<cmd>%s/\\s\\+$//e<CR>")
vim.keymap.set("n", "<Leader>h", function()
vim.opt.cmdheight = 0
vim.opt.colorcolumn = ""
vim.opt.laststatus = 0
vim.opt.listchars = {}
vim.opt.number = false
vim.opt.relativenumber = false
vim.lsp.stop_client(vim.lsp.get_clients())
end)
vim.keymap.set("v", "<Leader>t", function() vim.keymap.set("v", "<Leader>t", function()
local sep = string.char(vim.fn.getchar()) local sep = string.char(vim.fn.getchar())

View File

@ -55,36 +55,35 @@ static const Layout layouts[] = {
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
#define CMD(...) {__VA_ARGS__, NULL}
/* commands */ /* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static const char *dmenucmd[] = CMD("dmenu_run", "-i", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4);
static const char *dmenucmd[] = { "dmenu_run", "-i", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; static const char *termcmd[] = CMD("alacritty");
static const char *termcmd[] = { "alacritty", NULL }; static const char *lockcmd[] = CMD("lock");
static const char *lockcmd[] = { "lock", NULL }; static const char *wwwcmd[] = CMD("bookmarks");
static const char *wwwcmd[] = { "bookmarks", NULL }; static const char *pwwwcmd[] = CMD("bookmarks", "-p");
static const char *pwwwcmd[] = { "bookmarks", "-p", NULL }; static const char *calccmd[] = CMD("alacritty", "-epython");
static const char *calccmd[] = { "alacritty", "-epython", NULL }; static const char *prtsccmd[] = CMD("sh", "-c", "magick import png:- | xclip -sel c -t image/png && xclip -sel c -o | feh -");
static const char *fmcmd[] = { "pcmanfm", NULL }; static const char *spkdefcmd[] = CMD("wpdef", "s");
static const char *prtsccmd[] = { "sh", "-c", "magick import png:- | xclip -sel c -t image/png && xclip -sel c -o | feh -", NULL }; static const char *spklcmd[] = CMD("vol", "s", "-5");
static const char *spkdefcmd[] = { "wpdef", "s", NULL }; static const char *spkrcmd[] = CMD("vol", "s", "+5");
static const char *spklcmd[] = { "vol", "s", "-5", NULL }; static const char *spkmutecmd[] = CMD("vol", "s", "m");
static const char *spkrcmd[] = { "vol", "s", "+5", NULL }; static const char *micdefcmd[] = CMD("wpdef", "m");
static const char *spkmutecmd[] = { "vol", "s", "m", NULL }; static const char *miclcmd[] = CMD("vol", "m", "-5");
static const char *micdefcmd[] = { "wpdef", "m", NULL }; static const char *micrcmd[] = CMD("vol", "m", "+5");
static const char *miclcmd[] = { "vol", "m", "-5", NULL }; static const char *micmutecmd[] = CMD("vol", "m", "m");
static const char *micrcmd[] = { "vol", "m", "+5", NULL }; static const char *pausecmd[] = CMD("playerctl", "play-pause");
static const char *micmutecmd[] = { "vol", "m", "m", NULL }; static const char *prevcmd[] = CMD("playerctl", "previous");
static const char *pausecmd[] = { "playerctl", "play-pause", NULL }; static const char *nextcmd[] = CMD("playerctl", "next");
static const char *prevcmd[] = { "playerctl", "previous", NULL }; static const char *stopcmd[] = CMD("playerctl", "stop");
static const char *nextcmd[] = { "playerctl", "next", NULL }; static const char *lbrtcmd[] = CMD("light", "-1");
static const char *stopcmd[] = { "playerctl", "stop", NULL }; static const char *rbrtcmd[] = CMD("light", "+1");
static const char *lbrtcmd[] = { "light", "-1", NULL }; static const char *passselectcmd[] = CMD("nohup", "pass", "select");
static const char *rbrtcmd[] = { "light", "+1", NULL }; static const char *passopencmd[] = CMD("pass", "openurl");
static const char *passselectcmd[] = { "nohup", "pass", "select", NULL }; static const char *passusercmd[] = CMD("pass", "printuser");
static const char *passopencmd[] = { "nohup", "pass", "openurl", NULL }; static const char *passpasscmd[] = CMD("pass", "printpass");
static const char *passusercmd[] = { "nohup", "pass", "printuser", NULL }; static const char *passotpcmd[] = CMD("pass", "printotp");
static const char *passpasscmd[] = { "nohup", "pass", "printpass", NULL };
static const char *passotpcmd[] = { "nohup", "pass", "printotp", NULL };
static const char *reloadbarcmd[] = { "sh", "-c", "kill -34 \"$(cat \"$HOME/.cache/pidofbar\")\"", NULL};
static const Key keys[] = { static const Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
@ -94,7 +93,6 @@ static const Key keys[] = {
{ MODKEY, XK_b, spawn, {.v = wwwcmd } }, { MODKEY, XK_b, spawn, {.v = wwwcmd } },
{ MODKEY|ShiftMask, XK_b, spawn, {.v = pwwwcmd } }, { MODKEY|ShiftMask, XK_b, spawn, {.v = pwwwcmd } },
{ 0, XF86XK_Calculator, spawn, {.v = calccmd } }, { 0, XF86XK_Calculator, spawn, {.v = calccmd } },
{ MODKEY, XK_e, spawn, {.v = fmcmd } },
{ 0, XK_Print, spawn, {.v = prtsccmd } }, { 0, XK_Print, spawn, {.v = prtsccmd } },
{ MODKEY, XK_v, spawn, {.v = spkdefcmd } }, { MODKEY, XK_v, spawn, {.v = spkdefcmd } },
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = spklcmd } }, { 0, XF86XK_AudioLowerVolume, spawn, {.v = spklcmd } },
@ -150,5 +148,4 @@ static const Button buttons[] = {
{ ClkClientWin, MODKEY, Button1, movemouse, {0} }, { ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} }, { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} }, { ClkTagBar, 0, Button1, view, {0} },
{ ClkStatusText, 0, Button1, spawn, {.v = reloadbarcmd } },
}; };

View File

@ -1649,8 +1649,6 @@ spawn(const Arg *arg)
{ {
struct sigaction sa; struct sigaction sa;
if (arg->v == dmenucmd)
dmenumon[0] = '0' + selmon->num;
if (fork() == 0) { if (fork() == 0) {
if (dpy) if (dpy)
close(ConnectionNumber(dpy)); close(ConnectionNumber(dpy));

@ -1 +1 @@
Subproject commit c819ff1192867d5d1c9927d2995fb65c4e5c4a58 Subproject commit c45589c02c50d8be0539653769e96e80ca28c0af

View File

@ -1,10 +1,8 @@
#!/bin/bash #!/bin/bash
sites=( sites=(
'https://chat.mistral.ai'
'https://discord.com' 'https://discord.com'
'https://gmoker.com' 'https://gmoker.com'
'https://login.microsoftonline.com'
'https://maby.dev' 'https://maby.dev'
'https://web.whatsapp.com' 'https://web.whatsapp.com'
) )

View File

@ -1,10 +1,10 @@
#!/bin/bash -e #!/bin/bash -e
STEPS=16 FILE=/sys/class/backlight/amdgpu_bl1/brightness
DIR="$(find /sys/class/backlight/* -print -quit)" STEPS=7196
MAX=64764
CUR="$(cat "$DIR/brightness")" CUR="$(< "$FILE")"
MAX=$(cat "$DIR/max_brightness")
case "$1" in case "$1" in
+*|-*) CUR=$(((++CUR / STEPS + $1) * STEPS)) ;; +*|-*) CUR=$(((++CUR / STEPS + $1) * STEPS)) ;;
@ -18,4 +18,4 @@ elif [ "$CUR" -gt "$MAX" ]; then
CUR="$MAX" CUR="$MAX"
fi fi
echo "$CUR" > "$DIR/brightness" echo "$CUR" > "$FILE"

25
.local/bin/mullvad_update Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash -e
{ read -r AN; read -r PRV; } < <(pass mullvad | sed -n '1p; s/^Privkey:\s*//p')
ADDRESS="$(curl 'https://api.mullvad.net/wg/' \
-d "account=$AN" --data-urlencode "pubkey=$(wg pubkey <<< "$PRV")")"
j="$(curl 'https://api.mullvad.net/app/v1/relays/')"
q='.wireguard.relays[] | "\(.hostname) \(.ipv4_addr_in) \(.public_key)"'
DNS="$(jq -r '.wireguard.ipv4_gateway' <<< "$j")"
while read -r file endpoint pubkey; do
cat <<EOF > "$file.conf"
[Interface]
PrivateKey = $PRV
Address = $ADDRESS
DNS = $DNS
[Peer]
PublicKey = $pubkey
AllowedIPs = 0.0.0.0/0,::0/0
Endpoint = $endpoint:51820
EOF
done < <(jq -r "$q" <<< "$j")

View File

@ -7,15 +7,15 @@ scrypto() {
} }
scpu() { scpu() {
echo " $(awk '{print $1}' /proc/loadavg)" > cpu awk '{print " "$1}' /proc/loadavg > cpu
} }
smemory() { smemory() {
echo " $(free -h | awk '/^Mem:/{print $3}')" > memory free -h | awk '/^Mem:/{print " "$3}' > memory
} }
sbat() { sbat() {
local cap; cap="$(cat /sys/class/power_supply/BAT0/capacity)" local cap; cap="$(< /sys/class/power_supply/BAT0/capacity)"
if grep -qv Discharging /sys/class/power_supply/BAT0/status; then if grep -qv Discharging /sys/class/power_supply/BAT0/status; then
echo " $cap%" echo " $cap%"
@ -25,7 +25,7 @@ sbat() {
} }
svol() { svol() {
local st v m vol=('' ' ') local st i v m vol=('' ' ')
mapfile -t st <<< "$(wpctl status | sed -n 's/.*\*.*\[vol: \(.*\)]/\1/p')" mapfile -t st <<< "$(wpctl status | sed -n 's/.*\*.*\[vol: \(.*\)]/\1/p')"
for i in "${!vol[@]}"; do for i in "${!vol[@]}"; do
@ -34,32 +34,27 @@ svol() {
break break
fi fi
v="${vol[$i]} $((10#${v/./}))" v="${vol[$i]} $((10#${v/./}))"
if [ -n "$m" ]; then echo -n "${v//?/&${m:+$'\U0336'}}"
echo -n "${v//?/&$'\U0336'}"
else
echo -n "$v"
fi
done > vol done > vol
} }
snet() { snet() {
local dev j ssid sig local if sig
dev="$(ip route | grep -oP 'default.*dev\s+\K[^\s]+')" mapfile -t if < <(networkctl --json=short | jq -r '.Interfaces[] | select(.Routes) | select(.Routes[].Gateway) | .Type, .Name, .SSID')
j="$(networkctl status "$dev" --json=short)" case "${if[0]}" in
case "$(jq -r .Type <<< "$j")" in
ether) ether)
echo "🌐 $dev" echo "🌐 ${if[1]}"
;; ;;
wlan) wlan)
ssid="$(jq -r .SSID <<< "$j")" sig="$(awk "/${if[1]}/{printf \"%.0f\", \$3}" /proc/net/wireless)"
sig="$(awk "/$dev/{printf \"%.0f\", \$3}" /proc/net/wireless)" if [ "$sig" -gt 56 ]; then sig='▂▄▆█'
if [ "$sig" -gt 56 ]; then echo "▂▄▆█ $ssid" elif [ "$sig" -gt 38 ]; then sig='▂▄▆_'
elif [ "$sig" -gt 38 ]; then echo "▂▄▆_ $ssid" elif [ "$sig" -gt 21 ]; then sig='▂▄__'
elif [ "$sig" -gt 21 ]; then echo "▂▄__ $ssid" elif [ "$sig" -gt 3 ]; then sig='▂___'
elif [ "$sig" -gt 3 ]; then echo "▂___ $ssid" else sig='____'
else echo "____ $ssid"
fi fi
echo "$sig ${if[2]}"
;; ;;
*) *)
echo '⚠' echo '⚠'
@ -68,33 +63,33 @@ snet() {
} }
svpn() { svpn() {
local v; v="$(ip -br link show type wireguard | awk '{print $1}')" ip -br link show type wireguard | awk '{print " 🔒 "$1}' > vpn
if [ -n "$v" ]; then
echo " 🔒 $v"
fi > vpn
} }
stz() { _tz() {
local tmp ip; ip="$(ip route | grep -oP '^default.*src\s+\K[^\s]+')" local j if f="$XDG_CACHE_HOME/tz"
if ! [ -s tz ] || [ "$ip" != "$(cat ip)" ]; then mapfile -t if < <(ip -j route show default | jq -r '.[] | .prefsrc, .dev')
tmp="$(curl -s --interface wlan0 'https://ipapi.co/timezone')" \ if ! [ -s "$f" ] || [ "${if[0]}" != "$(< ip)" ]; then
&& echo "$tmp" > tz echo "${if[0]}" > ip
echo "$ip" > ip if j="$(curl -s 'https://ipapi.co/json')"; then
jq -r '.timezone, "\(.latitude):\(.longitude)"' <<< "$j" > "$f"
head -1 "$f"
fi
else
head -1 "$f"
fi fi
} }
stime() { stime() {
TZ="$(cat tz)" date '+%a %m-%d %R%:::z' > 'time' TZ="$(_tz)" date '+%a %m-%d %R%:::z' > 'time'
} }
display() { display() {
declare -A v
for f in *; do for f in *; do
local - "$f"="$(cat "$f")" v[$f]=$(< "$f")
done done
# shellcheck disable=SC2154 xsetroot -name "${v[crypto]} | ${v[cpu]} | ${v[memory]} | ${v[vol]} | ${v[net]}${v[vpn]} | ${v[bat]} | ${v[time]}"
xsetroot -name "$crypto | $cpu | $memory | $vol | $net$vpn | $bat | $time"
} }
trap "kill 0" INT trap "kill 0" INT
@ -102,13 +97,13 @@ trap "kill 0" INT
mkdir -p "$XDG_RUNTIME_DIR/sbar" mkdir -p "$XDG_RUNTIME_DIR/sbar"
cd "$XDG_RUNTIME_DIR/sbar" || exit 1 cd "$XDG_RUNTIME_DIR/sbar" || exit 1
(while :; do while :; do
scrypto scrypto
stz
sleep 300 sleep 300
done &) done &
(while :; do touch ip
while :; do
scpu scpu
smemory smemory
sbat sbat
@ -117,8 +112,8 @@ done &)
svpn svpn
stime stime
display display
sleep $((5 - $(date '+%S') % 5)) sleep $((5 - 10#$(date '+%S') % 5))
done &) done &
while read -r _ _ f; do while read -r _ _ f; do
"s$f" "s$f"

View File

@ -1,16 +1,13 @@
#!/bin/bash -eu #!/bin/bash -eu
getmaxram() {
local ram; ram="$(free -g | awk '/^Mem:/{print $2 - 2}')"
if [ "$ram" -le 2 ]; then ram=2
elif [ "$ram" -gt 32 ]; then ram=32; fi
echo "${ram}G"
}
ISO="$1"; shift ISO="$1"; shift
DISK="$HOME/${ISO%.*}.qcow2" DISK="$HOME/${ISO%.*}.qcow2"
MAXMEM="$(getmaxram)" RAM="$(free -g | awk '/^Mem:/{t=$2 / 2; print(t < 2 ? 2 : t)"G"}')"
if ! [ -f "$ISO" ]; then
echo "$ISO does not exist" >&2
exit 1
fi
if ! [ -f "$DISK" ]; then (set -x if ! [ -f "$DISK" ]; then (set -x
qemu-img create -f qcow2 "$DISK" 64G qemu-img create -f qcow2 "$DISK" 64G
@ -21,13 +18,13 @@ qemu-system-x86_64 \
-M q35 \ -M q35 \
-bios /usr/share/edk2/x64/OVMF.4m.fd \ -bios /usr/share/edk2/x64/OVMF.4m.fd \
-monitor stdio \ -monitor stdio \
-cpu host \ -smp "$(nproc --ignore 4)" \
-m "2G,maxmem=$MAXMEM" \ -m "$RAM" \
-vga virtio \ -vga virtio \
-audio pipewire,model=hda \ -audio pipewire,model=hda \
-nic model=virtio-net-pci,type=user \ -nic model=virtio-net-pci,type=user \
-device qemu-xhci \ -device qemu-xhci \
-object "memory-backend-ram,id=mem,size=2G,share=on" \ -object "memory-backend-ram,id=mem,size=$RAM,share=on" \
-numa node,memdev=mem \ -numa node,memdev=mem \
-drive "if=virtio,file=$DISK" \ -drive "if=virtio,file=$DISK" \
-drive "file=$ISO,media=cdrom,readonly=on" \ -drive "file=$ISO,media=cdrom,readonly=on" \

View File

@ -21,8 +21,10 @@ if [ "$1" != off ]; then
CMD=( CMD=(
"basename -s.conf '/etc/wireguard/$1'*.conf > '$d/1'" "basename -s.conf '/etc/wireguard/$1'*.conf > '$d/1'"
"inotifywait -e close_write '$d/2'" "inotifywait -e close_write '$d/2'"
"up=\"\$(cat '$d/2')\""
"[ -z \"\$up\" ] && exit"
"${CMD[@]}" "${CMD[@]}"
"wg-quick up \"\$(cat '$d/2')\"" "wg-quick up \"\$up\""
) )
fi fi

View File

@ -24,13 +24,8 @@ case "$1" in
*) exit 1 ;; *) exit 1 ;;
esac esac
dev="$(getdev "${CLASS,,}")" read -r id <<< "$(getdevs "$CLASS" | sed "s/^\($(getdev "${CLASS,,}")\)$/* \1/" | dmenu -l 16 | sed 's/* //')"
if [ -n "$dev" ]; then if [ -n "$id" ]; then
devs="$(getdevs "$CLASS" | grep -v "$dev")"$'\n'"* $dev" wpctl set-default "$id"
else touch "$XDG_RUNTIME_DIR/sbar/vol"
devs="$(getdevs "$CLASS")"
fi fi
read -r id <<< "$(dmenu -l 16 <<< "$devs" | sed 's/*//')"
wpctl set-default "$id"
touch "$XDG_RUNTIME_DIR/sbar/vol"

View File

@ -1255,7 +1255,7 @@ user_pref("browser.startup.page", 3);
user_pref("browser.tabs.hoverPreview.showThumbnails", false); user_pref("browser.tabs.hoverPreview.showThumbnails", false);
user_pref("browser.tabs.inTitlebar", 0); user_pref("browser.tabs.inTitlebar", 0);
user_pref("browser.toolbars.bookmarks.visibility", "never"); 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\",\"unified-extensions-button\"],\"toolbar-menubar\":[\"menubar-items\"],\"TabsToolbar\":[\"tabbrowser-tabs\"]},\"currentVersion\":21}"); user_pref("browser.uiCustomization.state", "{\"placements\":{\"nav-bar\":[\"back-button\",\"forward-button\",\"stop-reload-button\",\"urlbar-container\",\"downloads-button\",\"unified-extensions-button\"],\"toolbar-menubar\":[\"menubar-items\"],\"TabsToolbar\":[\"tabbrowser-tabs\"]},\"currentVersion\":22}");
user_pref("browser.urlbar.suggest.openpage", false); user_pref("browser.urlbar.suggest.openpage", false);
user_pref("browser.urlbar.suggest.topsites", false); user_pref("browser.urlbar.suggest.topsites", false);
user_pref("browser.zoom.siteSpecific", false); user_pref("browser.zoom.siteSpecific", false);
@ -1275,7 +1275,7 @@ user_pref("privacy.clearHistory.historyFormDataAndDownloads", true);
user_pref("privacy.clearOnShutdown_v2.browsingHistoryAndDownloads", false); user_pref("privacy.clearOnShutdown_v2.browsingHistoryAndDownloads", false);
user_pref("privacy.clearOnShutdown_v2.cache", false); user_pref("privacy.clearOnShutdown_v2.cache", false);
user_pref("privacy.clearOnShutdown_v2.cookiesAndStorage", true); user_pref("privacy.clearOnShutdown_v2.cookiesAndStorage", true);
user_pref("privacy.clearOnShutdown_v2.downloads", false); user_pref("privacy.clearOnShutdown_v2.downloads", true);
user_pref("privacy.clearOnShutdown_v2.formdata", true); user_pref("privacy.clearOnShutdown_v2.formdata", true);
user_pref("privacy.clearOnShutdown_v2.historyFormDataAndDownloads", false); user_pref("privacy.clearOnShutdown_v2.historyFormDataAndDownloads", false);
user_pref("privacy.clearOnShutdown_v2.siteSettings", true); user_pref("privacy.clearOnShutdown_v2.siteSettings", true);

View File

@ -3,16 +3,16 @@
dbus-update-activation-environment --systemd DISPLAY XAUTHORITY dbus-update-activation-environment --systemd DISPLAY XAUTHORITY
# startup # startup
xss-lock -n "feh --fullscreen '$XDG_CONFIG_HOME/wallpapers/lock.png'" -- lock & xss-lock -l lock &
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 || # arch /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 || # arch
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 || # debian /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 || # debian
/usr/libexec/polkit-gnome-authentication-agent-1 & # fedora /usr/libexec/polkit-gnome-authentication-agent-1 & # fedora
picom & picom &
gammastep &
sbar & sbar &
gammastep -t 5000:3500 \
-l "$(tail -1 "$XDG_CACHE_HOME/tz" 2> /dev/null || echo 0:0)" &
xset s 600 15 xset dpms 600 600 600
xset dpms 616 616 616
wallpaper wallpaper