Index: .gitignore ================================================================== --- .gitignore +++ .gitignore @@ -1,3 +1,3 @@ *~ -config/fish/fish_variables +fish/fish_variables vim/.netrwhist DELETED config/fish/completions/pkg_delete.fish Index: config/fish/completions/pkg_delete.fish ================================================================== --- config/fish/completions/pkg_delete.fish +++ config/fish/completions/pkg_delete.fish @@ -1,1 +0,0 @@ -complete -c pkg_delete -x -a "(pkg_info | awk '{ print \$1 }')" DELETED config/fish/completions/pkg_info.fish Index: config/fish/completions/pkg_info.fish ================================================================== --- config/fish/completions/pkg_info.fish +++ config/fish/completions/pkg_info.fish @@ -1,1 +0,0 @@ -complete -c pkg_info -x -a "(pkg_info | awk '{ print \$1 }')" DELETED config/fish/completions/run.fish Index: config/fish/completions/run.fish ================================================================== --- config/fish/completions/run.fish +++ config/fish/completions/run.fish @@ -1,1 +0,0 @@ -complete -c run -a '(__fish_complete_subcommand)' DELETED config/fish/config.fish Index: config/fish/config.fish ================================================================== --- config/fish/config.fish +++ config/fish/config.fish @@ -1,28 +0,0 @@ -set -g fish_greeting -set -g fish_escape_delay_ms 300 - -set -g fish_color_autosuggestion 303030 -set -g fish_color_command 205cb3 -set -g fish_color_comment 6600cc -set -g fish_color_cwd 209060 -set -g fish_color_end 730099 -set -g fish_color_host 176945 -set -g fish_color_jobs --bold yellow -set -g fish_color_operator cc6fdf -set -g fish_color_param 3377cf -set -g fish_color_quote ff751a -set -g fish_color_redirection bf4080 -set -g fish_color_search_match ffff00 -set -g fish_color_selection c0c0c0 -set -g fish_color_status --bold red -set -g fish_color_suffix 29bc7d -set -g fish_color_user 00ff00 -set -g fish_color_valid_path normal -set -g fish_color_vcs 43d696 -set -g fish_color_vcs_braces 29bc7d - -set -g _fish_abbr_gpg gpg2 -set -g _fish_abbr_vi vim - -set -x EDITOR vim -set -x LS_COLORS 'di=34:ow=44;37:tw=44;37:st=44;37:ex=31:su=7;31:sg=7;31:ln=33:or=7;33:pi=32:do=32:bd=35:cd=35:so=32:*.bz2=36:*.dmg=36:*.gz=36:*.gpg=36:*.rar=36:*.tar=36:*.tbz2=36:*.tgz=36:*.xz=36:*.zip=36:*.orig=90:*~=90' DELETED config/fish/functions/cd.fish Index: config/fish/functions/cd.fish ================================================================== --- config/fish/functions/cd.fish +++ config/fish/functions/cd.fish @@ -1,66 +0,0 @@ -# -# Wrap the builtin cd command to maintain directory history. -# -function cd --description "Change directory" - set -l MAX_DIR_HIST 25 - - if test (count $argv) -gt (test "$argv[1]" = "--" && echo 2 || echo 1) - printf "%s\n" (_ "Too many args for cd command") - return 1 - end - - # Skip history in subshells. - if status --is-command-substitution - builtin cd $argv - return $status - end - - # Avoid set completions. - set -l previous $PWD - - if test "$argv" = "-" - if test "$__fish_cd_direction" = "next" - nextd - else - prevd - end - return $status - end - - # allow explicit "cd ." if the mount-point became stale in the meantime - if test "$argv" = "." - cd "$PWD" - return $status - end - - builtin cd $argv - set -l cd_status $status - - if test $cd_status -eq 0 -a "$PWD" != "$previous" - set -q dirprev - or set -l dirprev - set -q dirprev[$MAX_DIR_HIST] - and set -e dirprev[1] - - # If dirprev, dirnext, __fish_cd_direction - # are set as universal variables, honor their scope. - - set -U -q dirprev - and set -U -a dirprev $previous - or set -g -a dirprev $previous - - set -U -q dirnext - and set -U -e dirnext - or set -e dirnext - - set -U -q __fish_cd_direction - and set -U __fish_cd_direction prev - or set -g __fish_cd_direction prev - end - - if test $cd_status -eq 0 - ls - end - - return $cd_status -end DELETED config/fish/functions/cross.fish Index: config/fish/functions/cross.fish ================================================================== --- config/fish/functions/cross.fish +++ config/fish/functions/cross.fish @@ -1,133 +0,0 @@ -function cross --description 'Set up cross-compilation environment' - if test (count $argv) = 0 - echo 'Usage: cross platform [architecture1] [architecture2]' - return 1 - end - - switch $argv[1] - case 3ds nds - if test -z "$DEVKITPRO" - echo 'Please set DEVKITPRO!' - end - if test -z "$DEVKITARM" - echo 'Please set DEVKITARM!' - end - - set PATH $DEVKITARM/bin $PATH - set -g cross_host arm-none-eabi - set -g objfw_configure_flags --with-$argv[1] - case amiga - if test (count $argv) != 2 - echo 'Usage: cross amiga m68k|ppc' - return 1 - end - - switch $argv[2] - case m68k - if test -z "$amiga_gcc_path" - echo 'Please set amiga_gcc_path!' - return 1 - end - - set PATH $amiga_gcc_path/bin $PATH - set -g cross_host m68k-amigaos - case ppc - if test -z "$adtools_path" - echo 'Please set adtools_path!' - return 1 - end - - set PATH $adtools_path/bin $PATH - set -g cross_host ppc-amigaos - end - - if test (count $argv) != 2 -o -z "$cross_host" - echo 'Usage: cross amiga m68k|ppc' - return 1 - end - case ios iossim - if ! type -q xcrun - echo 'Can only cross-compile for iOS on a Mac with Xcode!' - return 1 - end - - set -l sdk_type - set -l default_archs - switch $argv[1] - case ios - set sdk_type iphoneos - set default_archs arm64 - case iossim - set sdk_type iphonesimulator - set default_archs x86_64 - end - - set -l sdk (xcrun --show-sdk-path --sdk $sdk_type) - set -l archs $argv[2..-1] - - if test (count $archs) = 0 - set archs $default_archs - end - - set -gx CC clang -isysroot $sdk - set -gx CPP clang -E -isysroot $sdk - set -gx CXX clang++ -isysroot $sdk - set -gx CXXPP clang++ -E -isysroot $sdk - - for arch in $archs - set -a CC -arch $arch - set -a CXX -arch $arch - end - set -a CPP -arch $archs[1] - set -a CXXPP -arch $archs[1] - - set -gx OBJC $CC - set -gx OBJCPP $CPP - set -gx OBJCXX $CXX - set -gx OBJCPPXX $CXXPP - set -gx IPHONEOS_DEPLOYMENT_TARGET 10.0 - set -g cross_host $archs[1]-apple-darwin - case morphos - set -l prefix (pkg_info -qp ppc-morphos-gcc-9 | - awk '/^@cwd/ { print $2; exit }') - - if test -z "$prefix" - echo 'Please install ppc-morphos-gcc-9 from pkgsrc!' - return 1 - end - - set PATH $prefix/gg/bin $PATH - set -gx CC ppc-morphos-gcc-9 - set -gx CXX ppc-morphos-g++-9 - set -gx OBJC ppc-morphos-gcc-9 - set -gx OBJCXX ppc-morphos-g++-9 - set -g cross_host ppc-morphos - case switch - if test -z "$DEVKITPRO" - echo 'Please set DEVKITPRO!' - end - if test -z "$DEVKITA64" - echo 'Please set DEVKITA64!' - end - - set PATH $DEVKITA64/bin $PATH - set -g cross_host aarch64-none-elf - set -g objfw_configure_flags --with-switch - case wii wii-u - if test -z "$DEVKITPRO" - echo 'Please set DEVKITPRO!' - end - if test -z "$DEVKITPPC" - echo 'Please set DEVKITPPC!' - end - - set PATH $DEVKITPPC/bin $PATH - set -g cross_host powerpc-eabi - set -g objfw_configure_flags --with-$argv[1] - case '*' - echo "Unknown target: $argv[1]" - return 1 - end - - set -g objfw_configure_flags --host=$cross_host $objfw_configure_flags -end DELETED config/fish/functions/eps.fish Index: config/fish/functions/eps.fish ================================================================== --- config/fish/functions/eps.fish +++ config/fish/functions/eps.fish @@ -1,4 +0,0 @@ -function eps --description 'Expand, print and set variable $e' - set -g e $argv - echo $e -end DELETED config/fish/functions/fgrep.fish Index: config/fish/functions/fgrep.fish ================================================================== --- config/fish/functions/fgrep.fish +++ config/fish/functions/fgrep.fish @@ -1,7 +0,0 @@ -function fgrep - if type -q ggrep - command ggrep -F --color=auto $argv - else - command fgrep --color=auto $argv - end -end DELETED config/fish/functions/fish_prompt.fish Index: config/fish/functions/fish_prompt.fish ================================================================== --- config/fish/functions/fish_prompt.fish +++ config/fish/functions/fish_prompt.fish @@ -1,22 +0,0 @@ -function fish_prompt --description 'Write out the prompt' - set -l suffix - switch "$USER" - case root toor - set suffix (set_color $fish_color_cwd_root)'#' - case '*' - set suffix '>' - end - - set -l branch (git symbolic-ref HEAD 2>/dev/null) - set branch (string replace -r "^refs/heads/" "" $branch) - set -l vcs - if test -n "$branch" -a "$branch" != "master" - set vcs (set_color $fish_color_vcs_braces)"(" \ - (set_color $fish_color_vcs)"$branch" \ - (set_color $fish_color_vcs_braces)")" - end - - echo -n -s (set_color $fish_color_host) (prompt_hostname) ' ' \ - (set_color $fish_color_cwd) (prompt_pwd) (string join '' $vcs) \ - (set_color $fish_color_suffix) $suffix (set_color normal) ' ' -end DELETED config/fish/functions/fish_right_prompt.fish Index: config/fish/functions/fish_right_prompt.fish ================================================================== --- config/fish/functions/fish_right_prompt.fish +++ config/fish/functions/fish_right_prompt.fish @@ -1,15 +0,0 @@ -function fish_right_prompt - set -l code $status - set -l jobs (jobs | wc -l) - set -l prompt - - test $jobs -gt 0 - and set -a prompt (set_color $fish_color_jobs)$jobs - - test $code -gt 0 - and set -a prompt (set_color $fish_color_status)$code - - echo $prompt - - set_color normal -end DELETED config/fish/functions/fish_title.fish Index: config/fish/functions/fish_title.fish ================================================================== --- config/fish/functions/fish_title.fish +++ config/fish/functions/fish_title.fish @@ -1,3 +0,0 @@ -function fish_title - echo (status current-command) · (prompt_pwd) · (prompt_hostname) -end DELETED config/fish/functions/gpg-sftp.fish Index: config/fish/functions/gpg-sftp.fish ================================================================== --- config/fish/functions/gpg-sftp.fish +++ config/fish/functions/gpg-sftp.fish @@ -1,4 +0,0 @@ -function gpg-sftp - set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh - sftp $argv -end DELETED config/fish/functions/gpg-ssh-add.fish Index: config/fish/functions/gpg-ssh-add.fish ================================================================== --- config/fish/functions/gpg-ssh-add.fish +++ config/fish/functions/gpg-ssh-add.fish @@ -1,4 +0,0 @@ -function gpg-ssh-add - set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh - ssh-add $argv -end DELETED config/fish/functions/gpg-ssh.fish Index: config/fish/functions/gpg-ssh.fish ================================================================== --- config/fish/functions/gpg-ssh.fish +++ config/fish/functions/gpg-ssh.fish @@ -1,4 +0,0 @@ -function gpg-ssh - set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh - ssh $argv -end DELETED config/fish/functions/grep.fish Index: config/fish/functions/grep.fish ================================================================== --- config/fish/functions/grep.fish +++ config/fish/functions/grep.fish @@ -1,7 +0,0 @@ -function grep - if type -q ggrep - command ggrep --color=auto $argv - else - command grep --color=auto $argv - end -end DELETED config/fish/functions/ixio.fish Index: config/fish/functions/ixio.fish ================================================================== --- config/fish/functions/ixio.fish +++ config/fish/functions/ixio.fish @@ -1,3 +0,0 @@ -function ixio - curl -F 'f:1=<-' ix.io -end DELETED config/fish/functions/ls.fish Index: config/fish/functions/ls.fish ================================================================== --- config/fish/functions/ls.fish +++ config/fish/functions/ls.fish @@ -1,7 +0,0 @@ -function ls --description 'List contents of directory' - if type -q gls - command gls --color=auto $argv - else - command ls --color=auto $argv - end -end DELETED config/fish/functions/make.fish Index: config/fish/functions/make.fish ================================================================== --- config/fish/functions/make.fish +++ config/fish/functions/make.fish @@ -1,15 +0,0 @@ -# Automatically use bmake instead of make when using pkgsrc, if necessary -function make - if string match -q -r '/pkgsrc$|/pkgsrc/' $PWD - # pkgsrc does not like MAKEFLAGS including -j - set -lx MAKEFLAGS - - if type -q bmake - command bmake $argv - else - command make $argv - end - else - command make $argv - end -end DELETED config/fish/functions/mpv.fish Index: config/fish/functions/mpv.fish ================================================================== --- config/fish/functions/mpv.fish +++ config/fish/functions/mpv.fish @@ -1,5 +0,0 @@ -# To work around mpv not liking locales that use , as a decimal separator -function mpv - set -lx LC_ALL C - command mpv $argv -end DELETED config/fish/functions/pkg_chk.fish Index: config/fish/functions/pkg_chk.fish ================================================================== --- config/fish/functions/pkg_chk.fish +++ config/fish/functions/pkg_chk.fish @@ -1,4 +0,0 @@ -function pkg_chk - set -lx MAKEFLAGS - command pkg_chk $argv -end DELETED config/fish/functions/pkg_rolling-replace.fish Index: config/fish/functions/pkg_rolling-replace.fish ================================================================== --- config/fish/functions/pkg_rolling-replace.fish +++ config/fish/functions/pkg_rolling-replace.fish @@ -1,4 +0,0 @@ -function pkg_rolling-replace - set -lx MAKEFLAGS - command pkg_rolling-replace $argv -end DELETED config/fish/functions/prompt_pwd.fish Index: config/fish/functions/prompt_pwd.fish ================================================================== --- config/fish/functions/prompt_pwd.fish +++ config/fish/functions/prompt_pwd.fish @@ -1,19 +0,0 @@ -function prompt_pwd --description 'Print the current working directory' - set -l options 'h/help' - argparse -n prompt_pwd --max-args=0 $options -- $argv - or return - - if set -q _flag_help - __fish_print_help prompt_pwd - return 0 - end - - # Replace $HOME with "~" - set realhome ~ - set -l tmp (basename (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD)) - - test $PWD = "/$tmp" - and set tmp $PWD - - echo $tmp -end DELETED config/fish/functions/pw.fish Index: config/fish/functions/pw.fish ================================================================== --- config/fish/functions/pw.fish +++ config/fish/functions/pw.fish @@ -1,13 +0,0 @@ -function pw - set -l clipboard - if type -q pbcopy - set clipboard pbcopy - else if type -q xclip - set clipboard xclip - else - echo "No clipboard handler found!" - return 1 - end - - cryptopassphrase -k ~/.scrypt-pwgen.key $argv | tr -d '\n' | $clipboard -end DELETED config/fish/functions/pws.fish Index: config/fish/functions/pws.fish ================================================================== --- config/fish/functions/pws.fish +++ config/fish/functions/pws.fish @@ -1,14 +0,0 @@ -function pws - set -l clipboard - if type -q pbcopy - set clipboard pbcopy - else if type -q xclip - set clipboard xclip - else - echo "No clipboard handler found!" - return 1 - end - - cryptopassphrase -k ~/.scrypt-pwgen-server.key $argv \ - | tr -d '\n' | $clipboard -end DELETED config/fish/functions/run.fish Index: config/fish/functions/run.fish ================================================================== --- config/fish/functions/run.fish +++ config/fish/functions/run.fish @@ -1,9 +0,0 @@ -function run - if test (count $argv) = 0 - echo "Usage: run command" - return 1 - end - - $argv & - disown -end DELETED config/fish/functions/url2pkg.fish Index: config/fish/functions/url2pkg.fish ================================================================== --- config/fish/functions/url2pkg.fish +++ config/fish/functions/url2pkg.fish @@ -1,5 +0,0 @@ -# pkgsrc does not like MAKEFLAGS being set -function url2pkg - set -lx MAKEFLAGS - command url2pkg $argv -end DELETED config/youtube-dl/config Index: config/youtube-dl/config ================================================================== --- config/youtube-dl/config +++ config/youtube-dl/config @@ -1,10 +0,0 @@ -# 315 2160p[56]0 vp9 -# 308 1440p[56]0 vp9 -# 264 1440p avc1 -# 299 1080p[56]0 avc1 -# 137 1080p avc1 - -# -f 315+251/308+251/264+140/299+140/137+140/best --f 308+251/264+140/299+140/137+140/best - ---merge-output-format mkv Index: create_symlinks.sh ================================================================== --- create_symlinks.sh +++ create_symlinks.sh @@ -20,12 +20,12 @@ which tmux >/dev/null 2>&1 && link_file tmux.conf .tmux.conf if which vim >/dev/null 2>&1; then link_file vim .vim link_file vimrc .vimrc fi -which fish >/dev/null 2>&1 && link_file config/fish .config/fish ../ -which youtube-dl >/dev/null 2>&1 && link_file config/youtube-dl .config/youtube-dl ../ +which fish >/dev/null 2>&1 && link_file fish .config/fish ../ +which youtube-dl >/dev/null 2>&1 && link_file youtube-dl .config/youtube-dl ../ which zsh >/dev/null 2>&1 && link_file zshrc .zshrc if test x"$(uname -s)" = x"Darwin"; then dest="$HOME/Library/Keyboard Layouts/eu_US.keylayout" # This does not like being symlinked… ADDED fish/completions/pkg_delete.fish Index: fish/completions/pkg_delete.fish ================================================================== --- fish/completions/pkg_delete.fish +++ fish/completions/pkg_delete.fish @@ -0,0 +1,1 @@ +complete -c pkg_delete -x -a "(pkg_info | awk '{ print \$1 }')" ADDED fish/completions/pkg_info.fish Index: fish/completions/pkg_info.fish ================================================================== --- fish/completions/pkg_info.fish +++ fish/completions/pkg_info.fish @@ -0,0 +1,1 @@ +complete -c pkg_info -x -a "(pkg_info | awk '{ print \$1 }')" ADDED fish/completions/run.fish Index: fish/completions/run.fish ================================================================== --- fish/completions/run.fish +++ fish/completions/run.fish @@ -0,0 +1,1 @@ +complete -c run -a '(__fish_complete_subcommand)' ADDED fish/config.fish Index: fish/config.fish ================================================================== --- fish/config.fish +++ fish/config.fish @@ -0,0 +1,28 @@ +set -g fish_greeting +set -g fish_escape_delay_ms 300 + +set -g fish_color_autosuggestion 303030 +set -g fish_color_command 205cb3 +set -g fish_color_comment 6600cc +set -g fish_color_cwd 209060 +set -g fish_color_end 730099 +set -g fish_color_host 176945 +set -g fish_color_jobs --bold yellow +set -g fish_color_operator cc6fdf +set -g fish_color_param 3377cf +set -g fish_color_quote ff751a +set -g fish_color_redirection bf4080 +set -g fish_color_search_match ffff00 +set -g fish_color_selection c0c0c0 +set -g fish_color_status --bold red +set -g fish_color_suffix 29bc7d +set -g fish_color_user 00ff00 +set -g fish_color_valid_path normal +set -g fish_color_vcs 43d696 +set -g fish_color_vcs_braces 29bc7d + +set -g _fish_abbr_gpg gpg2 +set -g _fish_abbr_vi vim + +set -x EDITOR vim +set -x LS_COLORS 'di=34:ow=44;37:tw=44;37:st=44;37:ex=31:su=7;31:sg=7;31:ln=33:or=7;33:pi=32:do=32:bd=35:cd=35:so=32:*.bz2=36:*.dmg=36:*.gz=36:*.gpg=36:*.rar=36:*.tar=36:*.tbz2=36:*.tgz=36:*.xz=36:*.zip=36:*.orig=90:*~=90' ADDED fish/functions/cd.fish Index: fish/functions/cd.fish ================================================================== --- fish/functions/cd.fish +++ fish/functions/cd.fish @@ -0,0 +1,66 @@ +# +# Wrap the builtin cd command to maintain directory history. +# +function cd --description "Change directory" + set -l MAX_DIR_HIST 25 + + if test (count $argv) -gt (test "$argv[1]" = "--" && echo 2 || echo 1) + printf "%s\n" (_ "Too many args for cd command") + return 1 + end + + # Skip history in subshells. + if status --is-command-substitution + builtin cd $argv + return $status + end + + # Avoid set completions. + set -l previous $PWD + + if test "$argv" = "-" + if test "$__fish_cd_direction" = "next" + nextd + else + prevd + end + return $status + end + + # allow explicit "cd ." if the mount-point became stale in the meantime + if test "$argv" = "." + cd "$PWD" + return $status + end + + builtin cd $argv + set -l cd_status $status + + if test $cd_status -eq 0 -a "$PWD" != "$previous" + set -q dirprev + or set -l dirprev + set -q dirprev[$MAX_DIR_HIST] + and set -e dirprev[1] + + # If dirprev, dirnext, __fish_cd_direction + # are set as universal variables, honor their scope. + + set -U -q dirprev + and set -U -a dirprev $previous + or set -g -a dirprev $previous + + set -U -q dirnext + and set -U -e dirnext + or set -e dirnext + + set -U -q __fish_cd_direction + and set -U __fish_cd_direction prev + or set -g __fish_cd_direction prev + end + + if test $cd_status -eq 0 + ls + end + + return $cd_status +end ADDED fish/functions/cross.fish Index: fish/functions/cross.fish ================================================================== --- fish/functions/cross.fish +++ fish/functions/cross.fish @@ -0,0 +1,133 @@ +function cross --description 'Set up cross-compilation environment' + if test (count $argv) = 0 + echo 'Usage: cross platform [architecture1] [architecture2]' + return 1 + end + + switch $argv[1] + case 3ds nds + if test -z "$DEVKITPRO" + echo 'Please set DEVKITPRO!' + end + if test -z "$DEVKITARM" + echo 'Please set DEVKITARM!' + end + + set PATH $DEVKITARM/bin $PATH + set -g cross_host arm-none-eabi + set -g objfw_configure_flags --with-$argv[1] + case amiga + if test (count $argv) != 2 + echo 'Usage: cross amiga m68k|ppc' + return 1 + end + + switch $argv[2] + case m68k + if test -z "$amiga_gcc_path" + echo 'Please set amiga_gcc_path!' + return 1 + end + + set PATH $amiga_gcc_path/bin $PATH + set -g cross_host m68k-amigaos + case ppc + if test -z "$adtools_path" + echo 'Please set adtools_path!' + return 1 + end + + set PATH $adtools_path/bin $PATH + set -g cross_host ppc-amigaos + end + + if test (count $argv) != 2 -o -z "$cross_host" + echo 'Usage: cross amiga m68k|ppc' + return 1 + end + case ios iossim + if ! type -q xcrun + echo 'Can only cross-compile for iOS on a Mac with Xcode!' + return 1 + end + + set -l sdk_type + set -l default_archs + switch $argv[1] + case ios + set sdk_type iphoneos + set default_archs arm64 + case iossim + set sdk_type iphonesimulator + set default_archs x86_64 + end + + set -l sdk (xcrun --show-sdk-path --sdk $sdk_type) + set -l archs $argv[2..-1] + + if test (count $archs) = 0 + set archs $default_archs + end + + set -gx CC clang -isysroot $sdk + set -gx CPP clang -E -isysroot $sdk + set -gx CXX clang++ -isysroot $sdk + set -gx CXXPP clang++ -E -isysroot $sdk + + for arch in $archs + set -a CC -arch $arch + set -a CXX -arch $arch + end + set -a CPP -arch $archs[1] + set -a CXXPP -arch $archs[1] + + set -gx OBJC $CC + set -gx OBJCPP $CPP + set -gx OBJCXX $CXX + set -gx OBJCPPXX $CXXPP + set -gx IPHONEOS_DEPLOYMENT_TARGET 10.0 + set -g cross_host $archs[1]-apple-darwin + case morphos + set -l prefix (pkg_info -qp ppc-morphos-gcc-9 | + awk '/^@cwd/ { print $2; exit }') + + if test -z "$prefix" + echo 'Please install ppc-morphos-gcc-9 from pkgsrc!' + return 1 + end + + set PATH $prefix/gg/bin $PATH + set -gx CC ppc-morphos-gcc-9 + set -gx CXX ppc-morphos-g++-9 + set -gx OBJC ppc-morphos-gcc-9 + set -gx OBJCXX ppc-morphos-g++-9 + set -g cross_host ppc-morphos + case switch + if test -z "$DEVKITPRO" + echo 'Please set DEVKITPRO!' + end + if test -z "$DEVKITA64" + echo 'Please set DEVKITA64!' + end + + set PATH $DEVKITA64/bin $PATH + set -g cross_host aarch64-none-elf + set -g objfw_configure_flags --with-switch + case wii wii-u + if test -z "$DEVKITPRO" + echo 'Please set DEVKITPRO!' + end + if test -z "$DEVKITPPC" + echo 'Please set DEVKITPPC!' + end + + set PATH $DEVKITPPC/bin $PATH + set -g cross_host powerpc-eabi + set -g objfw_configure_flags --with-$argv[1] + case '*' + echo "Unknown target: $argv[1]" + return 1 + end + + set -g objfw_configure_flags --host=$cross_host $objfw_configure_flags +end ADDED fish/functions/eps.fish Index: fish/functions/eps.fish ================================================================== --- fish/functions/eps.fish +++ fish/functions/eps.fish @@ -0,0 +1,4 @@ +function eps --description 'Expand, print and set variable $e' + set -g e $argv + echo $e +end ADDED fish/functions/fgrep.fish Index: fish/functions/fgrep.fish ================================================================== --- fish/functions/fgrep.fish +++ fish/functions/fgrep.fish @@ -0,0 +1,7 @@ +function fgrep + if type -q ggrep + command ggrep -F --color=auto $argv + else + command fgrep --color=auto $argv + end +end ADDED fish/functions/fish_prompt.fish Index: fish/functions/fish_prompt.fish ================================================================== --- fish/functions/fish_prompt.fish +++ fish/functions/fish_prompt.fish @@ -0,0 +1,22 @@ +function fish_prompt --description 'Write out the prompt' + set -l suffix + switch "$USER" + case root toor + set suffix (set_color $fish_color_cwd_root)'#' + case '*' + set suffix '>' + end + + set -l branch (git symbolic-ref HEAD 2>/dev/null) + set branch (string replace -r "^refs/heads/" "" $branch) + set -l vcs + if test -n "$branch" -a "$branch" != "master" + set vcs (set_color $fish_color_vcs_braces)"(" \ + (set_color $fish_color_vcs)"$branch" \ + (set_color $fish_color_vcs_braces)")" + end + + echo -n -s (set_color $fish_color_host) (prompt_hostname) ' ' \ + (set_color $fish_color_cwd) (prompt_pwd) (string join '' $vcs) \ + (set_color $fish_color_suffix) $suffix (set_color normal) ' ' +end ADDED fish/functions/fish_right_prompt.fish Index: fish/functions/fish_right_prompt.fish ================================================================== --- fish/functions/fish_right_prompt.fish +++ fish/functions/fish_right_prompt.fish @@ -0,0 +1,15 @@ +function fish_right_prompt + set -l code $status + set -l jobs (jobs | wc -l) + set -l prompt + + test $jobs -gt 0 + and set -a prompt (set_color $fish_color_jobs)$jobs + + test $code -gt 0 + and set -a prompt (set_color $fish_color_status)$code + + echo $prompt + + set_color normal +end ADDED fish/functions/fish_title.fish Index: fish/functions/fish_title.fish ================================================================== --- fish/functions/fish_title.fish +++ fish/functions/fish_title.fish @@ -0,0 +1,3 @@ +function fish_title + echo (status current-command) · (prompt_pwd) · (prompt_hostname) +end ADDED fish/functions/gpg-sftp.fish Index: fish/functions/gpg-sftp.fish ================================================================== --- fish/functions/gpg-sftp.fish +++ fish/functions/gpg-sftp.fish @@ -0,0 +1,4 @@ +function gpg-sftp + set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh + sftp $argv +end ADDED fish/functions/gpg-ssh-add.fish Index: fish/functions/gpg-ssh-add.fish ================================================================== --- fish/functions/gpg-ssh-add.fish +++ fish/functions/gpg-ssh-add.fish @@ -0,0 +1,4 @@ +function gpg-ssh-add + set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh + ssh-add $argv +end ADDED fish/functions/gpg-ssh.fish Index: fish/functions/gpg-ssh.fish ================================================================== --- fish/functions/gpg-ssh.fish +++ fish/functions/gpg-ssh.fish @@ -0,0 +1,4 @@ +function gpg-ssh + set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh + ssh $argv +end ADDED fish/functions/grep.fish Index: fish/functions/grep.fish ================================================================== --- fish/functions/grep.fish +++ fish/functions/grep.fish @@ -0,0 +1,7 @@ +function grep + if type -q ggrep + command ggrep --color=auto $argv + else + command grep --color=auto $argv + end +end ADDED fish/functions/ixio.fish Index: fish/functions/ixio.fish ================================================================== --- fish/functions/ixio.fish +++ fish/functions/ixio.fish @@ -0,0 +1,3 @@ +function ixio + curl -F 'f:1=<-' ix.io +end ADDED fish/functions/ls.fish Index: fish/functions/ls.fish ================================================================== --- fish/functions/ls.fish +++ fish/functions/ls.fish @@ -0,0 +1,7 @@ +function ls --description 'List contents of directory' + if type -q gls + command gls --color=auto $argv + else + command ls --color=auto $argv + end +end ADDED fish/functions/make.fish Index: fish/functions/make.fish ================================================================== --- fish/functions/make.fish +++ fish/functions/make.fish @@ -0,0 +1,15 @@ +# Automatically use bmake instead of make when using pkgsrc, if necessary +function make + if string match -q -r '/pkgsrc$|/pkgsrc/' $PWD + # pkgsrc does not like MAKEFLAGS including -j + set -lx MAKEFLAGS + + if type -q bmake + command bmake $argv + else + command make $argv + end + else + command make $argv + end +end ADDED fish/functions/mpv.fish Index: fish/functions/mpv.fish ================================================================== --- fish/functions/mpv.fish +++ fish/functions/mpv.fish @@ -0,0 +1,5 @@ +# To work around mpv not liking locales that use , as a decimal separator +function mpv + set -lx LC_ALL C + command mpv $argv +end ADDED fish/functions/pkg_chk.fish Index: fish/functions/pkg_chk.fish ================================================================== --- fish/functions/pkg_chk.fish +++ fish/functions/pkg_chk.fish @@ -0,0 +1,4 @@ +function pkg_chk + set -lx MAKEFLAGS + command pkg_chk $argv +end ADDED fish/functions/pkg_rolling-replace.fish Index: fish/functions/pkg_rolling-replace.fish ================================================================== --- fish/functions/pkg_rolling-replace.fish +++ fish/functions/pkg_rolling-replace.fish @@ -0,0 +1,4 @@ +function pkg_rolling-replace + set -lx MAKEFLAGS + command pkg_rolling-replace $argv +end ADDED fish/functions/prompt_pwd.fish Index: fish/functions/prompt_pwd.fish ================================================================== --- fish/functions/prompt_pwd.fish +++ fish/functions/prompt_pwd.fish @@ -0,0 +1,19 @@ +function prompt_pwd --description 'Print the current working directory' + set -l options 'h/help' + argparse -n prompt_pwd --max-args=0 $options -- $argv + or return + + if set -q _flag_help + __fish_print_help prompt_pwd + return 0 + end + + # Replace $HOME with "~" + set realhome ~ + set -l tmp (basename (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD)) + + test $PWD = "/$tmp" + and set tmp $PWD + + echo $tmp +end ADDED fish/functions/pw.fish Index: fish/functions/pw.fish ================================================================== --- fish/functions/pw.fish +++ fish/functions/pw.fish @@ -0,0 +1,13 @@ +function pw + set -l clipboard + if type -q pbcopy + set clipboard pbcopy + else if type -q xclip + set clipboard xclip + else + echo "No clipboard handler found!" + return 1 + end + + cryptopassphrase -k ~/.scrypt-pwgen.key $argv | tr -d '\n' | $clipboard +end ADDED fish/functions/pws.fish Index: fish/functions/pws.fish ================================================================== --- fish/functions/pws.fish +++ fish/functions/pws.fish @@ -0,0 +1,14 @@ +function pws + set -l clipboard + if type -q pbcopy + set clipboard pbcopy + else if type -q xclip + set clipboard xclip + else + echo "No clipboard handler found!" + return 1 + end + + cryptopassphrase -k ~/.scrypt-pwgen-server.key $argv \ + | tr -d '\n' | $clipboard +end ADDED fish/functions/run.fish Index: fish/functions/run.fish ================================================================== --- fish/functions/run.fish +++ fish/functions/run.fish @@ -0,0 +1,9 @@ +function run + if test (count $argv) = 0 + echo "Usage: run command" + return 1 + end + + $argv & + disown +end ADDED fish/functions/url2pkg.fish Index: fish/functions/url2pkg.fish ================================================================== --- fish/functions/url2pkg.fish +++ fish/functions/url2pkg.fish @@ -0,0 +1,5 @@ +# pkgsrc does not like MAKEFLAGS being set +function url2pkg + set -lx MAKEFLAGS + command url2pkg $argv +end ADDED youtube-dl/config Index: youtube-dl/config ================================================================== --- youtube-dl/config +++ youtube-dl/config @@ -0,0 +1,10 @@ +# 315 2160p[56]0 vp9 +# 308 1440p[56]0 vp9 +# 264 1440p avc1 +# 299 1080p[56]0 avc1 +# 137 1080p avc1 + +# -f 315+251/308+251/264+140/299+140/137+140/best +-f 308+251/264+140/299+140/137+140/best + +--merge-output-format mkv