@timmy6942025/cli-timer 1.1.10 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/package.json +1 -1
- package/src/index.js +19 -0
package/README.md
CHANGED
|
@@ -62,6 +62,7 @@ timer style
|
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
This is instant and lists all figlet fonts.
|
|
65
|
+
`timer style --all` is supported as an explicit alias.
|
|
65
66
|
|
|
66
67
|
To list only timer-compatible fonts (fonts that render `01:23:45` visibly):
|
|
67
68
|
|
|
@@ -69,6 +70,12 @@ To list only timer-compatible fonts (fonts that render `01:23:45` visibly):
|
|
|
69
70
|
timer style --compatible
|
|
70
71
|
```
|
|
71
72
|
|
|
73
|
+
To set a random font:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
timer style random
|
|
77
|
+
```
|
|
78
|
+
|
|
72
79
|
To set your preferred font:
|
|
73
80
|
|
|
74
81
|
```bash
|
|
@@ -108,6 +115,8 @@ This launches a Bubble Tea based screen where you can change:
|
|
|
108
115
|
- Restart key
|
|
109
116
|
- Exit key / exit alt key
|
|
110
117
|
|
|
118
|
+
When completion sound/alarm is enabled, it plays 5 terminal bell beeps.
|
|
119
|
+
|
|
111
120
|
Controls in settings UI:
|
|
112
121
|
|
|
113
122
|
- `Enter`: select/toggle
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1198,6 +1198,7 @@ function printUsage() {
|
|
|
1198
1198
|
process.stdout.write(" timer style\n");
|
|
1199
1199
|
process.stdout.write(" timer style --all\n");
|
|
1200
1200
|
process.stdout.write(" timer style --compatible\n");
|
|
1201
|
+
process.stdout.write(" timer style random\n");
|
|
1201
1202
|
process.stdout.write(" timer style <font>\n");
|
|
1202
1203
|
}
|
|
1203
1204
|
|
|
@@ -1244,6 +1245,24 @@ function runTimer(args) {
|
|
|
1244
1245
|
return;
|
|
1245
1246
|
}
|
|
1246
1247
|
|
|
1248
|
+
if (args.length === 2 && args[1].toLowerCase() === "random") {
|
|
1249
|
+
const fonts = getAllFonts();
|
|
1250
|
+
if (fonts.length === 0) {
|
|
1251
|
+
process.stderr.write("No fonts are available.\n");
|
|
1252
|
+
process.exitCode = 1;
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
const randomFont = fonts[Math.floor(Math.random() * fonts.length)];
|
|
1256
|
+
const result = setFontInConfig(randomFont);
|
|
1257
|
+
if (!result.ok) {
|
|
1258
|
+
process.stderr.write(`Failed to set random font: ${randomFont}\n`);
|
|
1259
|
+
process.exitCode = 1;
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
process.stdout.write(`Random font set to: ${result.font}\n`);
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1247
1266
|
const requestedFont = args.slice(1).join(" ");
|
|
1248
1267
|
const result = setFontInConfig(requestedFont);
|
|
1249
1268
|
if (!result.ok) {
|