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.

123 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,519
  • 3
  • 18
  • 35
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…
Rey Leonard Amorato
  • 2,218
  • 1
  • 16
  • 27
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…
adrenochrome
  • 197
  • 1
  • 1
  • 9
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,583
  • 10
  • 52
  • 71
11
votes
3 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
  • 428
  • 3
  • 9
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
  • 3
  • 11
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
  • 1
  • 10
  • 23
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
  • 2,917
  • 12
  • 38
  • 58
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
  • 1
  • 1
  • 2
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
  • 24,311
  • 37
  • 113
  • 162
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…
WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401
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
  • 41,240
  • 22
  • 121
  • 214
6
votes
1 answer

Reliable alert dialogs from the shell

I'd like to have a message pop up in response to various system events, mostly in order to be able to set reminders for myself from a shell session. There are a few ways to do this; zenity seems to be the most polished. However, I've found at…
intuited
  • 7,153
  • 4
  • 28
  • 40
6
votes
2 answers

zenity window on top

I would like the window produced by zenity to be configured so it is always on top. There does not appear to be an option to enable this. Can someone suggest a source change to the zenity code so that I can get this to work? I want to be able to do …
user36410
  • 319
  • 3
  • 8
1
2 3
8 9