The PS1 thread[

Post em bash prompts, fuck

>code
"\W \\$ \[$(tput sgr0)\]"

>result
~ $

Pic related: my co-workers after seeing my facemelting prompt

Other urls found in this thread:

notes.torrez.org/2013/04/put-a-burger-in-your-shell.html
twitter.com/NSFWRedditImage

export PS1="\w% "

...

...

>enlightenment

You LITERALLY can't beat my prompt
%{%f%b%k%}$(build_prompt)
%{${fg_bold[default]}%}$(prompt_char) %{$reset_color%}


For those that have oh-my-zsh. It's the bullet train theme.

[code

%{$fg[blue]%}%~ $(git_prompt_info)$(bzr_prompt_info)[%n@%m] [%*]%{$reset_color%} $(emoji-clock)
%{$fg_bold[black]%}>%{$reset_color%}

# ------------------------------------------------------------------------------
# FILE: emoji-clock.plugin.zsh
# DESCRIPTION: The current time with half hour accuracy as an emoji symbol.
# Inspired by Andre Torrez' "Put A Burger In Your Shell"
# notes.torrez.org/2013/04/put-a-burger-in-your-shell.html
# AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net)
# VERSION: 1.0.0
# -----------------------------------------------------------------------------

function emoji-clock() {
# Add 15 minutes to the current time and save the value as $minutes.
(( minutes = $(date '+%M') + 15 ))
(( hour = $(date '+%I') + minutes / 60 ))
# make sure minutes and hours don't exceed 60 nor 12 respectively
(( minutes %= 60 )); (( hour %= 12 ))

case $hour in
0) clock=""; [ $minutes -ge 30 ] && clock="";;
1) clock=""; [ $minutes -ge 30 ] && clock="";;
2) clock=""; [ $minutes -ge 30 ] && clock="";;
3) clock=""; [ $minutes -ge 30 ] && clock="";;
4) clock=""; [ $minutes -ge 30 ] && clock="";;
5) clock=""; [ $minutes -ge 30 ] && clock="";;
6) clock=""; [ $minutes -ge 30 ] && clock="";;
7) clock=""; [ $minutes -ge 30 ] && clock="";;
8) clock=""; [ $minutes -ge 30 ] && clock="";;
9) clock=""; [ $minutes -ge 30 ] && clock="";;
10) clock=""; [ $minutes -ge 30 ] && clock="";;
11) clock=""; [ $minutes -ge 30 ] && clock="";;
*) clock="";;
esac
echo $clock
}

No thanks

why do people need more than prompt character, it wastes space and it doesn't do anything

$ user, # root

other info is useless

I often have a lot of terminals open, which is why I need to have the current dir path in my prompt.
I also log into multiple servers with multiple users, when I do that the hostname of the machine is added to my PS1. Also, I use vi keybindings, so having my PS1 change color depending on the mode I'm in (insert/normal) is very useful.
Pic related, my PS1.

Well, I use vi mode with zsh so having it show if I'm in Insert or Normal mode is VERY useful. My pwd is shown to the right, where it isn't taking up important writing space and actually disappears when the text input starts to reach it.

It's just the "kardan" theme modified btw.

welp, shitty demo, here's a better one

i remember where i am and when i don't i pwd, the hostname is probably only thing that makes it useful

Where do you gous learn all this haxxor terminal stuff from? Is zsh better than bash?

Read the manual.

I prefer zsh to bash (even though zsh is disgustingly bloated) but if you can't be bothered to read zsh's manual you might as well just use bash.

Don't listen to Zsh is pretty damn good. Just make sure you add oh-my-zsh.

>Just make sure you add oh-my-zsh.
You just discredited yourself. If you're just going to install that awful, disgusting framework that doesn't give you anything actually useful that you couldn't get on bash, you should just kill yourself.

>you should just kill yourself.
That's what I say to my self every time I'm here

Don't worry user I say to my self a lot too. Just try to remember that you aren't actually responsible for anything, from your success to your failures to the way you are. The universe made you the way you are and you have absolutely no control over your thoughts and preferences. You aren't responsible. Blaming yourself doesn't make sense.

This.

To answer your question: Gentoomen have always had a desire to masturbate to every customizable feature of their computer. These features are for example desktop aesthetics and build flags. The original reason to stand out was to attract the opposite sex. It's instinct to every sexual creature, and reasonable that virgins do it in the only area they know well.

