How to use Zenity with examples

We look into how to use Zenity, showing some examples. Zenity is a graphical tool for your scripting that shows dialog boxes on the GUI and returns the result from Zenity back to your script.
Join the Google Cloud-led certificate program on Coursera and dive into security principles in cloud computing. Master cloud risk management and attack mitigation techniques. Equip yourself with cutting-edge cybersecurity skills.
imp.i384100.net/c/3402234/209...
Get Proficient knowledge in Azure services and infrastructures, managing cloud resources, cloud security with our Cloud Support Associate Certificate !
imp.i384100.net/c/3402234/203...
Join the channel to get access to more perks:
/ @danielpersson
Or visit my blog at:
danielpersson.dev
Outro music: Sanaas Scylla
#zenity #examples #xorg

Пікірлер: 16

  • @aaronperl
    @aaronperl2 жыл бұрын

    Ooh, nice. Reminds me of an updated "dialog" tool. I never had much luck working with the dialog tool (too much redirection of input and output streams), but hopefully zenity will be easier to manage. I'll have to remember this for my shell scripts. I was always impressed that the Slackware installer was written using dialog, after all the trouble I had getting it to do useful things :)

  • @BlazeYT_
    @BlazeYT_ Жыл бұрын

    As an average dialog bash developer I'm amazed what zenity can do. Plus some functions on zenity don't require exec stdin and stdout (3>&1 2>&1 1>&3) (at least for now, I haven't gone deep through the zenity hole yet) Although I noticed the question yes no input which dialog thinks yes is 0 and zenity thinks the opposite is quite uncomfortable at least for me atm Also whiptail sucks

  • @fabiano8888
    @fabiano88885 ай бұрын

    That's pretty cool! The problem is that it will randomly pop up in a different position of my screen every time I run it. Does anyone know how to fix it?

  • @DanielPersson

    @DanielPersson

    5 ай бұрын

    Hi Fabian. Sadly that is up to your Window Manager as it Manages Windows :) I've seen a couple of examples where you could tell a particular manager to open windows of a program in a particular position but sadly there is no silver bullet here. Thank you for watching my videos. Best regards Daniel

  • @fabiano8888

    @fabiano8888

    5 ай бұрын

    @@DanielPerssonHi, Daniel. Thanks for the awesome video and for commenting back. I forgot to mention that I was using WLS. After trying the same on a native Linux distro, it worked just fine. :)

  • @user-rp1du4fs4v
    @user-rp1du4fs4v10 ай бұрын

    Hi, is there an similar tool as zenity for MacOS?

  • @DanielPersson

    @DanielPersson

    10 ай бұрын

    Hi Simone I don't run any machines with MacOS but I guess there might be as it's a pretty useful tool. I would give it a search but I've never needed it so never looked. Thank you for watching my videos. Best regards Daniel

  • @zineb4466
    @zineb44662 жыл бұрын

    Hello, i have a question. What command can i use if the user clicked on the cancel button and it must show a window with a message?

  • @DanielPersson

    @DanielPersson

    2 жыл бұрын

    Hi Zineb. Depending on which dialog you are showing, they should return an error code, and the error code is > 0 in case of a cancellation. Otherwise, if you want to build some more extensive logic, I would probably create something native instead. I hope this helps. Thank you for watching my videos. Best regards Daniel

  • @Turjak_art
    @Turjak_art Жыл бұрын

    How get the result of zenity --question --text="Are you OK?" pops up a dialog but where is the output? After pressing YES my terminal stays blank

  • @DanielPersson

    @DanielPersson

    Жыл бұрын

    Hi Tujak You need to look at the return code of the program. My guess it's 1 for yes and 0 for no. I hope this helps. Thank you for watching my videos. Best regards Daniel

  • @suchintonchakravarty3638
    @suchintonchakravarty36382 жыл бұрын

    Hi, I need a little bit of help...... I'm trying to write a bash script using zenity -password by assigning it a variable PASSWD but when I try to pipe it to a sudo command it says incorrect password attempt.... can somebody help? PASSWD= "$(zenity --password --title="Authentication")" echo $PASSWD | sudo -S mv $name.xml /usr/share/gnome-background-properties/

  • @DanielPersson

    @DanielPersson

    2 жыл бұрын

    Hi suchinton I would try debugging this issue by typing out the string to the console and look at it. Think about if there is any special characters that might require escaping or quotes. And they try entering the password manually via echo and pipe. And if all of that works then I don't really know what the problem is and it might be an implementation issue that you need to report to the zenity team. I hope this helps. Thank you for watching my videos. Best regards Daniel