[Updated 1 Oct 2011: Another update has been uploaded to my Dropbox. The fortune count is now 272. As always you can get the updated file from the link below. -Peng]
One of the things I love using on KDE is the Fortune plasmoid. It’s a handy little gadget for putting a random quotation on your desktop on a recurring basis, which I found out about on one of the Ubuntu Forums’ monthly screenshot thread some time back when I was still a GNOME user. It’s a great applet with over 30 sets of quotations in English alone, not to mention several other languages.
Yesterday I was reading a thread on the Ubuntu Forums about comments an idiot at an electronics store’s tech support group (think Nerd Herd) told his grandparents. The very second post had a comment from theraje that I thought would be perfect for the Fortunes:
It takes an amateur to mess something up… but to REALLY screw something up requires an “expert”.
Since jramen is the developer of the Fortune plasmoid on KDE-Look.org I left him a comment on plamoid’s KDE-Look page asking how to get it added to the quotations that Fortune uses. He was kind enough to not only tell me how to do it but also keep working with me until I got it working properly, especially since OpenSUSE and Mint KDE installs it a little differently.
The first thing you need to do is to create a document at /usr/share/games/fortunes/ called something like myfortunes. You’ll need root access to create this file so I fired up Dolphin, navigated over to /usr/share/games, and right clicked on the fortunes directory, selecting Root Actions > Open in File Manager (you may need to install the package kde-service-menu-rootactions or Mint’s rootactions-servicemenu to get this context menu). Once you’re in the folder right click anywhere in it and select Create New > Text File… and use the filename you want to call it. Then open this new file in Kate (or your favorite KDE text editor) and add the quotation you want to use, with percent signs (“%”) on the lines above and below your quote. You will need to have each quotation wrapped in percent signs, although you only need one between quotations. For just this one quotation it should look like this:
%
It takes an amateur to mess something up... but to REALLY screw something up requires an "expert".
-- theraje on the Ubuntu Forums
%
Save the file and open a root terminal, which you can do from the Root Actions context menu. In that terminal run this command:
# strfile /usr/share/games/fortunes/myfortunes
substituting whatever name you gave the file for myfortunes if you used a different filename. This is to create a .dat file that Fortunes needs to use the file. You should see a response like this:
# strfile /usr/share/games/fortunes/myfortunes
"/usr/share/games/fortunes/myfortunes.dat" created
There was 1 string
Longest string: 133 bytes
Shortest string: 133 bytes
#
As jramen said, “hopefully Fortune will pick this particular quote someday, too, ‘cuz as I saw, there are gazillions of them there.” To make sure Fortune can read the file run
# fortune -f
in your terminal window. Unfortunately, if you’re running a distro that installs Fortune into different directories than OpenSUSE does, like Ubuntu or Mint, that command will return an error.
# fortune -f
Command 'fortune' is available in '/usr/games/fortune'
The command could not be located because '/usr/games' is not included in the PATH environment variable.
fortune: command not found
#
Houston, we definitely have a problem, although I’m not sure why. The easiest way to fix that is to create a system link to the fortunes file in /usr/games (which is the executable file that is run to use Fortunes) to any directory in your system’s path settings. I created it in /usr/bin. You should be able to create it from the command line by running
ln -a /usr/games/fortune /usr/bin/fortune
I say “should” because it didn’t work for me. I got around the problem by opening a Dolphin window as root and splitting it into two panes, one showing /usr/games and the other showing /usr/bin, as shown in the screenshot to the right. You can do this buy using View>Split or by simply pressing the F3 key. Once you have the two directories in your two panes simply click on fortune within the /usr/games pane and dragging it to the /usr/bin pane, and either selecting Link Here from the window that pops up when you release the mouse button or by holding down the Alt key as you drag the file.
Once you’ve created the link, which will show up with an arrow on top of the icon in the /usr/bin pane, go back to your root terminal and run # fortune -f. On my system, with a number of fortune packages installed and over 60 additional quotations in my myfortunes file, showed this when I run that command.
# fortune -f
100.00% /usr/share/games/fortunes
0.65% linuxcookie
0.95% kids
1.02% ethnic
1.27% law
0.34% goedel
0.33% news
0.87% husse-helping
3.98% work
2.67% wisdom
0.79% riddles
4.11% miscellaneous
3.94% science
0.33% pets
1.79% disclaimer
0.40% myfortunes
0.11% husse-funny
2.86% bofh-excuses
0.27% debian-hints
0.19% magic
6.49% computers
2.12% linux
1.28% education
4.55% songs-poems
0.93% sports
1.43% startrek
0.13% husse-moderating
0.08% husse-self
1.31% drugs
0.06% ascii-art
7.59% definitions
1.24% humorists
7.86% people
0.47% medicine
0.95% love
1.25% food
0.45% paradoxum
2.93% art
0.08% translate-me
2.72% fortunes
7.16% cookie
3.41% knghtbrd
3.46% zippy
4.42% politics
3.68% men-women
0.54% debian
1.65% literature
3.16% platitudes
1.72% perl
#
Here’s how my newly added fortune looks when I have it on my desktop.

I know the line wrapping is broken on fortune plasmoid but if you have your terminal set up to show a fortune when you launch a terminal window it will show up properly there.
If you want to use my myfortunes file, which includes a number of quotations I used to run on my old blog under the heading Words To Live By, I’ve posted it to my Dropbox. Simply right-click on this link and select Save Link As… or whatever your preferred browser uses for saving a link on your computer.
Mega thanks to jramen for talking me though getting my own collection of fortunes created and usable by his damned nice plasmoid. I owe him a pint of his favorite adult (or non-adult) beverage.
Updated 7 Dec: I’m closing comments on this post because it seems to have become a magnet for comment spam. Akismet is able to catch all the spam, but it’s gotten a pain to have to verify that so many comments on this post are spam every day.