From 3ca41056f3fe8c3319d6ebc1e01660516f21aa7a Mon Sep 17 00:00:00 2001 From: Phantop Date: Mon, 3 Aug 2020 23:17:43 -0400 Subject: [PATCH] local-bin optiflac, flacr, minecraft --- .config/fish/functions/flacr.fish | 24 ------------------------ .config/fish/functions/minecraft.fish | 14 -------------- .config/fish/functions/optiflac.fish | 24 ------------------------ .local/bin/flacr | 23 +++++++++++++++++++++++ .local/bin/minecraft | 15 +++++++++++++++ .local/bin/optiflac | 23 +++++++++++++++++++++++ 6 files changed, 61 insertions(+), 62 deletions(-) delete mode 100644 .config/fish/functions/flacr.fish delete mode 100644 .config/fish/functions/minecraft.fish delete mode 100644 .config/fish/functions/optiflac.fish create mode 100755 .local/bin/flacr create mode 100755 .local/bin/minecraft create mode 100755 .local/bin/optiflac diff --git a/.config/fish/functions/flacr.fish b/.config/fish/functions/flacr.fish deleted file mode 100644 index 71d062e..0000000 --- a/.config/fish/functions/flacr.fish +++ /dev/null @@ -1,24 +0,0 @@ -# Defined in /tmp/fish.3hjAN7/flacr.fish @ line 2 -function flacr - mkdir out - ls *.flac | parallel ffmpeg-static -i {} -c:v copy -c:a flac -compression_level 12 -af aresample=resampler=soxr:precision=32:dither_method=triangular -sample_fmt s16 $argv out/{} - cd out - for i in * - if test (du $i | cut -f1) -lt (du ../$i | cut -f1) - echo $i - mv $i ../$i - end - end - cd .. - cp *.flac out - cd out - ls | parallel flacc {} - for i in * - if test (du $i | cut -f1) -lt (du ../$i | cut -f1) - echo $i - mv $i ../$i - end - end - cd .. - rm -r out -end diff --git a/.config/fish/functions/minecraft.fish b/.config/fish/functions/minecraft.fish deleted file mode 100644 index 8d49a1e..0000000 --- a/.config/fish/functions/minecraft.fish +++ /dev/null @@ -1,14 +0,0 @@ -function minecraft - cd $D/Games/Minecraft/Game - rm (ff -e log) - bin/MultiMC -d . $argv - rm functions/* - for i in (ls -d instances/*/ | grep -v _MMC_TEMP | xargs -n1 basename) - echo > functions/$i.fish "function $i - minecraft -l $i; end" - end - for i in (cat ~/.config/qutebrowser/quickmarks | cut -d ' ' -f1) - echo > functions/$i.fish function $i" - qb / \":quickmark-load $i\"; end" - end -end diff --git a/.config/fish/functions/optiflac.fish b/.config/fish/functions/optiflac.fish deleted file mode 100644 index b5a21fb..0000000 --- a/.config/fish/functions/optiflac.fish +++ /dev/null @@ -1,24 +0,0 @@ -# Defined in /tmp/fish.B19DWM/optiflac.fish @ line 2 -function optiflac - mkdir out - ls *.flac | parallel ffmpeg -i {} -c:v copy -c:a flac -compression_level 12 $argv out/{} - cd out - for i in * - if test (du $i | cut -f1) -lt (du ../$i | cut -f1) - echo $i - mv $i ../$i - end - end - cd .. - cp *.flac out - cd out - ls | parallel flacc {} - for i in * - if test (du $i | cut -f1) -lt (du ../$i | cut -f1) - echo $i - mv $i ../$i - end - end - cd .. - rm -r out -end diff --git a/.local/bin/flacr b/.local/bin/flacr new file mode 100755 index 0000000..b783afe --- /dev/null +++ b/.local/bin/flacr @@ -0,0 +1,23 @@ +#!/bin/bash +compare() { + for i in * + do + if [ `du "$i" | cut -f1` -lt `du ../"$i" | cut -f1` ] + then + echo $i + mv "$i" ../"$i" + fi + done +} + +mkdir out +ls *.flac | parallel ffmpeg-static -i {} -c:v copy -c:a flac -compression_level 12 -af aresample=resampler=soxr:precision=32:dither_method=triangular -sample_fmt s16 $@ out/{} +cd out +compare +cd .. +cp *.flac out +cd out +ls | parallel flac -f -8 -V {} +compare +cd .. +rm -r out diff --git a/.local/bin/minecraft b/.local/bin/minecraft new file mode 100755 index 0000000..e872c80 --- /dev/null +++ b/.local/bin/minecraft @@ -0,0 +1,15 @@ +#!/bin/bash +cd $D/Games/Minecraft/Game +rm `ff -e log` +bin/MultiMC -d . $@ +rm functions/* +for i in `ls -d instances/*/ | grep -v _MMC_TEMP | xargs -n1 basename` +do + echo > functions/$i.fish "function $i + minecraft -l $i; end" +done +for i in `cat ~/.config/qutebrowser/quickmarks | cut -d ' ' -f1` +do + echo > functions/$i.fish function $i" + qb / \":quickmark-load $i\"; end" +done diff --git a/.local/bin/optiflac b/.local/bin/optiflac new file mode 100755 index 0000000..3f37206 --- /dev/null +++ b/.local/bin/optiflac @@ -0,0 +1,23 @@ +#!/bin/bash +compare() { + for i in * + do + if [ `du "$i" | cut -f1` -lt `du ../"$i" | cut -f1` ] + then + echo $i + mv "$i" ../"$i" + fi + done +} + +mkdir out +ls *.flac | parallel ffmpeg -i {} -c:v copy -c:a flac -compression_level 12 $@ out/{} +cd out +compare +cd .. +cp *.flac out +cd out +ls | parallel flac -f -8 -V {} +compare +cd .. +rm -r out