Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Linux: Customize Shell Prompt
(edit)
Revision as of 06:35, 3 April 2017
767 bytes added
,
06:35, 3 April 2017
no edit summary
Line 23:
Line 23:
To test some color:
To test some color:
echo -e "\033[01;31mhi"
echo -e "\033[01;31mhi"
+
+
Another example:
+
<nowiki>function elite
+
{
+
+
local GRAY="\[\033[1;30m\]"
+
local LIGHT_GRAY="\[\033[0;37m\]"
+
local CYAN="\[\033[0;36m\]"
+
local LIGHT_CYAN="\[\033[1;36m\]"
+
local NO_COLOUR="\[\033[0m\]"
+
+
case $TERM in
+
xterm*|rxvt*)
+
local TITLEBAR='\[\033]0;\u@\h:\w\007\]'
+
;;
+
*)
+
local TITLEBAR=""
+
;;
+
esac
+
+
local temp=$(tty)
+
local GRAD1=${temp:5}
+
PS1="$TITLEBAR\
+
$GRAY-$CYAN-$LIGHT_CYAN(\
+
$CYAN\u$GRAY@$CYAN\h\
+
$LIGHT_CYAN)$CYAN-$LIGHT_CYAN(\
+
$CYAN\#$GRAY/$CYAN$GRAD1\
+
$LIGHT_CYAN)$CYAN-$LIGHT_CYAN(\
+
$CYAN\$(date +%H%M)$GRAY/$CYAN\$(date +%d-%b-%y)\
+
$LIGHT_CYAN)$CYAN-$GRAY-\
+
$LIGHT_GRAY\n\
+
$GRAY-$CYAN-$LIGHT_CYAN(\
+
$CYAN\$$GRAY:$CYAN\w\
+
$LIGHT_CYAN)$CYAN-$GRAY-$LIGHT_GRAY "
+
PS2="$LIGHT_CYAN-$CYAN-$GRAY-$NO_COLOUR "
+
}</nowiki>
https://www.maketecheasier.com/8-useful-and-interesting-bash-prompts/
https://www.maketecheasier.com/8-useful-and-interesting-bash-prompts/
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version