LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-20-2003, 08:01 AM   #1
Hegemon
Member
 
Registered: Jan 2002
Location: Australia
Distribution: Gentoo
Posts: 103

Rep: Reputation: 15
Talking FREE Coloured custom command prompts!!!!! =)


I though i would paste my custom command prompts here for people to use. Simply add them to your .profile in your home directory or type them as is to test them. The code for each of them is 1 line long, if you see diffrently its because your browser is wraping them around so make sure you paste them as one line. All prompts have the user@hostname and then the path, i havn't put the time in any of them because that would take lots of space.

Yellow and red one:
Code:
export PS1="\[\033[1;30m\][\[\033[0;32m\][\[\033[1;32m\][\[\033[1;33m\]\u\[\033[1;37m\]@\[\033[1;33m\]\h\[\033[1;37m\]:\[\033[1;31m\]\w\[\033[1;32m\]]\[\033[0;32m\]]\[\033[1;30m\]]\[\033[0;00m\] "
A red one designed to be used for root as a warning, also makes all text typed red:
Code:
export PS1="\[\033[1;30m\][\[\033[0;31m\][\[\033[1;31m\][\[\033[1;35m\]\u\[\033[1;37m\]@\[\033[1;35m\]\h\[\033[1;37m\]:\[\033[1;31m\]\w\[\033[1;31m\]]\[\033[0;31m\]]\[\033[1;30m\]]\[\033[1;31m\] "
A diffrent yellow and red one:
Code:
export PS1="\[\033[1;30m\]%\[\033[0;31m\]%\[\033[1;31m\]%\\033[1;33m\]\u\[\033[0;1m\]@\[\033[1;33m\]\h\[\033[0;1m\]:\[\033[0;33m\]\w\[\033[1;31m%\[\033[0;31m\]%\[\033[1;30m\]%\[\033[0;0m\] "
A green one:
Code:
export PS1="\[\033[1;30m\]<\[\033[0;36m\](\[\033[0;32m\]{\[\033[1;32m\][\[\033[0;32m\]\u\[\033[1;32m\]@\[\033[0;32m\]\h\[\033[1;36m\]:\[\033[0;36m\]\w\[\033[1;32m\]]\[\033[0;32m\]}\[\033[0;36m\])\[\033[1;30m\]>\[\033[0;32m\] "
A blue one:
[code[export PS1="\[\033[0;34m\]o\[\033[0;36m\](\[\033[1;36m\]O\[\033[0;36m\])\[\033[1;34m\]\u\[\033[1;36m\](\[\033[0;1m\]@\[\033[1;36m\])\[\033[1;34m\]\h\[\033[1;36m\]:\[\033[0;34m\]\w\[\033[0;36m\](\[\033[1;36m\]O\[\033[0;36m\])\[\033[0;34m\]o\[\033[0;0m\] "[/code]

A Inverted one
Code:
export PS1="\[\033[1;30;47m\][=]\[\033[0;30;47m\]\u\[\033[0;1;47m\]@\[\033[0;30;47m\]\h\[\033[1;30m\]][\[\033[0;30;47m\]\w\[\033[1;30m\][=]\[\033[0;0m\] "
Tell me your favorite and post any you may have
 
Old 01-20-2003, 08:09 AM   #2
membrax
Member
 
Registered: Nov 2002
Location: 50'48''N - 4'21''E
Distribution: SuSE7.1 - SuSE8.1 - SuSE8.2 - RH6.2 - RH7.1 - RH7.3 - RH8.0 - RH9.0 - Fedora Core 1
Posts: 281

Rep: Reputation: 30
any screenshot to help us choosing before trying ?
 
Old 01-20-2003, 09:33 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
free? why would they not be "free" ?
 
Old 01-20-2003, 09:38 AM   #4
Hegemon
Member
 
Registered: Jan 2002
Location: Australia
Distribution: Gentoo
Posts: 103

Original Poster
Rep: Reputation: 15
I supose i could arange a screen shot =)

 
Old 01-20-2003, 09:43 AM   #5
Hegemon
Member
 
Registered: Jan 2002
Location: Australia
Distribution: Gentoo
Posts: 103

Original Poster
Rep: Reputation: 15
Or maby i carn't =P

Try

and if i can get my isp to accept my upload


They should be in the same order as there given.

They wouldn't be free if i was charging money for them, although i don't think that very many people would pay =P

Last edited by Hegemon; 01-20-2003 at 09:44 AM.
 
Old 01-20-2003, 09:49 AM   #6
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 47
Well, anyone can create this after reading the bash how-to, or even get many other ones at themes depot, of course for free.. Still it's nice you're sharing your knowledge...
I still prefer mine:

#!/bin/bash

RED="\[\033[0;31m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
PURPLE="\[\033[0;35m\]"
CYAN="\[\033[0;36m\]"
YELLOW="\[\033[0;33m\]"
NONE="\[\033[0m\]"

# Things BASH understands:
# \a an ASCII bell character (07)
# \d the date in "Weekday Month Date" format
# \e an ASCII escape character (033)
# \h the hostname up to the first `.'
# \H the hostname
# \j the number of jobs currently managed by the shell
# \l the basename of the shell's terminal device
# \n newline
# \r carriage return
# \t the current time in 24-hour HH:MM:SS format
# \T the current time in 12-hour HH:MM:SS format
# \@ the current time in 12-hour am/pm format
# \u the username of the current user
# \v the version of bash (e.g., 2.00)
# \V the release of bash, version + patchlevel
# \w the current working directory
# \W the basename of the current working dir
# \! the history number of this command
# \# the command number of this command
# \$ if the effective UID is 0, a #, otherwise a $
# \\ a backslash
#

if
[ "$UID" = "0" ];
then
# Logged in as root

GREEN="\[\033[0;33m\]"
CYAN="\[\033[0;31m\]"
fi


PS1="$GREEN|:-($YELLOW\d \t$GREEN)$YELLOW-$GREEN($CYAN\u$GREEN@$CYAN\h:$GREEN\w$GREEN)$CYAN\$
$NONE "


-NSKL

Last edited by NSKL; 01-20-2003 at 09:52 AM.
 
Old 01-20-2003, 10:03 AM   #7
Hegemon
Member
 
Registered: Jan 2002
Location: Australia
Distribution: Gentoo
Posts: 103

Original Poster
Rep: Reputation: 15
I was planing on putting the colours into strings, not sure why i didn't in the end. I havn't seen themedeport.org befoure looking though it now =)
 
