Advertisement
fdevibe

Untitled

Oct 15th, 2020 (edited)
2,082
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.06 KB | None | 0 0
  1. set_prompt_variables () {
  2.     COLS=$(tput cols)
  3.     WS=$(i=0; while [ $i -lt $(($COLS-55)) ]; do i=$((i+1)); echo -n " "; done)
  4.     HWSL=$(($(($COLS-55))/2))
  5.     WS1=${WS:0:$HWSL}
  6.     [ $(($COLS-55)) -eq $(($HWSL*2)) ] && WS2="$WS1" || WS2="$WS1 "
  7.     QS=$(i=0; while [ $i -lt $(($COLS-2)) ]; do i=$((i+1)); echo -n "q"; done)
  8.     CWD=$(pwd)
  9.     HOST=$(uname -n)
  10.     HOST=${HOST%%.*}
  11.     case $TERM in
  12.         xterm*)
  13.             echo -en "\e]2;Da prompt - $USER@$HOST:$CWD\a"
  14.             ;;
  15.     esac
  16.     if [ $((${#HOST}+${#CWD})) -gt $(($COLS-9)) ]; then
  17.         PR="$HOST:...${CWD:$(($(($COLS-9))-$((${#HOST}+1))))}"
  18.     else
  19.         PR="$HOST:$CWD"
  20.     fi
  21.     QS2=$(max=$(($(($COLS-7))-${#PR})); i=0; while [ $i -lt ${max} ]; do i=$(($i+1)); echo -n "q"; done)
  22.     EN=$(tput enacs)
  23.     ST=$(tput smacs)
  24.     ED=$(tput rmacs)
  25.  
  26.     C=$(($RANDOM%7+1))
  27.     DAPCOL=$'\e[5;35m'
  28. }
  29.  
  30. export PROMPT_COMMAND=set_prompt_variables
  31. export PS1=$'\[\e[36m\]\[${EN}\]\[${ST}\]lqq\[${ED}\][\[\e[0;4m\]\[$PR\]\[\e[24;36m\]]\[${ST}\]\[${QS2}\]qk
  32. \[${ST}\]x\[${ED}\]\[\e[5;3${C}m\]\[$WS1\]  ____                                          _    \[$WS2\]\[\e[0;36m\]\[${ST}\]x
  33. \[${ST}\]x\[${ED}\]\[\e[5;3${C}m\]\[$WS1\] |  _ \  __ _   _ __  _ __ ___  _ __ ___  _ __ | |_  \[$WS2\]\[\e[0;36m\]\[${ST}\]x
  34. \[${ST}\]x\[${ED}\]\[\e[5;3${C}m\]\[$WS1\] | | | |/ _\` | | \'_ \| \'__/ _ \| \'_ \` _ \| \'_ \| __| \[$WS2\]\[\e[0;36m\]\[${ST}\]x
  35. \[${ST}\]x\[${ED}\]\[\e[5;3${C}m\]\[$WS1\] | |_| | (_| | | |_) | | | (_) | | | | | | |_) | |_  \[$WS2\]\[\e[0;36m\]\[${ST}\]x
  36. \[${ST}\]x\[${ED}\]\[\e[5;3${C}m\]\[$WS1\] |____/ \__,_| | .__/|_|  \___/|_| |_| |_| .__/ \__| \[$WS2\]\[\e[0;36m\]\[${ST}\]~
  37. \[${ST}\]x\[${ED}\]\[\e[5;3${C}m\]\[$WS1\]               |_|                       |_|\[\e[0;36m\]
  38. \[${ST}\]tqq\[${ED}\][\[\e[34m\]\\t\e[36m\]]\[${ST}\]qq\[${ED}\]-­ ­· ·   ·
  39. \[${ST}\]m\[${QS}\]k
  40. \[$WS\]                   \[${ED}\]·  ·-\[${ST}\]qqqq[\[${ED}\]\[\e[5;3${C}m\](C) 2004 phr3dr|k\[\e[0;36m\]\[${ST}\]]qqqqqqqu
  41. \[${ST}\]l\[${QS}\]j
  42. \[\e[36m\]\[${ST}\]mqq\[${ED}\]­· · $\[\e[0m\] '
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement