summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md9
-rw-r--r--src/render.c33
-rw-r--r--src/wlclock.c2
3 files changed, 30 insertions, 14 deletions
diff --git a/README.md b/README.md
index 8102346..5d39a16 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ wlclock depends on Wayland, Wayland protocols and Cairo.
To build this program you will need a C compiler, the meson & ninja build system
and `scdoc` to generate the manpage.
- git clone https://git.sr.ht/~leon_plickat/wlclock
+ git clone git://git.pinkro.se/wlclock.git
cd wlclock
meson build
ninja -C build
@@ -25,9 +25,7 @@ and `scdoc` to generate the manpage.
## Contributing
-**Contributions are welcome!** Read `CONTRIBUTING.md` to find out how you can
-contribute. Do not be afraid, it is really not that complicated.
-
+**Contributions are welcome!** Feel free to send a patch to rose@pinkro.se!
## Licensing
@@ -39,5 +37,6 @@ the header of the files for more information.
## Authors
-Leon Plickat <leonhenrik.plickat@stud.uni-goettingen.de>
+Forked by: Rose <rose@pinkro.se>
+Original wlclock by: Leon Plickat <leonhenrik.plickat@stud.uni-goettingen.de>
diff --git a/src/render.c b/src/render.c
index 9ed1963..341deb0 100644
--- a/src/render.c
+++ b/src/render.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
@@ -120,20 +121,36 @@ static void draw_clock_face (cairo_t *cairo, struct Wlclock_dimensions *dimensio
/* Radii are choosen to roughly mimic xclock. */
double cx = scale * (dimensions->center_x + (dimensions->center_size / 2));
double cy = scale * (dimensions->center_y + (dimensions->center_size / 2));
- double or = scale * 0.9 * dimensions->center_size / 2;
- double ir = scale * 0.85 * dimensions->center_size / 2;
- double bir = scale * 0.8 * dimensions->center_size / 2;
+ double orT = scale * 0.9 * dimensions->center_size / 2;
+ double orTL = scale * 0.83 * dimensions->center_size / 2;
+ double orL = scale * 0.8 * dimensions->center_size / 2;
+ double ir = scale * 0.75 * dimensions->center_size / 2;
double phi, phi_step = 2 * PI / 60;
cairo_save(cairo);
+ cairo_set_source_rgb(cairo, 1,1,1);
for (int i = 0; i < 60; i++)
{
phi = i * phi_step;
- cairo_move_to(cairo, cx + or * cos(phi), cy + or * sin(phi));
- if ( i % 5 == 0 )
- cairo_line_to(cairo, cx + bir * cos(phi), cy + bir * sin(phi));
- else
- cairo_line_to(cairo, cx + ir * cos(phi), cy + ir * sin(phi));
+ if ( i % 5 == 0) {
+ char *num;
+ int x = cx+orT*cos(phi);
+ int y = cy+orT*sin(phi);
+ cairo_move_to(cairo, x-4, y+3);
+ asprintf(&num, "%0.f", (((i+15)%60)*0.2));
+ cairo_show_text (cairo, num);
+
+ x = cx+orTL*cos(phi);
+ y = cy+orTL*sin(phi);
+ cairo_move_to(cairo, x, y);
+ cairo_line_to(cairo, cx + ir * cos(phi), cy + ir * sin(phi));
+ } else {
+ int x = cx+orL*cos(phi);
+ int y = cy+orL*sin(phi);
+ cairo_move_to(cairo, x, y);
+ cairo_line_to(cairo, cx + ir * cos(phi), cy + ir * sin(phi));
+ }
+
}
cairo_set_line_width(cairo, context.marking_width * scale);
colour_set_cairo_source(cairo, &context.clock_colour);
diff --git a/src/wlclock.c b/src/wlclock.c
index 2b4bfd1..dde8e89 100644
--- a/src/wlclock.c
+++ b/src/wlclock.c
@@ -630,7 +630,7 @@ static void clock_run ()
clocklog(0, "ERROR: poll: %s\n", strerror(errno));
continue;
}
-
+
/* Wayland events */
if ( fds[wayland_fd].revents & POLLIN && wl_display_dispatch(context.display) == -1 )
{