Old 01-20-2003, 10:09 AM   #8
membrax
Member
 
Registered: Nov 2002
Location: 50'48''N - 4'21''E
Distribution: SuSE7.1 - SuSE8.1 - SuSE8.2 - RH6.2 - RH7.1 - RH7.3 - RH8.0 - RH9.0 - Fedora Core 1
Posts: 281

Rep: Reputation: 30
any 3D effects ?

coz those colored lines ... errr ... how to say, I'm missing the point maybe.
 
Old 01-20-2003, 04:34 PM   #9
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
The Bash-prompt mini-howto is great. I now have a different coloured prompt for regular users, and root, which is great for keeping track of who you are. I also stuck the time in, just because:

PS1=\[\033[0;35m\][$(date +%H:%M)][\u@\h \W]$\[\033[0m\]

and the prompt looks like:

Code:
[12:43][bulliver@badcomputer src]$
Screenshot: http://members.shaw.ca/linuxbot/prompt.png

Last edited by bulliver; 01-20-2003 at 05:18 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command line: coloured files,dirs,etc kpachopoulos Linux - General 3 11-13-2005 04:24 PM
Usermin Custom Command help please AlphaNate Linux - Software 0 09-12-2005 08:16 AM
custom cd command glingon Linux - General 4 11-01-2004 07:39 PM
Custom Command? - Excuting Program SilverX Slackware 11 09-20-2004 03:49 PM
debian - custom startup command =X¥®µ§= Linux - Distributions 8 04-28-2003 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration