This isn’t specifically Rocky related but I can’t find any mention of this in regard to any other distribution either.
I have a Microsoft Natural 4000 keyboard which has a whole bunch of non-standard keys including a row of five across the top that’s called “My Favorites”. They don’t do anything in particular and it occurs to me that it would be convenient when filling out forms to assign those keys to type a string when I press one of them. For example, I could have one that types my name and another that types my email address.
Does anyone know how to tell those keys to write out a particular string when pressed?
(Rocky 8 with Mate desktop if that makes a difference.)
Thanks!
On quick search this was closest: shortcut keys - macro to paste pre-configured text - Ask Ubuntu
[EDIT]: The EPEL has ‘xclip’ and ‘xdotool’, but not the ‘ydotool’. Fedora has the latter – rebuild from its src.rpm might be possible.
I actually used xdotool some months ago to automatically create and save screenshots of a series of graphics that I needed to save a while back. It’s slick as all get-out.
Thanks! I haven’t tried this yet but it sure looks like it’ll get me where I want to go.
I’ve got this to work with just a slight alteration in the method describe above.
Here is my email-address-paste script:
#!/bin/bash
TEXT="example@example.com"
xdotool sleep 0.5 type $TEXT
Note: It needs the sleep in there or you only get the last half of the email address typed when you press the hotkey.
Then system-preferences-hardware-keyboard shortcuts
Create new shortcut
Point to that script
Press the key you want to call it from.
Done.
1 Like