Help answer threads with 0 replies.
Go Back > Blogs > linux-related notes
User Name


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Rate this Entry

Openbox keybinding for keyboard "version" of mouse's middle-click paste

Posted 05-08-2021 at 06:34 PM by the dsc
Updated 05-10-2021 at 10:31 AM by the dsc

I thought it already existed natively, but apparently it does not. Maybe it can be done directly on rc.xml's keybindings themselves, but in order to get it to work it seemed easier as a separate one-liner "script":

xdotool getactivewindow windowmap windowraise keyup Alt keyup v type --delay 0 "$(xclip -s primary -o) "
For a "left-alt+v" keybinding, to be set on rc.xml, or whatever it's done in other environments/WMs. I'm not sure all the activewindow windomap windowraise is necessary, but it doesn't seem to make it worse. I thought I needed this sort of thing because I was under the impression it was pasting the mid-click clipboard onto the "nothing," like on .xsession-errors or something, rather than on whatever is selected. But possibly the impression was mostly due to the lack of "keyup," which merged the "alt" with the pasting, issuing multiple other keybindings (when they coincided to exist with the clipboard characters).

It also types a space after the paste, which I think is more often how I end up using it, it's just a matter of removing the space between the parentheses and the closing quote, if that's not useful.

Edit/bugfix: the first version of it didn't have "keyup v," but without it, anything pasted containing v, will have it missing, even if you just press it really fast, not holding it at all. I also added "delay 0," so the typing is faster, not instantaneous, but faster.
Posted in Uncategorized
Views 134 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 01:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration