Jump to content


Custom Bash Prompts


  • Please log in to reply
48 replies to this topic

#26 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,766 posts

Posted 01 August 2012 - 11:16 PM

Yeah, that's true. It's best to learn from others' mistakes, though. :yes:

#27 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 24,658 posts

Posted 01 August 2012 - 11:32 PM

View PostV.T. Eric Layton, on 01 August 2012 - 11:16 PM, said:

Yeah, that's true. It's best to learn from others' mistakes, though. :yes:

Right :hysterical:
Posted ImagePosted Image
Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#28 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,766 posts

Posted 02 August 2012 - 12:12 AM

You do get wiser as you get older... or maybe just lazier and more cautious. ;)

#29 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 24,658 posts

Posted 02 August 2012 - 12:15 AM

View PostV.T. Eric Layton, on 02 August 2012 - 12:12 AM, said:

You do get wiser as you get older... or maybe just lazier and more cautious. ;)
Right :hysterical:
Posted ImagePosted Image
Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#30 OFFLINE   crp

crp

    Discussion Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,178 posts

Posted 02 August 2012 - 01:55 AM

View PostV.T. Eric Layton, on 01 August 2012 - 11:16 PM, said:

Yeah, that's true. It's best to learn from others' mistakes, though. :yes:
Especailly since I don't make any
Of all tyrannies, a tyranny sincerely exercised for the good of its victims may be the most oppressive. It would be better to live under robber barons than under omnipotent moral busybodies. The robber baron's cruelty may sometimes sleep, his cupidity may at some point be satiated; but those who torment us for our own good will torment us without end for they do so with the approval of their own conscience. ~C. S. Lewis

#31 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 24,658 posts

Posted 02 August 2012 - 09:19 AM

View Postcrp, on 02 August 2012 - 01:55 AM, said:

Especailly since I don't make any

Rofl :hysterical:
Posted ImagePosted Image
Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#32 OFFLINE   sunrat

sunrat

    Thread Kahuna

  • Forum Moderators
  • 5,945 posts

Posted 02 August 2012 - 10:01 PM

View Postcrp, on 02 August 2012 - 01:55 AM, said:

Especailly since I don't make any
Me neither. It's easy on Debian. (sunrat dodges hurled stones). :shifty: :whistling:

ps. I love the irony of your incorect speling. :D
registered Linux user number 324659  ||    The importance of Reading The *Fine* Manual! :D
Posted ImagePosted ImagePosted ImagePosted Image
For the things we have to learn before we can do them, we learn by doing them.

#33 OFFLINE   goretsky

goretsky

    Posting Prodigy

  • Forum Moderators
  • 2,054 posts

Posted 03 August 2012 - 03:36 AM

Hello,

A bit dated, but this decade-old thread on Slashdot might be of interest:  What Does Your Command Prompt Look Like?

Regards,

Aryeh Goretsky
Dexter is a good dog.

Aryeh Goretsky
Microsoft MVP 2004.1-2018.6 [Cloud and Datacenter Management]

(previously Networking, Windows, Windows for Devices and IT)
FacebookGoogle+ personal blogpersonal websiteTwitter work blog

#34 OFFLINE   sunrat

sunrat

    Thread Kahuna

  • Forum Moderators
  • 5,945 posts

Posted 03 August 2012 - 04:11 AM

Good one Aryeh. There be some nasty but funny posts there, eg.:
alias rm="echo I\\'m sorry Dave, I\\'m afraid I can\\'t do that"

registered Linux user number 324659  ||    The importance of Reading The *Fine* Manual! :D
Posted ImagePosted ImagePosted ImagePosted Image
For the things we have to learn before we can do them, we learn by doing them.

#35 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,766 posts

Posted 03 August 2012 - 10:47 AM

Wow! 2001. I hadn't even heard of Linux then. ;)

#36 OFFLINE   crp

crp

    Discussion Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,178 posts

Posted 03 August 2012 - 11:09 AM

