Reading KZKG ^ Gaara's article on "fortune", I remembered the Python script I wrote a while ago so that I could see the messages from "fortune" in a window.
You need to have python installed (obviously), with the libraries for gtk and gobject: pygtk, pygobject (In Ubuntu and derivatives install python-gtk2 and python-gobject packages)
To use it, the code must be copied into a plain text file, for example with the name fortune_gtk.py. It can be run from a terminal, locating in the directory where the file was saved and running:
python fortune_gtk.py
or give it execution permission and launch it like any application. (with double click, for example)
The script displays different messages one after the other, and ends when the window is closed.
Depending on the length of the text, the size of the window and the duration of the messages change for a better visualization. Also, if you click on the window, the text is copied, and it can be pasted into a text editor.
Take into account that the font is monospaced so that it is not misaligned.
Below the code. Enjoy it!!
(When downloading, save with name fortune_gtk.py)
PS: I'm not a programmer, just an amateur. Noticeable…:-)
Thanks for the contribution 😀
On the contrary, thanks to you for your work!
If you see that the message does not fit in the window, it is that the size of the font that your system shows is large. You can correct by increasing the size of the window. how? In the code…
where says:
self.factor = .2
It means 0.2 -> window size is 20% of the screen
Correct the factor to taste. For example, at 30% it will be:
self.factor = .3
Save the file and Done!
I provided the application in debian 8 but it is not working very well, but thanks for the code, in a few years when I am a jedi of c ++ and it reaches python it will be a good didactic material
What happened to you?