From 8d38397249b2b68f755743e13cc0706a8ec7f931 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Fri, 13 Oct 2023 09:24:44 +0200 Subject: [PATCH] Remaniement : configuration system-wide de bash --- etc/bash/bashrc.d/30-ahrc--laptop.bashrc | 3 +++ etc/bash/bashrc.d/30-ahrc--pc.bashrc | 3 +++ etc/bash/bashrc.d/30-tera--io.bashrc | 4 ++++ etc/bash/bashrc.d/50-ahurac.bashrc | 14 ++++++++++++++ etc/bash/bashrc.d/ahrc-laptop.bashrc | 10 ---------- etc/bash/bashrc.d/ahrc-pc.bashrc | 10 ---------- etc/bash/bashrc.d/ahurac.bashrc | 7 ------- etc/bash/bashrc.d/tera-io.bashrc | 12 ------------ 8 files changed, 24 insertions(+), 39 deletions(-) create mode 100644 etc/bash/bashrc.d/30-ahrc--laptop.bashrc create mode 100644 etc/bash/bashrc.d/30-ahrc--pc.bashrc create mode 100644 etc/bash/bashrc.d/30-tera--io.bashrc create mode 100644 etc/bash/bashrc.d/50-ahurac.bashrc delete mode 100644 etc/bash/bashrc.d/ahrc-laptop.bashrc delete mode 100644 etc/bash/bashrc.d/ahrc-pc.bashrc delete mode 100644 etc/bash/bashrc.d/ahurac.bashrc delete mode 100644 etc/bash/bashrc.d/tera-io.bashrc diff --git a/etc/bash/bashrc.d/30-ahrc--laptop.bashrc b/etc/bash/bashrc.d/30-ahrc--laptop.bashrc new file mode 100644 index 0000000..2dcbd5d --- /dev/null +++ b/etc/bash/bashrc.d/30-ahrc--laptop.bashrc @@ -0,0 +1,3 @@ +ps1_brackets='()' +ps1_color_1=32 +ps1_color_2=34 diff --git a/etc/bash/bashrc.d/30-ahrc--pc.bashrc b/etc/bash/bashrc.d/30-ahrc--pc.bashrc new file mode 100644 index 0000000..7cd2ffd --- /dev/null +++ b/etc/bash/bashrc.d/30-ahrc--pc.bashrc @@ -0,0 +1,3 @@ +ps1_brackets='[]' +ps1_color_1=35 +ps1_color_2=34 diff --git a/etc/bash/bashrc.d/30-tera--io.bashrc b/etc/bash/bashrc.d/30-tera--io.bashrc new file mode 100644 index 0000000..fa0ddc3 --- /dev/null +++ b/etc/bash/bashrc.d/30-tera--io.bashrc @@ -0,0 +1,4 @@ +ps1_color_1=36 +ps1_color_2=34 + +export SYSTEMD_PAGER= diff --git a/etc/bash/bashrc.d/50-ahurac.bashrc b/etc/bash/bashrc.d/50-ahurac.bashrc new file mode 100644 index 0000000..97346cf --- /dev/null +++ b/etc/bash/bashrc.d/50-ahurac.bashrc @@ -0,0 +1,14 @@ +if [ "$(id -u)" -eq 0 ]; then + ps1_color_1=31 + ps1_color_2=32 +fi + +PS1="\033[0m${ps1_brackets:0:1}\033[1;${ps1_color_1}m\u@\h\033[0m \033[1;${ps1_color_2}m\W\033[0m${ps1_brackets:1:1}\$ " + +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/ahrc-laptop.bashrc b/etc/bash/bashrc.d/ahrc-laptop.bashrc deleted file mode 100644 index 69356c3..0000000 --- a/etc/bash/bashrc.d/ahrc-laptop.bashrc +++ /dev/null @@ -1,10 +0,0 @@ -# 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)\]" - diff --git a/etc/bash/bashrc.d/ahrc-pc.bashrc b/etc/bash/bashrc.d/ahrc-pc.bashrc deleted file mode 100644 index 48ca71f..0000000 --- a/etc/bash/bashrc.d/ahrc-pc.bashrc +++ /dev/null @@ -1,10 +0,0 @@ -# PS1 -if [ "$(id -u)" -eq 0 ]; then - ps1_color_1=1 - ps1_color_2=10 -else - ps1_color_1=5 - 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)\]" - diff --git a/etc/bash/bashrc.d/ahurac.bashrc b/etc/bash/bashrc.d/ahurac.bashrc deleted file mode 100644 index 9cc867e..0000000 --- a/etc/bash/bashrc.d/ahurac.bashrc +++ /dev/null @@ -1,7 +0,0 @@ -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/tera-io.bashrc b/etc/bash/bashrc.d/tera-io.bashrc deleted file mode 100644 index 55f34ee..0000000 --- a/etc/bash/bashrc.d/tera-io.bashrc +++ /dev/null @@ -1,12 +0,0 @@ -# PS1 -if [ "$(id -u)" -eq 0 ]; then - ps1_color_1=1 - ps1_color_2=10 -else - ps1_color_1=6 - 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)\]" - -export SYSTEMD_PAGER= -