]> Frank Brehm's Git Trees - config/berta/etc.git/commitdiff
saving uncommitted changes in /etc prior to emerge run
authorFrank Brehm <frank@brehm-online.com>
Tue, 20 Dec 2016 13:55:38 +0000 (14:55 +0100)
committerFrank Brehm <frank@brehm-online.com>
Tue, 20 Dec 2016 13:55:38 +0000 (14:55 +0100)
.etckeeper
bash/bashrc.d/fbrehm.sh
motd.tail [new file with mode: 0644]

index 00b92dc869ee76b44c2877a2827d53f06e52684b..de19b75ef7836bd9319da184c1d47d6ec7c71d8f 100755 (executable)
@@ -349,6 +349,7 @@ maybe chmod 0644 'modprobe.d/aliases.conf'
 maybe chmod 0644 'modprobe.d/i386.conf'
 maybe chmod 0755 'modules-load.d'
 maybe chmod 0644 'modules-load.d/.keep_sys-apps_systemd-0'
+maybe chmod 0644 'motd.tail'
 maybe chmod 0644 'nanorc'
 maybe chmod 0644 'networks'
 maybe chmod 0644 'nsswitch.conf'
index eacd56d01d7e91665cbed901ff683306c9128cd9..79fbaa36a96e0be0d9d5c0f6b90f85adbd445c29 100644 (file)
@@ -99,7 +99,7 @@ fi
 #done
 
 # Try to keep environment pollution down, EPA loves us.
-unset use_color safe_term match_lhs
+unset safe_term match_lhs
 
 if [ -d /usr/scripts ] ; then
   export PATH="/usr/scripts:${PATH}"
@@ -170,12 +170,46 @@ if [ -f /usr/share/mc/mc.gentoo ]; then
     . /usr/share/mc/mc.gentoo
 fi
 
-if [ -e /etc/bash_completion.d/git ] ; then
-    if [[ ${EUID} == 0 ]] ; then
-        PS1='$? \[\033[01;31m\]\h\[\033[01;30m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(__git_ps1)\[\033[01;34m\] \$ \[\033[00m\]'
+GP_RC="/usr/share/bash-completion/completions/git-prompt"
+if [[ -r "${GP_RC}" ]] ; then
+    . "${GP_RC}"
+fi
+
+prompt_status() {
+    local e=$?;
+    [[ $e != 0 ]] && echo -e "$e ";
+}
+
+if ${use_color} ; then
+    if type -t __git_ps1 >/dev/null ; then
+        if [[ "$UID" = 0 ]]; then
+            PS1='\[\e[31m\]$(prompt_status)\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w\[\033[01;31m\]$(__git_ps1)\[\033[01;35m\] \$ \[\033[00m\]'
+        else
+            PS1='\[\e[31m\]$(prompt_status)\[\033[01;32m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w\[\033[01;31m\]$(__git_ps1)\[\033[01;35m\] > \[\033[00m\]'
+        fi
+    else
+        if [[ "$UID" = 0 ]]; then
+            PS1='\[\e[31m\]$(prompt_status)\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
+        else
+            PS1='\[\e[31m\]$(prompt_status)\[\033[01;32m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]> \[\033[00m\]'
+        fi
+    fi
+else
+    if type -t __git_ps1 >/dev/null ; then
+        if [[ "$UID" = 0 ]]; then
+            PS1='$(prompt_status)\u@\h \w$(__git_ps1) \$ '
+        else
+            PS1='$(prompt_status)\u@\h \w$(__git_ps1) > '
+        fi
     else
-        PS1='$? \[\033[01;32m\]\u@\h\[\033[01;30m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(__git_ps1)\[\033[01;34m\] > \[\033[00m\]'
+        if [[ "$UID" = 0 ]]; then
+            PS1='$(prompt_status)\u@\h \w \$ '
+        else
+            PS1='$(prompt_status)\u@\h \w > '
+        fi
     fi
 fi
 
+unset use_color
 # vim: ts=4 expandtab
diff --git a/motd.tail b/motd.tail
new file mode 100644 (file)
index 0000000..88702e2
--- /dev/null
+++ b/motd.tail
@@ -0,0 +1,6 @@
+ ____            _        
+| __ )  ___ _ __| |_ __ _ 
+|  _ \ / _ \ '__| __/ _` |
+| |_) |  __/ |  | || (_| |
+|____/ \___|_|   \__\__,_|
+