-
-
Notifications
You must be signed in to change notification settings - Fork 25
Add keyboard shortcut feature #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
wiiznokes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for this pr. This is a good work arround while waiting for the flatpak portal implementation.
I have some questions/suggestions. I understand you're not familiar with rust, so you can ask me if you don't understand something.
- Did you test your code? Does it works?
get_signal_file_pathis duplicated- You seems to write the timestamp but never actually use it in the code
- It would be nice if these change be in one module, e.i, the functions to read/write the signal file, and the subscription
- The subscription should be a file watcher, especially if we are doing io every 100ms
- why you define a shortcut in the app code? If i understand correctly, it should only be in the cosmic-comp config
|
Note that the approach looks good otherwise |
|
Thanks @wiiznokes -- I believe I addressed everything, please let me know if not. Tested fully on my local machine-- able to activate, start typing to search, use arrow keys to select, and enter to populate clipboard with selection and close the UI. Escape also exits the UI without altering the clipboard. |
|
So i wanted to make some minor modif before merging the pr (see this branch https://github.com/cosmic-utils/clipboard-manager/tree/pr160-modif), but i've realised that the popup doesn't show near the applet icon now. Maybe @wash2 have some insight about this problem 🙏 |
|
Yep, I noticed the positioning as well- I think it's due to how Wayland treats the layers, so I'm not sure how to align it with the applet icon if it goes that route. Whatever you think is best-- I have a local copy that works for me, so I'm happy to do anything else needed to get the functionality available to others. |
This adds the ability to assign keyboard shortcuts via the Cosmic keyboard custom settings to activate, search, select, and copy from the UI.
The command to add is:
and you can assign it to any shortcut. This will show/hide the clipboard manager, and allow you to type to search, use the arrow keys to select an item, and enter to copy and close the interface. Escape also works to exit without selecting anything.
Full disclosure: I am not an expert in Rust; I'm scratching my own itch to add this feature, so there may be a more suitable way of doing this.