You are not logged in.

#1 2016-05-11 17:51:06

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Post your Prompt █

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

#2 2016-05-11 18:20:47

el_koraco
Member
Registered: 2016-02-08
Posts: 307

Re: Post your Prompt █

PROMPT="%{$fg[white]$ %}%~%{$reset_color%} "

looks like:

$ ~ 

Last edited by el_koraco (2016-05-11 18:21:35)

Offline

#3 2016-05-11 19:02:09

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Post your Prompt █

I use grml's zsh configuration so:
https://gist.github.com/Head-on-a-Stick … ede9534aca

I think that's everything big_smile

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 smile

See https://grml.org/zsh/ & http://grml.org/zsh/zshrc

Offline

#4 2016-05-11 19:16:26

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Post your Prompt █

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

#5 2016-05-11 19:50:32

lamarca
Member
From: rio de janeiro
Registered: 2015-11-27
Posts: 467
Website

Re: Post your Prompt █

here is mine:

PS1='\[\e[1;31m\]\u@\h\W\$\[\e[0m\] '

lamarca@debian:~s

Offline

#6 2016-05-11 20:26:23

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Post your Prompt █

been using this one for a while now:
powerline-shell

Last edited by ohnonot (2021-07-03 10:38:27)

Offline

#7 2016-05-11 22:25:26

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: Post your Prompt █

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

#8 2016-05-12 04:20:07

kleiner_hussar
Member
From: Traunstein, Germany
Registered: 2016-04-25
Posts: 82

Re: Post your Prompt █

Wow  yikes It's great...

Offline

#9 2016-05-12 05:13:42

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Post your Prompt █

Horizon_Brave wrote:

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

#10 2016-05-12 05:55:49

vasa1
Member
Registered: 2015-09-29
Posts: 204

Re: Post your Prompt █

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

#11 2016-05-12 09:04:38

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Post your Prompt █

@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

#12 2016-05-12 20:27:13

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Post your Prompt █

^ 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

#13 2016-05-12 20:40:09

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Post your Prompt █

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

#14 2016-05-12 20:47:38

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Post your Prompt █

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

#15 2016-05-17 16:06:03

olminator
Member
Registered: 2015-11-24
Posts: 10

Re: Post your Prompt █

https://github.com/olmokramer/.dotfiles … ash_prompt

Looks something like this:

user@bunsen-labs /my/current/path                : )
» true

user@bunsen-labs /my/current/path                : )
» false

user@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

#16 2016-05-17 16:25:25

Irulan
Guest

Re: Post your Prompt █

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 |
                ||     ||

#17 2016-05-17 17:29:45

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,659

Re: Post your Prompt █

PS1='\[\033[0;36m\] ┌ ─ [\l] ─ \[\033[1;34m\][\w]\n \[\033[0;36m\]└ ─ > \[\033[0;37m\]$ \[\033[0;37m\]'

2016_05_17_scrot.jpg

the \l gives the basename of the shell’s terminal device name; the prompt will show tty1 etc.. when switching to a console.


You must unlearn what you have learned.
    -- yoda

Offline

#18 2016-05-19 11:11:22

wagmic
Member
From: Casablanca
Registered: 2015-09-30
Posts: 95

Re: Post your Prompt █

Mine :

PS1='\[\033[0;36m\] ┌ ─ ─[\u@\h]─ ─ ─ ─ ─ ─ ─ ─ ─ \[\033[0;31m\]\t\[\033[0;36m\]\n └ ─ >\[\033[1;34m\](${PWD}) \$ \[\033[0;37m\]'

1463656060.png


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

#19 2016-06-07 13:28:45

easysid
Member
Registered: 2016-01-01
Posts: 49

Re: Post your Prompt █

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.

qSLRhJJ.png

Offline

#20 2016-06-07 17:48:17

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Post your Prompt █

I'm using the stock OpenBSD prompt for their stripped Korn shell:

$

Offline

Board footer

Powered by FluxBB