bin: clean up simpler stuff to fish functions

This commit is contained in:
Phantop 2023-11-16 12:09:06 -05:00
parent 939636914e
commit eeb2d30b26
12 changed files with 32 additions and 53 deletions

View File

@ -25,6 +25,7 @@ clang
cmake
cpupower
dart-sass
doas-sudo-shim
dolphin-emu
dracula-gtk-theme-git
dracula-kde-theme-git

View File

@ -1,9 +0,0 @@
#!/bin/sh
#shellcheck disable=SC2046
yay -Scc
fc-cache -frvs
rm -r ~/.cache/* ~/.wine/* ~/.local/pipx/.cache/
fish -c "j --purge"
doas journalctl --vacuum-size=1K
bleachbit -c $(bleachbit -l|rg -v 'system.free_disk_space|system.memory')
doas bleachbit -c $(bleachbit -l|rg -v 'system.free_disk_space|system.memory')

View File

@ -6,4 +6,3 @@ for i in $(fd -t f); do
mv "$i" "$1/$i"
fi
done

View File

@ -1,7 +0,0 @@
#!/bin/sh
mkdir foo
ifuse --documents com.foobar2000.mobile foo || exit 1
# https://github.com/smxi/acxi/raw/stable/acxi
acxi -s ~/Music/HiFi -d "$PWD/foo" -o opus -q 128 --clean sync -F 16 -c mp3,m4a,opus,ogg
fusermount -u foo
rmdir foo

View File

@ -1,5 +0,0 @@
#!/bin/sh
in=$(mktemp)
cat > "$in"
fzf --preview-window='up:99%' --preview "jq --color-output -r {q} $in $1"
rm -f "$in"

13
bin/nse
View File

@ -1,13 +0,0 @@
#!/bin/sh
d=$(mktemp -d)
bsdtar xf "$@" -C"$d"
t=$(fd -e ncx . "$d")
xml_grep content "$t" | uniq | grep content | cut -d\" -f2 |\
sed -e 's#.*#<a href="&">&</a><br />#' -e 's#">[^/<]*/#">#'\
-e 's/\.xhtml/\.html/g' > "$(dirname "$t")"/index.html
fd -e xhtml . "$d" -x mv {} '{.}'.html
if test -z "$BROWSER"; then
BROWSER=netsurf
fi
eval "$BROWSER" "$(dirname "$t")"/index.html
rm -rf "$d"

View File

@ -1,12 +0,0 @@
#!/bin/sh
fd -e pdf -x qpdf --stream-data=compress --replace-input --compress-streams=y --recompress-flate --compression-level=9 --optimize-images {}
fd -e jpg -e jpeg -x jpegoptim
fd -e webp -x cwebp -z 9 -mt {} -o {}
fd -t f -x advzip -z3
fd -t f -x advdef -z3
fd -e mp3 -x mp3packer \; -x mv '{.}'-vbr.mp3 {}
fd -e so -x strip

View File

@ -1,6 +0,0 @@
#!/bin/sh
fd -e pdf -x qpdf --stream-data=uncompress --replace-input --compress-streams=n --recompress-flate --compression-level=0 --optimize-images {}
fd -e \~qpdf-orig -x rm
fd -t f -x advzip -z0
fd -e png -x advpng -z0
fd -t f -x advdef -z0

View File

@ -0,0 +1,9 @@
function clean
yay -Scc
fc-cache -frvs
rm -r ~/.cache/* ~/.wine/* ~/.local/pipx
fish -c "j --purge"
doas journalctl --vacuum-size=1K
bleachbit -c (bleachbit -l|rg -v 'system.free_disk_space|system.memory')
doas bleachbit -c (bleachbit -l|rg -v 'system.free_disk_space|system.memory')
end

View File

@ -0,0 +1,8 @@
function hitolo
mkdir /tmp/foo
ifuse --documents com.foobar2000.mobile /tmp/foo || return 1
# https://github.com/smxi/acxi/raw/stable/acxi
acxi -s ~/Music/HiFi -d /tmp/foo -o opus -q 128 --clean sync -F 16 -c mp3,m4a,opus,ogg
fusermount -u /tmp/foo
rmdir /tmp/foo
end

View File

@ -0,0 +1,7 @@
function optiall
fd -e jpg -e jpeg -x jpegoptim
fd -e mp3 -x mp3packer \; -x mv '{.}'-vbr.mp3 {}
fd -e pdf -x qpdf --stream-data=compress --replace-input --compress-streams=y --recompress-flate --compression-level=9 --optimize-images {}
fd -t f -x advdef -z3
fd -t f -x advzip -z3
end

View File

@ -0,0 +1,7 @@
function undefalte
fd -t f -x advzip -z0
fd -t f -x advdef -z0
fd -e pdf -x qpdf --stream-data=uncompress --replace-input --compress-streams=n --recompress-flate --compression-level=0 --optimize-images {}
fd -e \~qpdf-orig -x rm
fd -e png -x advpng -z0
end