2022-10-22 07:19:35 +00:00
|
|
|
#!/bin/sh
|
Misc: SSH, Vim, Helix, Ubuntu, setup, shells, ...
- SSH config: disable password and send COLORTERM
- Vim: use <space>u instead of <space>w
- Helix:
- Update for bug fixes after 23.10
- Install bash completions, desktop file, and icon
- Fix bufferline and inlay hints color
- Reenable auto pairs since smart tabs is a thing now
- Ubuntu:
- Update to 23.10
- Change naming convention
- Add podman and qemu-user-static
- Setup:
- Update install and swap config
- Add fish, Pods, Steam
- Fix CJK font config path
- Remove Firefox Wayland override now that it's the default
- Shells: configure fish
- Manual:
- Configure starship
- Use cargo locked install
- Remove sparse protocol config now that it's the default
- Fix failure when fish config directory is not found
- tmux: fix truecolor support for Alacritty
2023-09-27 23:48:38 +00:00
|
|
|
if grep -q '# custom' ~/.bashrc; then
|
|
|
|
echo 'found custom bash config, skipping'
|
|
|
|
exit 0
|
|
|
|
fi
|
2022-11-05 03:55:43 +00:00
|
|
|
cat >> ~/.bashrc << 'EOF'
|
|
|
|
|
|
|
|
# custom
|
|
|
|
|
|
|
|
umask 007
|
|
|
|
|
|
|
|
export EDITOR='vim'
|
|
|
|
export VISUAL='vim'
|
|
|
|
export GPG_TTY=$(tty)
|
|
|
|
|
2023-03-20 05:14:45 +00:00
|
|
|
if [[ -d "$HOME/.local/bin" && ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
|
|
|
|
PATH="$HOME/.local/bin:$PATH"
|
|
|
|
fi
|
|
|
|
|
2022-11-05 03:55:43 +00:00
|
|
|
# cool colored command prompt
|
|
|
|
|
|
|
|
PS1='${debian_chroot:+($debian_chroot)}\[\e[01;38;5;11m\]\u\[\e[00;38;5;208m\]@\[\e[01;38;5;27m\]\h\[\e[00m\]:\[\e[00;38;5;45m\]\w\[\e[0m\]\$ '
|
|
|
|
PROMPT_DIRTRIM=3
|
|
|
|
|
|
|
|
alias ls='ls --color'
|
2023-08-13 19:03:51 +00:00
|
|
|
alias bat='batcat'
|
|
|
|
alias mosh='mosh -o'
|
|
|
|
alias cargo='cargo auditable'
|
|
|
|
alias md='pulldown-cmark -TFSLH'
|
|
|
|
alias auto-av1='nice ab-av1 auto-encode --min-samples 2 --keyint 2s --scd true'
|
2022-11-05 03:55:43 +00:00
|
|
|
|
|
|
|
# Shows a oneline preview of all files under the folder after changing directory.
|
|
|
|
|
|
|
|
cd() {
|
|
|
|
builtin cd "$@" && ls -v -w $COLUMNS --color=always --format=commas --group-directories-first | head -n 1
|
|
|
|
}
|
|
|
|
|
|
|
|
pushd() {
|
|
|
|
builtin pushd "$@"
|
|
|
|
cd .
|
|
|
|
}
|
|
|
|
|
|
|
|
popd() {
|
|
|
|
builtin popd "$@"
|
|
|
|
cd .
|
|
|
|
}
|
|
|
|
EOF
|
2023-03-20 05:14:45 +00:00
|
|
|
if [ -f ~/.bash_profile ]; then
|
|
|
|
mv ~/.bash_profile ~/.bash_login
|
|
|
|
fi
|
2023-04-06 19:35:40 +00:00
|
|
|
if [ -f ~/.bash_login ]; then
|
|
|
|
cat >> ~/.bash_login << 'EOF'
|
|
|
|
|
|
|
|
# custom
|
|
|
|
|
|
|
|
EOF
|
|
|
|
else
|
|
|
|
cat >> ~/.bash_login << 'EOF'
|
2022-11-05 03:55:43 +00:00
|
|
|
|
|
|
|
# custom
|
|
|
|
|
2023-04-06 19:35:40 +00:00
|
|
|
if [ -f ~/.bashrc ]; then
|
|
|
|
. ~/.bashrc
|
|
|
|
fi
|
|
|
|
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
cat >> ~/.bash_login << 'EOF'
|
2022-11-05 03:55:43 +00:00
|
|
|
if [ -z "$TMUX" ] && [ -n "$SSH_TTY" ]; then
|
|
|
|
tput sc
|
|
|
|
tput smso
|
2023-03-20 05:14:45 +00:00
|
|
|
echo -n 'tmux: space / shell: any key'
|
2022-11-05 03:55:43 +00:00
|
|
|
tput sgr0
|
|
|
|
read -rsN1 input
|
|
|
|
tput rc
|
|
|
|
tput el
|
|
|
|
if [ "$input" = ' ' ]; then
|
2023-03-20 05:14:45 +00:00
|
|
|
exec tmux new -As default
|
2022-11-05 03:55:43 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
EOF
|