65 lines
4.0 KiB
Plaintext
65 lines
4.0 KiB
Plaintext
|
|
Episode: 323
|
||
|
|
Title: HPR0323: zenity
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0323/hpr0323.mp3
|
||
|
|
Transcribed: 2025-10-07 16:20:23
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
Music
|
||
|
|
Music
|
||
|
|
Music
|
||
|
|
Music
|
||
|
|
Hello, my name is Dave and welcome to another episode of Hacker Public Radio.
|
||
|
|
This episode is coming to you from a parked Honda Civic in a shower of rain.
|
||
|
|
So I'm using an Olympus LS-10 handheld recorder without the headset.
|
||
|
|
So you may hear some ambient rain noise on the roof of the car, so just consider it
|
||
|
|
atmosphere, a little extra bonus for you there.
|
||
|
|
But in today's very brief episode of Hacker Public Radio, I want to talk about Zenity.
|
||
|
|
And if I'm not mistaken, Zenity is part of the standard GNOME desktop and Zenity is a program
|
||
|
|
that will display GTK Plus dialogues and return, either in return code or in standard output.
|
||
|
|
The user's input, and this allows you to present information and ask for information from
|
||
|
|
the user, and you can use this in your bash shell scripts.
|
||
|
|
So that's from the man page, I'm pretty sure, and it's a succinct description of what
|
||
|
|
the program would do.
|
||
|
|
What this means is, is that it's a way to add really quick in your shell scripts, in
|
||
|
|
one or two lines of code, the GTK Plus dialogues that will allow the user to click or to fill
|
||
|
|
in a blank or to select the file or anything like that.
|
||
|
|
So you want to find out more, you can just type man's entity, and you will see a very large
|
||
|
|
number of options, and stuff like dash dash question, or calendar, entry, error, file
|
||
|
|
dash selection, info, list, progress, title, and on most of these, you can then pass some
|
||
|
|
text to that option that, for instance, with title, you can define what you want the
|
||
|
|
title of the GTK Dialog, the window that pops up to be the progress, of course, is the
|
||
|
|
progress dialogue, file selection is the GTK Plus file selection dialogue, entry is, will
|
||
|
|
output, on standard output, with the user typed into the text entry field question, will
|
||
|
|
allow the user to select either cancel or yes, return code of one or zero respectively.
|
||
|
|
So what this allows you to do is to enhance your shell scripts very easily, very quickly,
|
||
|
|
with some GTK Plus dialogues.
|
||
|
|
So if you're not a full-blown programmer of graphical programs, this is a way to look
|
||
|
|
like one, or maybe just feel like one just a little bit, I don't know, I'm not a programmer,
|
||
|
|
but I do write shell scripts that I use every day, and I've not used this, I don't know
|
||
|
|
that I will use it, but some of you may.
|
||
|
|
If you want an example that's probably a far better explanation than I'm giving right
|
||
|
|
now of what Zenith can do, you can go to forms.devion.net, and I could give you the really long
|
||
|
|
ugly URL to a thread in that forum, but instead I will do the title URL version, title URL.com
|
||
|
|
forward slash D7XX5B, and in this thread you will see an 11 line, 12 if you count the
|
||
|
|
Shabang at the beginning, bash shell script that will run at get update.
|
||
|
|
Find out if there are any updates, if there are updates are more than zero, it will, uh,
|
||
|
|
with literally, you know, two lines of Zenith code are really one, and then, well, I guess
|
||
|
|
there's two lines of Zenith code in the middle of this 11 line bash script.
|
||
|
|
It will say, you know, it'll present to you, a GTK Plus dialogue window will pop up that
|
||
|
|
and say as there are this many, there are updates available, there are this many updates
|
||
|
|
available.
|
||
|
|
Do you want to update yes or no?
|
||
|
|
And depending on whether you click yes or no, it'll pass a return code, zero or one
|
||
|
|
in this case, and it will allow you to update your system, so, and you put down a crime
|
||
|
|
job.
|
||
|
|
So that's sort of cool.
|
||
|
|
Maybe you didn't know about Zenith, I didn't know about Zenith, I'm a flux box user,
|
||
|
|
I don't use GNOME that much, but I stumbled upon this and noticed it was part of GNOME,
|
||
|
|
and it seems relatively useful, so if you didn't know about it, there, now you do.
|
||
|
|
If it sounds useful, go use it.
|
||
|
|
If you didn't like this episode of Hacker Putter Radio, do something about it, get off
|
||
|
|
your lazy carcass and record your own.
|
||
|
|
Be a producer of content for Hacker Putter Radio, not just a consumer.
|
||
|
|
Until next, Hacker Putter Radio, episode, this is Dave signing off.
|