
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
Displays random fortune/quote on a chalkboard.
Requires Fortune package to be installed to function properly.
10 years ago
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
10 years ago
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
HardinComp
9 years ago
Report
HardinComp
10 years ago
# 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!
Report
HardinComp
10 years ago
http://wp.me/p7lYn-OS
Thanks again for all the help, jramen. I definitely owe you a pint.
Report
jramen
10 years ago
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. :)
Report
HardinComp
10 years ago
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.
Report
HardinComp
10 years ago
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?
Report
jramen
10 years ago
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. :)
Report
HardinComp
10 years ago
# 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.
Report
jramen
10 years ago
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. :)
Report
overmind88
10 years ago
Thanks.
Report
jramen
10 years ago
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. :)
Report
overmind88
10 years ago
Many thanks!
Report
jramen
10 years ago
Thank you very much for your feedback. :)
Report
mreloads
10 years ago
Report
mreloads
10 years ago
My tongue is my enemy.
Report
jramen
10 years ago
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. :)
Report
H00K
10 years ago
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? ;)
Report
jramen
10 years ago
I will play with it a little, make some neat configuration box for it or something and let you know. ;)
Report