Comments (19)
You can also copy the next or previous item in list without removing it -- not sure that it would be better -- it would be possible to copy items to a different tab and retrieve them any time.
Now you can paste item and select previous (no removal) with copyq eval 'paste();previous();'
. But you need to activate the item you want to paste first in the main window or using "Copy next item" global shortcut -- but that's annoying :/.
So let's say I copy Bob
, Smith
and bobsmith@...
. It would be stored in history in reverse order with the latest item selected. If I press the custom shortcut (e.g. ctrl+alt+v
) I want Bob
(the third item in the history) to be pasted first so it needs to be somehow found in the history.
Selecting the first item to paste could be simply done by checking the time when the item was copied -- i.e. the latest copied item is bobsmith@...
and following is Smith
which was copied few seconds before the latest item. Next item is Bob
which is again only few seconds before Smith
. Now, next item (if any) was copied a longer time ago so we've found Bob
as the first candidate to paste. I guess the maximum interval between items can be up to 20 seconds (this would also allow user to reorder the items in list a bit).
Any ideas?
from copyq.
I like your idea about using the time between copies. I had never thought about that. I've been thinking about this feature for a long time but you've already thought through it better than I have.
I agree with what you say that you don't have to remove the item. In this issue I will use "pop paste" as the term because I can't think of a name for the other implementation/mode ("moving paste" ?).
I see two cases where the time-based system would not be ideal:
(1) Continually using a different shortcut might be annoying to some (ctrl+alt+v
does not seem inconvenient to me but maybe it is for others).
(2) A user wants "pop paste" but with lots of time in-between copies.
For example, suppose you are reading a long article and want to copy some quotes while you read and then paste them all at once at the end. Or, suppose you need to read through a lot of resumes and copy only the name and phone number of a few special candidates. But I think copyQ might have other ways of dealing with these situations.
Another possibility is to have a shortcut turn "pop paste" mode on. When activated by this shortcut, copyQ would switch to a new tab that has two special properties set: FILO and "pop".
Then, there are three possibilities for how the user transitions back from "pop paste" mode to normal mode:
(1) Normal mode is restored by using the same shortcut that is used to turn "pop pate" on.
(2) This mode is turned off automatically when the special copyQ tab is empty (when the last item was popped off).
(3) This mode is turned off automatically if there is a copy after there has been a paste. For example, suppose you turn the mode on, copy 5 elements, (pop) paste 3, and then copy something else.
Any combination of the above three also makes sense.
from copyq.
In v1.8.2 I've implemented shortcuts "Paste and copy next/previous" to paste current clipboard and copy next/previous item in history. This seems to be the simplest solution for now. It's very close to what you describe but every time you need to start popping items you have to open copyq (tray menu or main window) or use "Copy previous item" shortcut and select the item you want to start with.
Having a new special tab when in "pop mode" could be quiet difficult to implement -- right now tabs don't have any properties or flags.
Well, the "pop" tab could be just a normal tab with some fixed name and items could be added with a custom shortcut (ctrl+alt+c
) and paste+removed from the end of the tab with other shortcut (ctrl+alt+v
). So there would be no special tab and no "pop mode".
Unfortunately you'll have to remember to use the shortcut to copy instead of ctrl+c
and you'll have to remove the tab yourself if it's not needed anymore because otherwise the tab would be saved as normal tabs or paste+remove shortcut pastes something unexpected.
from copyq.
Thanks for implementing this. I can't seem to get it to work though. For me, "Paste and copy next" seems to be equivalent to "Copy next item" and same for "previous". Any ideas why the paste isn't getting executed/received? I've had this problem on Ubuntu 12.04 and 13.04.
from copyq.
These new command actually only send Shift+Insert
key press to current window. So this won't work if application don't paste using Shift+Insert
or target window and input widget are not focused yet.
What application is it? Does it work in any app?
Other thing is that the "copy next/previous" can happen before the clipboard is pasted to target app. I've solved it with additional small wait interval after sending Shift+Insert
.
from copyq.
I was testing in Gedit. Shift+Insert works, but the paste from the "Paste and copy next" shortcut does nothing.
In LibreOffice 4.0.2.2 I sometimes get the message "Requested clipboard format is not available." Other than that, it seems to work decently well. It also works well in LyX and Chromium. In any of the applications, it doesn't work well if I execute the shortcut fast -- often the same item is pasted two or three times in a row and skips the others. (Note that I don't have a use case for needing to be able to do it fast; I'm just testing).
In any case, you might have done everything you could. I guess a lot of this depends on the OS and the applications. Thank you for your work on this.
from copyq.
OK, fixed.
Some apps like gedit
ignore sent X11 events -- fortunately there is other way to do this, used e.g. by xdo utility.
You'll need libxtst-dev
package. If you don't have the package installed (or it cannot be found) cmake
will pop a warning and the old way will be used.
So if you can, please test it and close this task if it works well. I hope it will, I hate X11 and especially the API :).
from copyq.
It works great! It is much better than before. Thank you for sticking with this. This is a nice feature that I will use a lot and having to go to the menu to manually click where I want the starting point to be is not a problem for me at all. No more switching back and forth between applications to do mass copying!
I will note one thing (after which I think this can be closed). It sounds like you expect the compile to work if libxtst-dev
is not installed. I tested this and got the following output:
$ cmake .
-- The C compiler identification is GNU 4.7.3
-- The CXX compiler identification is GNU 4.7.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake (found version "4.8.4")
-- Building with Qt 4.
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Building for X11 window system.
CMake Warning at src/platform/x11/x11platform.cmake:10 (message):
X11 'TEST' extension library is needed to be able to automatically paste to
some windows!
Call Stack (most recent call first):
src/platform/platform.cmake:5 (include)
src/CMakeLists.txt:57 (include)
-- Building with ItemWeb plugin.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
X11_XTest_LIB (ADVANCED)
linked by target "copyq" in directory /home/scott/IndependentInstalls/CopyQ/src
-- Configuring incomplete, errors occurred!
from copyq.
Oh, I'll fix that. Thanks for letting me know about this.
from copyq.
If you have problems with shortcuts (e.g. system shortcuts not behaving correctly) let me know. Closing.
from copyq.
You might have told me some other place, but currently cmake fails if libxtst-dev is not installed. A couple of comments up you suggest that this should not be the case. Is the policy now that it is required? I have no problem with this (I actually prefer it) but I just wanted to make sure that it is what you intended.
from copyq.
Can you post the cmake output? I assume the culprit is commit 0a12ba7.
from copyq.
I get the following output
-- Building for X11 window system.
CMake Warning at src/platform/x11/x11platform.cmake:11 (message):
X11 'TEST' extension library is needed to be able to automatically paste to
some windows!
Call Stack (most recent call first):
src/platform/platform.cmake:5 (include)
src/CMakeLists.txt:29 (include)
-- Building with ItemWeb plugin.
I tested the commit before the one you suspect and I still get the error.
from copyq.
That should be just a warning, i.e. it should continue after printing the message. Do you see any other error? Maybe with clean build?
from copyq.
You are right. I suppose I was confused because of the Call Stack output and the only four lines output afterward. But yes, the exit code of cmake is 0. However, when doing a clean build I get:
[ 55%] Building CXX object src/CMakeFiles/copyq.dir/platform/x11/x11platform.cpp.o
/home/scott/IndependentInstalls/CopyQ/src/platform/x11/x11platform.cpp:26:34: fatal error: X11/extensions/XTest.h: No such file or directory
compilation terminated.
make[2]: *** [src/CMakeFiles/copyq.dir/platform/x11/x11platform.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/copyq.dir/all] Error 2
make: *** [all] Error 2
$
from copyq.
Oh, I see. You can just remove the line for now (#include <X11/extensions/XTest.h>
in src/platform/x11/x11platform.cpp
). I'll fix it later today. Thanks for the report.
from copyq.
Sounds good. Actually I prefer to install the package. Also, note that in INSTALL
, libxtst-dev
is not listed as optional.
from copyq.
OK, I've fixed those (using github's internal editor, yay!).
from copyq.
Looks good. I like that you put descriptions for what the optional packages add.
from copyq.
Related Issues (20)
- Encryption not working in copyq: Error: "gpg: agent_genkey failed" HOT 1
- original window gets unfocused when copyq is open HOT 1
- Visual indicators for tabs
- Runtime end of life (EOL) HOT 1
- No tray presence, or output shown on Windows 11, CLI or graphic UI start HOT 3
- How to make the same items not merge automatically after duplication?
- Copyq Hyprland scaling and copy/pasting issues HOT 2
- Clearing clipboard after timeout HOT 6
- Wayland issues on Hyprland with ydotool HOT 7
- How to blacklist file Gtk3 FileOpen dialog HOT 1
- Automatically starting the server HOT 1
- [Feature] Emoji picker + symbols tab
- Hide title bar
- Problem after trying to upgrade copyq on Ubuntu 22.04: requires libqt5waylandclient5 >= 5.14.4 but have 5.15.3-1 and can't get higher HOT 2
- Can someone help me?
- Version 9.0.0 Crash on launch on MacOS HOT 5
- copyq only shows only the reload symbol on start HOT 3
- Main window closes right after opening HOT 2
- Paste in pycharm is unreliable [linux][Focus issue] HOT 2
- v9 and RDP: Remote machine does not see copied items from local machine
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from copyq.