-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.html
More file actions
251 lines (235 loc) · 9.62 KB
/
setup.html
File metadata and controls
251 lines (235 loc) · 9.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>nightbar — setup</title>
<style>
:root {
--bg: #f6f7f9;
--panel: #ffffff;
--panel-2: #f0f2f5;
--text: #1a1d22;
--muted: #6b7280;
--accent: #e87a2b;
--accent-2: #c8651e;
--border: #e3e6ea;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); margin: 0; }
body {
font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
min-height: 100vh;
display: flex; justify-content: center;
padding: 40px 20px 80px;
}
.wrap { width: 100%; max-width: 720px; }
h1 {
font: 600 28px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
margin: 0 0 6px;
letter-spacing: -0.01em;
}
.lede { color: var(--muted); margin: 0 0 28px; }
fieldset {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 12px;
padding: 18px 22px 20px;
margin: 0 0 16px;
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
legend {
padding: 0 8px;
color: var(--accent);
font-weight: 600;
font-size: 13px;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.row {
display: flex; align-items: flex-start; gap: 12px;
padding: 10px 12px;
border-radius: 8px;
cursor: pointer;
user-select: none;
}
.row:hover { background: var(--panel-2); }
.row input { margin-top: 3px; accent-color: var(--accent); }
.row .label { font-weight: 500; }
.row .desc { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.row label { display: block; cursor: pointer; }
input[type="text"], textarea {
background: var(--panel-2);
color: var(--text);
border: 1px solid var(--border);
border-radius: 8px;
padding: 10px 12px;
font: inherit;
width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
.field { padding: 8px 12px; }
.field-label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.actions {
position: sticky; bottom: 16px;
display: flex; gap: 12px; margin-top: 22px;
}
button {
background: var(--accent);
color: #ffffff;
border: none;
border-radius: 10px;
padding: 12px 18px;
font: 600 15px/1 -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
cursor: pointer;
}
button:hover { background: var(--accent-2); }
button.secondary {
background: transparent;
color: var(--text);
border: 1px solid var(--border);
}
#output {
margin-top: 20px;
background: var(--panel);
color: var(--text);
border: 1px solid var(--border);
border-radius: 10px;
padding: 16px 18px;
font: 13px/1.55 "SF Mono", Menlo, monospace;
white-space: pre-wrap;
display: none;
}
.copied {
display: inline-block; margin-left: 12px; color: var(--accent-2); font-size: 13px;
}
</style>
</head>
<body>
<div class="wrap">
<h1>nightbar setup</h1>
<p class="lede">Pick what to include in v1. Hit <b>Generate</b> at the bottom, copy the result, and paste it back in chat.</p>
<form id="form">
<fieldset>
<legend>A · Features</legend>
<div class="row"><input type="checkbox" name="feat" value="core" id="f1" checked>
<label for="f1"><div class="label">Core: toggle on/off + strength slider</div>
<div class="desc">Menu item to enable/disable, plus a 0–100% color-temperature slider with live preview. Minimum useful product.</div></label></div>
<div class="row"><input type="checkbox" name="feat" value="schedule" id="f2">
<label for="f2"><div class="label">Schedule control</div>
<div class="desc">Switch between Off / Sunset-to-Sunrise / Custom, with editable from/to times for custom mode.</div></label></div>
<div class="row"><input type="checkbox" name="feat" value="timed" id="f3">
<label for="f3"><div class="label">Timed enable ("for 1 hour" / "until sunrise")</div>
<div class="desc">Quick presets that turn Night Shift on for a fixed duration and auto-off. Not in nocturnal — a nightbar addition.</div></label></div>
<div class="row"><input type="checkbox" name="feat" value="caffeinate" id="f4">
<label for="f4"><div class="label">Prevent display sleep while active</div>
<div class="desc">Hold an IOKit power assertion so the screen doesn't sleep while Night Shift is on.</div></label></div>
<div class="row"><input type="checkbox" name="feat" value="hotkey" id="f5">
<label for="f5"><div class="label">Global hotkey to toggle</div>
<div class="desc">System-wide keyboard shortcut (e.g. ⌥⌘N). Requires a small extra dependency or hand-rolled Carbon hotkey.</div></label></div>
<div class="row"><input type="checkbox" name="feat" value="dimness" id="f6">
<label for="f6"><div class="label">Dimness overlay ("darker than dark")</div>
<div class="desc">Extra screen dimming via a translucent overlay window. Nocturnal's signature feature.</div></label></div>
</fieldset>
<fieldset>
<legend>B · Distribution</legend>
<div class="row"><input type="radio" name="dist" value="local" id="d1" checked>
<label for="d1"><div class="label">Local build only (recommended)</div>
<div class="desc">Makefile + xcodegen like imbar. Ad-hoc signed. You run it on your own machine. Simplest path.</div></label></div>
<div class="row"><input type="radio" name="dist" value="signed" id="d2">
<label for="d2"><div class="label">Developer ID signed + notarized zip</div>
<div class="desc">Adds notarytool step so you can share the .app with others. Needs your Developer ID cert + App Store Connect API key.</div></label></div>
</fieldset>
<fieldset>
<legend>C · Launch at login</legend>
<div class="row"><input type="radio" name="login" value="yes" id="l1" checked>
<label for="l1"><div class="label">Yes — include a toggle</div>
<div class="desc">Uses SMAppService.mainApp on macOS 13+. Small addition.</div></label></div>
<div class="row"><input type="radio" name="login" value="no" id="l2">
<label for="l2"><div class="label">No — skip for v1</div>
<div class="desc">Keep surface area minimal.</div></label></div>
</fieldset>
<fieldset>
<legend>D · Name & bundle ID</legend>
<div class="row"><input type="radio" name="name" value="lower" id="n1" checked>
<label for="n1"><div class="label">nightbar / com.lordhung.nightbar</div>
<div class="desc">Lowercase, matches the directory name.</div></label></div>
<div class="row"><input type="radio" name="name" value="cap" id="n2">
<label for="n2"><div class="label">Nightbar / com.lordhung.Nightbar</div>
<div class="desc">Capitalized product name, like ImBar.</div></label></div>
</fieldset>
<fieldset>
<legend>E · Target macOS</legend>
<div class="field">
<div class="field-label">Minimum deployment target (default <b>14.0</b>, like imbar). Lower it if you need older Macs.</div>
<input type="text" name="macos" value="14.0" />
</div>
</fieldset>
<fieldset>
<legend>F · Anything else</legend>
<div class="field">
<div class="field-label">Other features, constraints, or notes you want me to know.</div>
<textarea name="notes" placeholder="e.g. menu bar icon style, color preferences, Developer ID team ID, ..."></textarea>
</div>
</fieldset>
<div class="actions">
<button type="button" id="gen">Generate & copy</button>
<button type="button" id="reset" class="secondary">Reset</button>
<span id="copied" class="copied"></span>
</div>
</form>
<pre id="output"></pre>
</div>
<script>
const FEAT_LABEL = {
core: 'Core: toggle + strength slider',
schedule: 'Schedule (Off / Sunset-to-Sunrise / Custom)',
timed: 'Timed enable (1h / until sunrise)',
caffeinate: 'Prevent display sleep while active',
hotkey: 'Global hotkey to toggle',
dimness: 'Dimness overlay (darker than dark)',
};
function generate() {
const form = document.getElementById('form');
const data = new FormData(form);
const feats = data.getAll('feat');
const dist = data.get('dist');
const login = data.get('login');
const name = data.get('name');
const macos = (data.get('macos') || '').trim() || '14.0';
const notes = (data.get('notes') || '').trim();
const distLabel = dist === 'signed'
? 'Developer ID signed + notarized zip'
: 'Local build only';
const nameLabel = name === 'cap'
? 'Nightbar / com.lordhung.Nightbar'
: 'nightbar / com.lordhung.nightbar';
const lines = [];
lines.push('nightbar setup');
lines.push('');
lines.push('A · Features:');
if (feats.length === 0) lines.push(' (none selected)');
else for (const f of feats) lines.push(' - ' + FEAT_LABEL[f]);
lines.push('');
lines.push('B · Distribution: ' + distLabel);
lines.push('C · Launch at login: ' + (login === 'yes' ? 'yes' : 'no'));
lines.push('D · Name: ' + nameLabel);
lines.push('E · Target macOS: ' + macos);
lines.push('F · Notes: ' + (notes || '(none)'));
const text = lines.join('\n');
const out = document.getElementById('output');
out.textContent = text;
out.style.display = 'block';
navigator.clipboard.writeText(text).then(() => {
const c = document.getElementById('copied');
c.textContent = 'Copied to clipboard — paste it in chat';
setTimeout(() => c.textContent = '', 4000);
}).catch(() => {});
}
document.getElementById('gen').addEventListener('click', generate);
document.getElementById('reset').addEventListener('click', () => {
document.getElementById('form').reset();
document.getElementById('output').style.display = 'none';
});
</script>
</body>
</html>