+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
*nix Thread, bash to GUI in Technical; Ive made a few basic 'frontend' (if you can call them that) bash scripts for some programs that require many ...
  1. #1

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,532
    Thank Post
    1,341
    Thanked 470 Times in 307 Posts
    Blog Entries
    6
    Rep Power
    200

    bash to GUI

    Ive made a few basic 'frontend' (if you can call them that) bash scripts for some programs that require many -flags where it will prompt for each setting, and then run the program based on the user input.

    Similar to the oldschool batch files, which any tom dick and pony could make, there wasnt really a GUI equivelent until AutoIT (as far as I know)

    My question is, is there anything a complete newbie like me can use to make a GUI frontend, that will take the options inserted into fields in a GUI, and then launch an external program populating the various flags with what has been entered into the various boxes in the GUI?

    Hope this makes sense?/

    Cheers

    RB

  2. #2

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,867
    Thank Post
    412
    Thanked 778 Times in 651 Posts
    Rep Power
    182
    Hmm, I don't know if ncurses can do what you're after, it's worth looking at. But I think you'll probably be looking at a more complex language like python and PyGtk, which I think it probably the 'easiest' combination.

  3. #3
    box_l's Avatar
    Join Date
    May 2007
    Location
    Herefordshire
    Posts
    439
    Thank Post
    80
    Thanked 95 Times in 79 Posts
    Rep Power
    63
    try gambas

    Gambas - Gambas Almost Means Basic

    very like visual basic,

    BoX

  4. #4

    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead
    Posts
    18,496
    Thank Post
    526
    Thanked 2,638 Times in 2,042 Posts
    Blog Entries
    24
    Rep Power
    895
    How about building little C Sharp applications with Mono? C Sharp is an easy language to pick up for things like this I'd say.

  5. #5

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,767
    Thank Post
    1,306
    Thanked 803 Times in 697 Posts
    Rep Power
    240
    Quote Originally Posted by RabbieBurns View Post
    is there anything a complete newbie like me can use to make a GUI frontend
    A web page. It's the exact processing model you're after - stick a form on the screen, the user fills it in and hits "submit", the data is sent to a web server and calls the command-line application via system() or whatever. All you need is a small web server to listen out on a port (doesn't have to be port 80). Python has a web server module that lets you write a small web server in about 3 lines of code.

    --
    David Hicks

  6. #6

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,532
    Thank Post
    1,341
    Thanked 470 Times in 307 Posts
    Blog Entries
    6
    Rep Power
    200
    Quote Originally Posted by dhicks View Post
    A web page. It's the exact processing model you're after - stick a form on the screen, the user fills it in and hits "submit", the data is sent to a web server and calls the command-line application via system() or whatever. All you need is a small web server to listen out on a port (doesn't have to be port 80). Python has a web server module that lets you write a small web server in about 3 lines of code.

    --
    David Hicks
    I was imagining something that would be distributable, rather than having to have them run a web server seems a bit complicated. Thanks though.

    building little C Sharp applications with Mono
    and
    gambas
    Im afraid I am going to have to look up as I have no clue.

    Python again I have not dabbled with. But will give it a look.

  7. #7
    Arcath's Avatar
    Join Date
    Feb 2009
    Location
    Lancashire
    Posts
    982
    Thank Post
    103
    Thanked 117 Times in 102 Posts
    Rep Power
    74
    if your using gnome you could allways use "zenity" your script can bring up a series of simple 1 line input boxes.

    Zenity examples

    it basically works by putting "var=$(zenity --entry --text "Does this work")", the users input is now in $var

  8. Thanks to Arcath from:

    RabbieBurns (4th March 2009)

  9. #8

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,767
    Thank Post
    1,306
    Thanked 803 Times in 697 Posts
    Rep Power
    240
    Quote Originally Posted by RabbieBurns View Post
    I was imagining something that would be distributable, rather than having to have them run a web server seems a bit complicated.
    No, Python lets you write a web server in a few lines of code, it's the simples thing ever!

    --
    David Hicks

  10. Thanks to dhicks from:

    RabbieBurns (4th March 2009)

  11. #9
    Arcath's Avatar
    Join Date
    Feb 2009
    Location
    Lancashire
    Posts
    982
    Thank Post
    103
    Thanked 117 Times in 102 Posts
    Rep Power
    74
    Is the machine that will be running the bash script a webserver? if it is write a simple PHP page with a form on it, then take the POST data and do this:

    system("sh /path/to/script/script.sh -flag \"{$_POST['value']}\")

    not sure if using \" will work, or if {$var['var']} will, but you get the idea

  12. #10
    linuxgirlie's Avatar
    Join Date
    Jul 2005
    Location
    Kent
    Posts
    340
    Thank Post
    106
    Thanked 33 Times in 18 Posts
    Rep Power
    32
    Xdialog is a nice simple frontend for bash scripts.

    Xdialog

    That is the website, gives you lots of examples so you can copy and paste (just highlight what one you want and the script appears below), its what we use to use before we went web-based and is really simple.

    Jo

  13. Thanks to linuxgirlie from:

    RabbieBurns (4th March 2009)

  14. #11

    Gatt's Avatar
    Join Date
    Jan 2006
    Posts
    6,819
    Thank Post
    881
    Thanked 685 Times in 454 Posts
    Rep Power
    505
    looking at dialog at the moment for servers without X on them...

  15. #12

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,532
    Thank Post
    1,341
    Thanked 470 Times in 307 Posts
    Blog Entries
    6
    Rep Power
    200
    Thanks, looks the business Ill give that a play tonight

  16. #13

    Join Date
    May 2010
    Posts
    4
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Smile

    Please take a look to my BASH library: EasyBashGUI
    sites.google.com/site/easybashgui

    Goal is making very easy bash "GUI" script creation...
    :-)

  17. #14

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,420
    Thank Post
    644
    Thanked 966 Times in 666 Posts
    Blog Entries
    2
    Rep Power
    328

  18. #15

    Join Date
    May 2010
    Posts
    4
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    With my library:
    it's so easy... (easybashgui)

    You can use indifferently -with same script- dialog, Xdialog, kdialog or zenity. If you want, you can force use one of them, or you can make Easybashgui choose for you.
    In the latter case, it chooses "dialog" if X is not running, or Xdialog, kdialog and zenity are not present in your system, otherwise it chooses "Xdialog", "kdialog" or "zenity" depending on wich D.E. are running script into ( e.g.: KDE, GNOME, or others... ).

    Important point is: all is done with same script, and shell scripter has not to worry about everything .

    Bye



SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. bash script doesnt like folders with spaces
    By RabbieBurns in forum Scripts
    Replies: 20
    Last Post: 12th February 2009, 01:28 PM
  2. batch to bash rewrite help needed please
    By RabbieBurns in forum Scripts
    Replies: 4
    Last Post: 22nd September 2008, 10:05 AM
  3. GUI and some help needed
    By MK-2 in forum Windows
    Replies: 4
    Last Post: 1st March 2007, 06:18 PM
  4. One time runas gui
    By plexer in forum Coding
    Replies: 4
    Last Post: 29th July 2006, 11:36 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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