fish: use startup files for command scripts
parent
5930fc191a
commit
2ba04a89e7
|
@ -0,0 +1 @@
|
||||||
|
scripts/fish/priv
|
|
@ -34,7 +34,7 @@ if test -f ~/.cargo/env
|
||||||
source ~/.cargo/env
|
source ~/.cargo/env
|
||||||
end
|
end
|
||||||
|
|
||||||
for f in (find $_agw_dir_scripts/fish -type f -name '*.fish')
|
for f in (find $_agw_dir_scripts/fish -type f)
|
||||||
source $f
|
source $f
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
#!/usr/bin/env fish
|
|
||||||
# vim: syntax=fish:
|
|
||||||
|
|
||||||
cd $_agw_dir_src/hosts
|
|
||||||
git pull
|
|
||||||
|
|
||||||
sudo sh -c "cat $_agw_dir_rc/applications/hosts > /etc/hosts"
|
|
||||||
sudo sh -c "cat $_agw_dir_src/hosts/hosts >> /etc/hosts"
|
|
||||||
|
|
||||||
## EOF
|
|
|
@ -1,15 +0,0 @@
|
||||||
#!/usr/bin/env fish
|
|
||||||
# vim: syntax=fish:
|
|
||||||
|
|
||||||
for f in (find . -type f)
|
|
||||||
set ftype (file -b --mime-type "$f")
|
|
||||||
set basetype (string split "/" "$ftype")
|
|
||||||
|
|
||||||
if test "$basetype[1]" = "text"
|
|
||||||
set tmp (mktemp)
|
|
||||||
mac2unix -n "$f" "$tmp"
|
|
||||||
mv "$tmp" "$f"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
## EOF
|
|
|
@ -1,17 +0,0 @@
|
||||||
#!/usr/bin/env fish
|
|
||||||
# vim: syntax=fish:
|
|
||||||
|
|
||||||
set filter 'pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak'
|
|
||||||
|
|
||||||
for f in (find . -type f \( -name "*.ogg" -o \
|
|
||||||
-name "*.flac" -o \
|
|
||||||
-name "*.mp3" -o \
|
|
||||||
-name "*.opus" \))
|
|
||||||
set out (ffprobe "$f" 2>/dev/null | rg "album_artist")
|
|
||||||
|
|
||||||
if test ! "$out"
|
|
||||||
echo "$f has no album artist tag"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
## EOF
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/usr/bin/env fish
|
|
||||||
# vim: syntax=fish:
|
|
||||||
|
|
||||||
set filter 'pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak'
|
|
||||||
|
|
||||||
for f in $argv
|
|
||||||
set out (ffmpeg -nostdin -loglevel error -i "$f" -filter_complex "$filter" -t 0.00002 -f crc -)
|
|
||||||
|
|
||||||
if test "$out" != 'CRC=0x00000001'
|
|
||||||
set other /tmp/(basename "$f")
|
|
||||||
echo "$f is stereo, converting"
|
|
||||||
ffmpeg -i "$f" -ac 1 "$other" && mv "$other" "$f"
|
|
||||||
else
|
|
||||||
echo "$f is mono"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
## EOF
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/usr/bin/env fish
|
|
||||||
# vim: syntax=fish:
|
|
||||||
|
|
||||||
function fail
|
|
||||||
echo "failed to process $f, exiting"
|
|
||||||
exit 1
|
|
||||||
end
|
|
||||||
|
|
||||||
for f in ./*.flac
|
|
||||||
ffmpeg -i "$f" -q:a 0 -vn (basename "$f" ".flac")".mp3"
|
|
||||||
or fail
|
|
||||||
echo "$f success"
|
|
||||||
end
|
|
||||||
|
|
||||||
read -P "success. delete files? [yn] " yn
|
|
||||||
|
|
||||||
test $yn = y
|
|
||||||
and rm ./*.flac
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
# vim: syntax=sh:
|
|
||||||
|
|
||||||
grub-mkconfig -o /boot/grub/grub.cfg
|
|
||||||
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=arch
|
|
||||||
|
|
||||||
## EOF
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/env fish
|
|
||||||
# vim: syntax=fish:
|
|
||||||
|
|
||||||
while true
|
|
||||||
x11vnc -forever -scale 0.25
|
|
||||||
end
|
|
|
@ -1 +0,0 @@
|
||||||
priv
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
|
function build-hosts -d 'Builds /etc/hosts'
|
||||||
|
cd $_agw_dir_src/hosts
|
||||||
|
git pull
|
||||||
|
|
||||||
|
sudo sh -c "cat $_agw_dir_rc/applications/hosts > /etc/hosts"
|
||||||
|
sudo sh -c "cat $_agw_dir_src/hosts/hosts >> /etc/hosts"
|
||||||
|
end
|
||||||
|
|
||||||
|
## EOF
|
|
@ -1,3 +1,5 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
function cheat.sh -d 'Grabs a sheet from cheat.sh' -a arg
|
function cheat.sh -d 'Grabs a sheet from cheat.sh' -a arg
|
||||||
curl cheat.sh/$arg
|
curl cheat.sh/$arg
|
||||||
end
|
end
|
|
@ -0,0 +1,16 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
|
function crtolf -d 'Converts all CR=EOL files to LF=EOL'
|
||||||
|
for f in (find . -type f)
|
||||||
|
set ftype (file -b --mime-type "$f")
|
||||||
|
set basetype (string split "/" "$ftype")
|
||||||
|
|
||||||
|
if test "$basetype[1]" = "text"
|
||||||
|
set tmp (mktemp)
|
||||||
|
mac2unix -n "$f" "$tmp"
|
||||||
|
mv "$tmp" "$f"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
## EOF
|
|
@ -0,0 +1,18 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
|
function find-no-album-artist -d "Finds files which don't have an album artist"
|
||||||
|
set filter 'pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak'
|
||||||
|
|
||||||
|
for f in (find . -type f \( -name "*.ogg" -o \
|
||||||
|
-name "*.flac" -o \
|
||||||
|
-name "*.mp3" -o \
|
||||||
|
-name "*.opus" \))
|
||||||
|
set out (ffprobe "$f" 2>/dev/null | rg "album_artist")
|
||||||
|
|
||||||
|
if test ! "$out"
|
||||||
|
echo "$f has no album artist tag"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
## EOF
|
|
@ -0,0 +1,19 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
|
function find-stereo -d 'Finds files that are stereo'
|
||||||
|
set filter 'pan=mono|c0=0.5*FL+-0.5*FR,silenceremove=start_periods=1:detection=peak'
|
||||||
|
|
||||||
|
for f in $argv
|
||||||
|
set out (ffmpeg -nostdin -loglevel error -i "$f" -filter_complex "$filter" -t 0.00002 -f crc -)
|
||||||
|
|
||||||
|
if test "$out" != 'CRC=0x00000001'
|
||||||
|
set other /tmp/(basename "$f")
|
||||||
|
echo "$f is stereo, converting"
|
||||||
|
ffmpeg -i "$f" -ac 1 "$other" && mv "$other" "$f"
|
||||||
|
else
|
||||||
|
echo "$f is mono"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
## EOF
|
|
@ -0,0 +1,18 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
|
function flac2mp3 -d 'Converts FLAC files to MP3'
|
||||||
|
for f in ./*.flac
|
||||||
|
if not ffmpeg -i "$f" -q:a 0 -vn (basename "$f" ".flac")".mp3"
|
||||||
|
echo "failed to process $f, exiting"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
echo "$f success"
|
||||||
|
end
|
||||||
|
|
||||||
|
read -P "success. delete files? [yn] " yn
|
||||||
|
|
||||||
|
test $yn = y
|
||||||
|
and rm ./*.flac
|
||||||
|
end
|
||||||
|
|
||||||
|
## EOF
|
|
@ -0,0 +1,8 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
|
function generate-grub -d 'Generates and installs GRUB'
|
||||||
|
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
|
sudo grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=arch
|
||||||
|
end
|
||||||
|
|
||||||
|
## EOF
|
|
@ -1,3 +1,5 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
set -x HOMEBREW_NO_ANALYTICS 1
|
set -x HOMEBREW_NO_ANALYTICS 1
|
||||||
set -x HOMEBREW_INSTALL_BADGE 'OK'
|
set -x HOMEBREW_INSTALL_BADGE 'OK'
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
|
function emit-srcinfo -d 'Emits .SRCINFO'
|
||||||
|
makepkg --printsrcinfo > .SRCINFO
|
||||||
|
end
|
||||||
|
|
||||||
|
## EOF
|
|
@ -1,5 +0,0 @@
|
||||||
function emit-srcinfo
|
|
||||||
makepkg --printsrcinfo > .SRCINFO
|
|
||||||
end
|
|
||||||
|
|
||||||
## EOF
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
|
function megadl-all -d 'Downloads all files in ~/dl'
|
||||||
|
megadl (cat ~/dl)
|
||||||
|
end
|
||||||
|
|
||||||
|
## EOF
|
|
@ -1,5 +0,0 @@
|
||||||
function megadl-all
|
|
||||||
megadl (cat ~/dl)
|
|
||||||
end
|
|
||||||
|
|
||||||
## EOF
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
function fish_prompt
|
function fish_prompt
|
||||||
echo (set_color c792ea)"$hostname% "(set_color normal)
|
echo (set_color c792ea)"$hostname% "(set_color normal)
|
||||||
end
|
end
|
|
@ -1,3 +1,5 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
function ql -d 'Changes directory to a quicklink' -a name
|
function ql -d 'Changes directory to a quicklink' -a name
|
||||||
if not set -q quicklink_$name name
|
if not set -q quicklink_$name name
|
||||||
echo (set_color red)"error: no quicklink named $name"(set_color normal)
|
echo (set_color red)"error: no quicklink named $name"(set_color normal)
|
|
@ -0,0 +1,7 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
|
function rebuild -d 'Builds an AUR package'
|
||||||
|
$HOME/src/scripts/rebuild.rkt $argv
|
||||||
|
end
|
||||||
|
|
||||||
|
## EOF
|
|
@ -1,5 +0,0 @@
|
||||||
function rebuild
|
|
||||||
$HOME/src/scripts/rebuild.rkt $argv
|
|
||||||
end
|
|
||||||
|
|
||||||
## EOF
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
function vis-transfer -d 'Shows how a transfer is doing with pv' -a name
|
function vis-transfer -d 'Shows how a transfer is doing with pv' -a name
|
||||||
tail -f "$name" | pv > /dev/null
|
tail -f "$name" | pv > /dev/null
|
||||||
end
|
end
|
|
@ -1,7 +1,8 @@
|
||||||
#!/usr/bin/env fish
|
|
||||||
# vim: syntax=fish:
|
# vim: syntax=fish:
|
||||||
|
|
||||||
function pull_plugins
|
function pull-vim-plugin -d 'Updates all vim plugins in the current directory'
|
||||||
|
cd $argv[1]
|
||||||
|
|
||||||
for plugin in ./*
|
for plugin in ./*
|
||||||
cd $plugin
|
cd $plugin
|
||||||
|
|
||||||
|
@ -24,23 +25,21 @@ function pull_plugins
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function cd_and_pull
|
|
||||||
cd $argv[1]
|
|
||||||
pull_plugins
|
|
||||||
cd ..
|
cd ..
|
||||||
end
|
end
|
||||||
|
|
||||||
cd ~/.vim/pack
|
function update-vim-plugins -d 'Updates all vim plugins'
|
||||||
|
cd ~/.vim/pack
|
||||||
|
|
||||||
for folder in ./*
|
for folder in ./*
|
||||||
cd $folder
|
cd $folder
|
||||||
|
|
||||||
test -d start; and cd_and_pull start
|
test -d start; and pull-vim-plugin start
|
||||||
test -d opt; and cd_and_pull opt
|
test -d opt; and pull-vim-plugin opt
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
## EOF
|
## EOF
|
|
@ -0,0 +1,9 @@
|
||||||
|
# vim: syntax=fish:
|
||||||
|
|
||||||
|
function vnc -d 'Runs x11vnc, always'
|
||||||
|
while true
|
||||||
|
x11vnc -forever -scale 0.25
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
## EOF
|
Loading…
Reference in New Issue