felipecrs / clipboard-sync Goto Github PK
View Code? Open in Web Editor NEWSync your clipboard between computers using a shared folder
License: MIT License
Sync your clipboard between computers using a shared folder
License: MIT License
In case for example, there is already a text
clipboard sync available in a given remote access but you would still like to use Clipboard Sync for images and files.
Hi,
Thanks for this tool.
On a Windows 11 computer, when I copy something in my clipboard, I can see the icon with the upload arrow, and then in the OneDrive folder I can see the file created that contains my text.
On the other computer (Windows 10), the icon doesn't show the download arrow, and it seems it doesn't pick the new created file at all.
I checked and the Win 10 computer has the correct folder selected (right click -> open folder). Is there a debug mode I can activate to check what's going on? Any idea why this instance doesn't detect the new file?
They both run the last available version of your app.
Environment: any Clipboard Sync version on Windows with the OneDrive official client.
This is really annoying. Quickly the trash bin starts to fill up with Clipboard Sync files, and I have to keep cleaning it up manually on both computers.
After investigation, this issue is caused because the folder is synchronized (set as Always keep on this device) on both devices. In this situation, if you delete the file from computer B, when OneDrive synchronizes the deletion with computer A, it will send the file to the trash bin instead of permanently delete it as a "security" measure since the file wasn't explicitly deleted by an action initiated in that computer.
Unfortunately there aren't many options for handling this issue. The only solution I came up with is:
But this is not trivial to implement. I'm keeping this as a note to myself. Any help is of course appreciated.
As we rely on the system's time for writing and reading clipboard files, it's prone to errors when the system time in one of the computers is not correctly set.
For example, I have a managed environment which have the time some seconds ahead of my local environment, and I don't have privilege to adjust or sync the time.
Because of that, Clipboard Sync often loses some events because it thinks it's too old or vice-versa.
I thought in using incremental ids for the clipboard files, like 1, 2, 3. At the time of writing, we figure out the latest and bump. But this may be not perfect, as one system could potentially not have the Clipboard folder to set as "Always available" and thus not all clipboard files would be there for correctly incrementing.
I found this case today. Example attached.
Happened when I clicked on an image in Microsoft Teams, then right-clicked its preview and clicked in Copy Image.
It would be cool to bundle the source code, so it can be optimized a bit. However, I stumbled upon a problem, which is that the Electron Forge Webpack plugin mandates the use of a renderer process, which I don't use.
Any help would be appreciated.
Refs electron/forge#2628
We basically need to set a guid: https://www.electronjs.org/docs/latest/api/tray#new-trayimage-guid
Microsoft Edge by default uses bookmark as the clipboard type.
That's because we only count the number of files and folders in the root of the folder itself. If there are more files to come in a subfolder, that isn't counted.
https://github.com/parcel-bundler/watcher
Because VS Code did it so it may be a good idea to do it too:
This is a better idea than timestamps, because we can set the file watcher to ignore files with the current hostname in it. The problem is that the hostname is not unique, but as OneDrive does something similar when it goes out-of-sync, I guess we are fine.
Or https://github.com/automation-stack/node-machine-id. But I like hostnames as they make clear which computer has sent a clipboard.
The current implementation is extremely dirty. When I started the project, I just wanted to make it as quick as possible, because I really wanted to prove my concept.
Now the project is fully functional, but it would be good to add support for more clipboard types.
Converting the codebase to be more objet oriented would help to reduce code repetition and make it much more readable and maintainable.
There is already logic to handle this by creating the is-receiving
file. However, this file does not get deleted on shutdown, which causes the writing side to believe there is some computer still receiving.
These files should be deleted automatically on shutdown, but if something happens and they don't get deleted, we should clean them up at some point.
We should ensure Clipboard Sync renews this file from time to time, and on the read side, we should only take into account recent enough ones.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.