Make the commandprompt colorful

This is a simple tweak that adds a little color to the command-prompt so that it's easier to pick-out amongst a lot of output.

Open your .bashrc file in Gedit (gedit ~/.bashrc) and add a new line at the bottom that reads as follows:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]: \[\033[01;34m\]\w\[\033[00m\]\$ '

Your fingers will probably ache after typing that! Check to ensure you've typed it correctly and then save the file. From now on, all command-prompts will be in color, in both terminal windows and virtual consoles.

Changing the color scheme is a little complicated. Look at the command-line above and pick-out 01;32m and 01;34m. The first numbers refer to

Monitor network speed

Make the command-prompt colorful M 179

the coloring of the [email protected] component of the prompt, and the second to the path listing that comes after the colon (:).

Possible values are as follows: Style

Text color

Background color

It doesn't matter in which order the numbers are written and you can supply more than two (ie 01 ;34;43m). For example, to change the prompt to a magenta background with white text for the [email protected] component, and green text for the path component (without bold in both cases), you could change the line to read:

PS1='${debian_chroot:+($debian_chroot)}\[\033[45;37m\]\[email protected]\h\[\033[00m\]: \[\033[32m\]\w\[\033[00m\]\$ '

To simply make the entire prompt bold, but no colors, so that it's simply easier to spot in a long list of output, set the values at 01 :

PS1='${debian_chroot:+($debian_chroot)}\[\033[01m\]\[email protected]\h\[\033[01m\]: \[\033[01m\]\w\[\033[00m\]\$ '

Bear in mind that bold text does not appear on virtual consoles. You should also check any color schemes you set against the black background of the virtual console—a common mistake is to set colors that just aren't visible against anything other than the white background of the GNOME Terminal window.

Make Windows permanently available M 180

Do you find it annoying that, after booting, your Windows partition must be manually selected from the Places menu? Me too. To ensure Windows is always mounted, you'll need to add an entry to the /etc/fstab file, as follows:

1. Mount your Windows partition (click its entry on the Places menu) and then open a terminal window. Type mount. Look for the line that includes /media/disk, and look at the front of the line. It should read something like /dev/sda1. Make a note of this.

2. Create a permanent mount point for the Windows partition by typing sudo mkdir /media/windows.

3. Open the fstab file for editing by typing gksu gedit /etc/fstab. Add a new line at the end that reads as follows:

/dev/sda1 /media/windows ntfs-3g rw,defau1ts 0 0

If necessary, replace /dev/sda1 with what you discovered earlier. Then reboot. From now on, your Windows partition will always be available whenever you boot and an icon should appear on the desktop at all times. If you want to mount the partition read-only (very wise), replace rw in the line above with ro.

You will not be able to unmount the Windows partition in the usual way by right-clicking its icon and selecting Unmount volume. To do so, open a terminal window and type sudo umount /media/windows.

Ubuntu's boot menu is ugly and looks like it's straight out of 1985. It doesn't have to be this way. Ubuntu uses the GRUB menu software, and that's capable of having a graphical backdrop that can be any picture. However, you'll need to shrink the picture and reduce its color level. Because of this need to simplify the image, graphical designs tend to work better than photographs (I noticed that cartoon images work well too—pictures from The Simpsons being a particularly good choice!).

Was this article helpful?

0 0

Post a comment