From 942e682e8859fca92c2d9ef8366f846c9d9b9e61 Mon Sep 17 00:00:00 2001 From: Phantop Date: Sat, 4 Dec 2021 15:53:41 -0500 Subject: [PATCH] fish: Simplify drivedl, hitolo foobar, ccache --- dot-config/fish/config.fish | 1 + dot-local/bin/drivedl | 7 ++++--- dot-local/bin/hitolo | 21 ++++++++++++--------- dot-local/bin/optiall | 2 +- dot-local/bin/setup | 1 - 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/dot-config/fish/config.fish b/dot-config/fish/config.fish index 50cfaf9..4f53458 100644 --- a/dot-config/fish/config.fish +++ b/dot-config/fish/config.fish @@ -1,6 +1,7 @@ set -x EDITOR nvim set -x PAGER most set -x MANPAGER 'nvim +Man!' +set -x USE_CCACHE 1 set D ~ test (hostname) = aperture && set D /mnt/LocalDiskD/ diff --git a/dot-local/bin/drivedl b/dot-local/bin/drivedl index 06da4a7..5444c9e 100755 --- a/dot-local/bin/drivedl +++ b/dot-local/bin/drivedl @@ -1,4 +1,5 @@ #!/bin/bash -ID="$(echo $1 | sed -n 's#.*\https\:\/\/drive\.google\.com/file/d/\([^.]*\)\/view.*#\1#;p')"; -CODE=$(wget -q --show-progress --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$ID" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p') -aria2c --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CODE&id=$ID" -c -x16 -s 16 +cook=/tmp/cookies +link="https://docs.google.com/uc?export=download&id=$(echo $1 | cut -d/ -f6)" +code=$(wget --save-cookies $cook "$link" -O- | egrep -o confirm=[0-9A-Za-z_]+) +aria2c --load-cookies $cook "$link&$code" -c -x16 -s 16 diff --git a/dot-local/bin/hitolo b/dot-local/bin/hitolo index df6e4bc..cf2cfe6 100755 --- a/dot-local/bin/hitolo +++ b/dot-local/bin/hitolo @@ -1,21 +1,24 @@ #!/usr/bin/fish set HIFI ~/Music/HiFi -set LOFI /tmp/vox/LoFi -test $argv && set LOFI $argv +set LOFI /tmp/foo test -f /usr/share/man/man3/Parallel::ForkManager.3 || sudo eopkg it perl-parallel-forkmanager -mkdir /tmp/vox -fusermount -u /tmp/vox -ifuse --documents com.coppertino.VoxMobile /tmp/vox +if test $argv + set LOFI $argv +else + mkdir $LOFI + fusermount -u $LOFI + ifuse --documents com.foobar2000.mobile $LOFI +end if not test -d $LOFI cd $HIFI fd -t d -x mkdir -p $LOFI/{} - fd -e flac -x opusenc --bitrate 72 {} $LOFI/{.}.opus + fd -e flac -x opusenc --bitrate 256 {} $LOFI/{.}.opus end -set args -s $HIFI -d $LOFI -o opus -q 72 --clean sync -F 8 -a mp3,m4a,opus +set args -s $HIFI -d $LOFI -o opus -q 256 --clean sync -F 8 -a mp3,m4a,opus acxi $args || wget https://github.com/smxi/acxi/raw/stable/acxi -O- -o/dev/null | perl -- - $args -fusermount -u /tmp/vox -rmdir /tmp/vox +fusermount -u $LOFI +rmdir $LOFI diff --git a/dot-local/bin/optiall b/dot-local/bin/optiall index d8422b9..bdc0f82 100755 --- a/dot-local/bin/optiall +++ b/dot-local/bin/optiall @@ -3,8 +3,8 @@ fd -e pdf -x cpdfsqueeze {} {} fd -e pdf -x qpdf --stream-data=compress --replace-input --compress-streams=y --recompress-flate --compression-level=9 --optimize-images {} fd -e png -x oxipng -fd -e png -ejp{e,}g -X pingo -s9 fd -ejp{e,}g -x jpegoptim +fd -e png -ejp{e,}g -X pingo -s9 fd -e webp -x cwebp -z 9 -mt {} -o {} fd -e{epub,zip,cbz,jar,docx,odt,apk} -x advzip -z4 diff --git a/dot-local/bin/setup b/dot-local/bin/setup index f76e615..28dc9f6 100755 --- a/dot-local/bin/setup +++ b/dot-local/bin/setup @@ -14,7 +14,6 @@ web="arcanist aria2 nicotine-plus qutebrowser openssh-server rclone subliminal s se up se it -c system.devel $audio $dev $gui $media $rice $sys $term $web se rm $gnome firefox hexchat libreoffice-common onboard thunderbird -se rm --ignore-dependency plata-theme tracker echo source ~/.config/bashrc > ~/.bashrc install -D <(echo set -g mouse on) ~/.config/tmux/tmux.conf