Show your terminal prompt

image
image

1 Like

2 Likes

2023-03-28-155009_513x143_scrot

2 Likes

my oh-my-zsh. colorful but useless

pacseek took 11 hours :smirk:

2 Likes

My prompt is unchanged from the EOS original one, except that I added some colour. This is what the line in .bashrc looks like:

PS1='[\033[0;32m][\u@\h[\033[1;32m] \W[\033[0;32m]][\033[0m]$ ’

which gives this output:
image

2 Likes

It is my normal, untouched .bashrc:

When I apply your suggestion, I get this:

Think I’m done with customizing my shell prompt here and now. :rofl:

3 Likes

+1 for the rubbish shell fish. :two_hearts: :fish:

5 Likes

I guess I go with simple but effective - at least I don’t get lost! :grin:

and I know (if I want) how long the command took..
2 Likes

Initially I had a typo in my .bashrc, too, so it didn’t work. These colour codes are quite complicated for me as a beginner, and typos are not easy to spot.

But in this case, the customizing does not work because some backslashes got deleted when pasting the line into the forum as text and not as code :wink:. Feel free to try again with this line:

PS1='\[\033[0;32m\][\u@\h\[\033[0;34m\] \W\[\033[0;32m\]]\[\033[0m\]\$ '

This should look something like this:
grafik

1 Like

Now it works. - So much for your self-responsibility posting rubbish on a public forum… and yet, no real big sweat from my end. :wink:

Thank you very much, but I’m

:crazy_face:

just for the remembrance of doing such and i was bored

PS1="[\e[01;35m]inxi -s | grep "System" | awk {'print $3, $4, $5'}\nWhat is thy Bidding Master?\n[\e[00m]\u@\h:\w$ "
ps1

3 Likes

Works for me:

2 Likes

(Show your terminal prompt - #26 by swh)
This only means I have to go out more. (hides head in paper bag)

1 Like

one more for the win lol
ps1-02

curl wttr\.in/"Newark"?0?A?u
PS1="\[\e[01;35m\]\nWhat is thy Bidding Master?\n\[\e[00m\]\u@\h:\w$ "

the first runs the weather seperate
you can add the weather into the prompt like so
PS1="curl wttr\.in/"Newark"?0?A?u[\e[01;35m]\nWhat is thy Bidding Master?\n[\e[00m]\u@\h:\w$ "
however this gives a undesirable look at the beginning as curl will show off stats

to keep the weather in the prompt with out the curl output add clear after the prompt in your bashrc file like so

#<----[ custom prompt inspired by https://forum.endeavouros.com/t/show-your-terminal-prompt/39011/36
PS1="`curl wttr\.in/"Newark"?0?A?u`\[\e[01;35m\]\nWhat is thy Bidding Master?\n\[\e[00m\]\u@\h:\w$ "
clear #<----[ use clear to remove unwanted data from curl
1 Like

Fu… me. Those are things I’d desperately need, I guess, because there ought to be some fun in it? - Playing around for fun, granted. Playing around to get your system messed up, not so generously granted… 'cause I remember it happened to me once to a point I did a reinstall sometime ago - stupid me. :rofl:

oh-my-zsh is too heavy/complicated for my needs, I use zap :

and the cmdtime plugin :

wttr.in is great, but for a prompt, I think I would use ansiweather :

My simple one :

1 Like

or just add the following to your .zshrc

function preexec() {
  timer=$(date +%s%3N)
}

function precmd() {
  if [ $timer ]; then
    local now=$(date +%s%3N)
    local d_ms=$(($now-$timer))
    local d_s=$((d_ms / 1000))
    local ms=$((d_ms % 1000))
    local s=$((d_s % 60))
    local m=$(((d_s / 60) % 60))
    local h=$((d_s / 3600))
    if ((h > 0)); then elapsed=${h}h${m}m
    elif ((m > 0)); then elapsed=${m}m${s}s
    elif ((s >= 10)); then elapsed=${s}.$((ms / 100))s
    elif ((s > 0)); then elapsed=${s}.$((ms / 10))s
    else elapsed=${ms}ms
    fi

    export RPROMPT="%F{cyan}${elapsed} %{$reset_color%}"
    unset timer
  fi
}
2 Likes

maybe so i was just showing it as a possibility. honestly thats to much for me. I like it plain and simple.
ps1-03

2 Likes

Oh-my-zsh is insufferable bloat. I use nothing of the sort, just clean Zsh. If I want something fancy, I either implement it myself or look at oh-my-zsh git and steal it from there :rofl:

2 Likes

For my zsh config I use GitHub - sorin-ionescu/prezto: The configuration framework for Zsh which is quite convenient.

1 Like