Results 1 to 3 of 3

Thread: Just something ive been pondering

  1. #1
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    1,512
    Distro
    Ubuntu 16.04 Xenial Xerus

    Just something ive been pondering

    Are there gui toolkits that work with bash, ive never thought about it before but can you write a bash script that generates a gui or do you have write a gui into say, python and then send commands to a bash shell from the python script????
    Catch me on Freenode - imark

  2. #2
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Just something ive been pondering

    You can use Zenity to provide simple gui interaction for bash scripts. There's other libraries like this too.

    It's not as capable as gtk in python. Depending on how involved the gui interface needs to be you may be better off using python, which isn't so hard. Python also has the advantage it's pretty much always installed by default.

  3. #3
    Join Date
    Apr 2007
    Location
    (X,Y,Z) = (0,0,0)
    Beans
    3,715

    Re: Just something ive been pondering

    The problem with Bash is that it actually doesn't interface to libraries, but to programs and AFAIK the only data structure it knows are strings. This means that you can't do proper GTK+ or Qt programming in bash: you can't access the data structures and manipulate, say a QtApplication or a GtkWindow instance using the features provided by the Bash language. So, yes, the nearest you can get for GTK+ is Zenity, which is a program that takes some arguments and creates a GUI object according to that argument. But as you see, that GUI object is actually under Zenity's control.

    If you want something like shell scripting language with native GUI capabilities, maybe you should take a look at Tcl/Tk.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •