A versatile graphical DSL and army knife to make and modify GUIs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Francesco Palumbo c9c98bdbb5 added textblock element (similar to editor but without some methods and readonly), refactored autostuff 6 months ago
examples fixed issues, refactored some sourcedriver/parser logic, improved 8 months ago
helper from version 0.2-alpha licese changes from MIT to GPL3, refactoring and improvements, removed some examples, now "use" special command data mode is limited to a single command only 10 months ago
man new version 1.0.6: added conditionals, if & else commands, added shell command exit status substitution syntax through brackets "[]", modified syntax files, updated man page 6 months ago
screenshots Splitted syntaxes in different headers by lang, remove README, added README.md with screenshots, minor refator of syntax class to include descriptions, initial code for another help system with -d option 11 months ago
src added textblock element (similar to editor but without some methods and readonly), refactored autostuff 6 months ago
syntaxes added textblock element (similar to editor but without some methods and readonly), refactored autostuff 6 months ago
.gitignore refactored parser/evaluator to use vectors of tokens instead of strings ones, now it is possible to avoid using eval to define a variable that has a shellsub expression as value (becouse shellsub now happens in the evaluator instead of in the lexer, fix aliases listing 8 months ago
COPYING from version 0.2-alpha licese changes from MIT to GPL3, refactoring and improvements, removed some examples, now "use" special command data mode is limited to a single command only 10 months ago
Makefile.am added textblock element (similar to editor but without some methods and readonly), refactored autostuff 6 months ago
Makefile.in added textblock element (similar to editor but without some methods and readonly), refactored autostuff 6 months ago
README.md removed old url 7 months ago
changelog added textblock element (similar to editor but without some methods and readonly), refactored autostuff 6 months ago
compile beta8 9 months ago
configure added textblock element (similar to editor but without some methods and readonly), refactored autostuff 6 months ago
configure.ac added textblock element (similar to editor but without some methods and readonly), refactored autostuff 6 months ago
depcomp beta8 9 months ago
install-sh fixed tty fallback when switching from file source 6 months ago
missing beta8 9 months ago

README.md

guish - a versatile, simple DSL and army knife to make and modify GUIs (optionally using XEmbed)

Description

guish is a GUI creation and modification tool that can be used to tie different programs together using XEmbed protocol and the shell (or as standalone) to create new programs, or to make simple GUIs.

It makes possible to control graphical elements using the shell, and allows to decouple the driving logic from the GUI.

The logic can be expressed by using plain shell code (or embedding it inside guish with some special syntax)

To view available elements do:

guish -l

To view available commands, events and signals for an element do:

guish -d

To view commands, events, signals and special syntax common to all elements do:

guish -a

Usage examples (please see the examples in examples directory)

Try guish in raw mode as a command interpreter:

    rlwrap guish
    button settext ok
    style {
        background:blue;
    }
     ...
    quit

Use guish in raw mode to make a button that launch free program:

echo 'button settext mem style "background:red;"' undecorate | guish | (
     while read -r input
     do
         set -- $input
         test "$2" = clicked && free
     done
)

Same as above, but uses the new events system:

    echo button settext mem on clicked run free | guish -qnc

Same as above, but use command line arguments:

    guish -qnc 'button settext mem on clicked run free'

Same as above, but use an english-like syntax:

    guish 'make a button, and when it`s clicked run free'

Same as above, but use an italian-like syntax:

    guish -t it.syntax 'crea un bottone, e quando vien cliccato esegui free'

Demo screenshots

Reuse xterm program to create a mini-splitted term (see splitterm.sh example)

SplitTerm

Same but with toggled orientation

splitter_toggled

A mini-browser (standalone mode with English-like DSL)

#!/usr/local/bin/guish -conqimzf

Make a button named b, 
    filling it with '<-',
    and styling it with '
        max-width: 40px;
        background: magenta;
    '

Then, make a button named f,
    fill it with '->',
    and style it with '
        max-width: 40px;
        background: magenta;
    '

Create an input, and call it urlbar.

Then make a page named toolbar, 
    and stylize it with '
        #toolbar { 
            min-height: 30px;
            max-height: 30px; 
        }
    '
    Make it embed b
    Make it embed urlbar
    Make it embed f

Create a webpage named w, with images, private, and with javascript.

Make a page named main entitled MiniBrowser
    and make it vertical
    and make it embed toolbar
    and make it embed w

Center it
    Show it

When w link is clicked 'fill urlbar with "@1"'
    When urlbar is return pressed 'use urlbar to load w'
        When b is clicked 'w back, use w to fill urlbar'
            When f is clicked 'w forward, use w to fill urlbar'

And its screenshot

MiniBrowser

Building and installing

    git clone https://codeberg.org/phranz/guish
    cd guish
    ./configure --enable-webkit
    make
    sudo make install

By default xtest is enabled to support xembedded application control (with keyboard)

Please see configure options to know more:

./configure --help

Documentation

For more details on syntax and other stuff, please refer to the manual page.

License

GPL3 (see COPYING)