From 2d60f939ab17ba1635c8f2fec592db35ff1f73b1 Mon Sep 17 00:00:00 2001 From: "FCD (uberspace)" Date: Wed, 11 Nov 2020 11:15:20 +0100 Subject: [PATCH] Adjusted solarize color integration (bashrc.d). --- .../executable_01.solarize_colors | 0 .../executable_01.solarize_colors_base | 0 dot_bashrc.d/executable_10.sshrc | 114 ------------------ .../executable_10.sshrc.tmpl | 4 +- 4 files changed, 1 insertion(+), 117 deletions(-) rename dot_solarize_colors => dot_bashrc.d/executable_01.solarize_colors (100%) rename dot_solarize_colors_base => dot_bashrc.d/executable_01.solarize_colors_base (100%) delete mode 100644 dot_bashrc.d/executable_10.sshrc rename dot_sshrc.tmpl => dot_bashrc.d/executable_10.sshrc.tmpl (96%) diff --git a/dot_solarize_colors b/dot_bashrc.d/executable_01.solarize_colors similarity index 100% rename from dot_solarize_colors rename to dot_bashrc.d/executable_01.solarize_colors diff --git a/dot_solarize_colors_base b/dot_bashrc.d/executable_01.solarize_colors_base similarity index 100% rename from dot_solarize_colors_base rename to dot_bashrc.d/executable_01.solarize_colors_base diff --git a/dot_bashrc.d/executable_10.sshrc b/dot_bashrc.d/executable_10.sshrc deleted file mode 100644 index 59d0633..0000000 --- a/dot_bashrc.d/executable_10.sshrc +++ /dev/null @@ -1,114 +0,0 @@ -# -# sshrc will be called byaliased ssh command 's'. -# -# if [ -f $HOME/.profile ]; then -# source $HOME/.profile -# fi -# if [ -f $HOME/.bashrc ]; then -# source $HOME/.bashrc -# fi - -# -# System Name and type detectedn -# -mySystem=$(uname -n) -myFQDN="$(uname -n).$(dnsdomainname)" -if [ -f /etc/os-release ];then - myPrettyName=$(grep PRETTY_NAME /etc/os-release) -fi - -# last exit code -function lastExitCode { - local exit="$?" - - if [ $exit != 0 ];then - printf '\e[38;5;160m%-5s' "✕ ❗ ($exit)" - else - printf '✔' - fi -} - -# sourcing Solarized Theme -# and building PS1 prompt -source $HOME/.solarize_colors_base -echo "mySystem: $mySystem" -echo "myFQDN: $myFQDN" - -bg_reset="\[\e[49m\]" -fg_reset="\[\e[39m\]" - -SYSTEM="" -bg_system="${sol_bg_magenta}" -fg_system="${sol_magenta}" -fg_type="${sol_magenta}" - -bg_type="${sol_bg_base3}" -fg_arrow1="${fg_type}" -fg_arrow2="${sol_base3}" - -if [[ -z "${myType// }" ]]; then - TYPE=$(uname -n) -else -TYPE=" $myType " -fi -if [ "$myNum" != "0" ]; then - TYPE="$TYPE ($myNum)" -fi -echo "System Prompt: $SYSTEM_PROMPT" - -SYSTEM_PROMPT="\n${fg_arrow1}░▒▓${bg_system} ${fg_sytem}${SYSTEM} ${bg_type}${fg_arrow1}▓▒░" -TYPE_PROMPT="$TYPE  \$(lastExitCode) ${fg_arrow1}  $mySlesVersion ${sol_blue}\${STY#[0-9]*.} ${bg_reset}${fg_arrow2}▓▒░" - -PROMPT="${SYSTEM_PROMPT} ${TYPE_PROMPT}" -DATE="\[\e[0;32m\]\d \t" -if [ "$(whoami)" = "root" ]; then - DIR="\[\e[97;49m\]\[\e[0;91;107m\] \u@\h \[\e[97;49m\]\[\e[39;49m\] in \[\e[0;32m\]\w" -else - DIR="\[\e[0;32m\]\u@\h \[\e[31m\]☆ \[\e[0;32m\]\w" -fi - -# PROMPT_COMMAND=promptcmd - -PS1="${PROMPT}\[\e[0m\] \n${DIR}\n${DATE} → \[\e[0m\]" - -if [ $(whoami | grep root | wc -l) == 1 ]; then - echo -e "\e[31;107m┌─────────────────────────────┐\e[0m" - echo -e "\e[31;107m│ YOU ARE ROOT, BE CAREFUL! │\e[0m" - echo -e "\e[31;107m└─────────────────────────────┘\e[0m" - - # Test mintty - echo -ne '\e]11;44,10,10\a' -fi - -# TODO: background colors... -# TODO: private history file for shared accounts -# TODO: vim - -export LS_OPTIONS='--color=auto' -eval "$(dircolors -b)" -alias ls='ls $LS_OPTIONS' - -alias psg='ps -aux | grep -v grep | grep ' - -# Some functions (some by c't magazine) -cdl() { - cd "$@" - if [ "$?" == 0 ]; then - ls - fi -} - -backup() { - cp -p "$@" "$@".backup-$(date +%Y-%m-%d_%H_%M_%S) -} - -extract() { - case $1 in - *.tar.bz2) tar xvjf $1;; - *.tar.gz|*.tgz) tar xvfz $1;; - *.zip) unzip $1;; - *) echo "Not supported: $1";; - esac -} - -PATH=$PATH:$HOME/bin diff --git a/dot_sshrc.tmpl b/dot_bashrc.d/executable_10.sshrc.tmpl similarity index 96% rename from dot_sshrc.tmpl rename to dot_bashrc.d/executable_10.sshrc.tmpl index e3a284b..2daa444 100644 --- a/dot_sshrc.tmpl +++ b/dot_bashrc.d/executable_10.sshrc.tmpl @@ -29,9 +29,7 @@ function lastExitCode { fi } -# sourcing Solarized Theme -# and building PS1 prompt -source $HOME/.solarize_colors_base +# sourcing Solarized Theme is already done in .bashrc.d echo "mySystem: $mySystem" echo "myFQDN: $myFQDN"