dotfiles/auto/shells/fish
DuckDuckWhale 9736e73c8e
Misc: setup, fish, auto, helix, starship, system
- Setup: add Fedora guides, Signal, Dynamic Desktop, and Flatseal
- Shells: fix $() on older fish versions and unalias batcat on Fedora
- Auto:
    - Detect git dependency
    - Add .clang-format for C/C++ family
    - Add full-setup script
- Helix: update to 24.03, add text width, rulers, and fix reflow
- Rust: fix fish env
- Starship: fix config path
- System: rename mac fnmode scripts and update sshd_config
2024-07-02 19:04:41 -07:00

67 lines
3.1 KiB
Bash
Executable File

#!/bin/sh -e
if [ -f ~/.config/fish/config.fish ]; then
echo 'fish config found, skipping'
exit 0
fi
mkdir -p ~/.config/fish
cat >> ~/.config/fish/config.fish << 'EOF'
function fish_greeting
echo ' '(set_color F00)'___
___======____='(set_color FF7F00)'-'(set_color FF0)'-'(set_color FF7F00)'-='(set_color F00)')
/T \_'(set_color FF0)'--='(set_color FF7F00)'=='(set_color F00)') '\
(set_color yellow)(whoami)(set_color FF7F00)'@'(set_color blue)(hostname)(set_color red)'
[ \ '(set_color FF7F00)'('(set_color FF0)'0'(set_color FF7F00)') '(set_color F00)'\~ \_'\
(set_color FF0)'-='(set_color FF7F00)'='(set_color F00)')'(set_color FF7F00)' Uptime: '\
(set_color white)(uptime -p | sed 's/up \(.*\)/\1/')(set_color red)'
\ / )J'(set_color FF7F00)'~~ \\'(set_color FF0)'-='(set_color F00)') IP Address: '\
(set_color white)(begin; ip -o route get to 1.1.1.1 2> /dev/null || echo network error; end | \
sed 's/.*src \([0-9.]\+\).*/\1/' || echo not found)(set_color red)'
\\\\___/ )JJ'(set_color FF7F00)'~'(set_color FF0)'~~ '(set_color F00)'\) '(set_color red)\
'Memory used: '(set_color white)(free -h | grep Mem | awk '/Mem/ { print "mem " $3 " / " $2 ", "}')\
(free -h | grep Swap | awk '/Swap/ { print "swap " $3 " / " $2 }')(set_color red)'
\_____/JJJ'(set_color FF7F00)'~~'(set_color FF0)'~~ '(set_color F00)'\\ '\
(set_color yellow)'Load average: '(set_color white)(uptime | sed 's/.*average: \(.*\)/\1/')\
(set_color red)'
'(set_color FF7F00)'/ '(set_color FF0)'\ '(set_color FF0)', \\'(set_color F00)'J'\
(set_color FF7F00)'~~~'(set_color FF0)'~~ '(set_color FF7F00)'\\
(-'(set_color FF0)'\)'(set_color F00)'\='(set_color FF7F00)'|'(set_color FF0)'\\\\\\'\
(set_color FF7F00)'~~'(set_color FF0)'~~ '(set_color FF7F00)'L_'(set_color FF0)'_
'(set_color FF7F00)'('(set_color F00)'\\'(set_color FF7F00)'\\) ('(set_color FF0)'\\'\
(set_color FF7F00)'\\\)'(set_color F00)'_ '(set_color FF0)'\=='(set_color FF7F00)'__
'(set_color F00)'\V '(set_color FF7F00)'\\\\'(set_color F00)'\) =='(set_color FF7F00)\
'=_____ '(set_color FF0)'\\\\\\\\'(set_color FF7F00)'\\\\
'(set_color F00)'\V) \_) '(set_color FF7F00)'\\\\'(set_color FF0)'\\\\JJ\\'\
(set_color FF7F00)'J\)
'(set_color F00)'/'(set_color FF7F00)'J'(set_color FF0)'\\'(set_color FF7F00)\
'J'(set_color F00)'T\\'(set_color FF7F00)'JJJ'(set_color F00)'J)
(J'(set_color FF7F00)'JJ'(set_color F00)'| \UUU)
(UU)'(set_color normal)
if status is-interactive
if [ -z "$TMUX" -a -n "$SSH_TTY" ]
tput sc
set stty_orig (stty -g)
stty -echo
read -n 1 -P (set_color -r)'tmux: space / shell: any key' input
stty "$stty_orig"
tput rc
tput el
if [ "$input" = ' ' ]
exec tmux new -As default
end
end
end
end
umask 007
export EDITOR='vim'
export VISUAL='vim'
export GPG_TTY=(tty)
export PATH="$HOME/.local/bin:$PATH:/usr/lib/llvm-15/bin"
alias md='pulldown-cmark -TFSLH'
alias mosh='mosh -o'
alias cargo='cargo auditable'
alias auto-av1='ab-av1 auto-encode --min-samples 2 --keyint 2s --scd true'
EOF