Commit Graph

58 Commits

Author SHA1 Message Date
Gergely Polonkai 09e3dbcb9e
Add a -c/--config option to use a config file different from the default 2022-05-24 17:36:21 +02:00
Gergely Polonkai b63d4cbac8
Add a -n/--now flag to only print the current hour’s name 2022-05-24 17:34:25 +02:00
Gergely Polonkai ccaa902be8
Parse command line arguments 2022-05-24 17:07:08 +02:00
Gergely Polonkai 88ad047315
[Refactor] Move window-based (Wayland) code to a separate function 2022-05-24 16:21:03 +02:00
Gergely Polonkai b2e387fbe8
[Refactor] Move current hour name calculation to the clock module 2022-05-24 11:53:37 +02:00
Gergely Polonkai 5095d2cc9f
[Refactor] Move hour name calculation to the clock module 2022-05-24 11:50:13 +02:00
Gergely Polonkai d9017d447a
[Bugfix] Fix seconds value returned by get_hms() 2022-05-24 11:50:12 +02:00
Gergely Polonkai 8968507d29
[Refactor] Move UTC offset calculation to the clock module 2022-05-24 11:37:16 +02:00
Gergely Polonkai eecd5c2938
[Refactor] Move calculation of the day parts to the clock module 2022-05-24 11:37:13 +02:00
Gergely Polonkai b485b01c2f
[Refactor] Move UTC hour calculation to the clock module 2022-05-24 11:27:02 +02:00
Gergely Polonkai d56c6ef087
[Refactor] Move local time calculation to the clock module 2022-05-24 10:34:21 +02:00
Gergely Polonkai b6d6e71be2
[Refactor] Move local time’s seconds since midnight calculation to the clock module 2022-05-24 10:33:57 +02:00
Gergely Polonkai 1d485c824b
[Refactor] Move Moon phase calculation to a new clock module 2022-05-24 09:26:05 +02:00
Gergely Polonkai 3d4224b560
[Refactor] Move configuration reading to the config module 2022-05-23 18:09:17 +02:00
Gergely Polonkai 852e8e090e
[Refactor] Move the gen_svg function to the svg_clock module 2022-05-23 18:05:16 +02:00
Gergely Polonkai b45a2bd8ee
[Refactor] Move the config structs to a new module 2022-05-23 18:04:37 +02:00
Gergely Polonkai 48ace5dc01
[Refactor] Move the get_moon_path function to the svg_clock module 2022-05-23 17:52:40 +02:00
Gergely Polonkai af637bcd10
[Refactor] Move the get_range_path function to the svg_clock module 2022-05-23 17:51:05 +02:00
Gergely Polonkai 4c15ffa826
[Refactor] Move the seconds_to_degrees function to the svg_clock module 2022-05-23 17:49:52 +02:00
Gergely Polonkai eb99194e16
[Refactor] Remove the time_to_degrees function
It just passed its sole parameter to seconds_to_degrees, so having this function
doesn’t really make sense.

It was actually a remnant from the Python version which operated on timestamps, not raw
seconds-since-midnight values.
2022-05-23 17:48:45 +02:00
Gergely Polonkai b7aa26be89
[Refactor] Move the hour_marker function to the svg_clock module 2022-05-23 17:46:45 +02:00
Gergely Polonkai e61c247915
Cache UTC hour labels 2022-05-23 14:03:01 +02:00
Gergely Polonkai f567362c29
[Refactor] Convert utc_hour_font_size to a constant 2022-05-23 13:48:45 +02:00
Gergely Polonkai 2fd9d4e8de
Cache the paths generated from hour name texts
Rendering text along a textPath is very CPU intensive, especially since we’re doing it every second.
2022-05-23 05:01:25 +02:00
Gergely Polonkai 7e8f62b811
[Refactor] Move hour_name_path to the svg_clock module 2022-05-23 04:43:48 +02:00
Gergely Polonkai 66e9c3d3f3
[Refactor] Move svg => usvg conversion to a separate function 2022-05-22 19:13:41 +02:00
Gergely Polonkai b95c035133
[Refactor] Move some constants to a new module 2022-05-22 19:03:09 +02:00
Gergely Polonkai cba5372b4d
[Refactor] Convert ring_width to a constant 2022-05-22 06:06:36 +02:00
Gergely Polonkai fd516083cf
[Refactor] Convert outer_r to a constant 2022-05-22 06:04:32 +02:00
Gergely Polonkai dcde43831b
[Refactor] Convert hour_name_font_size to a constant 2022-05-22 06:01:54 +02:00
Gergely Polonkai eaf111f216
[Refactor] Convert image_width to a constant 2022-05-22 05:59:49 +02:00
Gergely Polonkai b7cbc9f7e7
Do secondly refresh via a calloop Timer instead of measuring elapsed time 2022-05-21 11:37:06 +02:00
Gergely Polonkai 418ab212ea
Make configuration file optional 2022-05-21 07:13:32 +02:00
Gergely Polonkai 98e5f3c06d
Make location configurable 2022-05-21 07:00:40 +02:00
Gergely Polonkai bd521ac62d
[Bugfix] Move the current time box to the bottom between 6:00 and 18:00
Instead of 7:00 and 17:00; it was’t *that bad the old way, but it’s more balanced this way.
2022-05-21 06:59:41 +02:00
Gergely Polonkai ac95404017
Highlight the current hour name with a brighter colour 2022-05-19 09:27:27 +02:00
Gergely Polonkai 81907c5842
[Refactor] Calculate large arc flag in a more effective way 2022-05-19 09:21:57 +02:00
Gergely Polonkai b07361d392
[Bugfix] Fix the day part arcs for locations on the western hemisphere 2022-05-19 08:45:29 +02:00
Gergely Polonkai 8a4c25bd80
[Bugfix] Calculate the current UTC hour in a more safe way
This should now work in any time zone from -12:00 to +12:00, any time of the day.
2022-05-19 08:33:29 +02:00
Gergely Polonkai b0a943c270
Calculate day parts based on UTC time instead of local time 2022-05-19 08:14:01 +02:00
Gergely Polonkai 95557c839b
Show the current hour’s name and the current time in a box 2022-05-19 06:19:38 +02:00
Gergely Polonkai 6e0dedb1fb
Colour hour name plates based on their season 2022-05-19 05:04:48 +02:00
Gergely Polonkai e24e199e9e
Create a Seasons enum 2022-05-19 04:59:34 +02:00
Gergely Polonkai 08cb444e7d
Add hour names 2022-05-19 04:48:28 +02:00
Gergely Polonkai 064e11640c
Create a path we can use to run hour names along 2022-05-18 18:48:19 +02:00
Gergely Polonkai c6eee17618
Pre-fill the pixmap with the background color to prevent having white strips at the edge 2022-05-18 17:20:05 +02:00
Gergely Polonkai 5e3ab2c7ed
[Bugfix] Don’t fill the smoothing circle so day parts remain visible 2022-05-18 17:19:49 +02:00
Gergely Polonkai 53671b21fb
Add a circle with the background colour around day parts
…so it smoothens the edges!
2022-05-18 17:15:27 +02:00
Gergely Polonkai a613855a66
Add a Sun disc to the dial
It rises on the horizon ^_^
2022-05-18 17:13:56 +02:00
Gergely Polonkai 534bf3a899
[Bugfix] Fix the night-time colour 2022-05-18 17:13:56 +02:00