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.
Multi-device
TwinDesk is a one-to-one app: one computer with another computer, or with a phone. Multi-device is an option on top of it, built on the mesh from pull request #29 by Erdoğan Yeşil (@erdodo): many computers and phones connected at once, one clipboard and one notification pool for all of them, each screen edge leading to a different device, a phone and a computer connected at the same time.
It is off by default, and while it is off TwinDesk runs exactly the code it runs today.
Rules
Off means today's app. With Multi-device off nothing of the mesh is loaded: no module, no listener, no extra field on the wire. The one-to-one connection code (
server.js,link.js,peer.js,hostpair.js/pairing.js,kvm.js,clip.js/clipboard.js,notifs.js,phone*.js,wired.js, …) is not changed for it. The one-to-one app only gains the switch: one line inmain.js,multi.js, and the Multi-device tab.One switch, read at start. Multi-device tab › Use several devices at once › Turn on / Turn off. It is
oninmulti.json;main.jsreads it once, right after it sets the user data folder, and with it on hands over tomesh/main.js. Changing it restarts TwinDesk (as Quit, then start again), so the two never run side by side; the window comes back on the Multi-device tab.Everything for several devices is in the Multi-device tab: the layout of the screens (which device each edge leads to) and Join every device automatically. The device list is the sidebar's. The other tabs stay as they are.
Storage of its own. The one-to-one app's files are read by the mesh, never written:
one-to-one app mesh hosts this computer dials pairing.json(Windows),hosts.json(Mac)pairings.json,hosts-mesh.jsondevices that dial this computer paired.jsonpaired-mesh.jsonsettings only the mesh has – multi.json(layout,mesh, Windowskvm.edges)A pairing of the one-to-one app joins the mesh's list once (
multi.json›imported): one forgotten in the mesh stays forgotten, one paired again in the one-to-one app joins again. Settings both have (speed, clipboard, …) stay insettings.json, the same choices in both;kvm.pcSideis kept. Switching off gives back exactly what was there.Older devices and devices with it off are plain one-to-one peers to a multi-device one: no roster, no relayed items. Their
kvm.layoutplaces them where they say, as the one-to-one app does; between mesh devices the shared layout is the one map.Native helpers: two builds of the same sources. What Multi-device adds (several watched sides, the side in the edge and return events) is inside
#if MULTI:windows-helper/src/CaptureMulti.cs,Program.cs,Json.cs;mac-helper'sCapture.swiftandmain.swift, where the#elseparts are today's code as it was.macshare-winhelper.exe,macshare-helperandmacshare-linuxhelperare built without it and are today's helpers; the-multibuilds have it, and onlymesh/helper.jsstarts them.linux-helperreads the sides assideList("left,top"), as its JSON reader skips arrays. Without a-multibuild the mesh starts the one-to-one helper, which watches the first side (the mesh sends it assidetoo).Android, first release: unchanged. A multi-device computer sees today's phone app as a plain one-to-one device. A phone with several computers at once comes later, behind its own switch.
Linux has Multi-device too (
linux/mesh/), with less in it, to stay clear of what Bluetooth, the desktops and the GPU drivers make fragile there:- with it on, other computers connect to the Linux one over the same network only, never Bluetooth
(no
BleGuest;BleHostand the Bluetooth policy take phones only; General's Bluetooth with computers is left as the one-to-one app has it). Phones connect as before, Bluetooth included. - screen sharing goes to the selected device, as today (no screen per device, no virtual display per device);
- several watched edges on X11 (
macshare-linuxhelper-multi); the Wayland backend watches one; - Windows and Mac keep Bluetooth with each other in Multi-device. A Linux computer with Multi-device off is a plain one-to-one peer to the others, with its Bluetooth as today.
- with it on, other computers connect to the Linux one over the same network only, never Bluetooth
(no
Join every device automatically is on by default, so every computer the mouse goes through ends up connected to the others (a chain needs the computer whose mouse is used to be connected to each device of it). With it on, a paired device can add another device to this one without a pairing code; off, each pair of devices is paired by hand, and the layout shows in red a device the pointer stops before (in the mesh, not connected here) and greys the ones past it. Switched off, multi.json keeps
mesh: { autoJoin: false, chosen: true }; afalsewithoutchosenwas written by a build before 2.2.0, where off was the default and every save wrote it, so it reads as on.
Where things are
shared/mesh.js,intro.js,layout.js,kvm-edges.js,screen-mesh.js,sidebar-model.js,notif-guard.js: the mesh core, plain JS for every platform. Tests inshared/test/.windows/multi.js,mac/multi.js: the switch.ui-multi.js: the tab with it off.windows/mesh/: the Windows app with Multi-device on.main.js,ipc.js,preload-app.js; the link layer (server,link,hostpair,links,session,hub); the features (clip,notifs,kvm,layout-sync,autojoin,phones,phone,phone-link,phone-bridge,wired,pcscreen,pcscreenset,sender);settingsandstore(its files, rule 4); the window (app.htmlwith<base href="../">, so everything it doesn't have loads fromwindows/, itsapp.js, pages and css,ui-multi.js).mac/mesh/: the same for the Mac (services,pairing,clipboard,stream/streams,displays,control.html, …).linux/mesh/: the same for Linux, made fromwindows/mesh/withlinux/'s own parts (notifications read with dbus-monitor, sleep that ends every session and invites each device back:sleepwake.js).- A file in
mesh/named like one a folder up is its mesh version: when a fix there applies to both, make it in both. - The design: mesh.md and screen-mesh.md.
Tests: node <file> for each of shared/test/*.js, windows/mesh/test/*.js, mac/mesh/test/*.js and
linux/mesh/test/*.js,
with NODE_PATH set to windows/node_modules. switch.test.js checks rule 1 (off: nothing of the
mesh is loaded) and the hand-over; storage.test.js checks rule 4. The installers leave test folders
out.
Steps
- Import the mesh as new files, its tests passing. (done)
- Windows and Mac: the switch and the Multi-device tab, the mesh app in
mesh/, its own storage,kvm.layoutfrom older peers. (done) - Helpers: several watched sides in
-multibuilds of the same sources (rule 6); the fork's extra edge logging left out. (done; the Windows helper built withoutMULTIhas the same types, methods and IL as before, compared method by method; the Mac-multibuild is still to be compiled on a Mac; the Linux helper built withoutMULTIcompiles to the same object files as before) - Real devices: two computers and a phone with the switch off (must match today), then on.
- Android: several computers at once, behind its own switch.
- Linux. (done: computers over the network only, the screen to the selected device, several edges on X11)
Not part of this
- The clipboard rework in the mesh fork (images, files, the latest copy wins, a Recent list) changes today's clipboard: a pull request of its own.
- Pull request #28 (a phone and a computer at once, several edges) is what Multi-device does; here it lives behind the switch.
- The mesh fork's log file (
shared/logfile.js).
Credit
The mesh is Erdoğan Yeşil's work (@erdodo, pull request #29). Files he wrote or changed carry both
names; commits built on it carry Co-authored-by: Erdoğan Yeşil <[email protected]>.