Add clipboard widget with history, search, and image support#666
Add clipboard widget with history, search, and image support#666stylebending wants to merge 5 commits intoamnweb:mainfrom
Conversation
|
Isn't it better to use the official API to access Windows clipboard data in realtime? https://learn.microsoft.com/en-us/windows/win32/dataxchg/clipboard |
Thanks for the suggestion and the link! That makes sense, and I agree that using the official Windows clipboard API is the better approach for real-time access. Would you prefer that I update this PR with the new approach, or close it and open a fresh one once the changes are ready? |
As you wish, your choice. |
|
This is as complete as I could get it, only thing missing is the pinning feature but the Python WinRT package doesn't support clipboard pinning it seems. Sorry for the multiple commits. |
|
I will probably check this this week when I have some free time, but let me know, using WinRT will require having the clipboard enabled in Windows OS, right? |
|
Thanks for the PR @stylebending. Same issue as with your other PR regarding the new validation schema format. It was a necessary change, so please check other widgets to get the general idea. Also Writing Widgets was updated. |
merge-main-into-widget-branch
Yes it specifically requires 'Clipboard History' to be toggled On in Windows System Settings. If disabled, the WinRT API won't have a history buffer to pull from, and the widget will default to 'No items match your search.' I can add a small note to the widgets' README/Docs about this if you think it's necessary!
Thanks again for the heads-up! I've updated the validation schema to follow the new Pydantic format, using the other widgets and the updated documentation as a reference. This is ready for another look, let me know if any further tweaks are needed! |
|
Ok, tested.
|
Summary
This PR adds a new clipboard widget to YASB, providing a searchable clipboard history with long text preview and support for both text and images.
Features
Built-in search bar.
Clear history or delete single item.
Preview long text per history item by hovering over it.
Full support for copying and previewing images directly in the history list.
This is my first contribution of this size to a free and open-source project, so any feedback (code, structure, or UX) is very welcome 🙂
Tested with both text and image clipboard content on Windows 11.