Harmonizing the bash startup scripts

If you have any suggestions or ideas about improving Salix, here's the place to post them.
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: Harmonizing the bash startup scripts

Post by damNageHack »

thenktor wrote:EDIT2: SuSE uses a red root prompt. Done by this:
:oops: :evil:
User avatar
lmello
Posts: 218
Joined: 4. Aug 2010, 17:38
Location: Brazil
Contact:

Re: Harmonizing the bash startup scripts

Post by lmello »

But as long as PS1 has \W instead of \w it's OK to me - I hate when the #!$@% prompt gets so big it fills the whole line.
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: Harmonizing the bash startup scripts

Post by thenktor »

Yep, because you can always use 'pwd' to see where you actually are.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
EricC
Posts: 79
Joined: 24. Sep 2009, 02:11
Location: Under an overpass in a shipping crate

Re: Harmonizing the bash startup scripts

Post by EricC »

thenktor wrote:
...

EDIT2: SuSE uses a red root prompt. Done by this:

Code: Select all

        # Colored root prompt (see bugzilla #144620)
        if test "$UID" -eq 0 -a -t ; then
            _bred="$(path tput bold 2> /dev/null; path tput setaf 1 2> /dev/null)"
            _sgr0="$(path tput sgr0 2> /dev/null)"
            PS1="\[$_bred\]$PS1\[$_sgr0\]"
            unset _bred _sgr0
        fi

Interesting approach to a red colored root prompt. I have taken the PCLinuxOS approach for my root prompt.

Code: Select all

export PS1='\[\033[01;31m\]\u[\W]\$\[\033[00m\] '
Image
User avatar
bioterror
Posts: 20
Joined: 19. Sep 2010, 13:11
Location: Espoo, Finland
Contact:

Re: Harmonizing the bash startup scripts

Post by bioterror »

Giving my ZSH prompt.

Code: Select all

PS1="$(print '%{\e[1;30m%}-%{\e[0m%}')$(print '%{\e[0;31m%}-%{\e[0m%}')$(print '%{\e[1;31m%}(%{\e[0m%}')$(print '%{\e[0;31m%}%n%{\e[0m%}')$(print '%{\e[1;30m%}@%{\e[0m%}')$(print '%{\e[0;31m%}%m%{\e[0m%}')$(print '%{\e[1;31m%})%{\e[0m%}')$(print '%{\e[;31m%}-%{\e[0m%}')$(print '%{\e[1;31m%}(%{\e[0m%}')$(print '%{\e[0;31m%}%!%{\e[0m%}')$(print '%{\e[1;30m%}/%{\e[0m%}')$(print '%{\e[0;31m%}%l%{\e[0m%}')$(print '%{\e[1;31m%})%{\e[0m%}')$(print '%{\e[0;31m%}-%{\e[0m%}')$(print '%{\e[1;31m%}(%{\e[0m%}')$(print '%{\e[0;31m%}%T%{\e[0m%}')$(print '%{\e[1;30m%}:%{\e[0m%}')$(print '%{\e[0;31m%}%D{%d/%m/%y}%{\e[0m%}')$(print '%{\e[1;31m%})%{\e[0m%}')$(print '%{\e[0;31m%}-%{\e[0m%}')$(print '%{\e[1;30m%}-%{\e[0m%}')
$(print '%{\e[1;30m%}-%{\e[0m%}')$(print '%{\e[0;31m%}-%{\e[0m%}')$(print '%{\e[1;31m%}(%{\e[0m%}')$(print '%{\e[0;31m%}%#%{\e[0m%}')$(print '%{\e[1;30m%}:%{\e[0m%}')$(print '%{\e[0;31m%}%~%{\e[0m%}')$(print '%{\e[1;31m%})%{\e[0m%}')$(print '%{\e[0;31m%}-%{\e[0m%}')$(print '%{\e[1;30m%}-%{\e[0m%}') "
And here's another one I use, ZSH too.

Code: Select all

PS1="$(print '%{\e[0;36m%}%n%{\e[0m%}')$(print '%{\e[1;36m%}')@$(print '%{\e[0;36m%}%m%{\e[0m%}'):$(print '%{\e[1;36m%}%~%{\e[0m%}')%# "


RPS1="$(print '%{\e[0;36m%}.%{\e[1;36m%}:%{\e[0;36m%}%*') on $(print '%{\e[0;36m%}%D%{\e[0m%}%{\e[1;36m%}:%{\e[0;36m%}.%{\e[0m%}')"
Archbang has kinda 1337 bash startup :ugeek:
Image
User avatar
fredg
Posts: 232
Joined: 3. Oct 2009, 16:50
Location: Lyon, France
Contact:

Re: Harmonizing the bash startup scripts

Post by fredg »

I would say that startup script have to be minimals and then set by the user himself but yours (lmello) are just not so intrusive, they are just the less they're should be.
I vote yes.

++
User avatar
Akuna
Salix Wizard
Posts: 1038
Joined: 14. Jun 2009, 12:25

Re: Harmonizing the bash startup scripts

Post by Akuna »

fredg wrote:I would say that startup script have to be minimals and then set by the user himself but yours (lmello) are just not so intrusive, they are just the less they're should be.
I vote yes.

++
+1 ;)
Image
What really matters is where you are going, not where you come from.
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: Harmonizing the bash startup scripts

Post by gapan »

I really don't agree with most of what Imello proposed in his 1st post. man pages should not default to US locale no matter what, I certainly don't want rm/mv/cp to ask me for every file I'm about to delete/move/copy, grep should not be colorized by default as it might break stuff that are piped the grep output and I don't get why we should have ~/.bash_login and ~/.bash_logout files that only point to non existing files in /usr/local/bin.
Image
Image
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: Harmonizing the bash startup scripts

Post by thenktor »

gapan wrote:I certainly don't want rm/mv/cp to ask me for every file I'm about to delete/move/copy
Yes, that really sucks :ugeek: But I'm using verbose output for these commands now.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
lmello
Posts: 218
Joined: 4. Aug 2010, 17:38
Location: Brazil
Contact:

Re: Harmonizing the bash startup scripts

Post by lmello »

thenktor wrote:
gapan wrote:I certainly don't want rm/mv/cp to ask me for every file I'm about to delete/move/copy
Yes, that really sucks :ugeek: But I'm using verbose output for these commands now.
That's what the -f option is for.
Post Reply