You are not logged in.
prompt
PS1="\033[32m\\w\033[0m\\n\`if [ \$? = 0 ]; then echo \:\); else echo \:\/; fi\` \u> " # two lines
demo
~
:) ticho> test
~
:/ ticho> echo "see the sad face there?"
see the sad face there?
~
:) ticho> cd source/
~/source
:) ticho> cd sadjhasjdhasjkd
bash: cd: sadjhasjdhasjkd: No such file or directory
~/source
:/ ticho> █
features
- two lines (path is different color)
- sad face on error
p.s. predator edition
PS1="\033[32m\\w\033[0m\\n\`if [ \$? = 0 ]; then echo ∴; else echo ∵; fi\`\u@\h> " # two lines, predator edition
demo
∴ticho@arch> cd source/
~/source
∴ticho@arch> false
~/source
∵ticho@arch> true
~/source
∴ticho@arch> █
Last edited by brontosaurusrex (2016-05-11 22:23:17)
Offline
PROMPT="%{$fg[white]$ %}%~%{$reset_color%} "
looks like:
$ ~
Last edited by el_koraco (2016-05-11 18:21:35)
Offline
I use grml's zsh configuration so:
https://gist.github.com/Head-on-a-Stick … ede9534aca
I think that's everything
The normal display is just:
empty@alpine ~ %
But it can be modified further (there is an option to add battery status and other stuff).
When a command errors out, a sad face is printed on the right and the error code is printed before the prompt.
When in git directories, the prompt displays some version information:
empty@alpine ~/arc-theme (git)-[master] %
The prompt is dynamic and changes according to the completion status and I'm sure it does lots of other cool stuff I don't even know about.
The configuration is the same as that used for the Arch live ISO
Offline
Just colour changes for me:
user:
PS1='\[\e[1;32m\]\u@\h \W\$\[\e[0m\] '
root:
PS1='\[\e[0;91m\]\u\[\e[m\]\[\e[0;92m\]@\h \W\$\[\e[0m\] '
damo@debian ~$ sudo -i
root@debian ~#
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
here is mine:
PS1='\[\e[1;31m\]\u@\h\W\$\[\e[0m\] '
lamarca@debian:~s
Offline
been using this one for a while now:
powerline-shell
Last edited by ohnonot (2021-07-03 10:38:27)
Offline
been using this one for a while now:
https://github.com/ohnonot/powerline-shell
http://dt.iki.fi/stuff/powerline-shell.png
oh god my eyes!! 8)
For whatever reason, I'm reminded of Whole Foods...
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
been using this one for a while now:
https://github.com/ohnonot/powerline-shell
http://dt.iki.fi/stuff/powerline-shell.png
Wow It's great...
Offline
oh god my eyes!! 8)
yes, i agree.
i tried to pack as many features as possible into that scrot. it's not exactly beautiful, but it's great to work with - commands' outputs are always nicely seperated by a colorful bar.
great when you have to scroll back up and find something.
Last edited by ohnonot (2021-07-03 10:38:13)
Offline
I use
PS1="\[\033[33m\]\@ \w \$ \[\033[0m\]"
and
PROMPT_DIRTRIM=2
Using the Openbox (3.5.2) session of Lubuntu 14.04 LTS but very interested in BL :)
Offline
@ohnonot & to the people of more complex examples that may follow:
Could you add 3-5 main/interesting features to the post (From your perspective)?
Last edited by brontosaurusrex (2016-05-12 10:30:18)
Offline
^ i don't understand the request? what do you want me to add? explanations? other prompts?
or do you mean, explain what the prompt does?
Offline
What are the main or interesting features for you, for example:
features
- smart git status
- error code number
- dunno
All optional of course, but will make the thread a lot more useful for the casual reader imho.
Offline
ahh, i see.
from my personal config:
Show the last command's exit code if it was non-zero
Show a padlock if the current user has no write access to the current directory
Show the current user's username as in ordinary prompts
Show the current directory. If the path is too long, the middle part is replaced with ellipsis
Show the current git branch and status
Shows a '#' if the current user is root, '$' otherwise. Also, changes color if the last command exited with a non-zero error code
Last edited by ohnonot (2021-07-03 10:37:54)
Offline
https://github.com/olmokramer/.dotfiles … ash_prompt
Looks something like this:
user@bunsen-labs /my/current/path : )
» trueuser@bunsen-labs /my/current/path : )
» falseuser@bunsen-labs /my/current/path 1 : (
»
There's an empty line between previous output and the next prompt line
The color of the smilies on the right and the arrow on the left indicate previous exit status
If a command failed the exit code is printed next to the sad smily
(Will probably only work with bash, haven't tested other shells)
Last edited by olminator (2016-05-18 01:38:47)
Offline
I added fortunes using quotes from Rick Cook's Wizardry Compiled
/ "A jump gone awry is one of the hardest \
| bus to locate." |
| |
\ --programmers' saying /
-----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
Offline
Mine :
PS1='\[\033[0;36m\] ┌ ─ ─[\u@\h]─ ─ ─ ─ ─ ─ ─ ─ ─ \[\033[0;31m\]\t\[\033[0;36m\]\n └ ─ >\[\033[1;34m\](${PWD}) \$ \[\033[0;37m\]'
La liberté, personne ne peut l’expliquer mais tout le monde peut la comprendre.Cecilia Meireles
Tout ce qui n'est pas donné ou partagé est perdu (proverbe tsigane)
Offline
current directory, last command success, and git info
# PS1 with error, and git info
__set_ps1 (){
local err="\[\033[1;31m\]" # error -- red
local nor="\[\033[1;30m\]" # normal -- white
local por="\[\033[1;30m\]" # prompt char
local dirty="\[\033[0;33m\]" # dirty git
local rst="\[\033[0m\]" # Text Reset
#
# git info
local gitinfo=
local branch=$(git symbolic-ref HEAD --short 2> /dev/null)
if [[ $branch ]]; then
local x=$(git status --porcelain)
if [[ $x ]]; then
gitinfo="${nor}(${dirty}${branch}${nor}) "
else
gitinfo="${nor}(${branch}) "
fi
fi
#
# generate prompt
PS1="\n \$([[ \$? != 0 ]] && echo \"$err\" || echo \"$nor\")\W ${gitinfo}${por}$ $rst"
}
# set PS1
PROMPT_COMMAND="__set_ps1"
following shows normal prompt, error, clean git, and dirty git, respectively.
Offline
I'm using the stock OpenBSD prompt for their stripped Korn shell:
$
Offline