bash: add bashrc, alias and envs (also add .bashrc for root user)

This commit is contained in:
inkch 2024-01-17 19:40:29 +09:00
parent 33c0936e53
commit 3e8e8c769e
5 changed files with 37 additions and 0 deletions

11
.chezmoitemplates/bashrc Normal file
View File

@ -0,0 +1,11 @@
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Set enviroment variables here.
[[ -f ~/.config/bash/envs ]] && . ~/.config/bash/envs
# Source (read) `alias` file.
[[ -f ~/.config/bash/alias ]] && . ~/.config/bash/alias
# Customize prompt
PS1='[\u@\h \W]\$ '

1
dot_bashrc.tmpl Normal file
View File

@ -0,0 +1 @@
{{- template "bashrc" . -}}

View File

@ -0,0 +1,9 @@
if command -v exa &> /dev/null
then
alias ls='exa'
alias la='exa -lag'
alias tree='exa -a --tree --git-ignore --level=3'
else
alias ls='ls --color=auto'
alias la='ls --color=auto -la'
fi

View File

@ -0,0 +1 @@
{{- template "bashrc" . -}}

15
dot_config/bash/envs.tmpl Normal file
View File

@ -0,0 +1,15 @@
export XDG_CONFIG_HOME="$HOME"/.config
export XDG_DATA_HOME="$HOME"/.local/share
export XDG_RUNTIME_DIR=/run/user/{{ .chezmoi.uid }}
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_DESKTOP_DIR="$HOME/vc/desk"
export XDG_DOCUMENTS_DIR="$HOME/vc/docs"
export XDG_DOWNLOAD_DIR="$HOME/dl"
export XDG_MUSIC_DIR="$HOME/vc/audio"
export XDG_PICTURES_DIR="$HOME/vc/pix"
export XDG_VIDEOS_DIR="$HOME/vc/vids"
export HISTFILE="$XDG_DATA_HOME"/bash/history
export PATH="$XDG_DATA_HOME/cargo/bin:$PATH"