Closed mil-ad closed 4 years ago
Hi there! Please maintain backwards compatibility of options :-)
It's also not acceptable to make xdotool mandatory, sorry. Please see how we already handle similar cases elsewhere.
The comments in #129 also go over other requirements.
Closing without prejudice due to lack of response to feedback.
I wouldn't do this in clipmenu itself. You should be able to assign this to however you launch clipmenu in your WM or DE. For XMonad, I linked the following to my desired keybinding:
spawn "clipmenu && xdotool key Ctrl+v"
Replace "Ctrl+v" with whichever key binding you use for pasting.
Thanks! ... && xdotool key Ctrl+v
works flawlessly! I use xdotool anyway for various scripts.
For case of interesting - text typing works with xdotool type ...
, just needs '\r' replaced with '\r'. Though it may cause strange problem after use - when I did it against leafpad editor, it did not react to more key presses for short time, also Ctrl+Backspace did not work few times, when I used it to delete pasted text.
I'm experimenting with clipmenu, trying to extend its own rofi-script mode with some operations. Of course, not sure if they are necessary to be right in that file.
This is snippet from case $ROFI_RETV
block (in this case assigned to 2nd custom command):
11) chosen_line="$1"
sed -E 's|(["\$])|\\\1|g
s|$|\r|
1s/^/xdotool type --clearmodifiers --delay 20 -- "/
$s/$/"/' \
< "${cache_dir}/$(printf '%s\n' "$chosen_line" | cksum)" | sh >/dev/null &
exit;
Sure, 3rd mouse button simulation would be also useful. Or even more reliable (if any text is placed to selection - mouse paste works in far more cases).
Update: simulation of mid mouse button click seems even harder to work. If runing from shell, it works fine. From clipmenu it's same only with sleep 1
prepended, otherwise - when I tried with leafpad, it either minimized or just went back in stack. Small sleep time, like 0.1 was not enough to prevent this behavior.
This allows pasting directly in other non-terminal programs. For example a browser's address bar.