pngphoon
This program is intended as an alternative to the great xphoon program
(X PHase of mOON), which was written by Jef Poskanzer and Craig Leres
and is available from: https://www.acme.com/software/xphoon/.
xphoon is a program that displays the actual phase of the moon on the X11
root window. Nowadays all desktop systems like KDE hide the X11 rootwindow
with an own background image, so xphoon could paint as much in the root
window as it likes to, but nothing was to been seen.
Modern desktops have an advanced interface for programs to dynamically
provide background images in png format. Alternatively they just track
when the background image file has been changed. That is what this program
was originally written for.
Here is an example in full size. The image must
have a width of at least 760 pixels to place the moon. If the image is
smaller just the stars will be drawn. And by the way: it is pronounced
"pingphoon" (like "typhoon").
And the image format is pronounced
"ping", NOT "pee-en-gee".
Wikipedia
and
Oxford's Dictionaries,
you are just plain wrong.
(Source: https://www.w3.org/TR/PNG-Introduction.html,
see "Pronunciation", at the bottom.)
Downloading:
Compiling:
- necessary are only a C compiler and
- the development files of the png library (png.h and libpng.so or .a, and
their dependencies of cause)
- a simple "make" should create the binary.
Setting up for most current desktops:
- several current desktops now get triggered automatically when the image
file changes
- so a simple entry in crontab will do:
# m h dom mon dow command
0 * * * * /home/svolli/bin/run-pngphoon
- With run-pngphoon looking like this:
#!/bin/sh
readonly image="${HOME}/.local/moon.png"
readonly dir="$(dirname "${image}")"
[ -d "${dir}" ] || mkdir "${dir}"
pngphoon -w 1920 -h 1080 -f "${image}"
(you will most probably use slightly different parameters)
Setting up pngphoon for KDE 3.x:
- assuming that the binary has been copied to /usr/local/bin/pngphoon
- select configure desktop
- bring up the advanced options dialog
- check "Use the following program for drawing the background"
- click add and fill out the form like this:
Name: | pngphoon |
Comment: | Phase of moon |
Command: | /usr/local/bin/pngphoon -w %x -h %y -f %f |
Preview Cmd: | /usr/local/bin/pngphoon -w %x -h %y -f %f |
Executable: | /usr/local/bin/pngphoon |
Refresh Time: | 60 min |
- click "OK" on everything you opened
Setting up pngphoon for KDE 4.x:
This cannot be done yet. There are two bugs filed about this problem:
I remember reading a statement in the bugtracker, that this will not be
fixed in KDE 4.x, but is planned for KDE 5.x to be fixed...
Setting up pngphoon for Gnome 2.x:
Setting up pngphoon for Mac OS X:
I just don't know. I tried to set it up, but failed. If you know how it's done,
please let me know, so I can update this page.
If you've got knowledge on how to set the background image on any other desktop,
please drop me an email: svolli.svolli.de (lame spam protection, replace the first "." with "@").
History:
- 2021-12-18:
- Minor update (1.3).
Surprisingly I'm not the only one still using this software:
Lars Löfving provided two patches
- bugfix for star drawing routine
- new parameters for setting colors
Thanks, Lars!
Other changes include:
- fixed compiler warnings introduced with newer versions of gcc
- fixed memory leak in pngwrite.c discovered using valgrind
- added option for southern hemisphere rotating the image 180 degrees,
inspired by the readme of xphoon
- 2015-02-12:
- Noticed that the last update wasn't put online, whoops!
The official debian-package is now "orphan".
Can anyone tell me how to
notify them of this update?
- 2014-09-14:
- Minor update (1.2), with two bugfixes:
- A problem in the drawing algorithm, causing edges not been shaded
correctly, has been fixed.
- If the moon does not fit in height, only the central section is exported
in the png, while the image is drawn internally in the height of the
moon.
- 2010-03-12:
- Updated info about KDE.
- 2009-02-16:
- Minor update (1.1), with two bugfixes:
- If a mandatory parameter is missing, the program will exit with a
message, instead of crashing after a message.
- When the width was not a multiple of 8 both moon and stars were not
drawn correctly.
- 2008-11-02:
- Added Gnome setup info.
- 2008-01-15:
- Minor update (1.0), with only two new features:
- a filename of "-" (without the quotes) can be used for stdout
- pngphoon now has a version number :-)
A Windows binary is now also provided.
- 2006-01-09:
- Initial release.