Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xdotool doesn't know about --file #17

Closed
bascht opened this issue Aug 27, 2015 · 7 comments
Closed

xdotool doesn't know about --file #17

bascht opened this issue Aug 27, 2015 · 7 comments

Comments

@bascht
Copy link
Contributor

bascht commented Aug 27, 2015

I searched the other issues & I couldn't find anything similar: xdotool won't accept the --file parameter:

$ echo "foo" | xdotool type --clearmodifiers --file -
type: unrecognized option '--file'
Usage: type [--window windowid] [--delay milliseconds] <things to type>
--window <windowid>    - specify a window to send keys to
--delay <milliseconds> - delay between keystrokes
--clearmodifiers       - reset active modifiers (alt, etc) while typing
--args N  - how many arguments to expect in the exec command. This is
            useful for ending an exec and continuing with more xdotool
            commands
--terminator TERM - similar to --args, specifies a terminator that
                    marks the end of 'exec' arguments. This is useful
                    for continuing with more xdotool commands.
-h, --help             - show this help output

It would work with either

$ echo -n type --clearmodifiers "foo" | xdotool - 
foo

or

$ xdotool type --clearmodifiers foo
foo

Using xdotool version 2.20110530.1 (the one Fedora 22 ships) + rofi-pass b01d40c.

bascht added a commit to bascht/rofi-pass that referenced this issue Aug 27, 2015
@bascht
Copy link
Contributor Author

bascht commented Aug 27, 2015

(atm I'm using my patched up version in https://github.com/carnager/rofi-pass/compare/carnager:master...bascht:issues/17?expand=1) ;)

@carnager
Copy link
Owner

  • I have xdotool 3.20150503.1, which is the only supported upstream version. They don't even offer older versions as release tarballs anymore. The version fedora uses is 4 years old. Time to update.
  • your patch will show the password in process managers, which is a no-go
  • Your first suggestion seems to work, but it leaves garbage on stdout:

Original command:

carnager@caprica ~ > echo "foo" | xdotool type --clearmodifiers --file -
foo

Your suggestion:

carnager@caprica ~ > echo -n type --clearmodifiers "foo" | xdotool - 
foo%  

@bascht
Copy link
Contributor Author

bascht commented Aug 29, 2015

Good grief. That's really embarrassing - even Debian ships a newer version. 😊 But xdotool ships in a great variety for all kinds of distributions: http://pkgs.org/search/xdotool :) I've installed the the 3.20150503.1 tag from source to reproduce it and that % isn't garbage, but a missing line feed.

If you trace the Key events, you'll see that the original command will send a Return:

KeyPress event, serial 58, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 4389109, (180,176), root:(2730,1127),
    state 0x10, keycode 41 (keysym 0x66, f), same_screen YES,
    XLookupString gives 1 bytes: (66) "f"
    XmbLookupString gives 1 bytes: (66) "f"
    XFilterEvent returns: False

KeyRelease event, serial 59, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 4389113, (180,176), root:(2730,1127),
    state 0x10, keycode 41 (keysym 0x66, f), same_screen YES,
    XLookupString gives 1 bytes: (66) "f"
    XFilterEvent returns: False

KeyPress event, serial 59, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 4389116, (180,176), root:(2730,1127),
    state 0x10, keycode 32 (keysym 0x6f, o), same_screen YES,
    XLookupString gives 1 bytes: (6f) "o"
    XmbLookupString gives 1 bytes: (6f) "o"
    XFilterEvent returns: False

KeyRelease event, serial 59, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 4389119, (180,176), root:(2730,1127),
    state 0x10, keycode 32 (keysym 0x6f, o), same_screen YES,
    XLookupString gives 1 bytes: (6f) "o"
    XFilterEvent returns: False

KeyPress event, serial 59, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 4389122, (180,176), root:(2730,1127),
    state 0x10, keycode 32 (keysym 0x6f, o), same_screen YES,
    XLookupString gives 1 bytes: (6f) "o"
    XmbLookupString gives 1 bytes: (6f) "o"
    XFilterEvent returns: False

KeyRelease event, serial 59, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 4389125, (180,176), root:(2730,1127),
    state 0x10, keycode 32 (keysym 0x6f, o), same_screen YES,
    XLookupString gives 1 bytes: (6f) "o"
    XFilterEvent returns: False

KeyPress event, serial 59, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 4389128, (180,176), root:(2730,1127),
    state 0x10, keycode 109 (keysym 0xff0a, Linefeed), same_screen YES,
    XLookupString gives 1 bytes: (0a) "
"
    XmbLookupString gives 1 bytes: (0a) "
"
    XFilterEvent returns: False

KeyRelease event, serial 59, synthetic NO, window 0x1e00001,
    root 0xd6, subw 0x0, time 4389131, (180,176), root:(2730,1127),
    state 0x10, keycode 109 (keysym 0xff0a, Linefeed), same_screen YES,
    XLookupString gives 1 bytes: (0a) "
"
    XFilterEvent returns: False

Maybe we can use the second command, wrap it in a function and send a separate KP_Enter?

@carnager
Copy link
Owner

ah! actually i remember now, why i did it the way i did. the other command does not work with spaces.

carnager@caprica ~ >  echo -n type --clearmodifiers "foo bar" | xdotool - 
foobar% 

see jordansissel/xdotool#72

you will see that the official passmenu uses the same method for the same reason
zx2c4/password-store@87ec148

@bascht
Copy link
Contributor Author

bascht commented Aug 29, 2015

Makes sense. Now that I have both versions I could try to work on a wrapper. Might have some time next week. :)

@carnager
Copy link
Owner

Seriously, the best thing to do here is to mark the fedora xdotool package as outdated and move on :)

@bascht
Copy link
Contributor Author

bascht commented Aug 31, 2015

sigh You might be right. I'll probably forget that I still have this package installed manually and leave this issue here for future me. :) Anyways, thanks for looking into it!

@bascht bascht closed this as completed Aug 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants