Skip to content

Conversation

@ehamiter
Copy link

@ehamiter ehamiter commented Oct 12, 2025

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:

cosmic-ext-applet-clipboard-manager --toggle

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.


Copy link
Collaborator

@wiiznokes wiiznokes left a 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_path is 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

@wiiznokes
Copy link
Collaborator

Note that the approach looks good otherwise

@ehamiter
Copy link
Author

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.

@wiiznokes
Copy link
Collaborator

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.
This is unfortunate. Futhermore, i think the layer surface stuff was meant to be removed from cosmic-panel, so idt it's a good idea to start using this.

Maybe @wash2 have some insight about this problem 🙏
tldr: We want to show the popup programatically. The popup doesn't show up when using get_popup, but does when using get_layer_surface

@ehamiter
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toggle with keyboard shortcut and navigate using arrows

2 participants