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:
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.
I guess I go with simple but effective - at least I don’t get lost!
and I know (if I want) how long the command took..
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 . 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:
Now it works. - So much for your self-responsibility posting rubbish on a public forum… and yet, no real big sweat from my end.
Thank you very much, but I’m
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$ "
(Show your terminal prompt - #26 by swh)
This only means I have to go out more. (hides head in paper bag)
one more for the win lol
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
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.
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 :
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
}
maybe so i was just showing it as a possibility. honestly thats to much for me. I like it plain and simple.
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
For my zsh config I use GitHub - sorin-ionescu/prezto: The configuration framework for Zsh which is quite convenient.