Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Extra informative Bash prompt
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
poly_poly-man
Advocate
Advocate


Joined: 06 Dec 2006
Posts: 2477
Location: RIT, NY, US

PostPosted: Mon Jan 21, 2008 4:46 pm    Post subject: What's your prompt? Reply with quote

echo $PS1 , please! :D


poly-p man
_________________
iVBORw0KGgoAAAANSUhEUgAAA

avatar: new version of logo - see topic 838248. Potentially still a WiP.
Back to top
View user's profile Send private message
runningwithscissors
Guru
Guru


Joined: 21 Apr 2006
Posts: 454
Location: the third world

PostPosted: Mon Jan 21, 2008 4:54 pm    Post subject: Reply with quote

At a tty:
Code:
\u@\h:\w\$


In an xterm:
Code:
\s-\v\$
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Mon Jan 21, 2008 5:06 pm    Post subject: Reply with quote

gentoo default;
Code:
\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]
Looks like this;
Quote:
hopeless@arisu ~ $


I end up adding it to my bash profile on none gentoo boxes too, and in cygwin too.
_________________
"You have to invite me in"


Last edited by Sadako on Mon Jan 21, 2008 6:59 pm; edited 2 times in total
Back to top
View user's profile Send private message
kostja
Apprentice
Apprentice


Joined: 25 May 2004
Posts: 261
Location: D, 69239 Neckarsteinach

PostPosted: Mon Jan 21, 2008 5:47 pm    Post subject: Reply with quote

Nice evening!
Here's mine:
Code:

PS1=$'%D{%e %b %R}\t%(!.%{\e[1;31m%}.%{\e[1;32m%})%m %n%{\e[1;34m%}\t%d\n%{\e[0m%} (%h)%{\e[1;34m%} %# %{\e[0m%}'

and it looks like:
Quote:

21 Jan 18:44 deepthought kostja /home/kostja
(3) %


Konstantin
_________________
Registered Linux User #356484
Back to top
View user's profile Send private message
luqas
Guru
Guru


Joined: 02 Jan 2004
Posts: 588
Location: /US/Texas/Beaumont

PostPosted: Mon Jan 21, 2008 6:05 pm    Post subject: Reply with quote

Code:
PS1="\n\[\e[0;1m\]\[\016\]l\[\017\]\[\e[0;1m\](\[\e[34;1m\]\H\[\e[0;1m\])-(\[\e[34;1m\]\T\[\e[0;1m\])->\n\[\016\]m\[\017\](\[\e[34;1m\]\w\[\e[0;1m\])--> \[\e[0m\]"


Quote:

┌(linux)-(12:03:13)->
└(/var/tmp)-->
Back to top
View user's profile Send private message
ocin
Guru
Guru


Joined: 01 Jan 2006
Posts: 500

PostPosted: Mon Jan 21, 2008 6:41 pm    Post subject: Reply with quote

Code:
PROMPT='%~ %# '


Quote:
~ %
Back to top
View user's profile Send private message
StarDragon
Guru
Guru


Joined: 19 Jun 2005
Posts: 390
Location: tEXas

PostPosted: Mon Jan 21, 2008 7:01 pm    Post subject: Reply with quote

The default.
_________________
"After all, a person's a person, no matter how small."--Horton Hears A Who!
Back to top
View user's profile Send private message
jonnevers
Veteran
Veteran


Joined: 02 Jan 2003
Posts: 1594
Location: Gentoo64 land

PostPosted: Mon Jan 21, 2008 7:15 pm    Post subject: Reply with quote

