10

I love Linux Mint's bash customization. It includes both a color prompt and a quote displayed with ASCII art.

Is it possible to have it in Ubuntu?

Pitto
  • 1,978

5 Answers5

24

The file ~/.bashrc allows you to make the customizations you would like, among other things.

First open it with gedit ~/.bashrc

Now in order to have the multicolored prompt, find the line that looks like this:

#force_color_prompt=yes

Un-comment it (remove the #).

Now to get the ascii art and quote, you will need to install two packages:

sudo apt-get install cowsay fortune

Now in ~/.bashrc add a line with:

fortune | cowsay

Save the file, and restart your terminal (or resource the file with source ~/.bashrc).

mint-like bash prompt

3

The custom setup is done in /etc/bash.bashrc on Linux Mint 11 - if you download the .iso you can mount that as a loop device on Ubuntu and copy/paste the text, which is quite large, but you should be able to paste it into your ~/.bashrc.

One nice feature is that the prompt changes to red when you are root.

There will also be some setup for the GNOME Terminal application to make the background be white - you can do that through the Terminal preferences.

RichVel
  • 213
1

If add the following to your .bashrc file, you get color-coded date, time, username, hostname, and the current directory. Most importantly, you get the entire line to type your command.

PS1="\a\n\n\e[31;1m\u@\h on \d at \@\n\e[33;1m\w\e[0m\n$ "

enter image description here

BZ1
  • 598
1

Instead of customizing ~/bashrc file manually, simply use Gogh script for the customization of the entire color scheme for Gnome terminal.

The Gogh library provides dozens of different color schemes which can be installed by simply running a single command and restarting the terminal.

For instance, the following command will change the color scheme to light,

wget -O xt  http://git.io/vs7UQ && chmod +x xt && ./xt && rm xt

DEMO

enter image description here

Please visit on the following page for the list of all the available Color Schemes and their demonstration,

https://github.com/Mayccoll/Gogh/blob/master/content/themes.md

0

Yes, It's possible. Just open up your .bashrc file with any Editor(ex: nano, vi and etc.).Then scroll down to this line of code.

if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '...........

Then comment out the current PS1 variable (If you want to use it later).Then add Mint prompt instead of that. Just paste this right below that.

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\]$ '

Then save it and reopen up the terminal. You'll see the changes.

Have you seen the bash prompt of parrot os??

I found it very cool.I have uploaded bash prompts for both root and normal users in Linux Mint to my Github account. Here's the link to my repo. I have added the screenshots there. Just like first modification, now use the following variable instead.

PS1="${debian_chroot:+($debian_chroot)}\[\033[01;35m\]\[\033[0;35m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;35m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;35m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;35m\]]\342\224\200[\[\033[01;32m\]\w\[\033[0;35m\]]\n\[\033[0;35m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\] "

Reopen up the terminal, then you'll see this, Hope you found this answer useful.