You are not logged in.
i recently found out that the keyboard shortcut shift+ins can be used to paste the primary X selection. Where can i set a different shortcut to paste the selection? or do i have remap the desired combination to shift+ins?
ccc1
Last edited by ccc1 (2013-03-25 17:20:30)
Offline
You have to remap. If you take the other route you end up having an application "type" the contents which hardly ever does what you want.
.xbindkeysrc example:
"xdotool click 2"
control+F1
"xsel -x; xsel -b | xsel -i; xdotool click 2; xsel -x"
control+F2
The second one is for control+v replacement (in terminals for example)
Offline
cheers
Edit: the xbindkeys solution works fine in the terminal, but not in firefox for example.
Last edited by ccc1 (2009-12-26 09:39:46)
Offline
Yeah it's not very solid, you could try xdotool key --clearmodifiers Shift+Insert, but I find that works less well, and also note that when the mouse is out of the text field, middle clicking doesn't paste either (same for pressing shift+insert when the mouse isn't over the terminal).
Offline
Yeah it's not very solid, you could try xdotool key --clearmodifiers Shift+Insert, but I find that works less well, and also note that when the mouse is out of the text field, middle clicking doesn't paste either (same for pressing shift+insert when the mouse isn't over the terminal).
i already tried the "xdotool key Shift+Insert" variant and it is, as you said, pretty unreliable. one has to press the keyboard shortcut 5 times to paste. the most elegant solution would be of course to hack the X source code, but i have no idea where the shortcut is defined and if i want to recompile X everytime the version is bumped
Offline
You could try the paste character-by-character approach. It won't work with unicode, but I just read some people really like it:
"sleep 0.1; xdotool type --delay 2 --clearmodifiers "$(xsel -o -p)""
Control + F1
"sleep 0.1; xdotool type --delay 2 --clearmodifiers "$(xsel -o -b)""
Control + F2
You need a --delay that isn't 0, --clearmodifiers and a sleep (because --clearmodifiers doesn't really work that well, you have to release the Control key in the 0.1 seconds)
And changing the binding actually needs a hack for GTK / QT / and all applications that use xlib raw, so it's quite impossible and shows how rooted in these shortcuts are.
Offline
This is an old thread, but does this perhaps work for you? It seems to be solid for me.
Offline
This is an old thread, but does this perhaps work for you? It seems to be solid for me.
Thanks, just read your answer! This works great
The new link to the solution: https://wiki.archlinux.org/index.php/Ke … tion-Paste
clcl
Offline