Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

3
Become a Fan
7.0

Description:
Displays random fortune/quote on a chalkboard.
Requires Fortune package to be installed to function properly.
Last changelog:

0.3:
- added UTF-8 support (hopefully )

0.2:
- configuration dialog added, it's now possible to:
- change text font type and size (default: Monospace 7pt)
- change text color (default: white)
- set refresh delay, setting 0m 0s disables autorefresh (default: 1 minute)
- enter custom fortune command (default: fortune)
Note: Be sure to use monospaced font for ascii graphics
like cowsay/cowthink to make it look fine and resize the
applet accordingly to fit it.
- known problems: after closing fortune applet plasma desktop sometimes crashes after some delay.
can't figure out why or if it's applet-related. (KDE 4.3.5) :-S Any help appreciated..

0.1:
- basic functionality. Displays random quote from application Fortune (needs to be installed for plasmoid to work correctly)
- update in every minute
- new fortune can be obtained clicking anywhere on the chalkboard


Ratings & Comments

18 Comments

HardinComp

After my computer died earlier this year I recently got a laptop with Linux Mint Debian Edition installed. I added KDE to it (GNOME just looks weird to me now) and when I installed this plasmoid again it look different. Wasn't there a way to show the fortunes on a regular widget without the blackboard? I'd love to be able to get back to that look if I can.

HardinComp

Unfortunately that didn't help at all for some odd reason. After trying several things that didn't work, I noticed that the error was complaining that while it found '/usr/games/fortune/' it wasn't seeing 'usr/bin/games/fortunes'. I opened a root Dolphin window split bewteen two paths, /usr/games and /usr/bin. I alt-dragged a link form /usr/games/fortune to /usr/bin/fortune. I then ran fortune -f and got this: # 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 Finally! I'm going to write a blog post about this in a few and share my myfortunes file, which also has a number of quotes I ran on an old blog under the heading Words To Live By. Thanks for the assists!

HardinComp

I just posted an article on my blog documenting how I added the myfortunes file. I also have a link to my file with over 60 quotations I've picked up over the years for anyone who wants it. http://wp.me/p7lYn-OS Thanks again for all the help, jramen. I definitely owe you a pint.

jramen

:) I'm very very happy that it finally worked! :) And it was a pleasure to be of service. :) But let me say this: WOW! Sooo many fortune files! :)) My "fortune -f" lists only 7 that are included in basic package I presume, but you really have quite a collection! :) I've read your blog article already and I find it very nicely written and informative (and amusing here and there)! :)) And of course I downloaded your myfortunes.txt file and added to my modest collection. ;) Finally, thank you very much for all your kind words and interest in my lil' plasmoid. :)

HardinComp

I think I added a bunch more one day when I was going through KPackageKit or something. I'm glad you like my post. I try to include some humor in my posts (when I get a chance to write one that is) just to give my readers a chuckle as well as what I hope is good info. I need to go through my fortunes and add some sources to a lot of them but it will have to wait until I can chase them down. When I do I'll post it to my Dropbox and add a comment that the file is updated so folk can get the newer version of the file. Thanks for writing the plasmoid. Like I said in my post I discovered it on someone's desk when I was still a GNOME user and it was part of why I looked at KDE. It's now a must install plasmoid on my system.

HardinComp

I saw a great line on the Ubuntu Forums that I'd love to see in Fortunes. It takes an amateur to mess something up... but to REALLY screw something up requires an "expert". What would be the best way to get this added?

jramen

