Skip to content

[feature-request] configuration option to bind selected text copy to somthing other than Ctrl+c based on focused application #99

Open

Description

@ChetanKoneru

Since some applications like terminal, emacs or other similar editors do not use Ctrl+c to copy text, maybe we can create a config file with Application and copy keybinding.

We can then match configured application name to active window title to simulate application based copy keybinding.

Let me know if you need help to create this feature.

Activity

  1. changed the title [-][feature-request] configuration option to bind selected text copy to somthing other than `Ctrl+c` based on focued application[/-] [+][feature-request] configuration option to bind selected text copy to somthing other than `Ctrl+c` based on focused application[/+] on Jan 10, 2025
  2. momokrono commented on Jan 10, 2025

    @momokrono
    Collaborator

    The idea is not bad, actually. I fear it will require a bit of code refactoring, but I could be done.

    For Linux systems ideally it could access the second clipboard buffer (the one that gets filled while simply selecting some text and pasting it with the press of the middle mouse button or the scroll-wheel), so that we can bypass emulating ctrl+c completely since the buffer has been already filled by the user when selecting the text.

  3. ChetanKoneru commented on Jan 10, 2025

    @ChetanKoneru
    Author

    I think it is a better idea to access the clipboard rather than simulating Ctrl+c.
    I would suggest user to copy the desired text [with application specific copy key-binding] and trigger Writing-tools. Writing-tools will access the top most clipboard entry and parses it to AI tools.

    I think this approach would be cleaner and more adaptable across linux desktop environments.

  4. momokrono commented on Jan 10, 2025

    @momokrono
    Collaborator

    Pyperclip is the library already in use for this app.

    Changing the default behavior by removing the ctrl+c/v emulation would not only be a major change but also make the app way less intuitive. For example, "chat mode" works exactly because there is no selected text, if we were to pick the top-most clipboard element we would completely lose this feature.

  5. ChetanKoneru commented on Jan 11, 2025

    @ChetanKoneru
    Author

    Yes, completely agree.

    What about having 2 functions and 2 keybindings. One keybinding is configured to read from the clipboard. One keybinding opens writing tools in chat mode.

    C+` - chat mode
    C+~ - that is Ctrl+Shift+` - copies from clipboard and gives AI options.

    This approach might be easier to manage. Thoughts?

  6. theJayTea commented on Jan 21, 2025

    @theJayTea
    Owner

    Hey everyone! Sorry I wasn't able to research about this and reply earlier.

    As @momokrono suggested, on Linux under X11, we should be able to access the second clipboard buffer directly, allowing Writing Tools to work on any selected text—even in editors like emacs & the terminal. Chat mode could still work too, since when you invoke Writing Tools without any text selected, the second clipboard buffer should be blank.

    However, Wayland doesn't have a secondary selected text clipboard buffer, and by refactoring the code with the above implementation for Linux, we're essentially solidifying a lack of support for Wayland in the future.

    For context, currently, Writing Tools only works on Wayland if you:

    In the future, we could look into implementing KDE's global shortcuts API so things work smoothly on Wayland with KDE.

    So I don't think it would be wise to refactor with some Xorg-specific functionality at the moment...

    Let me know what you think!

    Kind regards,
    Jesai

  7. added
    enhancement
    on Jan 21, 2025
  8. added a commit that references this issue on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions