Index: fish/config.fish ================================================================== --- fish/config.fish +++ fish/config.fish @@ -24,17 +24,40 @@ set -g fish_color_vcs_braces 29bc7d set -g fish_normal_user js test -n "$XDG_CONFIG_HOME" -or set -x XDG_CONFIG_HOME $HOME/.config +or set -x XDG_CONFIG_HOME "$HOME/.config" test -n "$XDG_CACHE_HOME" -or set -x XDG_CACHE_HOME $HOME/.cache +or set -x XDG_CACHE_HOME "$HOME/.cache" test -n "$XDG_DATA_HOME" -or set -x XDG_DATA_HOME $HOME/.local/share +or set -x XDG_DATA_HOME "$HOME/.local/share" set -x EDITOR vim set -x VIMINIT "source $XDG_CONFIG_HOME/vim/vimrc" 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' set -x SUDO_PROMPT (printf "\033[0;31m[\033[1;31msudo -> %%U\033[0;31m]\033[0m Password for \033[1m%%p@%%H\033[0m: ") -set -x GNUPGHOME $XDG_DATA_HOME/gnupg +set -x GNUPGHOME "$XDG_DATA_HOME/gnupg" set -x CVS_RSH ssh + +if type -q gpg + # Make sure the GPG agent is running + gpg --card-status &>/dev/null + + set -l sock + if test -d "$XDG_RUNTIME_DIR/gnupg" + set sock (find $XDG_RUNTIME_DIR/gnupg -name S.gpg-agent.ssh | head -1) + end + if test -z "$sock" + set sock "$GNUPGHOME/S.gpg-agent.ssh" + end + + alias gssh="SSH_AUTH_SOCKET=$sock ssh" + alias gssh-add="SSH_AUTH_SOCKET=$sock ssh-add" + alias gsftp="SSH_AUTH_SOCKET=$sock sftp" +end + +if test (uname -s) = Darwin + set -x MAKEFLAGS -j(math (sysctl -n machdep.cpu.thread_count)'*2') +else if type -q nproc + set -x MAKEFLAGS -j(math (nproc)'*2') +end Index: fish/functions/cross.fish ================================================================== --- fish/functions/cross.fish +++ fish/functions/cross.fish @@ -41,11 +41,11 @@ 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 + if not type -q xcrun echo 'Can only cross-compile for iOS on a Mac with Xcode!' return 1 end set -l sdk_type @@ -64,14 +64,14 @@ if test (count $archs) = 0 set archs $default_archs end - set -gx CC clang --sysroot $sdk - set -gx CPP clang -E --sysroot $sdk - set -gx CXX clang++ --sysroot $sdk - set -gx CXXPP clang++ -E --sysroot $sdk + 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 @@ -104,23 +104,23 @@ return 1 end set PATH $prefix/cross/$cross_host/bin $PATH case morphos - set -l prefix (pkg_info -qp ppc-morphos-gcc-9 | + set -l prefix (pkg_info -qp ppc-morphos-gcc-11 | 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 -gx CC ppc-morphos-gcc-11 + set -gx CXX ppc-morphos-g++-11 + set -gx OBJC ppc-morphos-gcc-11 + set -gx OBJCXX ppc-morphos-g++-11 set -g cross_host ppc-morphos case switch if test -z "$DEVKITPRO" echo 'Please set DEVKITPRO!' return 1 @@ -128,13 +128,13 @@ if test -z "$DEVKITA64" echo 'Please set DEVKITA64!' return 1 end - set PATH $DEVKITA64/bin $PATH + set PATH $DEVKITA64/bin $DEVKITPRO/tools/bin $PATH set -g cross_host aarch64-none-elf - set -g objfw_configure_flags --with-switch + set -g objfw_configure_flags --with-nintendo-switch case wii wii-u if test -z "$DEVKITPRO" echo 'Please set DEVKITPRO!' return 1 end @@ -141,15 +141,15 @@ if test -z "$DEVKITPPC" echo 'Please set DEVKITPPC!' return 1 end - set PATH $DEVKITPPC/bin $PATH + set PATH $DEVKITPPC/bin $DEVKITPRO/tools/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 Index: fish/functions/flgrep.fish ================================================================== --- fish/functions/flgrep.fish +++ fish/functions/flgrep.fish @@ -1,8 +1,8 @@ function flgrep set -l ret - fossil changes --all . | sed 's/^.* //' | while read file + fossil changes --all . | awk '{ print $2 }' | while read file grep -H $argv "$file" && set ret 0 test $status -gt 1 && return $status end return $ret end ADDED fish/functions/power_now.fish Index: fish/functions/power_now.fish ================================================================== --- fish/functions/power_now.fish +++ fish/functions/power_now.fish @@ -0,0 +1,5 @@ +if test -f /sys/class/power_supply/BAT0/power_now + function power_now + awk '{ print $1*10^-6 " W" }' /sys/class/power_supply/BAT0/power_now + end +end Index: fish/functions/pw.fish ================================================================== --- fish/functions/pw.fish +++ fish/functions/pw.fish @@ -1,13 +1,3 @@ -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 ~/.cryptopassphrase.key $argv | tr -d '\n' | $clipboard +function pw --wraps pwnk + pwnk -k ~/.cryptopassphrase.key $argv end ADDED fish/functions/pwnk.fish Index: fish/functions/pwnk.fish ================================================================== --- fish/functions/pwnk.fish +++ fish/functions/pwnk.fish @@ -0,0 +1,15 @@ +function pwnk + set -l clipboard + if type -q wl-copy + set clipboard wl-copy + else 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 $argv | tr -d '\n' | $clipboard +end Index: fish/functions/pws.fish ================================================================== --- fish/functions/pws.fish +++ fish/functions/pws.fish @@ -1,14 +1,3 @@ -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 ~/.cryptopassphrase-server.key $argv \ - | tr -d '\n' | $clipboard +function pw --wraps pwnk + pwnk -k ~/.cryptopassphrase-server.key $argv end ADDED fish/functions/uart.fish Index: fish/functions/uart.fish ================================================================== --- fish/functions/uart.fish +++ fish/functions/uart.fish @@ -0,0 +1,13 @@ +switch (uname -s) + case Linux + function uart + if not set -q argv[1] + set argv[1] 115200 + end + if not set -q argv[2] + set argv[2] 0 + end + screen /dev/ttyUSB"$argv[2]" "$argv[1]" + end + end +end Index: zshrc ================================================================== --- zshrc +++ zshrc @@ -367,11 +367,11 @@ # Make sure GPG agent is running. gpg --card-status &>/dev/null local sock if [ -d "$XDG_RUNTIME_DIR/gnupg" ]; then - sock=$(find $XDG_RUNTIME_DIR/gnupg -name S.gpg-agent.ssh | + sock=$(find "$XDG_RUNTIME_DIR/gnupg" -name S.gpg-agent.ssh | head -1) fi [ -n "$sock" ] || sock="$GNUPGHOME/S.gpg-agent.ssh" alias gssh="SSH_AUTH_SOCK=$sock ssh" @@ -565,16 +565,16 @@ switch) if [ -z "$DEVKITPRO" ]; then echo "Please set DEVKITPRO!" return 1 fi - if [ -z $"DEVKITA64" ]; then + if [ -z "$DEVKITA64" ]; then echo "Please set DEVKITA64!" return 1 fi - export PATH="$DEVKITA64/bin:$PATH" + export PATH="$DEVKITA64/bin:$DEVKITPRO/tools/bin:$PATH" export cross_host="aarch64-none-elf" export objfw_configure_flags="--with-$1" ;; wii | wii-u) if [ -z "$DEVKITPRO" ]; then