-
Notifications
You must be signed in to change notification settings - Fork 447
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
Handle X11 selection for stopped clients #821
Comments
You could copy the selection again in CopyQ before stopping the other application. This way, CopyQ will provide the selection text instead of the other app.
|
Thanks, that seems to work well. Could this be done automatically - e.g. similar to how it is done with killed clients? |
I don't know how. This is really strange use case - AFAIK, GUI apps are usually not stopped. CopyQ could automatically take ownership of the X11 selection just after it changes, but some apps deselect text when this happens. |
OK. |
@hluk |
I have no idea how to do that (perhaps using XGetSelectionOwner and somehow getting PID for the window). |
Yes, that's what I've found, too. Could you imagine having an API for this in CopyQ, to get the PID of the clipboard or selection owner? To simplify things for my usecase it would be great to have something along "take ownership of selection/clipboard for $PID". |
I think a good workaround is also this:
|
If you stop an application where something is selected (using the mouse typically), e.g. a terminal (using the PID from
echo $PPID
) withkill -STOP $pid
, trying to paste this selection somewhere else will block, until youkill -CONT
the application with the selection.Could CopyQ handle this case?
This is related to awesomeWM/awesome-www#111, where I dynamically stop e.g. browsers when they are not focused.
I've tried using
xsel --keep --primary
before thekill -STOP
to work around this, but it appears to cause issues with Neovim, which usesxsel
itself for clipboard management.The text was updated successfully, but these errors were encountered: