linux, X11, dialog menu with items

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.

sqxmn

Posted 2016-07-24T01:51:57.890

Reputation: 11

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 – 2016-07-25T15:27:40.893

Answers

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.

Baard Kopperud

Posted 2016-07-24T01:51:57.890

Reputation: 136