How can a script ask for user input under X?
January 23, 2009 2:18 AM
Subscribe
What's a good way to make a script pop up an input box under X? Bonus points for blind password entry support and visual integration with XFCE.
I want to make a shell script that requires a small amount of user input --- a username/password pair for an openvpn connection --- that will be launched from a pannel button in XFCE.
I'm looking for a way to pop up an input box, collect the input and return it to my script without going to the trouble of writing a full-blown X application.
I know there are graphical openvpn front-ends out there, as well as ways to store the login credentials, but I keep coming accross this question from time to time and would like to find an reusable solution.
posted by ghost of a past number to computers & internet (3 comments total)
1 user marked this as a favorite
#!/bin/bash
TEXT_ENTRY=`zenity --entry`
echo "You entered $TEXT_ENTRY"
This should be what you need.
posted by DecemberBoy at 2:29 AM on January 23