0

I'm looking for a scriptable dialog utility for Linux/X11/Wayland that I'd run like this:

$ ask F="Delete all files" D="Launch drones" X="Open images"

and it'd display X11 dialog window similar to this:

(F) Delete all files
(D) Launch drones
(X) Open images

that would disappear either after pressing Escape or after pressing any letter specified (F, D, X). In the first case it'd output nothing and exit with code 1, in the second case it'd output line with the pressed letter and exit with code 0.

I know 9menu or ratmenu. I know I could make one but I hate to mess with available GUI toolkits.

1
  • Several possibilities for that in Unix/Linux. Have a look at Zenity, kdialog, gtkdialog; each is a scriptable command line program for displaying X dialogs with widgets galore. The problem is deciding from all the options of each.
    – P. Heffner
    Jul 25, 2016 at 15:27

1 Answer 1

0

Perhaps Tcl/Tk ( www.tcl.tk ). Tcl is a scripting-language, and the Tk-extension to it lets you make GUIs pretty easily. There are online examples, and it's also mentioned in books like "Running Linux".

(With Tcl you can also get expect, an extension that lets you create scripts that interacts with other programs, and contains challenge-response pairs... eg. the script starts ftp, and when it receives "ogin" and "assword", it responds with your username and password.)

You'll probably find tcl, tk and expect in the repository for your linux-distro.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .