Insert text with hotkey combination
Insert text with hotkey combination
Is there a way to assign a text string to a hot key combination ?
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Give example of what you want to do and in what program or what?
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
- Puppus Dogfellow
- Posts: 1667
- Joined: Tue 08 Jan 2013, 01:39
- Location: nyc
re: Insert text with hotkey combination
Code: Select all
#!/bin/sh
xdotool type ''
Code: Select all
<Key mask="SAC" key="S">exec:(path to your script)</Key>
anyway, the above works--will remember returns and line breaks, too.
the key command is also pretty handy.
http://www.semicomplete.com/projects/xdotool/
xdotool-2.20110530.1-3.pet]xdotool pet i've mirrored
works in every 32 bit pup, i believe, but you may want to check your PPM for a more recent version.
(been a while--can't remember the original source of the file, but i use it all the time, so thanks again...)
after you make your changes to to jwmrc-personal, restart jwm.
Re: Insert text with hotkey combination
Yes.scientist wrote:Is there a way to assign a text string to a hot key combination ?
Re: re: Insert text with hotkey combination
Good one, Puppus.Puppus Dogfellow wrote:Code: Select all
#!/bin/sh xdotool type ''
Just got my first auto-typing command working.
- Puppus Dogfellow
- Posts: 1667
- Joined: Tue 08 Jan 2013, 01:39
- Location: nyc
Re: re: Insert text with hotkey combination
cool. glad to be of help.Bushbuck wrote:Good one, Puppus.Puppus Dogfellow wrote:Code: Select all
#!/bin/sh xdotool type ''
Just got my first auto-typing command working.
- Puppus Dogfellow
- Posts: 1667
- Joined: Tue 08 Jan 2013, 01:39
- Location: nyc
get 11 blank autotext scripts, open them for editing.
requires xdotool. use a launcher like pexec or gexec and/or assign a shortcut key.
you can assign the scripts to keys, but if you think you will have many, it may be better to use a launcher. sample use:
does nothing.
types out:
phick zit
types out:
phi
x z
i
t
---
script is making a template, then making ten copies of it, then setting the perimissions, then opening the blanks. you could also put it directly into jwm,
hth
(tested in a precise derivative.)
----
edit: this one will make an xdotool autotype script:
Code: Select all
echo $'#!/bin/sh
xdotool type \'\'
#Place desired text output between the single quotes above.
#at -- autotext---place in /nwp or a bin. make a series...' > /root/my-applications/bin/at
cd /root/my-applications/bin; for f in at{1..10} ; do cp at $f ; done
chmod 755 /root/my-applications/bin/at1 /root/my-applications/bin/at2 /root/my-applications/bin/at3 /root/my-applications/bin/at4 /root/my-applications/bin/at5 /root/my-applications/bin/at6 /root/my-applications/bin/at7 /root/my-applications/bin/at8 /root/my-applications/bin/at9 /root/my-applications/bin/at10 /root/my-applications/bin/at
you can assign the scripts to keys, but if you think you will have many, it may be better to use a launcher. sample use:
Code: Select all
xdotool type ''
Code: Select all
xdotool type 'phick zit'
phick zit
Code: Select all
xdotool type 'phi
x z
i
t
'
phi
x z
i
t
---
script is making a template, then making ten copies of it, then setting the perimissions, then opening the blanks. you could also put it directly into jwm,
Code: Select all
<Key mask="SAC" key="S">exec:at1</Key>
Code: Select all
<Key mask="SC" key="S">exec:xdotool type 'long, forgettable thing or string'</Key>
hth
(tested in a precise derivative.)
----
edit: this one will make an xdotool autotype script:
Code: Select all
#!/bin/sh
xdotool type "
#!/bin/sh
xdotool type ''
"
#you need the double quotation marks to have the singles from the code show (same thing the $ \ \ in the first script in the post does).
Since xdotool does not work on my system, I found this.
But Ctrl-v does not show the character sequence, it pops up the menu.
How can I see the character sequences?
But Ctrl-v does not show the character sequence, it pops up the menu.
How can I see the character sequences?
Code: Select all
You can determine the character sequence emitted by a key by pressing Ctrl-v at the command line, then pressing the key you're interested in. On my system for F12, I get ^[[24~. The ^[ represents Esc. Different types of terminals or terminal emulators can emit different codes for the same key.
At a Bash prompt you can enter a command like this to enable the key macro so you can try it out.
bind '"\e[24~":"foobar"'
Now, when you press F12, you'll get "foobar" on the command line ready for further editing. If you wanted a keystroke to enter a command immediately, you can add a newline:
bind '"\e[24~":"pwd\n"'
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
I have got xdotool to run.
How would I assign 'test' to Shift F11 ?
How would I assign 'test' to Shift F11 ?
Code: Select all
# <Key mask="SAC" key="S">exec:at1</Key>
bash: syntax error near unexpected token `newline'
<ec:xdotool type 'long, forgettable thing or string'</K
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Letting anger control you ?
[/img]
[/img]
- Attachments
-
- e6StX8.jpg
- (25.52 KiB) Downloaded 277 times
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
You'd need to edit jwmrc.personal. jwmrc might appear to work, but changes will get wiped when you do anything that rebuilds the menu.scientist wrote:I have got xdotool to run.
How would I assign 'test' to Shift F11 ?
If you run xev in a terminal, you can find out what keycodes the keys generate.
It's a good idea to back the file up first, as it's possible to lose the menu if you get the XML wrong.
Xenial Puppy 64, Gigabyte motherboard, Intel i7 4770.
- Puppus Dogfellow
- Posts: 1667
- Joined: Tue 08 Jan 2013, 01:39
- Location: nyc
scientist wrote:I have got xdotool to run.
How would I assign 'test' to Shift F11 ?
Code: Select all
# <Key mask="SAC" key="S">exec:at1</Key> bash: syntax error near unexpected token `newline' <ec:xdotool type 'long, forgettable thing or string'</K
Code: Select all
<Key mask="S" key="F11">exec:at1</Key>
Code: Select all
<Key mask="S" key="F11">exec:/path/to/at1</Key>
jwm -restart.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Puppus, since you are an xdotool expert you may have an idea how to make this tool stable. More than once I get unpredictable results. Example: I made a desktop icon (left in the screenshot) and assigned it Ctrl+Shift+F11 as keyboard shortcut. The icon works nicely when I activate Geany and click on it. However the keyboard shortcut doesn't work. I suspected a timing problem and created a second icon, this time with a 1 sec delay before executing xdotool. This time the keyboard shortcut worked. Reducing the sleep command to something like 0.5 sec. triggers Geany's Replace dialog. Totally unexpected.
- Attachments
-
- xdotool.png
- (43.34 KiB) Downloaded 269 times