Ajouter bash_aliases
This commit is contained in:
parent
d68eb3b8a9
commit
d088ef379a
28
bash_aliases
Normal file
28
bash_aliases
Normal file
@ -0,0 +1,28 @@
|
||||
# Git
|
||||
parse_git_branch() {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
|
||||
}
|
||||
|
||||
# Docker context
|
||||
function docker_context_prompt() {
|
||||
local docker_context=$(docker context show 2> /dev/null)
|
||||
# Vérifie si le contexte est "default" et ajuste l'affichage en conséquence
|
||||
if [[ "$docker_context" == "default" ]]; then
|
||||
echo " "
|
||||
elif [[ -n "$docker_context" ]]; then
|
||||
echo "($docker_context)"
|
||||
fi
|
||||
}
|
||||
|
||||
# Créer avec https://ezprompt.net/
|
||||
export PS1="\n\[\e[37m\]\A\[\e[m\] \[\e[31m\]\h\[\e[m\] \[\e[34m\]\u\[\e[m\] [ \w ] \[\e[35m\]\`parse_git_branch\` \e[36m\]\`docker_context_prompt\`\[\e[m\]\n ~> "
|
||||
|
||||
# Alias
|
||||
alias fastfetch='fastfetch -l /home/${USER}/.config/fastfetch/ASCII/gandalf.txt --color white'
|
||||
alias rm="rm -i"
|
||||
alias rmdir="rm -rf --interactive=once"
|
||||
alias rmrf="rm -rf --interactive=once"
|
||||
alias sudo="sudo "
|
||||
|
||||
fastfetch
|
||||
cat /var/log/update.log
|
Loading…
x
Reference in New Issue
Block a user