From ced6cf6d6ad644b7930448747db1618bbec05e9d Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Wed, 6 Sep 2017 23:01:11 +0200 Subject: [PATCH] TMuX hostfiles renamed Introduced SHORTPS1 for a newline in PS1 (if not set or empty) --- bash/bash.d/ps1 | 25 +++++++++++++++---------- tmux/beatmachine.conf | 7 ------- tmux/beatmaker.conf | 2 -- tmux/fatserf.conf | 1 - 4 files changed, 15 insertions(+), 20 deletions(-) delete mode 100644 tmux/beatmachine.conf delete mode 100644 tmux/beatmaker.conf delete mode 100644 tmux/fatserf.conf diff --git a/bash/bash.d/ps1 b/bash/bash.d/ps1 index 3465a30..fdfddf9 100644 --- a/bash/bash.d/ps1 +++ b/bash/bash.d/ps1 @@ -73,18 +73,18 @@ function __prompt_command() { PS1+="@" if color ; then - case "$HOSTNAME" in - 'maclean') PS1+="${IGre}\H${RCol}";; - 'tinsmith'|'beatmaker') PS1+="${Gre}\H${RCol}";; - 'blacksmith'|'beatmachine') PS1+="${Blu}\H${RCol}";; - 'locksmith'|'fatserf') PS1+="${Pur}\H${RCol}";; - 'lilo'*) PS1+="${BWhi}\H${RCol}";; - 'hg'*) PS1+="${BRed}\H${RCol}";; - 'gouda'|'bunnik'|'houten'|'zandberg'|'bussum'|'baarn') PS1+="${Gre}${On_Whi}HEF:${Blu}${On_Whi}\H${RCol}";; - *) PS1+="${Blu}${On_Whi}\H${RCol}";; + case "${HOSTNAME%%.*}" in + 'maclean') PS1+="${IGre}\h${RCol}";; + 'tinsmith') PS1+="${Gre}\h${RCol}";; + 'blacksmith') PS1+="${Blu}\h${RCol}";; + 'locksmith') PS1+="${Pur}\h${RCol}";; + 'lilo'*) PS1+="${BWhi}\h${RCol}";; + 'hg'*) PS1+="${BRed}\h${RCol}";; + 'gouda'|'bunnik'|'houten'|'zandberg'|'bussum'|'baarn') PS1+="${Gre}${On_Whi}HEF:${Blu}${On_Whi}\h${RCol}";; + *) PS1+="${Blu}${On_Whi}\h${RCol}";; esac else - PS1+="\H" + PS1+="\h" fi #time w/ seconds @@ -109,8 +109,13 @@ function __prompt_command() { PS1+="${RCol}" fi PS1+=" " +## Short prompt + if [ -n "${SHORTPS1}" ]; then + PS1+="\r\n" + fi #UID PS1+=':\$ ' + } function retval() { diff --git a/tmux/beatmachine.conf b/tmux/beatmachine.conf deleted file mode 100644 index c7dc5c8..0000000 --- a/tmux/beatmachine.conf +++ /dev/null @@ -1,7 +0,0 @@ -# status bar config -set -g status-interval 5 -set -g status-left "#h:[#S][#I]" -set -g status-left-length 20 -#set -g status-right "%A %m-%d %H:%M" -set -g status-right '♪ #(exec amixer get Master | egrep -o "[0-9]+%" | egrep -o "[0-9]*") | ♥#(acpi | cut -d ',' -f 2) | %A %m-%d %H:%M' - diff --git a/tmux/beatmaker.conf b/tmux/beatmaker.conf deleted file mode 100644 index 6889768..0000000 --- a/tmux/beatmaker.conf +++ /dev/null @@ -1,2 +0,0 @@ -set -g status-bg blue -set -g status-right '♪ #(exec amixer get Master | egrep -o "[0-9]+%" | egrep -o "[0-9]*") | ♥#(acpi | cut -d ',' -f 2) | %a %m-%d %H:%M' diff --git a/tmux/fatserf.conf b/tmux/fatserf.conf deleted file mode 100644 index 03ea0f1..0000000 --- a/tmux/fatserf.conf +++ /dev/null @@ -1 +0,0 @@ -set -g status-bg red