Is that the page that had the infamous Snoopy prompt? It left the user with only 1 viewable command line and took up all the memory allocated to the environment space.
Of all tyrannies, a tyranny sincerely exercised for the good of its victims may be the most oppressive. It would be better to live under robber barons than under omnipotent moral busybodies. The robber baron's cruelty may sometimes sleep, his cupidity may at some point be satiated; but those who torment us for our own good will torment us without end for they do so with the approval of their own conscience. ~C. S. Lewis

#37 OFFLINE   wa4chq

wa4chq

    Thread Head

  • Members
  • PipPipPipPipPipPip
  • 655 posts

Posted 23 July 2019 - 11:17 AM

Reviving the dead....lol
Here's my latest......using ZSH.....I'm also including todays weather.
Posted Image

Posted Image
REGISTERED LINUX USER #547579


#38 OFFLINE   saturnian

saturnian

    Multithreader

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,197 posts

Posted 23 July 2019 - 11:57 AM

Wow! I like short and simple for my bash prompts:

user1[~]$

PS1='\[\e[1;32m\]\u[\w]\\$ \[\e[0m\]'

Posted Image

#39 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,766 posts

Posted 23 July 2019 - 12:00 PM

Hmm... that is short and simple. I'll bet you're a vanilla ice cream type, huh? ;)

#40 OFFLINE   wa4chq

wa4chq

    Thread Head

  • Members
  • PipPipPipPipPipPip
  • 655 posts

Posted 23 July 2019 - 12:25 PM

lol....the screenshot I posted shows the whole screen including my prompt.....the prompt I'm using is just a single line! lol  I included the local weather out of kindness...lol

Edited by wa4chq, 23 July 2019 - 12:28 PM.

Posted Image
REGISTERED LINUX USER #547579


#41 OFFLINE   wa4chq

wa4chq

    Thread Head

  • Members
  • PipPipPipPipPipPip
  • 655 posts

Posted 23 July 2019 - 12:30 PM

Posted Image

Posted Image
REGISTERED LINUX USER #547579


#42 OFFLINE   saturnian

saturnian

    Multithreader

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,197 posts

Posted 23 July 2019 - 12:55 PM

View PostV.T. Eric Layton, on 23 July 2019 - 12:00 PM, said:

Hmm... that is short and simple. I'll bet you're a vanilla ice cream type, huh? ;)

Ha-ha, I don't know. Oh, here's the whole window with my neofetch:

Posted Image

Edited by saturnian, 23 July 2019 - 01:32 PM.


#43 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 24,658 posts

Posted 23 July 2019 - 01:13 PM

This is from my work laptop:

Posted Image
Posted ImagePosted Image
Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#44 OFFLINE   wa4chq

wa4chq

    Thread Head

  • Members
  • PipPipPipPipPipPip
  • 655 posts

Posted 24 July 2019 - 10:58 AM

PS1="[%w] $fg[green]%n %~ $fg[white]--> "
Posted Image

Edited by wa4chq, 24 July 2019 - 11:08 AM.

Posted Image
REGISTERED LINUX USER #547579


#45 OFFLINE   saturnian

saturnian

    Multithreader

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,197 posts

Posted 24 July 2019 - 10:04 PM

View Postwa4chq, on 24 July 2019 - 10:58 AM, said:

PS1="[%w] $fg[green]%n %~ $fg[white]--> "

Does this work only for ZSH? I tried it here (using BASH) and it gives me this prompt, all in white:

[%w] [green]%n %~ [white]-->


#46 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 24,658 posts

Posted 24 July 2019 - 10:09 PM

Main home rig prompt:

Posted Image
Posted ImagePosted Image
Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#47 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 24,658 posts

Posted 25 July 2019 - 07:07 AM

View Postsaturnian, on 24 July 2019 - 10:04 PM, said:

View Postwa4chq, on 24 July 2019 - 10:58 AM, said:

PS1="[%w] $fg[green]%n %~ $fg[white]--> "

Does this work only for ZSH? I tried it here (using BASH) and it gives me this prompt, all in white:

[%w] [green]%n %~ [white]-->

Zsh does not use that syntax in it's config. Here is my ~/.zshrc:

# Path to your oh-my-zsh installation.
ZSH=/usr/share/oh-my-zsh/

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="evan"

# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"

plugins=(git)

# User configuration
export PATH=$HOME/bin:/usr/local/bin:$PATH

ZSH_CACHE_DIR=$HOME/.oh-my-zsh-cache
if [[ ! -d $ZSH_CACHE_DIR ]]; then
mkdir $ZSH_CACHE_DIR
fi

source $ZSH/oh-my-zsh.sh

#Syntax highlighting
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

#Aliases
alias vtop='vtop --theme dark'
alias grep='grep --color=auto'
alias rb='dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Reboot'
alias pa='yay -Syu'
alias di='di -H -x tmpfs,run'
alias tor='chromium --proxy-server="socks://localhost:9050"'
alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
alias mixer='pulsemixer'
alias mail='neomutt'
alias mkdir='mkdir -pv'
source /usr/share/doc/pkgfile/command-not-found.zsh
export _JAVA_OPTIONS='-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
export GEM_HOME=$(ruby -e 'print Gem.user_dir')
source ~/.rvm/scripts/rvm

transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }

Posted ImagePosted Image
Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#48 OFFLINE   wa4chq

wa4chq

    Thread Head

  • Members
  • PipPipPipPipPipPip
  • 655 posts

Posted 25 July 2019 - 02:16 PM

View Postsaturnian, on 24 July 2019 - 10:04 PM, said:

View Postwa4chq, on 24 July 2019 - 10:58 AM, said:

PS1="[%w] $fg[green]%n %~ $fg[white]--> "

Does this work only for ZSH? I tried it here (using BASH) and it gives me this prompt, all in white:

[%w] [green]%n %~ [white]-->
I believe so, only for zsh.  If I try using bash prompts with zsh, they don't work.  There are plenty of sites for pimping bash.  Here's one...https://www.maketech...h-prompt-linux/

Posted Image
REGISTERED LINUX USER #547579


#49 OFFLINE   wa4chq

wa4chq

    Thread Head

  • Members
  • PipPipPipPipPipPip
  • 655 posts

Posted 25 July 2019 - 02:32 PM

View Postsecuritybreach, on 25 July 2019 - 07:07 AM, said:

View Postsaturnian, on 24 July 2019 - 10:04 PM, said:

View Postwa4chq, on 24 July 2019 - 10:58 AM, said:

PS1="[%w] $fg[green]%n %~ $fg[white]--> "

Does this work only for ZSH? I tried it here (using BASH) and it gives me this prompt, all in white:

[%w] [green]%n %~ [white]-->

Zsh does not use that syntax in it's config. Here is my ~/.zshrc:

# Path to your oh-my-zsh installation.
ZSH=/usr/share/oh-my-zsh/

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="evan"

# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"

plugins=(git)

# User configuration
export PATH=$HOME/bin:/usr/local/bin:$PATH

ZSH_CACHE_DIR=$HOME/.oh-my-zsh-cache
if [[ ! -d $ZSH_CACHE_DIR ]]; then
mkdir $ZSH_CACHE_DIR
fi

source $ZSH/oh-my-zsh.sh

#Syntax highlighting
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

#Aliases
alias vtop='vtop --theme dark'
alias grep='grep --color=auto'
alias rb='dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Reboot'
alias pa='yay -Syu'
alias di='di -H -x tmpfs,run'
alias tor='chromium --proxy-server="socks://localhost:9050"'
alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
alias mixer='pulsemixer'
alias mail='neomutt'
alias mkdir='mkdir -pv'
source /usr/share/doc/pkgfile/command-not-found.zsh
export _JAVA_OPTIONS='-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
export GEM_HOME=$(ruby -e 'print Gem.user_dir')
source ~/.rvm/scripts/rvm

transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }
Nice.  I use to use "oh-my-zsh"....pretty slick....lot's of cool prompts to choose from.
vtop.....looks interesting......gotta look into that one.
well, I checked into vtop for MX-18 and Slackware....no dice.   Guess I'll settle for nmon or htop.

Edited by wa4chq, 25 July 2019 - 06:35 PM.

Posted Image
REGISTERED LINUX USER #547579





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users