Questions tagged [zenity]

Zenity is a program often used in scripts to display graphical boxes that very often prompt for user input. It is a rewrite of the old, but still used gdialog program, and has a 'gdialog wrapper script' so that it can be used in older scripts.

Zenity can be experimented with from the command line, and various formulaes tested; the simplest being something like:

zenity --entry 

which brings up a simple text entry box for the user to input a value which is then echoed to the terminal.

In scripts of all types (and not just bash or sh), it can be used for quite complex purposes. At sourceforge there is a site which holds a collection of user Nautilus scripts that make use of zenity's capabilities. A script by Martin Langasek, for example, uses zenity to prompt the user for a password when encrypting and decrypting files. It is available in the collection there.

For more information, see man zenity, or the Ubuntu man pages online.

121 questions
24
votes
4 answers

error message when running zenity under 16.04: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged

Under ubuntu 16.04 I get the following message Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged when I open zenity with the command zenity --text-info --filename= This didn't happen under 14.04. I…
Leo Simon
  • 1,549
22
votes
1 answer

How can I create a wget GUI with multiple progress bars?

I'm writing my own script to download multiple items (simultaneously, one item per command) using wget and I need a progress bar. I currently utilize zenity --progress for my progress bars, but the problem is it spawns multiple progress bars when…
13
votes
4 answers

Zenity and text formating

I just discovered that zenity support html tags. zenity --error --text "hello <b>world</b>" but how to make it work with entry type ? zenity --entry --text "hello <b>world</b>" It's printing tags instead of interpreting…
13
votes
3 answers

How to call zenity from cron script?

Example script error.sh: #! /bin/bash zenity --error --text='Something very bad has happened!' My incron-config: ~/Documents IN_MOVED_TO ~/scripts/error.sh If I run error.sh in terminal GUI dialog pops, but not in above incron scenario. How…
zetah
  • 9,871
13
votes
5 answers

Where's documented combo box usage with zenity?

I found by chance it was possible to display a combo box with zenity (version tested: 2.32.1). See the following code: #!/bin/bash array=(a b c d e) value=$(zenity --entry --title "Window title" --text "${array[@]}" --text "Insert your…
jep
  • 448
9
votes
1 answer

How to prevent Microsoft Teams "Allow settings change?" dialog on startup?

I am using Ubuntu 20.04 and I've installed Microsoft Teams using Ubuntu Software. My problem is that I am always getting this annoying dialog when starting teams. I said yes and no many times. No matter what I click teams start but the dialog will…
Alwin
  • 383
8
votes
2 answers

Avoid showing cancel button on dialog

I'm using Kubuntu 18.04 with: $ zenity --version 3.28.1 I want to display a --list dialog with zenity, but I don't want to show the Cancel button (in fact I'm okay if there is no OK either). It should be easy with the --no-cancel option: $ zenity…
Bakuriu
  • 642
7
votes
1 answer

Bash template to use zenity (or yad) to insert / edit / delete records in a file or database

I’m looking for a bash template that uses zenity or yad to maintain a list of records. The template could be a shopping check list with print option or it could be a list of servers to monitor ping time. In either case I’d like to take that code and…
7
votes
2 answers

How to use zenity file selection

I am new to zenity and I am trying to make a simple script for loading a file using zenity --file-selection and the wc command to get the word count of that file. I have successfully made a form which can be used to browse the file but I am unable…
Eka
  • 3,007
7
votes
4 answers

How can I easily create a GUI dialog with a bash script?

I need to present some text along with the items(about 15 values) for each of two Bash list(file) records. On the same screen I need to present a three way selection, (buttons, scrolled selection window, etc.). I'm an Ubuntu(11.04) scripting noob…
Harry
  • 71
7
votes
2 answers

How to load a `zenity` List Dialog with space-embedded data from `ls`?

I'm having problems loading a zenity List Dialog when the data contains spaces. It is straight-forward when there are no spaces in the listed data, but I don't know of a simple/standard method for space-embedded file names. For some reason, the…
Peter.O
  • 25,251
6
votes
1 answer

Zenity question - how can I use user input?

I want to make a zenity question that goes further depending on the answer you choose. The question in my script is: zenity --question --text="Would you like to participate in a little form?" _ Full script #!/bin/bash if [ "$(whoami)" != "root"…
EraySP909
  • 93
  • 1
  • 1
  • 9
6
votes
3 answers

How to make zenity "transient parent" warning disappear permanently

Zenity annoys me by always displaying the warning in terminal: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged. Apparently I'm not the only one: linuxquestions.org - Gtk message gtkdialog mapped without a transient…
6
votes
1 answer

youtube-dl file download progress with zenity progress bar

How to add youtube-dl file download progress percentage to zenity progress bar sample code (just an example, not a working one) #!/bin/sh ( progress=$(youtube-dl --extract-audio --audio-quality 0 --newline --audio-format mp3…
6
votes
1 answer

Confirm shutdown with Zenity?

I got this command which enables me to shutdown Ubuntu 13.10 directly from the keyboard (without needing to open a terminal and running something like sudo shutdown -h now): dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit…
DK Bose
  • 44,553
1
2 3
8 9