You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cinnamon-color-timer-clock-desklet@curbsoftware/README.md
+15-10Lines changed: 15 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,11 @@
2
2
3
3
A Cinnamon desklet with three cards (**Clock**, **Timer** and **Chronometer**) whose background colors follow a schedule you define. Each card's color ramps between (time, color) stops: the clock by time of day wrapping over midnight, the timer by time remaining, the chronometer by time elapsed.
@@ -16,37 +20,38 @@ One glance tells me the state of things. That's the whole idea.
16
20
17
21
## Features
18
22
19
-
- Up to three side-by-side cards; show or hide each one
23
+
- Up to three responsive cards. Narrow widths wrap cards onto centered rows and add enough height instead of hiding or clipping cards
20
24
- Per-card color schedules with smooth (interpolated) or stepped transitions
21
25
- Clock card with an optional IANA timezone
22
26
- Timer with on-card play/pause, reset and ±60 s buttons; survives restarts and expires correctly even after downtime
23
27
- Optional desktop notification when the timer finishes
24
28
- Optional notifications when the clock or chronometer reaches a schedule stop
25
29
- Chronometer with pause/resume; the accumulated time survives restarts, and an optional hundredths display (20 updates/s while running)
26
30
- Text and border colors adapt to the card background for readability (WCAG contrast ratio)
27
-
- Tooltips on every card control
28
-
- A per-card refresh button to reload settings without interrupting a running timer or chronometer
29
-
- A next-colour swatch on each card that previews the upcoming schedule colour
31
+
- Keyboard focus, pressed states, accessible names and tooltips on every card control
32
+
- One **Reload color schedules** desklet menu action that does not interrupt a running timer or chronometer
33
+
- A labelled **Next** preview chip on each card, with a 20 px double-ring colour sample and the upcoming stop details in its tooltip
34
+
- A clear setup message when every card is disabled
30
35
- One-click "Reset all schedules to defaults"
31
36
32
37
## Configuration
33
38
34
-
Right-click the desklet → **Configure…**
39
+
Right-click the desklet and choose **Configure**.
35
40
36
-
-**Color schedules**: a list of (time, color) stops per card. Colors are hex (`#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`) or a name (`red`, `blue`, …). Duplicate times keep the last row; invalid rows are dropped with a log line
41
+
-**Color schedules**: a list of (time, color) stops per card. Colors are hex (`#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`) or a name such as `red` or `blue`. Duplicate times keep the last row; invalid rows are dropped with a log line
37
42
-**Smooth color transitions**: blend gradually between stops, or hold each color and jump at the next stop
38
43
-**Show a notification when the timer finishes**: pops a desktop notification when the countdown reaches zero
39
44
-**Notify (per schedule row)**: tick a clock or chronometer schedule row's Notify checkbox to pop a notification when that time is reached
40
45
-**Timer minutes / seconds**: the default duration the timer restarts from
41
-
-**Refresh (per card)**: the small button in each card's top-right corner reloads that card's settings without restarting a running timer or chronometer
42
-
-**Next-colour swatch (per card)**: the small circle in each card's bottom-right corner previews the next schedule colour and snaps to it at the breakpoint
46
+
-**Reload color schedules**: the desklet menu action reloads all three schedules without restarting a running timer or chronometer
47
+
-**Nextcolour (per card)**: the labelled footer chip previews the next schedule colour. Hover its colour sample for the stop time and exact colour value
43
48
-**Show hundredths of a second**: adds a `.ss` fraction to the chronometer while it runs
44
49
-**Time / date format**: `strftime` patterns for the clock card
45
50
-**Maximum font sizes, card spacing, desklet width / height**: cards shrink text to fit
46
51
47
52
## Notes
48
53
49
-
Colors interpolate piecewise-linearly in RGB, so a red→blue ramp passes through purple. The clock schedule wraps over midnight; timer and chronometer schedules hold the last stop's color beyond it. Cards share the desklet width and each needs about 130 px. When the width cannot fit them all, the chronometer and then the timer hide automatically (a note is logged) and return when the desklet is widened.
54
+
Colors interpolate piecewise-linearly in RGB, so a red to blue ramp passes through purple. The clock schedule wraps over midnight; timer and chronometer schedules hold the last stop's color beyond it. Cards share the desklet width and wrap onto more rows when each card would otherwise become too narrow. Enabled cards never disappear because of desklet width.
Copy file name to clipboardExpand all lines: cinnamon-color-timer-clock-desklet@curbsoftware/files/cinnamon-color-timer-clock-desklet@curbsoftware/cardActions.js
+55-32Lines changed: 55 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -261,19 +261,17 @@ function thresholdsCrossed(prev, cur, times, wrap) {
261
261
}
262
262
263
263
/**
264
-
* nextColor:
264
+
* nextStop:
265
265
* @stops (array): normalised stops [{t, rgba}], any order
266
266
* @pos (number): query position in seconds
267
267
* @opts (object): { wrap, reverse }. wrap treats the position as circular
268
268
* (clock); reverse walks the schedule backwards (timer counting down).
269
269
*
270
-
* Returns (array): the colour of the next stop in the direction of travel, or
271
-
* null when there are no stops. A forward schedule returns the first stop
272
-
* above @pos (wrapping to the first past the end when @opts.wrap, else holding
273
-
* the last stop); a reverse schedule returns the first stop below @pos,
274
-
* falling back to the lowest stop at or past the end.
270
+
* Returns (object): a fresh {t, rgba} for the next stop in the direction of
271
+
* travel, or null when no stop remains. Wrapped schedules always have a next
272
+
* stop. This gives the desklet both the preview colour and its schedule time.
275
273
*/
276
-
functionnextColor(stops,pos,opts){
274
+
functionnextStop(stops,pos,opts){
277
275
opts=opts||{};
278
276
279
277
letlist=[];
@@ -294,24 +292,27 @@ function nextColor(stops, pos, opts) {
294
292
if(opts.wrap)
295
293
q=((q%DAY_SECONDS)+DAY_SECONDS)%DAY_SECONDS;
296
294
297
-
if(list.length===1)
298
-
returnlist[0].rgba.slice();
299
-
300
295
if(opts.reverse){
301
296
for(leti=list.length-1;i>=0;i--){
302
297
if(list[i].t<q)
303
-
returnlist[i].rgba.slice();
298
+
return{t: list[i].t,rgba: list[i].rgba.slice()};
304
299
}
305
-
returnlist[0].rgba.slice();
300
+
returnnull;
306
301
}
307
302
308
303
for(leti=0;i<list.length;i++){
309
304
if(list[i].t>q)
310
-
returnlist[i].rgba.slice();
305
+
return{t: list[i].t,rgba: list[i].rgba.slice()};
311
306
}
312
307
if(opts.wrap)
313
-
returnlist[0].rgba.slice();
314
-
returnlist[list.length-1].rgba.slice();
308
+
return{t: list[0].t,rgba: list[0].rgba.slice()};
309
+
returnnull;
310
+
}
311
+
312
+
/* Compatibility helper for callers that only need the preview colour. */
0 commit comments