You are not logged in.
I'd like to setup a hot-key [Ctrl-Shift-1] that pastes "me@domain" into the currently focused client
So far...
awful.key({ "Control", "Shift" }, "1", function() awful.spawn.with_shell("echo me@domain | xsel -i -b") end,
{description = "Auto Typer - 1", group = "hotkeys"}),That works but then I need to also press "Ctrl-V" but I'd rather not need the extra action
I've also tried many other ideas that seem to work in the shell but just don't from awful.key / xdotool seems close but often doesn't do the first chars)...
awful.key({ "Control", "Shift" }, "2", function() awful.spawn.with_shell("echo me@domain | xsel -i -b && xsel -o -b") end,
awful.key({ "Control", "Shift" }, "3", function() awful.spawn.with_shell("echo me@domain | xsel -i -b && xsel -o -b -n") end,
awful.key({ "Control", "Shift" }, "4", function() awful.spawn.with_shell("echo me@domain | xsel -i -b -n && xsel -o -b -n") end,
awful.key({ "Control", "Shift" }, "5", function() awful.spawn.with_shell("echo me@domain | xclip -selection c && xclip -o") end,
awful.key({ "Control", "Shift" }, "6", function() awful.spawn.with_shell("xdotool key --delay 100 m e shift+2 d o m a i n") end,
awful.key({ "Control", "Shift" }, "7", function() awful.spawn.with_shell("xdotool type --delay 100 me@domain") end,
awful.key({ "Control", "Shift" }, "8",function() awful.spawn.with_shell("(echo me@domain | xsel -n -i -b) & xdotool key control+v") end,
awful.key({ "Control", "Shift" }, "9",function() awful.spawn.with_shell(" echo me@domain | xsel -i -b")
root.fake_input( "key_press", 37 )
root.fake_input( "key_press", 55 )
root.fake_input( "key_release", 55 )
root.fake_input( "key_release", 37 )
end,Last edited by Sorky (2018-10-17 10:48:32)
Offline
Bump...
Any comments on getting "root.fake_input" working?
Any comments on getting "xsel -o -b" working?
Any comments on getting "xdotool" working properly?
Offline
Do not do that: https://wiki.archlinux.org/index.php/Co … ct#Bumping
Offline
Forget xsel, that will never do what you want it to.
Any comments on getting "xsel -o -b" working?
It *is* most likely working. That command prints the content of the clipboard selection to stdout - so it most likely when to the controlling tty or a xorg or awesomewm log. Sending something to stdout doesn't emulate x11 key presses.
Xdotool should work, but I know nothing about awesomewm's key bindings. Are you sure your key binding is even working? Test that first. Are you sure the input box or text field remains focused after awesomewm catches a grabbed key event? Have you tested the xdotool command directly (e.g., from a terminal emulator)?
EDIT: ah, I see you noted that xdotool mostly works. If it is missing the first characters, it may be due to awesomewm not returning focus to the input field soon enough. Add a sleep command or even better xdotools equivalent delay before the keys are sent.
Last edited by Trilby (2018-10-16 14:11:44)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
EDIT: ah, I see you noted that xdotool mostly works. If it is missing the first characters, it may be due to awesomewm not returning focus to the input field soon enough. Add a sleep command or even better xdotools equivalent delay before the keys are sent.
Yeah - And I used the --delay
But you are a star!
Doing Sleep 0.1; then xdotool was perfect!
Last edited by Sorky (2018-10-17 10:50:12)
Offline
Depending what you're trying to do, keepass' autotype functionality has been useful for me (single key activation, and content depends on window title, multiple matches need to be selected by user before typing commences). That's mainly because I already use it for passwords, and have found it helpful for other repetitive typing.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
keepass' autotype functionality has been useful for me (single key activation, and content depends on window title
Nice suggestion! Particularly the "depends on windows title" - Might try that!
I found this note: KeePass — A cross-platform password manager that has autotype and clipboard support when respectively xdotool and xsel are installed.
Seems that xdotool was the right choice for autotype functionality ;-)
Offline