actually I wasn't kidding It's Time FOr Fish

master
an 2019-06-10 23:30:49 -04:00
parent 0112f2231f
commit 025907fda1
11 changed files with 74 additions and 73 deletions

View File

@ -1,17 +1,17 @@
#!/usr/bin/env bash
#!/usr/bin/fish
filter='pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak'
set filter 'pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak'
for f in $@
do
out=$(ffmpeg -nostdin -loglevel error -i "$f" -filter_complex "$filter" -t 0.00002 -f crc -)
for f in $argv
set out (ffmpeg -nostdin -loglevel error -i "$f" -filter_complex "$filter" -t 0.00002 -f crc -)
if [[ "$out" != 'CRC=0x00000001' ]]
then
other="${f%.ogg}.1.ogg"
if test "$out" != 'CRC=0x00000001'
set other /tmp/(basename "$f")
echo "$f is stereo, converting"
ffmpeg -i "$f" -ac 1 "$other" && mv "$other" "$f"
fi
done
else
echo "$f is mono"
end
end
## EOF

View File

@ -1,16 +1,17 @@
#!/usr/bin/env bash
#!/usr/bin/fish
fail() {
function fail
echo "failed to process $f, exiting"
exit 1
}
end
for f in ./*.flac
do
ffmpeg -i "$f" -q:a 0 -vn "$(basename "$f" .flac).mp3"
(( $? )) && fail
ffmpeg -i "$f" -q:a 0 -vn (basename "$f" ".flac")".mp3"
or fail
echo "$f success"
done
end
read -rep "success. delete files? [yn] " YN
[[ ${YN,,} == y* ]] && rm ./*.flac
read -P "success. delete files? [yn] " yn
test $yn = y
and rm ./*.flac

View File

@ -1,3 +1,3 @@
#!/usr/bin/env bash
#!/usr/bin/fish
megadl $(cat ~/dl)
megadl (cat ~/dl)

View File

@ -1,4 +1,6 @@
#!/usr/bin/env bash
export PATH=$HOME/.local/bin:$HOME/.gem/ruby/2.6.0/bin:$PATH
export DOOMWADDIR=/mnt/d/Stuff/GamesPC/IWads
export PATH="$HOME/.local/bin":"$HOME/.gem/ruby/2.6.0/bin":$PATH
export DOOMWADDIR='/mnt/d/Stuff/GamesPC/IWads'
## EOF

View File

@ -1,5 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/fish
export spectacleargs=-a
. "$HOME/src/scripts/sharenix.sh"
source "$HOME/src/scripts/sharenix.sh"
run_spectacle -a

View File

@ -1,5 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/fish
export spectacleargs=-f
. "$HOME/src/scripts/sharenix.sh"
source "$HOME/src/scripts/sharenix.sh"
run_spectacle -f

View File

@ -1,5 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/fish
export spectacleargs=-r
. "$HOME/src/scripts/sharenix.sh"
source "$HOME/src/scripts/sharenix.sh"
run_spectacle -r

View File

@ -1,12 +1,13 @@
#!/usr/bin/env bash
#!/usr/bin/fish
f=$HOME/Pictures/$(date "+%y%m%d-%H%M%S").png
function run_spectacle
set f "$HOME/Pictures/"(date "+%y%m%d-%H%M%S")".png"
spectacle -b $spectacleargs -n -o $f
spectacle -b $argv -n -o "$f"
if [[ -f "$f" ]]
then
sharenix -n -s Greyserv "$f"
fi
if test -f "$f"
sharenix -n -s Greyserv "$f"
end
rm "$f"
rm "$f"
end

View File

@ -1,51 +1,49 @@
#!/usr/bin/env bash
pull_plugins() {
local res
#!/usr/bin/fish
function pull_plugins
for plugin in ./*
do
cd $plugin
git stash
git pull -f
res=$?
set res $status
if test $res != 0; and test $res != 128
if [[ $res -ne 0 ]] && [[ $res -ne 128 ]]
then
echo "error $res in $PWD"
exit 1
fi
end
if [[ $plugin = ./base16-vim ]]
then
if test "$plugin" = ./base16-vim
echo "fixing attrs for $plugin"
sed -i '/Base16hi/! s/a:\(attr\|guisp\)/l:\1/g' colors/*.vim
fi
end
if [[ -d doc ]]
then
if test -d doc
echo "generating tags for $PWD"
vim --cmd "helptags doc/" --cmd "q"
fi
end
cd ..
done
}
cd_and_pull() {
cd $1
end
end
function cd_and_pull
cd $argv[1]
pull_plugins
cd ..
}
end
cd ~/.vim/pack
for folder in ./*
do
cd $folder
[[ -d start ]] && cd_and_pull start
[[ -d opt ]] && [[ $1 = opt ]] && cd_and_pull opt
test -d start; and cd_and_pull start
test -d opt; and test $1 = opt; and cd_and_pull opt
cd ..
done
end
## EOF

View File

@ -1,6 +1,5 @@
#!/usr/bin/env bash
#!/usr/bin/fish
while [[ 1 ]]
do
while true
x11vnc -forever -scale 0.25
done
end

View File

@ -6,8 +6,11 @@ if status is-interactive
end
function fish_prompt
set_color purple
echo (hostname)"% "
echo (set_color purple)"$hostname% "
end
function fish_right_prompt
echo (set_color green)(pwd)
end
function fish_greeting