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
// TwinDesk — Copyright (C) 2026 inukaasith. GPL-3.0, see LICENSE.
// pam-e2e.sh's service side: the real Unlock of linux/fullkvm/service.js on /run/twindesk/unlock.sock, a
// phone key for uid 1000, and a stand-in for the app that answers the service's ask like a phone would:
// yes (signs), no (unlockNo), forged (signs with another key). Exits after a few seconds.
'use strict';
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const ROOT = path.join(__dirname, '../../..');
const { Unlock } = require(path.join(ROOT, 'linux/fullkvm/service.js'));
const U = require(path.join(ROOT, 'shared/fullkvm/unlock.js'));
const answer = process.argv[2] || 'yes';
const dir = process.env.TWINDESK_UNLOCK_DIR;
const kp = crypto.generateKeyPairSync('ec', { namedCurve: 'prime256v1' });
const pub = kp.publicKey.export({ format: 'der', type: 'spki' }).toString('base64');
fs.mkdirSync(dir, { recursive: true });
fs.writeFileSync(path.join(dir, '1000.keys'), 'kid_pixel01 fingerprint 1700000000 ' + pub + ' Pixel 9\n');
let u = null;
const svc = {
owner: { kind: 'greeter' },
toClient(o) {
if (o.event !== 'unlockAsk') return true;
setTimeout(async () => {
if (answer === 'no') { console.log('phone: no', JSON.stringify(await u.fromClient(null, { cmd: 'unlockNo', nonce: o.nonce }))); return; }
const key = answer === 'forged' ? crypto.generateKeyPairSync('ec', { namedCurve: 'prime256v1' }).privateKey : kp.privateKey;
const sig = crypto.sign('sha256', U.message(o.user, o.nonce), { key, dsaEncoding: 'der' }).toString('base64');
console.log('phone signed:', JSON.stringify(await u.fromClient(null, { cmd: 'unlockSign', nonce: o.nonce, key: 'kid_pixel01', sig })));
}, 300);
return true;
},
};
u = new Unlock(svc);
u.start();
u.fromClient(null, { cmd: 'unlockReach', keys: ['kid_pixel01'], ask: true });
setTimeout(() => process.exit(0), 4000);