-
Notifications
You must be signed in to change notification settings - Fork 17
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
Feature request: option to auto paste emoji after choosing it #11
Comments
I was thinking about this too. In the past, I've used xdotool for things like this. Maybe it'd be possible to use a shell subprocess and call it? I could provide assistance, but I'm trying to pull back from open source and personal projects because of university, which gobbles up like 110% of my free time lol |
Could also be possible to copy and then insert by putting the copy action and the insert action in an Action List. Regardless, it's probably doable. |
In fact i'm using a Clipboard Manager called Clipped which already has this feature. & from sources i think that it use fake events same as xdotool. |
I figured out that the XTest library used in Clipped is available on python too: So we could maybe use it instead of calling xdotool using a subprocess? |
Sure, if u think it'll be faster. xdotool was just the one I thought of, plus it does character encoding for typing simulations I think, so it's not JUST sending shift-insert. Regardless, I think it'll just be cool that it's working lol. Lmk how it works out! I'll be here if u need help with the implementation |
@MyriaCore I think that creating a custom action didn't work since i'm getting the following error message:
Edit: I tested the key press simulation code in a separated python script & it did work so i don't think that the problem comes from there. So, what do you suggest? have i done something wrong? |
Finally got it to work, based on code from ulauncher-kill extension. @MyriaCore thanks for the help 😉 |
Sweet! Yeah, the custom actions seem kinda fiddly. Glad you figured it out! |
There are still some users who might want to just copy the emoji, so it might be wise to add an action setting in the settings. Maybe the user could choose from "Auto-Insert" or "Copy". |
Just checked out your code. I think instead of sending Didn't look too hard at it, but other than that, it looks good. |
any updates @AXeL-dev? |
Well i didn't rework on this since the last time. I'll try to this night. |
@MyriaCore it seems like pasting emojis using P.S.: pasting emojis doesn't either work with |
Maybe instead of copying into the clipboard, we should copy into the primary buffer? I think |
The After looking at relevant docs, it looks like maybe we could use the following to make class CopyToPrimarySelectionAction(CopyToClipboardAction):
"""
Copy text to the clipboard
:param str text: text to copy
"""
def run(self):
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_PRIMARY)
clipboard.set_text(self.text, -1)
clipboard.store() |
@AXeL-dev you can test this on your terminal by:
If we use the primary selection instead of the clipboard, shift-insert should basically work everywhere, since AFAIK it's accepted everywhere, since it's more of a system thing than a user-controllable clipboard thing. |
I've implemented this in MyriaCore/auto-paste. |
HMMM, still not working. This is super weird. I get a completely different bug when trying to do both as well, so im not sure what to do here. Needless to say, for this to be useful for regular use, this will probably need to be debugged. |
This reverts commit a5c25d7.
This reverts commit 998cf72.
This reverts commit 88f035c.
Maybe the primary clipboard is read only? How does This is honestly pretty frustrating. Maybe it would've been better if we had just piped out at the beginning. |
I guess there should be a way to achieve it, the most common problem in Linux (i mean the one i always face) is the lake of good documentation, especially on some low level libraries.. Anyway, i'll try to give it a look from my side once i get enough free time for. By the way, |
Yeah. IDK, documentation is there, I guess I just don't know as much as I thought about the clipboard system. Most of my experience comes from working on a fork of texpander. Here, Shift-Insert is used to paste, and the text content is placed into the primary buffer and into the clipboard buffer. As I said, worst case we can use xsel to copy, and then use this XTest library to paste. IDK why the gtk clipboard stuff isn't working, but AFAIK that stuff is supposed to be used for implementing copy/paste in GUI apps, so I guess we'd be kinda abusing the feature a bit here. |
Hi there! I'd love this feature is implemented ❤ Is there any update? I give my two cents here on what I think is a common use case: IMO, and for my use case, to be really useful it should do both: copy to the X clipboard (the one that pastes with Reason: Many times you want to insert several times the same emoji, like 👏👏👏 - so you should be able to look for the emoji in the picker once, hit
What do you think? Hope this helps, cheers!! |
I haven't worked on this since 2020 so no updates unfortunately. I don't remember if I got this to work or not in my fork. Commits look ok but I never merged it, so I have to assume it's at least somewhat not working Again uni takes up a lot of my time so in general I've taken a step back from open source stuff. If you have experience with python why not take a stab at it yourself? |
I would love to see an auto paste feature, like in many others emoji selectors.
@MyriaCore Could you help on implementing this feature on your fork please? I'm not sure if it's doable, what do you think?
The text was updated successfully, but these errors were encountered: