Skip to content

[FR] option to read password with termux-api? #3

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

Closed
dezifit opened this issue Oct 26, 2015 · 5 comments
Closed

[FR] option to read password with termux-api? #3

dezifit opened this issue Oct 26, 2015 · 5 comments

Comments

@dezifit
Copy link

dezifit commented Oct 26, 2015

I'm new to termux (very nice package and Android interaction concept!) and tried to use termux-api to query a password from a script, but termux-dialog seems to be rather limited so far.

Do you think it makes sense and is possible to add such an option, for example to perform encfs or sshfs mounts controlled by scripts?

@fornwall
Copy link
Member

Thanks, I think that makes sense!

So would a -p,--password option which would set the input type to password work?

@dezifit
Copy link
Author

dezifit commented Oct 26, 2015

Yes, that would be excellent!

Maybe another option "-t" to specify a title (usefull for all kinds of dialogs)? Intended usage:
pw=termux-dialog -t "Please enter your password" -p

@sm4rk0
Copy link

sm4rk0 commented Oct 26, 2015

Sorry for being slightly off-topic.
@dezifit I suppose you wrote this:

pw=`termux-dialog -t "Please enter your password" -p`

But markdown formatting messed it.

See What is the benefit of using $() instead of backticks in shell scripts.

fornwall added a commit to termux/termux-packages that referenced this issue Oct 27, 2015
fornwall added a commit to termux/termux-api that referenced this issue Oct 27, 2015
@fornwall
Copy link
Member

@dezifit I've added the following options:

  • -m, --multiple-lines → Use input with multiple lines (single line being the new default)
  • -p, --password → Enter the input as a password
  • -t, --title <title> → The title to show for the input prompt

Let me know if there are any problems!

You have to apt update && apt upgrade to get the updated termux-api package (version 0.9), as well as wait for the corresponding 0.5 update of the Termux:API app to be installed from the Play Store as an update (it should be available in a couple of hours max).

@dezifit
Copy link
Author

dezifit commented Oct 27, 2015

Perfect, problem solved in amazing speed. Works like a charm, thanks a lot!

@sm4rk0
Yep, you're right (altough I stick with the backticks, as they are working almost everywhere)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants