Actually the color was 1;36 the light cyan Sorry I was very misleading I didn't even make a reference to the color.
Actually the color was 1;36 the light cyan Sorry I was very misleading I didn't even make a reference to the color.
すべてと、そして、すべてへのリナックスは自由を鳴らせました。
Linux to all, and to all, let freedom ring.
Hey! I was just playing with this yesterday from the terminal. If you change the PS1 line from terminal directly, it will change, but it changes back when ya restart the terminal. I figured there would be a file in the back somewhere, and I noticed POR's sig, and rejoiced!
Thanks, I like having the current time and date at the beginning. It makes things much more convenient.
I'm using PS1='\T on \d - \u:\w\$' It shows the time in 12 hour with seconds, on the date - my user name:current dir$
In the Terminal's edit, I changed the profile so it shows up 25% translucent, as well as displaying a better name for it that the PS1 line. In my case, 'Leo's Terminal'
Leo S.
The angels have the phone box!
My PS1 lines are preceded by this:
${debian_chroot:+($debian_chroot)}
So my line looks like:
PS1='${debian_chroot:+($debian_chroot)}\[\e[0;31m\](\t)\[\e[m\]\[\e[0;32m\]\u\[\e[m\]@\[\e[0;34m\]\w\[\e[m\]\$ '
What does this do, and is it required to run the terminal properly?
Since I don't use a Debian based system, I don't know what it does but I do know you probably don't need it. However, if it's there it's probably doing something and it's not hurting anything, so don't touch it.
You can just make a new PS1 line and put it at the end. The last PS1 line in the file is what is used.
Here's another example of prompt customisation :
This could be either in $HOME/.bashrc for a single user, or in /etc/bash.bashrc for a system-wide settingCode:# Some colors #grey='\[\033[1;30m\]' #red='\[\033[0;31m\]' #green='\[\033[0;32m\]' GREEN='\[\033[1;32m\]' #blue='\[\033[0;34m\]' #BLUE='\[\033[1;34m\]' cyan='\[\033[0;36m\]' #CYAN='\[\033[1;36m\]' GREEN='\[\033[1;32m\]' #white='\[\033[1;37m\]' #yellow='\[\033[1;33m\]' RED='\[\033[1;31m\]' #violet='\[\033[1;35m\]' NC='\[\033[0;m\]' # if you are root (uid=0) brackets and @ in red, else in green for normal user if [ "`id -u`" -eq 0 ]; then b=$RED e="$NC# " else b=$GREEN e="$NC$ " fi PS1="${debian_chroot:+($debian_chroot)}$b[$NC\u$b@$NC\h:$cyan\w$b]$e"
Good howto. ASCII sequences can go beyond the predefined eight colors. The process isnt' all too difficult but I learned that Freexx has a converter that converts hexidecimal code to the corresponding bash ASCII sequence.
http://frexx.de/xterm-256-notes/
Install and:
Alternatively instead of using ASCII, tput can be used:Code:echo d3d7cf | conv-rgb2xterm
Just thought I'd throw that in.Code:export TXT_GR=$(tput setaf 2) export TXT_BL=$(tput setaf 4) export TXT_BLD=$(tput bold) export TXT_RESET=$(tput sgr0) export PS1='\[${TXT_GR}${TXT_BLD}\]@${TXT_BL} \w \$${TXT_RESET} '
Last edited by Gen2ly; April 14th, 2008 at 01:15 AM.
Linux Tidbits | Hobbyist: archlinux
Is there any way to apply different PS1 lines to different terminal windows?
I have a dark background, and want a light font color for my Devilspie induced Desktop Terminal. My regular terminal windows are the default Ubuntu Human theme, so a light font is difficult to read.
Can I do this, or do I have to find a happy medium?
PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'
The user@host part is a different color for each of the servers so I can quickly differentiate which machine I'm connected to. Green is my laptop.
@Skones: If your desktop terminal is run from a different program you can put an export PS1 in the launcher. You can set a PS1 in bashrc which will persist across terminals, put an export line in gnome-terminal's launcher, and another in whichever program you use for the desktop terminal.
Last edited by conundrumx; June 26th, 2008 at 05:03 PM.
Thanks for the tip, works like a charm. Here's mine;
Last edited by trappy; July 2nd, 2008 at 03:36 AM.
Bookmarks