You are not logged in.
Does anyone like to put a newline after their prompt? I just discovered it, I get more space and can put more crap on my prompt at the expense of vertical space. (which isn't as critical with scrolling).
Personally, I'd rather be back in Hobbiton.
Offline
I have a newline and a $ in that order as the end of my prompt.
I need a sorted list of all random numbers, so that I can retrieve a suitable one later with a binary search instead of having to iterate through the generation process every time.
Offline
I tent to cut and paste alot from the terminal so I like to do it, req:
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
My prompt looks exactly like at the top of this: http://dev.archlinux.org/~allan/
Online
<off-topic>
@Gen2ly
What font are you using? It looks very nice
</off-topic>
Running ArchLinux on Compaq Presario v2000
Offline
It's blasphemy, but I use Redmond's consolas.
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
I do. At first, I didn't really think doing such a thing would be practical, but it really helps visibility when you want to do a long command in a deep directory.
/--[ alex@Hal-Jr-Arch ~/Music/Presidents_of_the_United_States_of_America/The_Presidents_Of_The_United_States_Of_America ]--(07:47:10)-
\--> for i in *.mp3; do x=`echo $i | sed -e 's/\..*//' -e 's/[0-9]*\ //'`; mid3v2 --song="$x" "$i"; done;
can fit on two lines in a smallish terminal.
Last edited by alexandrite (2009-12-04 12:53:09)
Offline
I use a newline at the end of my Zsh prompt. In case anyone is interested, to do so is slightly different than in Bash. My Prompt code (important part marked in bold):
export PS1="%{$fg[white]%}┌─[%{$fg[green]%}%n%{$fg[cyan]%}@%{$fg[green]%}%m%{$fg[white]%}:%{$fg[yellow]%}%~%{$fg[white]%}]%{$fg[yellow]%}-%{$fg[red]%}[%{$fg[cyan]%}%*%{$fg[red]%}]%{$reset_color%}%{$reset_color%}"$'\n'"%{$fg[white]%}└─>%{$reset_color%} "
Basically you have to break out of any double quotes there are, and add $'\n', in order to have a newline. I thought I'd post it here since it took me a while to figure that one out.
Results in this prompt (in the terminal it's colored, thus the colors above):
┌─[lswest@lswest-netbook:~]-[15:21:07]
└─>
Last edited by lswest (2009-12-04 14:25:45)
Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds
Offline
I use a newline at the end of my Zsh prompt. In case anyone is interested, to do so is slightly different than in Bash. My Prompt code (important part marked in bold):
export PS1="%{$fg[white]%}┌─[%{$fg[green]%}%n%{$fg[cyan]%}@%{$fg[green]%}%m%{$fg[white]%}:%{$fg[yellow]%}%~%{$fg[white]%}]%{$fg[yellow]%}-%{$fg[red]%}[%{$fg[cyan]%}%*%{$fg[red]%}]%{$reset_color%}%{$reset_color%}"$'\n'"%{$fg[white]%}└─>%{$reset_color%} "
Basically you have to break out of any double quotes there are, and add $'\n', in order to have a newline. I thought I'd post it here since it took me a while to figure that one out.
Results in this prompt (in the terminal it's colored, thus the colors above):
┌─[lswest@lswest-netbook:~]-[15:21:07] └─>
That's quite a nice PS1, very creative. Well done.
Offline
My laptop's prompt stuff is here. My main box is on the master branch.
[git] | [AURpkgs] | [arch-games]
Offline
That's quite a nice PS1, very creative. Well done.
Thanks I got the general idea for the layout of the prompt off someone either here on the Forums, or on UbuntuForums, so I can't take all the credit, but I added in the things I found most useful. I always find having a timestamp on command useful, in case you want to know how long it takes and such. I also have a variation to use in Screen, that displays the number of the screen window in the prompt, though that section was borrowed off someone else's config.
Last edited by lswest (2009-12-04 16:13:39)
Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds
Offline
export PS1='\[\033[0;32m\]╔═[\[\033[0m\033[0;36m\]\u\[\033[0;32m\]@\[\033[0m\033[0;36m\]\h\[\033[0;32m\]]═[\[\033[0m\033[0;36m\]\t \d\[\033[0;32m\]]═[\[\033[0m\033[0;36m\]\w\[\033[0;32m\]]\n\[\033[0;32m\]╚═══[\[\033[0m\033[0;36m\]\$\[\033[0;32m\]]>\[\033[0m\] '
results in
╔═[hatten@prinplup]═[19:24:32 Fri Dec 04]═[~]
╚═══[$]>
in teal and light green. sexy!
Offline
I wouldn't want to waste vertical space. Single-character prompts for me. Using the shell is more pleasant when visiting directories with long names doesn't obliterate your entire screen.
Offline
I wouldn't want to waste vertical space. Single-character prompts for me. Using the shell is more pleasant when visiting directories with long names doesn't obliterate your entire screen.
I got no conky, so i need to have the clock/date somewhere, and if i had a single character prompt i wouldn't be able to see which computer i were working on. But having a single-character prompt, won't you have to use pwd and the like quite often?
Offline
pauldonnelly wrote:I wouldn't want to waste vertical space. Single-character prompts for me. Using the shell is more pleasant when visiting directories with long names doesn't obliterate your entire screen.
I got no conky, so i need to have the clock/date somewhere,
Don't you need to press Enter to get an up-to-date time? I could type "date" as easily as that. But I do run an Xclock to tell me the time.
and if i had a single character prompt i wouldn't be able to see which computer i were working on.
I color-code mine.
But having a single-character prompt, won't you have to use pwd and the like quite often?
%grep -c pwd .histfile
1
%wc -l .histfile
1000 .histfile
Not particularly. Maybe if I leave the computer and there's nothing on the screen to remind me which directory I was in when I come back. The number of times per day that I forget what directory I'm in doesn't come close to justifying having it in my prompt at all times for me.
Offline
Well whatever suits your taste, might do that on my netbook where i don't have such a big screen.
Offline
This may be OT, but how are you getting the "window border" characters into your propmts? I know that I could just paste yours, but I'm betting there's a better way .
Offline
The number of times per day that I forget what directory I'm in doesn't come close to justifying having it in my prompt at all times for me.
this thought has occurred to me before, but until today i hadn't tried using a single character prompt (well.. two characters if we're counting the space after the '>'). my screen is so much cleaner now now to figure out if i can change lftp's prompt, which gets so long and ugly after i cd into child directories..
I've seen young people waste their time reading books about sensitive vampires. It's kinda sad. But you say it's not the end of the world... Well, maybe it is!
Offline
My prompt, modified slightly from one posted on these forums a while back:
╭─[jowilkin::bubba::~]
╰─[03:38:22]>
I'm considering taking the time out of it to get some more room and because I don't find it that useful. Username is light green, host is light blue, cwd is black My PS1:
╭─[\[\e[1;32m\]\u\[\e[0m\]::\[\e[1;36m\]\h\[\e[0m\]::\w] ╰─[\T]>
It turns red if I'm logged in as root, a nice reminder to not do anything stupid
Last edited by jowilkin (2009-12-07 08:24:02)
Offline
I tent to cut and paste alot from the terminal so I like to do it, req:
I like that. Would you share that?
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Yeah, no problem.
set_prompt_style () {
local bldpur='\e[1;35m' # Purple
local bldblu='\e[1;34m' # Blue
local bldblk='\e[1;30m' # Black - Bold
local bldred='\e[1;31m' # Red
local txtrst='\e[0m' # Text Reset
# local bashuser="\[$bldpur\]\u@\[$txtrst\]" # username
local bashhost="\[$bldpur\]\h\[$txtrst\]" # hostname
local bashdir="\[$bldblu\]\w\[$txtrst\]" # directory
local bashprompt="\[$bldblk\]:\n\[$txtrst\]" # prompt symbol
if [ `whoami` == "root" ] ; then
# local bashuser="\[$bldred\]\u@\[$txtrst\]"
local bashhost="\[$bldred\]\h\[$txtrst\]"
fi
PS1="$bashuser$bashhost $bashdir$bashprompt"
}
set_prompt_style
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
Here's what my prompt looks like:
.:[ b-con@beacon-laptop2 | 13:11:11 | ~/Desktop ]:.
$
My prompt function auto-trims the working directory to ensure that it doesn't go longer than the width of the terminal.
Offline