lince

xcmd

Xcmd is a Perl-tk script based on the possibilities illustrated by widget to provide a GUI to any text command.

When xcmd is runned for the first time it creates (if it dosen't exist) a directory ~/.xcmd where all command setup files should be placed.
Each command setup file has to have the same name as the command itself since xcmd will call us this name in a system call to the command.
Bellow there is a setup command file for the usual lpr command:

# command args setup
# You can write one setup like this for any command you want
# You just have to call xcmd with x[your_command]
# like xlpr stands for calling lpr through xcmd
# you just have to ln -s /usr/local/bin/xcmd xlpr
#
# any xcmd setup will stay in your ~/.xmcd/
# examples
#
#
# ARG TYPES:
# HELP help_option_name DEFAULT yes/no COMMENT user comment
# OPTION option_name DEFAULT yes/no COMMENT user comment
# OPTION_WITH_ARG option_name DEFAULT
# OPTION_WITH_ARG_NO_SPACE option_name DEFAULT
# FILE file_name DEFAULT yes/no/empty
# STRING file_name DEFAULT yes/no/empty
# NUMBER file_name DEFAULT yes/no/empty
OPTION -P DEFAULT yes
OPTION lp DEFAULT yes
OPTION simplex DEFAULT no COMMENT printer one
OPTION duplex DEFAULT no COMMENT printer two
OPTION color DEFAULT no
FILE files DEFAULT
After creating the link in your bin directory
> cd ~/bin
> ln -s /usr/local/bin/xcmd xlpr
the user can either run the command by typing
> xcmd lpr
or
> xlpr
and will get the following windows which are self explaining:

This scipt can be used to create GUIs for any command that can be called form the command prompt line and uses arguments in the normal way. It assumes nothing with respect to way the user passes arguments into his program.

For those interested the most recent version of this simple script can be dowloaded in the deb,rpm or text formats


Pedro Sebastião
Last modified: Wed Nov 24 10:51:22 WET 1999

URL: http://lince.cii.fc.ul.pt/xcmd/xcmd.html