diff --git a/.local/bin/scripts/clean b/.local/bin/scripts/clean index 4c92427..611994b 100755 --- a/.local/bin/scripts/clean +++ b/.local/bin/scripts/clean @@ -89,11 +89,14 @@ if [[ $1 =~ "o" ]]; then fi sudo rm -rf "$XDG_DATA_HOME/baloo" - docker image prune + # https://www.cyberciti.biz/faq/delete-remove-orphaned-unused-packages-arch-linux-pacman-command/ + which pacman &>/dev/null && + pacman -Qqdt | sudo pacman -Rsu - which yay &>/dev/null && yay -Sc --noconfirm nix-collect-garbage -d 2>/dev/null && nix-store --optimize + docker image prune fi df --output="source,avail" -h $(test -n "$local" && echo ".") "$dir" diff --git a/.local/bin/scripts/ds b/.local/bin/scripts/ds index d89dc7c..0540b76 100755 --- a/.local/bin/scripts/ds +++ b/.local/bin/scripts/ds @@ -2,7 +2,8 @@ # [d]isk [s]ize usage and partition overview # For an accurate usage percentage add "f" as argument which uses "df" if test "$1" = "f" - then df -B1M -x tmpfs -x devtmpfs -x squashfs | awk -v a="\033[31m" -v b="\033[33m" -v c="\033[35m" -v n="\033[0m" 'NR==1 {printf "%-20s %6s %7s %9s %s\n",$1,$5,$3,$4,$6} NR>1 {u=strtonum($5); printf (u > 99) ? a : (u > 97) ? b : (u > 94) ? c : ""; printf "%-20s %6s %6.1fG %8.1fG %s\n",$1,$5,$3/1024,$4/1024,$6; printf n}' + then df -B1M -x tmpfs -x devtmpfs -x squashfs -x overlay | + awk -v a="\033[31m" -v b="\033[33m" -v c="\033[35m" -v n="\033[0m" 'NR==1 {printf "%-20s %6s %7s %9s %s\n",$1,$5,$3,$4,$6} NR>1 {u=$5; printf (u > 99) ? a : (u > 97) ? b : (u > 94) ? c : ""; printf "%-20s %6s %6.1fG %8.1fG %s\n",$1,$5,$3/1024,$4/1024,$6; printf n}' else test "$(lsblk --version | cut -d. -f2)" -ge 37 && width="--width" && cols=$(tput cols) && outcols="s" IFS="\n" diff --git a/.local/bin/scripts/help b/.local/bin/scripts/help index 6cc2012..21acc2c 100755 --- a/.local/bin/scripts/help +++ b/.local/bin/scripts/help @@ -26,7 +26,7 @@ showinfo() { cmd="$1" case "$cmd" in - (fwupdmgr|hunt|rdoc|gh|chordpro|bat|pdfjam|reflector|topgrade|r128gain|7z|kubectl|diffr|docker|jrnl|difft|wiked-diff|qpdf|ninja) + (fwupdmgr|hunt|rdoc|gh|chordpro|bat|pdfjam|reflector|topgrade|r128gain|7z|kubectl|diffr|docker|jrnl|difft|wiked-diff|qpdf|ninja|qobuz-dl|beet) unbuffer "$@" --help | sed 's|^[^ ].*:|\0|' | $paginate;; (sqlcmd) sqlcmd -?;; (exa) "$0" eza;; diff --git a/.local/bin/scripts/jrnl-tag b/.local/bin/scripts/jrnl-tag index 58db18b..bf8b94d 100755 --- a/.local/bin/scripts/jrnl-tag +++ b/.local/bin/scripts/jrnl-tag @@ -2,9 +2,9 @@ # Find terms in jrnl files and turn them into tags # Check with jrnl --tags if test $# -eq 0 -then $0 sleep uni nap cry health tech read girl dev phone Zinc run bike tour laptop computer PC piano faith journal CB Claudia Catherine Franklin Kerstin Henri Katja Erlangen Bayreuth Berlin ICF +then $0 sleep lens uni nap cry health tech read girl dev phone Zinc bike tour laptop computer PC piano faith CB Claudia Franklin Kerstin Henri Katja Erlangen Bayreuth Berlin ICF Joan else for arg - do rpl "\(^\|[^@]\)\b$arg\b" "\1@$arg" $JOURNAL/*.txt 2>/dev/null + do rpl "\(^\|[^@/]\)\b$arg\b" "\1@$arg" $JOURNAL/*.txt 2>/dev/null done fi diff --git a/.local/bin/scripts/own b/.local/bin/scripts/own index 1ade337..b8a8d0b 100755 --- a/.local/bin/scripts/own +++ b/.local/bin/scripts/own @@ -6,3 +6,4 @@ case "$1" in (-*) u="${1#-}"; shift; break;; esac sudo chown -R --preserve-root "$u:$u" "${@:-.}" +#sudo chmod u+w . -R diff --git a/.local/bin/scripts/wg-reload b/.local/bin/scripts/wg-reload old mode 100644 new mode 100755 index 98f9c3b..7f2d4c8 --- a/.local/bin/scripts/wg-reload +++ b/.local/bin/scripts/wg-reload @@ -1,3 +1,5 @@ -#!/bin/sh -x +#!/bin/bash -x # wg-quick reload interface -wg syncconf "$@" <(wg-quick strip "$@") +# needs to be run with superuser permissions +wg syncconf "$@" <(wg-quick strip "$@") || + ip -br a