@walldock/agent 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/dist/main.js +12 -6
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -73,9 +73,11 @@ function log(msg) {
73
73
  // ─── Main ─────────────────────────────────────────────────────────────────────
74
74
  async function main() {
75
75
  const args = process.argv.slice(2);
76
- // --unlink: remove stored credentials and startup entry
77
- if (args.includes('--unlink')) {
78
- // Kill any running background instance first so the user can re-pair immediately
76
+ // --unlink / --relink: remove stored credentials and startup entry
77
+ // --relink also falls through to the pairing flow below
78
+ if (args.includes('--unlink') || args.includes('--relink')) {
79
+ const isRelink = args.includes('--relink');
80
+ // Kill any running background instance first
79
81
  const bgPid = await (0, pid_1.runningPid)();
80
82
  if (bgPid) {
81
83
  try {
@@ -92,8 +94,11 @@ async function main() {
92
94
  await storage.deleteDeviceToken();
93
95
  await storage.clearDeviceIdentity();
94
96
  await (0, startup_1.unregisterStartup)().catch(() => undefined);
95
- console.log('Device unlinked and startup entry removed.');
96
- return;
97
+ if (!isRelink) {
98
+ console.log('Device unlinked and startup entry removed.');
99
+ return;
100
+ }
101
+ console.log('Device unlinked. Starting pairing…\n');
97
102
  }
98
103
  // --status: print current link status
99
104
  if (args.includes('--status')) {
@@ -204,7 +209,8 @@ async function main() {
204
209
  await storage.setDeviceIdentity({ deviceId: existing.deviceId, deviceName: existing.deviceName });
205
210
  log(`Linked as "${existing.deviceName}". Starting sync…`);
206
211
  if (await maybeStartTray()) {
207
- console.log('Walldock Agent is running in the system tray.');
212
+ console.log(`Walldock Agent is running in the system tray (linked as "${existing.deviceName}").`);
213
+ console.log('To re-link this device: walldock-agent --unlink');
208
214
  process.exit(0);
209
215
  }
210
216
  sync.start({ token: existing.token, deviceId: existing.deviceId });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walldock/agent",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Walldock desktop agent — sync wallpapers across all your screens",
5
5
  "license": "MIT",
6
6
  "main": "dist/main.js",