From 91e23be94fe21a03bab884848617002101d1419d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Tansorier?= Date: Tue, 8 Nov 2022 17:37:25 +0100 Subject: [PATCH] bashrc: Add function to print compilater in prompt --- bashrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index 07a5624..991de7a 100644 --- a/bashrc +++ b/bashrc @@ -32,10 +32,18 @@ print_time() { printf "%*s%s\r" "$(tput cols)" "($(date +%H:%M))" } +# print cc compilater +print_cc() { + if [ ! -z "${CC}" ] + then + echo ${CC} | awk '{print " ["$1"]";}' + fi +} + # prompt sans heure -PS1='\[\033[00;35m\][${debian_chroot:+($debian_chroot)}\u@\h\[\033[00;35m\]:\[\033[00;36m\]\w\[\033[00;35m\]]\[\033[00;31m\]$(parse_git_branch)\n\[\033[00m\]\$ ' +PS1='\[\033[00;35m\][${debian_chroot:+($debian_chroot)}\u@\h\[\033[00;35m\]:\[\033[00;36m\]\w\[\033[00;35m\]]\[\033[00;31m\]$(parse_git_branch)\[\033[00;34m\]$(print_cc)\n\[\033[00m\]\$ ' # prompt avec heure -PS1='\[\033[00;33m\]$(print_time)\[\033[00;35m\][${debian_chroot:+($debian_chroot)}\u@\h\[\033[00;35m\]:\[\033[00;36m\]\w\[\033[00;35m\]]\[\033[00;31m\]$(parse_git_branch)\n\[\033[00m\]\$ ' +PS1='\[\033[00;33m\]$(print_time)\[\033[00;35m\][${debian_chroot:+($debian_chroot)}\u@\h\[\033[00;35m\]:\[\033[00;36m\]\w\[\033[00;35m\]]\[\033[00;31m\]$(parse_git_branch)\[\033[00;34m\]$(print_cc)\n\[\033[00m\]\$ ' ### Completion ###