Archive for the ‘Novelties’ Category

The terminal for running commands in Ubuntu and any other Linux distro is dull to look at, but you can easily spice it up a little with some colour.

Simply run the following command in a terminal:

gedit ~/.bashrc

When .bashrc opens, locate and uncommentforce_color_prompt=yes” (that is, remove the hash, so it no longer looks like: #force_color_prompt=yes).

Save the file, and open a new terminal window, and you should already see a change (the prompt should be Light Green, which is defined by 1;32). You can then change any colour value you like; eg: 0;35 = Purple.

To edit the colour values, locate the following section, and change the default values with some of the examples listed further down:

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

You can check out this Bash colour chart for a full range of colour values, but here are a few basic ones you can play around with (note that “Light” isn’t what you might think – it actually means “bold”):

Black 0;30Dark Gray 1;30Blue 0;34Light Blue 1;34Green 0;32Light Green 1;32Cyan 0;36Light Cyan 1;36Red 0;31Light Red 1;31Purple 0;35Light Purple 1;35Brown 0;33Yellow 1;33Light Gray 0;37White 1;37

For those curious about the codes used in the example pic, here’s the line from that section:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

As you can see, 1;35 is the Light Purple user and machine name, while the 1;34 is the Light Blue tilde (~). If you want yours a bit brighter, try:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;36m\]\u@\h\[\033[00m\]:\[\033[01;31m\]\w\[\033[00m\]\$ '

… which will give you Light Cyan and Light Red, and look like the following:

In case you’re wondering about the colon and dollar sign, you can change those as well, but you need to do more than just edit the colour values. You’ll need to insert code in the appropriate places, so the line looks like this:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;36m\]\u@\h\[\033[01;33m\]:\[\033[01;31m\]\w\[\033[01;33m\]\$ '

You’ll notice the first highlighted code is just before the colon (:) while the second is before the dollar sign ($). In this example, both are yellow, with the result looking like:

Now, if you want to go even further, you can make the user name stand out by doing the following:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;36m\]\u\[\033[01;35m\]@\h\[\033[01;33m\]:\[\033[01;31m\]\w\[\033[01;33m\]\$ '

That extra bit of code is specifying Light Purple for the @ and the desktop name, making it now look like:

And of course, one last bit of fiddling and you can have every element a different colour. In this last example, we’re going to make the computer name the same as the user name, and have them broken up by red, as with the yellow elements:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;36m\]\u\[\033[01;31m\]@\[\033[01;36m\]\h\[\033[01;33m\]:\[\033[01;31m\]\w\[\033[01;33m\]\$ '

As you can see, the @ is now Light Red, while the code before \h is specifying Light Cyan, like the user name:

You’ll also notice when you type commands that the colour of the text will match that of the $, which can be preferable if using a “light” colour, since the bold text is easier to see.

Lastly, in case you’re wondering whether the prompt can end in anything other than a $, the answer is yes, and it’s as easy as opening the Character Map (sudo apt-get install gucharmap if you don’t have it), selecting a character, and pasting it over the $ at the end of the line of code:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;36m\]\u\[\033[01;31m\]@\[\033[01;36m\]\h\[\033[01;33m\]:\[\033[01;31m\]\w\[\033[01;33m\] '

In that example, I simply selected a cool looking character from the font Runic, and replaced the $ with that. You’ll also note one other thing you’ll have to do, and that’s remove the \ before it, or else that will appear too (obviously, that doesn’t happen if using the $, but will with other characters).

Have fun experimenting!


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

If you’ve upgraded to Ubuntu 11.04, you may have noticed your Emerald themes for window borders are no longer working. You can still open the Emerald Theme Manager, but selecting new themes does nothing. And if you try starting Emerald via the terminal, all you will be presented with is a “segmentation fault”. This is because while Emerald may technically still be on your system, it’s actually not compatible with the latest Compiz-Fusion.

And you can forget about finding a newer version in the repos, since Emerald is unfortunately a dead project which hasn’t been maintained for a while now. So you can forgive Ubuntu for no longer supporting it, especially since Jasper, the successor to Emerald, is on its way.

But you can actually get Emerald working in 11.04, which you can do by uninstalling it, and reinstalling via git and manual compiling.

First off, we need to totally remove Emerald, which you can do by running the following command in a terminal:

sudo apt-get purge emerald

Next, we need to install git and some dependencies:

sudo apt-get install autoconf git intltool libdecoration0-dev libemeraldengine0 libtool libwnck1.0-cil-dev libwnck-dev

More dependencies will need to be installed, so just agree to those to proceed:

The following NEW packages will be installed:
 autoconf automake autotools-dev emacsen-common git git-man intltool
 libatk1.0-dev libcairo-script-interpreter2 libcairo2-dev libdecoration0-dev
 liberror-perl libexpat1-dev libfontconfig1-dev libfreetype6-dev
 libgdk-pixbuf2.0-dev libglib2.0-cil-dev libglib2.0-dev libgtk2.0-cil-dev
 libgtk2.0-dev libice-dev libltdl-dev libpango1.0-dev libpixman-1-dev
 libpng12-dev libpthread-stubs0 libpthread-stubs0-dev libsm-dev
 libstartup-notification0-dev libtool libwnck-dev libwnck1.0-cil-dev
 libwnck2.20-cil libx11-dev libxau-dev libxcb-render0-dev libxcb-shm0-dev
 libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev
 libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxrandr-dev
 libxrender-dev libxres-dev x11proto-composite-dev x11proto-core-dev
 x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev
 x11proto-randr-dev x11proto-render-dev x11proto-resource-dev
 x11proto-xext-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev
 0 upgraded, 64 newly installed, 0 to remove and 0 not upgraded.
 Need to get 29.9 MB of archives.
 After this operation, 96.2 MB of additional disk space will be used.
 Do you want to continue [Y/n]?

Now we need to fetch Emerald via git:

git clone git://anongit.compiz.org/fusion/decorators/emerald

Cloning into emerald...
 remote: Counting objects: 2265, done.
 remote: Compressing objects: 100% (2215/2215), done.
 remote: Total 2265 (delta 1619), reused 0 (delta 0)
 Receiving objects: 100% (2265/2265), 825.06 KiB | 132 KiB/s, done.
 Resolving deltas: 100% (1619/1619), done.

Once done, you will have an emerald folder inside your home folder, so get the terminal to point to that:

cd emerald

Now you can start the compiling (run each command once the previous one has finished):

git checkout -b compiz++ origin/compiz++


./configure --prefix=/usr/local


sudo make install

If you want to remove the emerald folder immediately, you can run the following commands:

cd ~

rm -rf emerald

However, you can always manually delete it later, once you’re sure you no longer need it (you will need it if you want to uninstall it later; read below for more info on that).

To enable your Emerald theme, hit Alt+F2 and run emerald --replace. You should now see your window borders change to an Emerald-themed one, and you can now open the theme manager to choose another.

If the Emerald Theme Manager is not in System > Preferences yet, you can try update-menus (or even update-menus && killall gnome-panel) in a terminal or via Alt+F2, but in my case it only appeared there after I ran Applications > System Tools > Compiz Fusion Icon and tried running the theme manager from there. For me, that only made the launcher appear, and I could only get the Emerald Theme Manager to open by running emerald-theme-manager --replace in the terminal (it probably won’t work in the Run Application dialog via Alt+F2, and you’ll need to keep the terminal window open until you’re finished using it).

You’ll see all your old themes are still there, as they weren’t uninstalled when Emerald was purged. Just click on another theme, and it should change instantly.

Can’t Move Windows After Initiating Emerald?

After that, you may find you can’t move your windows, but don’t worry, as you can change a Compiz setting to rectify this. Open System > Preferences > CompizConfig Settings Manager (if it isn’t installed, just run sudo apt-get install compizconfig-settings-manager in a terminal) and go to the Window Management section.

You will see that Move Window is unchecked, so click in the box to the left of it and you should now be able to move your programs and windows around. If Resize Windows is also unchecked, you may as well activate that too while you’re there.

Want to Uninstall Emerald?

If you look in Synaptic Package Manager, you’ll see that Emerald is apparently not installed. That’s because you didn’t install the version in the repositories, since it wouldn’t work. You will need to manually uninstall it, which you can do by going the the ~/emerald folder you compiled from, so open a terminal there and run the following: sudo make uninstall

Can I Use Emerald With Gnome 3?

You can forget about trying to run Emerald in Gnome-Shell, as Gnome 3 uses Clutter instead of Compiz-Fusion.


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Despite all the feature-rich games out there for the Windows platform, the #1 played game in the world is by far Solitaire. That’s because most of us aren’t gamers, so we’re happy to play with the simple games included as an occasional distraction. The games aren’t all that great, but what do you expect for nothing? The same goes for Ubuntu: you get some similar basic games,but don’t expect much if you’re a gamer!

The difference is that with Ubuntu, you can open up Synaptic and have a browse through the Games and Amusement section, then mark a whole lot of free games for installation! You can also search for specific types by using terms like “RPG” and “strategy game“. And if you know the names of some games, it makes it even easier, as you can just type them in the Quick search field.

One of the little gems that I have seen many vote as the best game in Linux is Frozen-Bubble. It is certainly a cut above the others in your Games folder, yet simple to play, with appeal for all members of the family. The object is simple: fire your coloured balls to get 3 or more in a row, in order to dislodge that row and all beneath it. The platform they’re suspended from keeps moving down, so you need think ahead and aim well, as you’ll be adding to the balls coming towards you!

Frozen-Bubble: Possibly the most addictive and widely played game in Linux!

Levels get progressively harder and faster, and you may soon find yourself joining the millions who are addicted to this game. It’s certainly better than playing Solitaire while you wait for something to download or whatever, so install it now and have some fun trying to keep your balls from being frozen!

Just look for frozen-bubble in Synaptic, or paste the following into a terminal:

sudo apt-get install frozen-bubble


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Here is funny way to turn your computer into a baby rocker, using your disc tray! What the following command does is continually opens and closes the CD/DVD tray, so you can either move the rocker in close so it ends up getting pushed a little each time the tray opens, or tie some string from the rocker handle to the tray.

while :; do eject ; eject -t ; done

You can check out a YouTube vid of it being done via the latter method (though the guy uses his own script). Don’t forget that if you would like to download this video clip, copy the url and paste it into QtTube for downloading to your Videos folder.


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Find out when you turn(ed) One Billion Seconds old! Completely useless, but fun nonetheless. Replace 12/31/1970 with your birth date (note it uses American dating, not what the rest of the world uses):

date -d12/31/1970+1000000000sec


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

This guide will show you how to have your wallpaper changing automatically using a program called Drapes. Either search for it online and install it via directions given, or open up your package manager (like Synaptic) and search for drapes, then mark it for installation (or sudo apt-get install drapes in the terminal). Once installed, don’t be surprised if you don’t find a launcher for it anywhere; this doesn’t matter as you can start it via the terminal, configure it, and have it load each time Ubuntu does.

Once installed, open a terminal, type drapes and hit Enter. You will now see a little icon near the system tray clock (should look like a monitor with curtains). Right-click that and choose Preferences.

In the first tab, Display, you will see you can +Add and -Remove wallpapers, so browse to any folders with wallpapers and select those you want included. To select all in a folder, click on one and then Ctrl+A to select all. To make building your list easier, you could even create a new folder just for these, then browse all your pictures and wallpapers folders and copy your favourites into this new folder, then just import all those in the one folder to the list in Drapes. Not only does doing this beforehand make it easier for adding the wallpapers all at once, you can also get Drapes to check for changes to a folder, so it makes sense to have a folder for this purpose.

While you are on the Display tab, you will also see that you can change the Style via a drop-down menu. These display modes are Centered, Fill Screen, Scaled, Tiled, and Zoom. You may want to play around with this if you have many pictures that aren’t exactly your screen size and shape (especially if you have a widescreen display).

In the second tab, General, you will see Startup options, and you select “Switch wallpaper on start” if desired. You will also see the autostart option “Start Desktop Drapes on start“, but if you check that don’t be surprised if Drapes doesn’t load by itself on the next reboot. But don’t worry, as a built-in feature of Ubuntu makes it easy to add anything to the boot process. But for now, we just need to configure Drapes before shutting it down properly (as closing the terminal will close down Drapes but not save any of the new settings).

Now, you’ll see you can change the “Timing selection“, which means the interval between changes. The default should be 15 mins, but you can lower it to 5 mins or as high as 2 hours.

At the bottom you will see “Wallpaper search directory” where you can check “Monitor this directory for new wallpapers“. If you check that, you can then browse for your wallpaper folder and select that; after that, you can just add new pictures and wallpapers into that folder, and you won’t need to import them manually (new wallpapers might not get noticed till the next reboot).

To make sure everything you’ve just done is saved, you will need to manually exit. Right-click the Drapes icon in your panel and choose Quit. If you close the terminal first, the settings will be lost; once you’ve quit properly, you can close the terminal (you will note it says the settings have been saved).

Finally, to have it start with each boot, go to System > Preferences > Startup Applications, click the +Add button, and fill in the info (for Name, you can put Drapes; the Command is simply drapes, and for Comment you can put Wallpaper Changer).

Upon your next reboot, Drapes will load and continue to do so until you disable it.


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

A little-known Linux command that comes with Ubuntu is espeak (and just in case you don’t have it for some reason, it is readily available in the repositories). No, it’s not a mind-numbingly useful command that will suddenly replace the need for seven of your GUI apps, but more of a novelty (that I don’t doubt could actually be put to some serious applications).

It is simply a command-line tool that will give you audio output in a robotic voice to whatever you type after espeak in the terminal. Like I said, nothing earth-shattering, and OK, you could probably get bored of it fairly quickly. But the purpose of this post is just to bring it to the attention of those who don’t even know it is on their system, and to give some tips on its use.

Now, if you enter one word after the command, it will of course just say that word. But if you type in a bunch of words without quotes, it will still only say the first word it finds. Also, it will say words at an even (yes, robotic) pace, and while it will add pauses according to punctuation, you can do a little more to add a more human feel to it. What this means is that while adding commas and periods as you usually would results in expected pauses, sometimes in speech we add slight pauses for emphasis that would be grammatically incorrect if transferred to written (or typed) word. Basically, what I do is type/paste as I would write it, and for added pauses I use a hyphen (-).

Also, just as you would end a question with a question-mark (?), do so with espeak and the robotic voice will have a querying inflection. So here and there you may even want to add it to words mid-sentence, which you wouldn’t dream of usually. For example, “Oh why, why, why?” will sound quite different from “Oh why? why? why?“. And sometimes adding a ? to the end of a question just doesn’t sound right, so needs to be replaced with a period. Just play around with things like this till you get it sounding as you want. And remember, you don’t need to retype it each time – just hit your UP arrow key on your keyboard and the previous command will appear in the terminal (and you can then use your other arrow keys to get to characters you want to use the Backspace or Delete key on before inserting new characters).

So here is an example you can copy then paste into a terminal:

espeak "Oh why? why? why the hell is my house on fire? I think I better call the fire brigade. Uh – oh! It looks like its going to explode"

Note the incorrect grammar of its, as it’s ended up sounding like a quick it is. And try it with the hyphen removed from Uh – oh! and see what a difference it makes!

Also, while you can see that in the middle of the command an exclamation mark (!) is fine, if you end the string of text with one, you will likely encounter this error:

bash: !”: event not found

Once you’ve had a play around with espeak, you can always find clever ways to utilise it, like add it to alarm scripts and whatever else you can think of. And let’s not forget you can actually get it to read text files out aloud for you! Just enter in the terminal:

espeak -f text.txt (replacing text.txt with the actual filename, and adding the path to it if you didn’t open the terminal in that folder).

Have fun!


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »