1
1
Fork 0

Bring zsh and fish back in sync

This commit is contained in:
Jonathan Schleifer 2022-11-25 22:16:50 +00:00
parent 84a7f938fb
commit fe8461f4b8
9 changed files with 81 additions and 46 deletions

View file

@ -43,7 +43,7 @@ function cross --description 'Set up cross-compilation environment'
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
@ -66,10 +66,10 @@ function cross --description 'Set up cross-compilation environment'
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
@ -106,7 +106,7 @@ function cross --description 'Set up cross-compilation environment'
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"
@ -115,10 +115,10 @@ function cross --description 'Set up cross-compilation environment'
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"
@ -130,9 +130,9 @@ function cross --description 'Set up cross-compilation environment'
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!'
@ -143,7 +143,7 @@ function cross --description 'Set up cross-compilation environment'
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 '*'

View file

@ -1,6 +1,6 @@
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

View file

@ -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

View file

@ -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

15
fish/functions/pwnk.fish Normal file
View file

@ -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

View file

@ -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

13
fish/functions/uart.fish Normal file
View file

@ -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