1
0

Added bash config

Copied over old .bashrc and .bash_aliases because they didn't need
really need changing
Slightly changed .bash_profile for starting graphical setups
Added simple starship.toml setup
Updated install script to copy/pull new files
This commit is contained in:
2025-09-25 18:08:46 +01:00
parent ffcf0f02c2
commit 42189f6687
5 changed files with 133 additions and 1 deletions

16
bash_aliases Normal file
View File

@@ -0,0 +1,16 @@
# Alias sudo to have a space at the end so it can be used with other aliases
alias sudo='sudo '
# Auto remove any packages that may be left over as dependencies
alias autorem='pacman -Rsn $(pacman -Qdtq)'
# Enable basic options for colour etc.
alias ls='ls -CFlvh --color=always --group-directories-first'
alias grep='grep --color=always'
alias less='less -R'
# Neovim instead of vim
alias vim='nvim'
# Out of habit
alias quit='exit'

34
bash_profile Normal file
View File

@@ -0,0 +1,34 @@
# Source .bashrc
[[ -f "$HOME/.bashrc" ]] && . "$HOME/.bashrc"
case $HOSTNAME in
# More can be added here in the future
kanto|tokyo)
HEADLESS=0
;;
*)
HEADLESS=1
;;
esac
if [[ $HEADLESS -eq 0 && -z $WAYLAND_DISPLAY && $XDG_VTNR -eq 1 ]];
then
export GTK_THEME=Adwaita:dark
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland-egl
export QT_QPA_PLATFORMTHEME=qt5ct
export SDL_VIDEODRIVER=wayland
case $HOSTNAME in
kanto)
export WLR_NO_HARDWARE_CURSORS=1
# Desktop with nvidia gpu
exec sway --unsupported-gpu
;;
tokyo)
# Laptop with intel gpu
exec sway
;;
esac
fi

40
bashrc Normal file
View File

@@ -0,0 +1,40 @@
# Make sure we are running interactively
[[ $- != *i* ]] && return
# Source aliases
[[ -f "$HOME/.bash_aliases" ]] && . "$HOME/.bash_aliases"
# Source devkitPro env if available
[[ -f "/etc/profile.d/devkit-env.sh" ]] && . "/etc/profile.d/devkit-env.sh"
# Misc options
shopt -s checkwinsize
shopt -s globstar
# History options
HISTCONTROL=ignoreboth
HISTSIZE=1000
HISTFILESIZE=2000
shopt -s histappend
# Disable history file for less
export LESSHISTFILE="-"
# Use neovim as editor
export EDITOR=nvim
# Required for passphrase input with gpg
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
gpg-connect-agent updatestartuptty /bye > /dev/null
# Append / to the end of symlinked directories
bind 'set mark-symlinked-directories on'
# Make C-w only delete up to first / in path
stty werase undef
bind '\C-w:unix-filename-rubout'
# If available setup execute starship prompt, otherwise default to a basic PS1
export PS1="[\033[01;92m\u@\h\033[00m] :: \033[00;34m\w \033[01;36m> \033[0;0m"
[[ $(command -v "starship") ]] && eval "$(starship init bash)"

33
config/starship.toml Normal file
View File

@@ -0,0 +1,33 @@
add_newline = false
scan_timeout = 10
format = "\\[$username$hostname\\] :: $directory $cmd_duration$character"
[line_break]
disabled = true
[hostname]
ssh_only = false
style = "bright-blue bold"
format = "[@$hostname]($style)"
[username]
show_always = true
style_user = "bright-blue bold"
style_root = "bright-red bold"
format="[$user]($style)"
[directory]
truncation_length = 3
truncate_to_repo = true
style = "blue"
read_only = "!"
read_only_style = "red"
format = "[$path]($style)[$read_only]($read_only_style)"
[cmd_duration]
style = "bold yellow"
format = "[+$duration]($style) "
[character]
success_symbol = "[>](cyan bold)"
error_symbol = "[>](red bold)"

9
dots
View File

@@ -10,6 +10,10 @@ Install() {
[[ ! -d "$1" ]] && mkdir -p "$1" [[ ! -d "$1" ]] && mkdir -p "$1"
cp "bashrc" "$1/.bashrc"
cp "bash_profile" "$1/.bash_profile"
cp "bash_aliases" "$1/.bash_aliases"
cp -RT "config" "$1/.config" cp -RT "config" "$1/.config"
} }
@@ -19,6 +23,11 @@ Pull() {
echo "[Info] :: Pulling dotfile changes from $1" echo "[Info] :: Pulling dotfile changes from $1"
cp -r "$1/.config/nvim" "config/" cp -r "$1/.config/nvim" "config/"
cp "$1/.config/starship.toml" "config/starship.toml"
cp "$1/.bashrc" "bashrc"
cp "$1/.bash_profile" "bash_profile"
cp "$1/.bash_aliases" "bash_aliases"
} }
INSTALL_DIR=${2:-$HOME} INSTALL_DIR=${2:-$HOME}