Index
xpaste
#xpaste can be used for copying text into an IPMI console or really anything else. This should/will work on basically any application.Running the alias will wait for you to click a window at which point it will enter the contents of the clipboard into that window
alias xpaste='xdotool windowactivate $(xdotool selectwindow); xdotool type --clearmodifiers --delay 100 "$(xclip -o)"'
This version only will work with IPMI console windows (intentionally) as it will automatically select the window and paste the contents of your clipboard :-) w/o any other interaction except selecting the window again and hitting enter just like you typed all that in.
alias xpaste='xdotool windowactivate $(xdotool search --name "Java iKVM Viewer"); xdotool type --clearmodifiers --delay 100 "$(xclip -o)"'
Want it to press enter as well after the text is entered? The following will do just that. The end "xdotool key Return" tells it to press the Enter/Return key
alias xpaste='xdotool windowactivate $(xdotool search --name "Java iKVM Viewer"); xdotool type "$(xclip -o)"; xdotool key Return'
Install dependencies
archlinux/manjaro
sudo pacman -S xdotool xclip
OR
yaourt -S xdotool xclip
Other OS? Probably similar package names
Ubunutu - should be
sudo apt install xdotool xclip
Tested thus far on Gentoo, and Manjaro
FYI:
For testing I used the following which I pasted into IPMI to set the timing for a generally slow server. If that is missing letters or words in your testing increase the delay by 25-50 ms at a time from the 100 above.
"Attempt to grab the mouse failed. Something already has the mouse grabbed. This can happen if you are dragging something or if there is a popup currently shown"