Re: Zsh + GUI
From: Chris F.A. Johnson (cfajohnson_at_gmail.com)
Date: Thu, 7 Jul 2005 00:54:30 -0400
On 2005-07-06, William Park wrote:
> email@example.com <firstname.lastname@example.org> wrote:
>> Maybe not quite what you are looking for (I'm not sure what you would
>> consider to be "marketable"), but you may want to have a look at
>> SATSHELL (www.satisoft.com/satshell). This is a utility to create GUI
>> interfaces for shell scripts (ksh, bash etc.).
>> I'll be releasing a new version shortly which has some small
>> enhancements, such as automatically repeating actions and the option to
>> associate an action with a picklist selection.
> Thanks Adrian. It's not what I'm looking for, but it got me
> re-thinking. Both TKsh and SATSHELL are killing the shell script
> writers with details. I'm leaning towards some sort of interface to
> GTK+, at the moment. Ultimate goal is to eliminate external programs
> (web server, browser, dialog, Xdialog, etc.) and interact directly with
> the user.
The last thing I want in a GUI shell interface is widgets, with the
possible exception of a string entry widget.
What I need is the ability to open a window, draw lines,
rectangles, etc., set a font and write text (including an interface
to the XTextWidth function), receive keypresses and mouse clicks
One of the uses I have is for creating crossword puzzles. The grids
normally contain 225 squares; I sure as hell don't want to create
225 widgets to do something that I can do with a few lines of code.
If I have the mouse co-ordinates, I can easily calculate which
square was clicked, with vastly less overhead than with a widget. I
do it already, using the mouse in an xterm window.
In my article at UnixReview.com, I present a shell script which
prints buttons on the screen and performs actions when one is
pressed. Adding a button and associating an action with it requires
an added label as argument to a function call and a single line of
script to perform the action.
The article ends with the instructions to add another button to the
script, and clear the screen when it is pressed. All it involves
print_buttons "$mv_str" "Exit"
print_buttons "$mv_str" "Clear" "Exit"
2) break ;;
2) clear ;;
3) break ;;
No widget interface is going to be that simple.
The article is at:
and the script at:
-- Chris F.A. Johnson <http://cfaj.freeshell.org> ================================================================== Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress <http://www.torfree.net/~chris/books/cfaj/ssr.html>