I'm writing a few little bash scripts under Ubuntu linux. I want to be able to run them from the GUI without needing a terminal window to enter any input or view any output.
So far the only input required is a password for sudo - and gksudo handles that fine. But I haven't found an easy way to show a message box yet. Is there some kind of 'gkmessage' command available? I'd prefer something present in a default Ubuntu install, but I don't mind installing a new package if necessary.
The echo command is one of the most basic and frequently used commands in Linux. The arguments passed to echo are printed to the standard output. echo is commonly used in shell scripts to display a message or output the results of other commands.
In fact, you are able to include GUI (Graphical User Interface) based input/output components into your next bash script using the Zenity command line tool which helps us to display GTK dialog boxes.
If you are using Ubuntu many distros the notify-send
command will throw one of those nice perishable notifications in the top right corner. Like so:
notify-send "My name is bash and I rock da house"
B.e.a.utiful!
I believe Zenity will do what you want. It's specifically designed for displaying GTK dialogs from the command line, and it's available as an Ubuntu package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With