Well, this plasmoid is just a "frontend" for Fortune package, so it doesn't handle fortunes directly. :( Therefore the easiest way to add your custom fortune is to add it to Fortune files. It can be a lil' bit tricky for linux beginners, but it's quite easy. :) You need to create a new file, for example "myfortunes", containing quotes separated by %, put it into fortune data directory (usually /usr/share/fortune/) and then run "strfile" command on it. All this requires root access, because only root can write into that directory and running strfile also requires root privileges. So. Short recipe follows: 1. gain root access 2. create file /usr/share/fortune/myfortunes containing: It takes an amateur to mess something up... but to REALLY screw something up requires an "expert". % 3. run: # strfile /usr/share/fortune/myfortunes This will create myfortunes.dat file in the same directory. 4. hopefully Fortune will pick this particular quote someday, too, 'cuz as I saw, there are gazillions of them there. 5. to see whether Fortune accepted your file run: # fortune -f and that will list all the files Fortune will pick quotes from. :) Hopefully this helps. ;) PS: You can also put all your desired fortunes into "myfortunes" file and then specify fortune command in plasmoid as: fortune myfortunes and then only quotes from this particular file will be picked. :)

HardinComp

It worked pretty well at the beginning, other than the fact that my path to the fortunes folder is /usr/share/games/fortunes/, and I got # strfile /usr/share/games/fortunes/myfortunes to run without a hitch, but when I tried to run #fortune -f I got 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 I'm not a total noob, as I've been running Linux for a few years now and am not the least bit afraid of the CLI, but I'm at a loss for how to fix this particular error. Once I get it working I'll write a post for my blog letting others know how to add fortunes.

jramen

Oh, I read somewhere that fortune is being installed in /usr/games/ directory on some distros. On my OpenSuse 11.3 executable is /usr/bin/fortune, right in the PATH. I would solve the problem you are encountering by creating a symbolic link to /usr/games/fortune in some directory which is in the PATH, for example in /usr/bin. You can do this by executing "ln" command at root's prompt (only root can write into /usr/bin directory): # ln -s /usr/games/fortune /usr/bin/fortune Hopefully this will solve that problem. :)

overmind88

Does'nt work with cyrillic fortunes (in utf-8 charset). Show only strange symbols. Can you add support? Thanks.

jramen

Please, try the new version 0.3. I had a very hard time to figure it out, because it's not very well documented (couldn't find any examples how to solve this), 'cuz I thought the problem was with python, but no, it was of Qt and its string interpretation/displaying. So please test it, whether it works for you. :)

overmind88

All works. Many thanks!

jramen

Glad to hear that! Thank you very much for your feedback. :)

mreloads

I haven't looked at source of this plasmoid, but usually crash is caused by accessing uninitialized pointers. Maybe you're trying to assign a value to such a pointer or trying to delete it?

mreloads

Oh, right, you're using Python. My tongue is my enemy.

jramen

I'm quite new to Python, I know "him" only for 5 days or so (not about his existence, just coding in it, mind you). :) I wouldn't dare to juggle with uninitialized pointers in C++ or Delphi, but I'm just learning this new language, so... I -really- appreciate any help. Some things I had to figure out by trial-and-error method, cuz I learn best from examples and there aren't many out there... Definition of functions is pretty important, too, but it's just a half of the story. How to use them is sometimes quite a different one. :-S Either way, many thanks for you comment and trying to help, I really appreciate that. :)

H00K

I usually run my fortune like this: fortune -a | cowthink -f moose -T ' U' -e Oo -n ...so I'd really be interested in seeing a fortune plasmoid that would enable piping. Would that be an option? ;)

jramen

Yes, no problem. :) I will play with it a little, make some neat configuration box for it or something and let you know. ;)

Pling
0 Affiliates
Details
license
version 0.3
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 5

More Plasma 4 Extensions from jramen:

Solar system
jramen
last update date: 14 years ago

Score 8.3

Galilean moons
jramen
last update date: 15 years ago

Score 5.0

Other Plasma 4 Extensions:

Icon Tasks deb build
N00bun2
last update date: 13 years ago

Score 4.3

Prayer Times Plasmoid
riyad
last update date: 12 years ago

Score 5.2

KPrayertime4 Islamic Prayer Times
ahaq
last update date: 15 years ago

Score 4.4

Hostinfo
mgraesslin
last update date: 13 years ago

Score 4.7

Monitor QuadCore Russian
kuchumovn
last update date: 16 years ago

Score 5.0

blaKjaK
werevire
last update date: 15 years ago

Score 5.0