Questions tagged [whiptail]

Whiptail is a tool used for displaying dialog boxes to users.

Whiptail is commonly used to display data in the form of data boxes. Some of the most common dialog boxes include

Info Box: (A data box displaying text)

whiptail --infobox "This is an infobox"

Message Box: (Waits for the user to click the OK button)

whiptail --msgbox "This is a message box"

Yes/No Box: (Offers users a choice of yes or no)

whiptail --yesno "Do you like dogs?"

Input Box: (Allows for user input)

whiptail --inputbox "Tell us your thoughts"

Password Box: (Masks user input)

whiptail --passwordbox "Enter a password"

Menu: (Present users with a list of options)

whiptail --menu "Choose an option [Dialog Height] [Dialog Width] [Menu Height] \ Apple A red fruit \ Pineaaple A tropical fruit \ Watermelon A Summer Fruit"

For more information please visit

https://en.wikibooks.org/wiki/Bash_Shell_Scripting/Whiptail

68 questions
17
votes
1 answer

How to write EOF to STDIN popen in python

I have the following command run through popen: p = subprocess.popen(["/usr/bin/whiptail", "--title", "\"Progress\"", "--gauge", "\"\"", "6", "50", "0"], stdout=subprocess.PIPE, stding=subprocess.PIPE) To stop the whiptail command from running I…
gudge
  • 1,053
  • 4
  • 18
  • 33
7
votes
1 answer

How to display different messages on whiptail progress bar along with progress bar?

I am trying to use "whiptail" to display progress to users while removing some RPM's. Using { echo 25 yum remove package_name echo 50 yum remove package_name echo 75 yum remove package_name echo 100 sleep 1 } | whiptail --gauge "Removing…
5
votes
2 answers

Changing colours in whiptail

Is there any way to change particular colour in whiptail ? For example to mark specific text in red ? For example : #!/bin/bash window=$(stty -a | tr \; \\012 |egrep 'rows|columns' | cut '-d ' -f3) RED="red" GREEN="green" OPTION=$(whiptail --menu…
zlobul
  • 335
  • 1
  • 5
  • 20
4
votes
1 answer

Error with Linux whiptail/dialog arguments from bash variable

could someone explain why the code below doesn't work? I'm going crazy trying to find out. #!/bin/bash TEST="M1 \"1-wire Interface\" ON" echo $TEST RESULT=$(dialog --title "Config Modules State" --checklist "Choose modules to activate" 20 50 1…
Sujay Phadke
  • 2,145
  • 1
  • 22
  • 41
3
votes
2 answers

Pretty shell script (menus, images, antialias, 1080p, colors, fade effects etc.)?

I've created a couple of very simple bash scripts for a home-made games arcade (input configuration, updating stuff etc). I've got a launcher, so it's not a problem to direct the user to run the wanted shell script, but while running a bash script…
jkgeyti
  • 2,344
  • 18
  • 31
3
votes
2 answers

Whiptail Gauge: Variable in loop not being set

Am new to bash and whiptail so excuse the ignorance. When assigning a var in the for loop, the new value of 20 is never set when using a Whiptail dialog. Any suggestions why ? andy="10" { for ((i = 0 ; i <= 100 ; i+=50)); do andy="20" …
2
votes
1 answer

How to display a long text file whiptail

This is the code than open a whiptail message box based on the content of the file in the file variable. The file has many lines. $(whiptail --title "Opening file" --yesno "$(cat $file)" 78 78 3>&1 1>&2 2>&3) Now the box is fixed in width and…
provola
  • 342
  • 1
  • 3
  • 15
2
votes
0 answers

Using Whiptail for bash script

How can I exit the whiptail screen on the terminal and stop the script from running in between? Is there a combination that can be used to stop the script execution and exit, similar to Ctrl+c?
2
votes
0 answers

How to show a dialog/whiptail gauge for curl?

I want to display a progress bar for curl using a dialog/whiptail --gauge box like: curl -#OL https://website/myfile 2>&1 | \ ??? stdbuf -o0 awk '???' ? | \ | whiptail --gauge "Downloading the file..." 6 64 0 I've found a solution for wget here,…
Jun
  • 31
  • 5
2
votes
2 answers

Making python terminal user interface

I'm trying to make terminal user interface with python which I will use it as post installation script for min linux os. But I don't want to use ncurses or urwid because it feels like overkill. I'm looking more in whiptail or screen direction. But I…
user2081554
2
votes
1 answer

Making dynamic choices. Help! Whiptail, Bashscript

I am new to Whiptail. I would like to create a program that allows user to show the information of certain things, such as network cards. I would like the menu to be dynamic, for example: my computer system has 2 network cards inserted at the…
Minorsee
  • 67
  • 10
2
votes
1 answer

How to display command output in a whiptail textbox

The whiptail command has an option --textbox that has the following description: --textbox The first option requires a file as input; I would like to use the output of a command in its place. It seems like this should be…
JoBu1324
  • 7,751
  • 6
  • 44
  • 61
2
votes
2 answers

bash spaces in whiptail/dialog menu items

I want to create a simple dialog with bash-dialog. I work with (X)DSL and bash-3.2. The latest (X)DSL is based on Linux 2.4.31 and comes with bash-2.05, however, bash-3.2 is downloadable from MyDSL/Testing. So, my script runs under…
linuph
  • 83
  • 3
  • 6
1
vote
1 answer

Whiptail: How can I handle an error when a gauge is running?

Here is a for loop, which is running a regular Whiptail gauge. I this loop, a command might throw an error and I would like to display a message box --msgbox displaying the error. After that, I could like the script to continue it's way like the…
Bnr
  • 33
  • 5
1
vote
1 answer

Using whiptail with variable containing dash ('-')

I want to display a menu in linux bash using whiptail When a menu item contains one or more dashes, whiptail fails to show the menu. Example with only one item: MQTT_PublisherArgs='-h {host} -t {topic} -m "{{message}}"' whiptail --title "MQTT…
SBF
  • 1,252
  • 3
  • 12
  • 21
1
2 3 4 5