Clock of clocks
A picture is worth a thousand words.
Here
is a short video giving an idea about the program capabilities.
The program can run on all OS that support standard Java, like Windows, macOS, Linux,
and also on Android phones, Android and Google TVs and boxes.
Plain Java version
Installation
To run CoC you need JRE 1.8 or later.
If you do not have JRE installed, you can find all the necessary instructions here:
www.java.com/en/download/help/download_options.html.
If you do not plan to build this project and just want to play with the program, JRE will be enough,
JDK is not necessary.
In this case you can get the pre-build program
here.
Launch
Open Terminal window (cmd.exe on Windows) and type:
java -jar <path to coc.jar file> [--root]
When the optional parameter '--root' is specified, the program runs in the
full screen mode.
Usage
Mouse right-click pops up the configuration screen. Depending on the
currently selected options, some parameters can be disabled.
The program has four fixed themes and one custom theme. Fixed themes:
- BL - black hands, light bg, no dials
- BLL - black hands, light bg, light dials
- GD - gold hands, dark bg, no dials
- WDD - white hands, dark bg, dark dials
Custom - most parameters are for this theme. It is recommended to
disable all fixed themes while configuring the custom one. This way
the user immediately sees all selected options in WYSIWYG mode.
Mouse left-click closes the program.
Using as a screensaver
First, you have to run the program as described in Launch section
and set up the desired configuration,
because in the screensaver mode it is not possible.
Ubuntu
Install xscreensaver if you do not have it.
In ~/.xscreensaver file right after the line:
programs:
enter:
Best: "coc" /usr/bin/java -jar -root \n\
It is important to enter the name wrapped in quotation marks, e.g. "coc".
Run:
xscreensaver-demo
and select coc as your screensaver
macOS
Not feasible.
Windows
to be done later ...
How to build
It is possible to build the program from the source code with Maven.
The code is here.
Download or clone the project, navigate to its folder and type:
mvn package
Android version
The pre-build program is
here.
The intallation instructions are here:
https://www.droidviews.com/install-apk-files-using-adb-commands/
The same program works on all Android flavors.
Configuration screen is launched by either a screen touch, or with Menu button
on remote control.
The program parameters are descibed in Usage section above.
CoC can be dismissed with Back or Home button.
The program also can be built from the source code at the same
location.
A bit of history
When I saw the clock made by Humans since 1982 on the wall, I was mesmerized.
Then I discovered its Java implementation
https://github.com/colugo/finless-porpoise.git
with a very interesting algorithm.
Unfortunately it was not without issues:
- The window size is hard-coded.
- I was not able to build the project in IntelliJ. I also was not able to build using Maven
because of a nonstandard file structure.
-
- The program eventually goes into an infinite loop without showing time.
- The code is not really OO.
- The whole code is heavily dependent on Swing. I'd like to see it split so that UI part is separated
from the algorithm. Then it will be easier to port it
to other platforms, e.g. Android.
I posted an issue, but the author did not respond.
So here is my own implementation,
free of these defects, with a broad set of options.
Thank you for reading this whole text till the end.
Alexander Bootman.