Linux Blog

Graphical Shell Scripting

Filed under: Shell Script Sundays — at 4:07 pm on Sunday, December 16, 2007

From all of my other previous shell scripting articles you can see that shell scripting is a very good way to get a task done or to automate. This is great but some times a little bit of that three letter acronym “GUI” is a nice touch. Well my friends, if you’ve been reading my articles and following my dialog examples then you are in luck. If not don’t worry, you can view all of the articles in the Shell Script section to the right.

The program to make your GUI’s for your shell scripts is the exact same thing as dialog except its graphical. Its called Xdialog. Once installed you basically use it the same way as dialog. If your thinking about upgrading a script thats written in dialog you might want to think twice because some window managers will display the windows differently.

Check out these Xdialog examples and corresponding screenshots:

Xdialog -yesno "Do you like Xdialog?" 5 50 && echo "Thats nice" || echo "Yea, some times its better to stick to CLI"

Xdialog ExampleXdialog Example

Man Pages for commands in this post »




Comment by Kaleb Porer

December 17, 2007 @ 1:21 am

yes extreamly good to know ive spent counless hours on shell scripts and to make a nice pretty gui for one of them would be fantastic

thanks a lot

Comment by anarchy1

November 17, 2010 @ 12:55 am

this is a good little tool thanks for showing the world..

but don’t forget the good old dialog command in bash this is pretty usefull as it also works over ssh
!even on windows! the only real difference is that dialog only colors the bash shell and draws some simple boxes on the shell but dont kick it it does a lot more than that
try this for size

# First shell script with "dialog"
dialog --title "Dialog message box" \
--msgbox "\n Hello world !" 6 25

save it as “”
then execute with “sh”
afterwords fire up “man dialog” in a shell and get learning…

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>