conductor-remote 1.23.1 → 1.24.1

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 CHANGED
@@ -254,37 +254,19 @@ lives at the root `pmset` layer no assertion can touch. Running those tools with
254
254
  no assertion for the standby layer. (Note: lid *closed* on Apple Silicon forces
255
255
  sleep regardless — keep the lid open, or attach an external display **and** power.)
256
256
 
257
- **Fix — act at the `pmset` layer (root).** Pick one:
258
-
259
- *Always-on relay a boot LaunchDaemon* (durable across reboots — `disablesleep`
260
- alone does not survive a restart, which is why this is a daemon, not a one-off):
257
+ **Fix — `conductor-remote nosleep`.** It blocks sleep at the root `pmset` layer (the
258
+ one no assertion reaches) for a bounded window and **auto-reverts** on exit, Ctrl-C, or
259
+ the timeout nothing permanent, nothing left on your machine:
261
260
 
262
261
  ```bash
263
- sudo tee /Library/LaunchDaemons/dev.conductor-remote.nosleep.plist >/dev/null <<'PLIST'
264
- <?xml version="1.0" encoding="UTF-8"?>
265
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
266
- <plist version="1.0"><dict>
267
- <key>Label</key><string>dev.conductor-remote.nosleep</string>
268
- <key>ProgramArguments</key>
269
- <array><string>/usr/bin/pmset</string><string>-b</string><string>disablesleep</string><string>1</string></array>
270
- <key>RunAtLoad</key><true/>
271
- </dict></plist>
272
- PLIST
273
- sudo launchctl bootstrap system /Library/LaunchDaemons/dev.conductor-remote.nosleep.plist
262
+ conductor-remote nosleep 2h # also 90m, 30s, bare seconds; no arg = until Ctrl-C
274
263
  ```
275
264
 
276
- *Occasional / time-boxed a shell function* that blocks battery sleep for a
277
- bounded window, then auto-reverts (on clean exit, Ctrl-C, or kill):
278
-
279
- ```bash
280
- nosleep() { # nosleep 1h | nosleep 30m | nosleep 90s (default 1h)
281
- local a="${1:-1h}" s
282
- case "$a" in *h) s=$(( ${a%h} * 3600 ));; *m) s=$(( ${a%m} * 60 ));; *s) s=${a%s};; *) s=$a;; esac
283
- sudo sh -c "pmset -b standby 0 powernap 0 disablesleep 1
284
- trap 'pmset -b standby 1 powernap 1 disablesleep 0' EXIT INT TERM
285
- sleep $s"
286
- }
287
- ```
265
+ It prompts for `sudo` once and runs in the foreground (the background LaunchAgent has no
266
+ terminal to prompt on, so it can't self-arm). Since sending from the phone already means
267
+ manually turning on your hotspot, flipping this on for the session is the same kind of
268
+ deliberate, revertable switch — no boot daemon, no permanent change. Simplest of all: keep
269
+ the Mac on **AC power**, where it never maintenance-sleeps.
288
270
 
289
271
  **Check / undo:**
290
272
 
@@ -293,8 +275,9 @@ pmset -g | grep -i sleepdisabled # 1 = sleep blocked
293
275
  sudo pmset -b standby 1 powernap 1 disablesleep 0 # restore defaults
294
276
  ```
295
277
 
296
- Once set, you can quit the keep-awake app entirely it was only ever asserting on
297
- the idle layer, which was never the problem.
278
+ While `nosleep` is running you can quit any keep-awake app — those only ever asserted
279
+ on the idle layer, which was never the problem. It restores on its own; the manual undo
280
+ above is only for the rare case where it was killed hard.
298
281
 
299
282
  ## Disclaimer
300
283
 
package/bin/cli.js CHANGED
@@ -60,6 +60,8 @@ function usage() {
60
60
  ' conductor-remote [start] run the relay (default)',
61
61
  ' conductor-remote service <subcommand> manage the login LaunchAgent',
62
62
  ' install | uninstall | restart | status',
63
+ ' conductor-remote nosleep [duration] keep this Mac awake (incl. lid-closed) until',
64
+ ' Ctrl-C or the duration (e.g. 1h, 90m); needs sudo',
63
65
  ' conductor-remote --version print the installed version',
64
66
  '',
65
67
  'Install flags (each also settable via the env var in [brackets]):',
@@ -87,6 +89,11 @@ switch (cmd) {
87
89
  process.argv = [process.argv[0], process.argv[1], ...rest]
88
90
  await import(resolveEntry('../dist-node/scripts/service.js', '../scripts/service.ts'))
89
91
  break
92
+ case 'nosleep':
93
+ // nosleep.ts reads its optional duration from argv[2]; re-shape argv so `nosleep 1h` → `1h`.
94
+ process.argv = [process.argv[0], process.argv[1], ...rest]
95
+ await import(resolveEntry('../dist-node/scripts/nosleep.js', '../scripts/nosleep.ts'))
96
+ break
90
97
  case '-v':
91
98
  case '--version':
92
99
  case 'version':