From 56dfeda5e7403591d79f556aef1798a86588e53a Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Mon, 14 Mar 2022 13:49:23 +0100 Subject: [PATCH] Initial commit - New Prompt --- README.md | 28 ++++++++++ bash-tools_echolib_prompt.png | Bin 0 -> 14796 bytes etc/profile.d/prompt.sh | 99 ++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 README.md create mode 100644 bash-tools_echolib_prompt.png create mode 100644 etc/profile.d/prompt.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..d979d01 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# Bash Tools + +Some Tools and convenient scripts to make using Console Life Better. +These tools in this repo are made for global use. Folders Structure is +kept to know where they must be copied in your system. + +# How to install +You will need sudo, as scripts are intended to be global + +``` +# Get scripts +git clone https://git.a-lec.org/echolib/bash-tools.git + +# Copy scripts (example) in the global profile folder +sudo cp ~/bash_tools/etc/profile.d/* /etc/profile.d/ +``` + +As bash scripts, you will have to manually edit /etc/bash.bashrc and +add - according to your needs - a load script line + +``` +# Change Prompt with this one +[[ -f /etc/profile.d/prompt.sh ]] && . /etc/profile.d/prompt.sh +``` + +# ToDo ? +There will be a lot more to come soon. Maybe then, i will create a setup +to help you install what you need. diff --git a/bash-tools_echolib_prompt.png b/bash-tools_echolib_prompt.png new file mode 100644 index 0000000000000000000000000000000000000000..b924bcd2a5fc29889b6fc2a0a2d525b4ae27abb2 GIT binary patch literal 14796 zcmdUWby${LyXT8YNQZQTibx}!0wO6OAt8+@ASEFnEsX*qk`j_igGhImgd&1;m$Y=w z{p{~tGjqOc&bem(oc#xTgPX_otaY#Z{?!|*t}2g@Lydz%q3{(I?rNY=Xh!hgKd>?3 z>m{zw`0%gGPBMyG*zk`h_Tv!vp2}HH*ICp4iLee zdV?ei#fVb8E3M_0v_9cspmKD9wWV{w&PMi5@a*lQ$4*um2FKpR$$}4WzSHJfsL{== z_xx?kqFlu-!~8(Mr`+&G9LE=h9~xXON;z3_Q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gjU{3 zfG#Y;!n%iR^}rAz?tOi`$^$I-9b&QB^`AMUaCSj30ze93W??}WvY%{)WbOdCjj_ut z@HoxZOPc`k)4=$HXdhT{vmic0fLa1hOE=-FKloEFW_}f5!9u*5nbaAjZXKZskM|+{ z-yPz6vbf-%VCvK5ix#2#RR#s5NCgn>^ucOCoG|+>68`3miM93Ut#@OH*9N)uXYe7q!{LVWK%l)% z@Chq`!jKUl1Q8jMnEL6F@Y|~3cK`;zr^lAtl?H- z@*7}&zicqWAY(8fOA5PS_Fvk0|Mp42e>403U;p&?1^TJ#{wvb^O;hl3Oq8OW>fJ&a HlUM%(b0D_A literal 0 HcmV?d00001 diff --git a/etc/profile.d/prompt.sh b/etc/profile.d/prompt.sh new file mode 100644 index 0000000..1d5dbfb --- /dev/null +++ b/etc/profile.d/prompt.sh @@ -0,0 +1,99 @@ +#!/bin/bash +_ps1__refresh_history() { +history -n +history -w +history -c +history -r + +tac "$HISTFILE" \ + | awk '!x[$0]++' \ + > /tmp/refreshprompt \ + && tac /tmp/refreshprompt \ + > "$HISTFILE" + +rm /tmp/refreshprompt +} + +# Adding new blank line for readability +_ps1__pre_prompt_blankline() { +IFS=';' read -sdR -p $'\E[6n' ROW COL +if ! [[ `echo "${ROW#*[}"` == 1 ]];then + if [[ $_ps1_verylight ]];then + _ps1_Hline="" + else + if [[ $_ps1_color ]];then + _ps1_Hline=`echo;printf "\e[2m🭻\e[0m%.0b" {1..26}` + else + _ps1_Hline=`echo;printf '🭻%.0b' {1..26}` + fi + fi + printf "%b\n" "${_ps1_Hline}" +fi +} + +# Preparing infos +_ps1__pre_prompt_set() { +_ps1_user="$USER" +_ps1_host="$HOSTNAME" + +_ps1_file=`\ +/bin/ls -1Ap \ + | /bin/grep -v / \ + | /usr/bin/wc -l \ + | /bin/sed 's: ::g'` + +_ps1_dirs=`\ +/bin/ls -1Ap \ + | /bin/grep / \ + | /usr/bin/wc -l \ + | /bin/sed 's: ::g'` + +_ps1_size=`\ +/bin/ls -lah \ + | /bin/grep -m 1 total \ + | /bin/sed 's/total //'` + +_ps1_time=`date +%H:%M` +_ps1_hist=$(( `cat $HISTFILE | wc -l` + 1 )) +_ps1_h=$PWD + +[[ $_ps1_h/ = "$HOME"/* ]] \ + && _ps1_h=\~${_ps1_h#$HOME} + +_ps1__pre_prompt_blankline +} + + +# 1. echolib Colored +_ps1__prompt_echolib() { +local _ps1_Exit="$?" +[[ ${_ps1_Exit} == 0 ]] \ + && _ps1_Exit=`echo -e "\e[32m${_ps1_Exit}\e[0m"` \ + || _ps1_Exit=`echo -e "\e[31m${_ps1_Exit}\e[0m"` + +_ps1__refresh_history +_ps1_color=true +_ps1__pre_prompt_set +unset _ps1_color + +# Line 1 +printf "%b %b %b %b\n" \ + " $_ps1_Exit" \ + "$_ps1_time" \ + "${C_Grey}!$_ps1_hist${NC}" \ + "${C_Green}$_ps1_user${NC}${C_Grey}@${NC}$_ps1_host" +# Line 2 +printf "%b %b %b %b %b\n" \ + " ${C_Grey}f:${NC}${C_Cyan}$_ps1_file${NC}" \ + "${C_Grey}D:${NC}${C_Yellow}$_ps1_dirs${NC}" \ + "${C_Grey}S=${NC}$_ps1_size" \ + "${C_Grey}>${NC}" \ + "${C_Yellow}$_ps1_h${NC}" +# Line 3 +PS1='$ ' +} + +shopt -s histappend +export HISTCONTROL=ignoreboth:erasedups +PROMPT_COMMAND=_ps1__prompt_echolib +export PS1=$PROMPT_COMMAND