Quote:
username hostname ~ $ echo $PS1
\[\033[00;37m\]\u \[\033[01;34m\]`echo $HOSTNAME`\[\033[01;37m\] \[\033[00;37m\]\W\[\033[01;37m\] \$ \[\033[00m\]

pretty basic, but it is a ton better then the green/blue default gentoo prompt...
Back to top
View user's profile Send private message
dforsyth
n00b
n00b


Joined: 29 Jan 2005
Posts: 26
Location: College Park, Murdaland

PostPosted: Mon Jan 21, 2008 7:19 pm    Post subject: Reply with quote

terminal wrote:
~ % cat .cshrc | grep 'set prompt'
set prompt = "${rgb_navy}%~ \%${rgb_restore} "

_________________
O
4~ <-- me, fapping to Palin.
/\ `_
Back to top
View user's profile Send private message
jho
Apprentice
Apprentice


Joined: 24 May 2007
Posts: 153
Location: Jyväskylä, Finland

PostPosted: Mon Jan 21, 2008 7:54 pm    Post subject: Reply with quote

Normal user:
Code:
\[\e[0;34m\w \e[1;31m>\e[0;31m>\e[0m\]


Root:
Code:
\[\e[0;34m\w \e[1;31m>>\e[0;31m> \e[1;31m\]


I think there's something wrong though -- If I type long lines/commands, the command sometimes overlaps the $PS1 line. Especially when working as a root. Any ideas?
I heard somewhere I need to add \[ to the beginning of $PS1, and \] to the end. I did it and it helped a bit, but it still occasionally happens.
Back to top
View user's profile Send private message
chrismcdirty
Apprentice
Apprentice


Joined: 18 Jul 2003
Posts: 160
Location: Newark, DE

PostPosted: Mon Jan 21, 2008 8:03 pm    Post subject: Reply with quote

You need to put \[...\] around your escape codes. So do something like \[\e[0;34m\]\w \[\e[1;31m\]>\[\e[0;31m\]>\[\e[0m\]
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1931

PostPosted: Mon Jan 21, 2008 8:49 pm    Post subject: Reply with quote

I like gentoo default.

Even if I don't use gentoo, I get a copy of gentoo's $PS1 and use it.
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
GWilliam
Guru
Guru


Joined: 29 Dec 2005
Posts: 350

PostPosted: Mon Jan 21, 2008 9:08 pm    Post subject: Reply with quote

#NULL

Last edited by GWilliam on Sun Jul 25, 2010 3:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Mon Jan 21, 2008 9:34 pm    Post subject: Reply with quote

GWilliam wrote:
Sabayon default:

Code:
\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]

Oh my, it appears to be identical to the gentoo default.

Imagine that?

:P
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
Zepp
Veteran
Veteran


Joined: 15 Mar 2004
Posts: 1246
Location: Ontario, Canada

PostPosted: Mon Jan 21, 2008 9:35 pm    Post subject: Reply with quote

Ha1f wrote:
terminal wrote:
~ % cat .cshrc | grep 'set prompt'
set prompt = "${rgb_navy}%~ \%${rgb_restore} "


Why csh?
Back to top
View user's profile Send private message
dforsyth
n00b
n00b


Joined: 29 Jan 2005
Posts: 26
Location: College Park, Murdaland

PostPosted: Mon Jan 21, 2008 9:37 pm    Post subject: Reply with quote

Zepp wrote:
Ha1f wrote:
terminal wrote:
~ % cat .cshrc | grep 'set prompt'
set prompt = "${rgb_navy}%~ \%${rgb_restore} "


Why csh?


Dunno. I just happen to like it as a user shell.
_________________
O
4~ <-- me, fapping to Palin.
/\ `_
Back to top
View user's profile Send private message
SiberianSniper
Guru
Guru


Joined: 06 Apr 2006
Posts: 378
Location: Dayton, OH, USA

PostPosted: Mon Jan 21, 2008 11:13 pm    Post subject: Reply with quote

Code:
PS1="C:\\\\\W> "
Back to top
View user's profile Send private message
tarpman
Veteran
Veteran


Joined: 04 Nov 2004
Posts: 1083
Location: Victoria, BC, Canada

PostPosted: Mon Jan 21, 2008 11:31 pm    Post subject: Reply with quote

Code:
PROMPT="%{${fg[white]}%}[%{${fg_bold[red]}%}%m%{${fg_no_bold[white]}%}] %{${fg_bold[green]}%}%1~ %{${fg[blue]}%}> %{${reset_color}%}"
[[ "$EUID" -eq 0 ]] && PROMPT="${PROMPT/\>/%#}"


[gantrithor] ~ >

Looks better on a black background since that's what I usually have. Used to have the time instead of the hostname, but switched to hostname since I've propagated to this prompt to quite a few different machines.
_________________
Saving the world, one kilobyte at a time.
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Mon Jan 21, 2008 11:37 pm    Post subject: Reply with quote

PS1='$PWD $ '
Back to top
View user's profile Send private message
Ken69267
Developer
Developer


Joined: 08 Apr 2007
Posts: 111
Location: #gentoo-pr0n

PostPosted: Tue Jan 22, 2008 1:22 am    Post subject: Reply with quote

Code:
%{%}%n@%m%{%} %{%}%1~ %# %{%}


ZSH, of course :wink:
_________________
!snack
Back to top
View user's profile Send private message
tylerwylie
Guru
Guru


Joined: 19 Sep 2004
Posts: 458
Location: /US/Georgia/Atlanta

PostPosted: Tue Jan 22, 2008 1:48 am    Post subject: Reply with quote

Code:
(19:44)[tyler:~]% echo $PS1
(\A)[\u:\w]%
Back to top
View user's profile Send private message
ksool
Guru
Guru


Joined: 27 May 2006
Posts: 337
Location: Cambridge, MA

PostPosted: Tue Jan 22, 2008 2:03 am    Post subject: Reply with quote

koqu wrote:
Code:
PS1="\n\[\e[0;1m\]\[\016\]l\[\017\]\[\e[0;1m\](\[\e[34;1m\]\H\[\e[0;1m\])-(\[\e[34;1m\]\T\[\e[0;1m\])->\n\[\016\]m\[\017\](\[\e[34;1m\]\w\[\e[0;1m\])--> \[\e[0m\]"


Quote:

┌(linux)-(12:03:13)->
└(/var/tmp)-->


What's the trick to get bash to display the bracket characters (1st char of each line)? I keep getting l and m in urxvt.

EDIT: Weird. It works find in a console through agetty. Any ideas on why it won't work with urxvt (or xterm)?


Last edited by ksool on Tue Jan 22, 2008 4:55 am; edited 2 times in total
Back to top
View user's profile Send private message
GWilliam
Guru
Guru


Joined: 29 Dec 2005
Posts: 350

PostPosted: Tue Jan 22, 2008 2:45 am    Post subject: Reply with quote

#NULL

Last edited by GWilliam on Sun Jul 25, 2010 3:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
luqas
Guru
Guru


Joined: 02 Jan 2004
Posts: 588
Location: /US/Texas/Beaumont

PostPosted: Tue Jan 22, 2008 4:50 am    Post subject: Reply with quote

ksool wrote:


What's the trick to get bash to display the bracket characters (1st char of each line). I keep getting l and m in urxvt.

EDIT: Weird. It works find in a console through agetty. Any ideas on why it work work with urxvt (or xterm)?


I don't know the trick to get it to work in xterm or urxvt. I know it works in aterm and xfce's terminal and the console. My xterm does the same as you and puts l and m.
Back to top
View user's profile Send private message
PraetorZero
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 239
Location: /home

PostPosted: Thu Feb 21, 2008 1:27 am    Post subject: wireless signal strength? Reply with quote

Does anybody know a way to add a wireless signal strength meter to the bash prompt?

I'm thinking something along the lines of
Quote:
[###..] praetor@prometheus ~ $
or
Quote:
[87%] praetor@prometheus ~ $
although the former would be preferable.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 8 of 9

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum