- 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
81 lines
1.4 KiB
Bash
Executable File
81 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
if grep -q '# custom' ~/.bashrc; then
|
|
echo 'found custom bash config, skipping'
|
|
exit 0
|
|
fi
|
|
cat >> ~/.bashrc << 'EOF'
|
|
|
|
# custom
|
|
|
|
umask 007
|
|
|
|
export EDITOR='vim'
|
|
export VISUAL='vim'
|
|
export GPG_TTY=$(tty)
|
|
|
|
if [[ -d "$HOME/.local/bin" && ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
|
|
PATH="$HOME/.local/bin:$PATH"
|
|
fi
|
|
|
|
# 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'
|
|
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'
|
|
|
|
# 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
|
|
if [ -f ~/.bash_profile ]; then
|
|
mv ~/.bash_profile ~/.bash_login
|
|
fi
|
|
if [ -f ~/.bash_login ]; then
|
|
cat >> ~/.bash_login << 'EOF'
|
|
|
|
# custom
|
|
|
|
EOF
|
|
else
|
|
cat >> ~/.bash_login << 'EOF'
|
|
|
|
# custom
|
|
|
|
if [ -f ~/.bashrc ]; then
|
|
. ~/.bashrc
|
|
fi
|
|
|
|
EOF
|
|
fi
|
|
cat >> ~/.bash_login << 'EOF'
|
|
if [ -z "$TMUX" ] && [ -n "$SSH_TTY" ]; then
|
|
tput sc
|
|
tput smso
|
|
echo -n 'tmux: space / shell: any key'
|
|
tput sgr0
|
|
read -rsN1 input
|
|
tput rc
|
|
tput el
|
|
if [ "$input" = ' ' ]; then
|
|
exec tmux new -As default
|
|
fi
|
|
fi
|
|
EOF
|