diff --git a/.config/shell/functions b/.config/shell/functions index 08999e8..80a5de5 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -5,6 +5,7 @@ alias -g ___='"$(eval "$(fc -ln -1)" | tail -n 1)"' alias -g G="| grp" alias -g X="| xargs" alias -g X1="| xargs -n 1" +alias -g L="--color=always | less" fi alias info='info --vi-keys' @@ -124,7 +125,14 @@ alias lar='last | tac' alias listen='pactl load-module module-loopback; echo "Press Enter to stop"; read; pactl unload-module module-loopback' alias browse-safe='sudo systemctl disable --now systemd-resolved && sudo rm -f /etc/resolv.conf && echo "nameserver 185.228.168.10" | sudo tee /etc/resolv.conf && sudo chattr +i /etc/resolv.conf' -alias browse-unsafe='sudo chattr -i /etc/resolv.conf && sudo mv /etc/resolv.conf /etc/resolv.conf.bak && sudo systemctl enable --now systemd-resolved && sleep 100 && browse-safe' +browse-unsafe() { + trap 'echo Browsing safe; browse-safe' INT + sudo chattr -i /etc/resolv.conf && + sudo mv /etc/resolv.conf /etc/resolv.conf.bak && + sudo systemctl enable --now systemd-resolved && + sleep 1 + browse-safe +} xo() { while test $# -gt 0; do diff --git a/.local/bin/scripts/synct b/.local/bin/scripts/synct index 3eedd42..5c75c7f 100755 --- a/.local/bin/scripts/synct +++ b/.local/bin/scripts/synct @@ -1,3 +1,9 @@ #!/bin/sh apikey=$(grep apikey $XDG_CONFIG_HOME/syncthing/config.xml | cut -d '>' -f2 | cut -d '<' -f1) curl -H 'Content-Type: application/json' -H "X-API-Key: $apikey" "http://localhost:8384/rest/$1" "${@:2}" | bat --style=numbers -l json + +# https://docs.syncthing.net/rest/db-browse-get.html +# synct 'db/browse?folder=data&levels=1' + +# https://docs.syncthing.net/rest/db-need-get.html +# synct 'db/need?folder=music' diff --git a/.local/bin/scripts/update-keyboard-layout b/.local/bin/scripts/update-keyboard-layout index 7c93a9c..fa27d93 100755 --- a/.local/bin/scripts/update-keyboard-layout +++ b/.local/bin/scripts/update-keyboard-layout @@ -12,5 +12,5 @@ xkbstate="$(dirname $(dirname $0))/xkblayout-state" test "$($xkbstate print %C)" -gt 1 && $xkbstate set $id # Swap semicolon and colon - https://unix.stackexchange.com/questions/615799/swap-semicolon-colon-to-p-unexpected-cause-semicolon-colon-affected-by-cpas-lock # test "$id" = "eu" && xmodmap -e 'keysym semicolon = colon semicolon colon semicolon' -test "$id" = "1" && xmodmap -e 'keysym semicolon = colon semicolon colon semicolon' || setxkbmap de nodeadkeys +test "$id" = "1" && setxkbmap eu && xmodmap -e 'keysym semicolon = colon semicolon colon semicolon' || setxkbmap de nodeadkeys } 2>&1 | tee -a /tmp/scripts.log