From c1438b1baa07dde00a48943cadaa7ca86291cba9 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Sun, 4 Jun 2023 08:02:06 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20:=20s=C3=A9paration=20entre=20ahrc-lapt?= =?UTF-8?q?op=20et=20ahrc-pc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/bash/bashrc.d/ahurac-ahrc-laptop.bashrc | 19 +++++++++++++++++++ .../{ahurac.bashrc => ahurac-ahrc-pc.bashrc} | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 etc/bash/bashrc.d/ahurac-ahrc-laptop.bashrc rename etc/bash/bashrc.d/{ahurac.bashrc => ahurac-ahrc-pc.bashrc} (73%) diff --git a/etc/bash/bashrc.d/ahurac-ahrc-laptop.bashrc b/etc/bash/bashrc.d/ahurac-ahrc-laptop.bashrc new file mode 100644 index 0000000..ce5ebb3 --- /dev/null +++ b/etc/bash/bashrc.d/ahurac-ahrc-laptop.bashrc @@ -0,0 +1,19 @@ +# Lines added by ahurac + +# PS1 +if [ "$(id -u)" -eq 0 ]; then + ps1_color_1=1 + ps1_color_2=10 +else + ps1_color_1=2 + ps1_color_2=4 +fi +export PS1="(\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;${ps1_color_1}m\]\u@\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;${ps1_color_2}m\]\W\[$(tput sgr0)\])\\$ \[$(tput sgr0)\]" + +shrc_d=/usr/local/etc/sh/shrc.d +if [ -d "$shrc_d" ]; then + for i in "${shrc_d}/"*; do + . "$i" + done +fi + diff --git a/etc/bash/bashrc.d/ahurac.bashrc b/etc/bash/bashrc.d/ahurac-ahrc-pc.bashrc similarity index 73% rename from etc/bash/bashrc.d/ahurac.bashrc rename to etc/bash/bashrc.d/ahurac-ahrc-pc.bashrc index f4cadc9..950de36 100644 --- a/etc/bash/bashrc.d/ahurac.bashrc +++ b/etc/bash/bashrc.d/ahurac-ahrc-pc.bashrc @@ -10,3 +10,10 @@ else fi export PS1="[\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;${ps1_color_1}m\]\u@\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;${ps1_color_2}m\]\W\[$(tput sgr0)\]]\\$ \[$(tput sgr0)\]" +shrc_d=/usr/local/etc/sh/shrc.d +if [ -d "$shrc_d" ]; then + for i in "${shrc_d}/"*; do + . "$i" + done +fi +