[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

The PS1 thread[

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 32
Thread images: 12

File: downloadfile-1.jpg (62KB, 400x221px) Image search: [Google]
downloadfile-1.jpg
62KB, 400x221px
Post em bash prompts, fuck

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


>result
~ $

Pic related: my co-workers after seeing my facemelting prompt
>>
export PS1="\w% "
>>
File: $PS1.png (22KB, 838x523px) Image search: [Google]
$PS1.png
22KB, 838x523px
>>
File: 2016-11-24-152805_462x838.png (31KB, 462x838px) Image search: [Google]
2016-11-24-152805_462x838.png
31KB, 462x838px
>>
File: 1270323879286.gif (2MB, 290x260px) Image search: [Google]
1270323879286.gif
2MB, 290x260px
>>57662997
>enlightenment
>>
File: 1454883151904.png (4KB, 440x85px) Image search: [Google]
1454883151904.png
4KB, 440x85px
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.
>>
>>57663027
[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"
# http://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
}
>>
>>57663052
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
>>
File: screenshot_2016-11-24-15:53:05.png (153KB, 959x1079px) Image search: [Google]
screenshot_2016-11-24-15:53:05.png
153KB, 959x1079px
>>57663178
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.
>>
>>57663178
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.
>>
>>57663278
welp, shitty demo, here's a better one
>>
>>57663241
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?
>>
>>57663394
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.
>>
>>57663394
Don't listen to >>57663410

Zsh is pretty damn good. Just make sure you add oh-my-zsh.
>>
>>57663427
>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.
>>
>>57663448
>you should just kill yourself.
That's what I say to my self every time I'm here
>>
>>57663486
Don't worry Anon 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.
>>
>>57663178
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.
>>
>>57660941
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
>>
File: demostration_of_internet_penis.jpg (40KB, 729x658px) Image search: [Google]
demostration_of_internet_penis.jpg
40KB, 729x658px
>>57665272
Shit, forgot the demo picture.
>>
PS1="\[\033[35m\]╭|╮\n╰|╮\n╰|╯ \[\033[m\]"
>>
>>57665397
>PS1="\[\033[35m\]╭|╮\n╰|╮\n╰|╯ \[\033[m\]"
big money cash money salvia
>>
>>57665450
aplel ? literally who ?
>>
File: .png (3MB, 1920x1200px) Image search: [Google]
.png
3MB, 1920x1200px
>>57665450
>>
File: PS1.jpg (1MB, 2816x2112px) Image search: [Google]
PS1.jpg
1MB, 2816x2112px
>>57660941
>>
>>57660941
\[\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\] '
>>
>>57666015
Holy shit do you actually use that? Screenshot?
>>
>>57666015
>function
>backticks
>echo -ne
>unquoted variables
Please learn shell scripting.
>>
File: Capture.png (18KB, 825x521px) Image search: [Google]
Capture.png
18KB, 825x521px
>>57666094
Yup

>>57666273
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.
Thread posts: 32
Thread images: 12


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.