This behavior drives them to compete on the best impression. They think themselves of low value and they have poor self esteem. They don't go out or attract any girls, so they channel their desire to get validation right here. In these threads, they try to attract each other, saying “Look at me! I'm cool and high value!” to each other. And sometimes they succeed. Their “girl” in this case is another virgin gentooman who is into the same look of their PS1 as they are. Isn't that homosexual? Yes it is.

This homosexual attraction is the product of the queer society we live in today. What we masturbate to isn't a girl who seems most suitable for carrying children. It can be anything. Not limited to humans, we can fap to animals or computer graphics, and it's completely acceptable because it's becoming the norm in the community.

I win.

chkec () {
local i=$?
if [ $i -ne 0 ]
then
echo -n " Exit Status : $i "
fi
}

PS1='\[\033[1;36m\]┌─[ \[\033[38;5;10m\]\u\[\033[38;5;226m\]@\[\033[38;5;9m\]\h\[\033[1;36m\] ]\[\033[1;36m\] [\[\033[1;33m\]\t\[\033[1;36m\]\[\033[1;36m\]]\n└─\[\033[1;36m\][ \[\033[38;5;137m\]\w\[\033[1;36m\] ]\[\033[38;5;230m\] \[\033[48;5;1m\]$(chkec)\[\e[m\] \[\033[1;36m\]\$\[$(tput sgr0)\] '

>inb4 hax

Shit, forgot the demo picture.

PS1="\[\033[35m\]╭|╮\n╰|╮\n╰|╯ \[\033[m\]"

>PS1="\[\033[35m\]╭|╮\n╰|╮\n╰|╯ \[\033[m\]"
big money cash money salvia

hello here is my ps1

aplel ? literally who ?

...

...

\[\033[1;35m\]\u\[\033[0m\]·\[\033[1;32m\]\h:\[\033[0m\]\w >\[\033[0m\]

I made a monstrous multiline abomination by fucking around with it myself back when I hardly knew anything at all about bash scripting or Linux. It works though and adapts to the width of the terminal window and the length of the current path. It makes it much easier for me to tell exactly where I am if the current path is somewhere deep inside a few folders with very long names.

Result:
┌miniserv@MINISERV-2 ~
└$ cd aaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/cccccccccccccccccccccccccccccccccccccc/dddddddddddddddddddddddddd/eeeeeeeeeeeeeeeeeeeeeeeeeeeee
┌miniserv@MINISERV-2 ~/aaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
│/cccccccccccccccccccccccccccccccccccccc/dddddddddddddddddddddddddd/eeeeeeeeeeee
│eeeeeeeeeeeeeeeee
└$ cd ~
┌miniserv@MINISERV-2 ~
└$ rm -rf aaaaaaaaaaaaaaaaaaaaaaaaaa/


Shit in .bashrc
# split path and add box drawing characters
function promptcmd {
numcols=`tput cols`
linelen=$(($numcols - 1))
info=${debian_chroot:+($debian_chroot)}┌$USER@`hostname`:
remaining=$(($numcols - ${#info}))
currentpath=$PWD
[[ "$currentpath" =~ ^"$HOME"(/|$) ]] && currentpath="~${currentpath#$HOME}"
pathlen=${#currentpath}

splitpath="${currentpath:0:$remaining}"
pos=$remaining
while (( $pos < $pathlen )); do
splitpath=`echo -ne "$splitpath\n\e[00m│\e[01;33m${currentpath:$pos:$linelen}"`
pos=$(($pos + $linelen))
done
}

if [ "$color_prompt" = yes ]; then
#multiline v2
PROMPT_COMMAND='promptcmd'
PS1='${debian_chroot:+($debian_chroot)}┌\[\033[01;31m\]\u\[\e[00m\]@\[\e[1;32m\]\h\[\033[00m\] \[\e[01;33m\]$splitpath\n\[\033[00m\]└\$\[\e[00m\] '

Holy shit do you actually use that? Screenshot?

>function
>backticks
>echo -ne
>unquoted variables
Please learn shell scripting.

Yup

I think it was the first script I wrote. I'm too lazy to rewrite something that's perfectly functional now though. Also the unquoted variables only contain numbers IIRC.