All your computers and your phone/iPhone, working as one desk. Screens, apps, files, clipboard, calls, texts, notifications, mouse and keyboard, shared between Mac, Windows, Linux , Android, Web and ios / ipados . Free and open source. No account, no cloud, and no shared network needed.
JavaScript androidapple-ecosystemconnectelectronfile-sharingintel-unison-alternativeiosios-windowskde-connect-alternativekvmlinuxmacbookmacosmouse-sharingphone-link-alternativeproductivityscreen-sharingsidecar-alternativesynergy-alternativewindows
// More screens of one computer to one device (shared/screen-ch.js): stream 0 sends what it always did
// and doesn't hear an extra stream; an extra stream tags what it sends and hears only its own.
'use strict';
const assert = require('assert');
const { channel } = require('../screen-ch.js');
const handlers = {};
const sent = [];
const link = { id: 'dev', on(t, fn) { (handlers[t] = handlers[t] || []).push(fn); }, send(m) { sent.push(m); return true; }, get status() { return { state: 'connected' }; } };
const emit = (t, m) => (handlers[t] || []).forEach((fn) => fn(m));
const zero = channel(link, 0), one = channel(link, 1);
const got0 = [], got1 = [], own = [];
zero.on('screen.state', (m) => got0.push(m));
one.on('screen.state', (m) => got1.push(m));
one.on('welcome', () => own.push(1));
const m = { t: 'screen.state', on: true };
zero.send(m);
assert.strictEqual(sent[0], m, 'stream 0: the very same message, no ch');
one.send({ t: 'screen.state', on: true });
assert.deepStrictEqual(sent[1], { t: 'screen.state', on: true, ch: 1 });
emit('screen.state', { on: true });
emit('screen.state', { on: true, ch: 1 });
emit('screen.state', { on: true, ch: 2 });
assert.deepStrictEqual([got0.length, got1.length], [1, 1]);
assert.strictEqual(got1[0].ch, 1);
emit('welcome');
assert.deepStrictEqual(own, [1], 'the device’s own events reach every stream');
assert.deepStrictEqual([zero.id, zero.status.state, one.ch, zero.ch], ['dev', 'connected', 1, 0]);
console.log('screen-ch ok');