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
0
votes
1 answer

How do I use an array in a whiptail menu?

Trying to write a simple script, on a Linux machine with systemd, to display a list of time zones using an array in whiptail. So far: tzones=$(timedatectl list-timezones) arr=( $tzones ) count=0 for i in "${arr[@]}"; do allzones[$count]=$(echo…
audiodef
  • 1
  • 1
0
votes
0 answers

Whiptail radiolist not appearing for variable assignment

I'm trying to use a Whiptail radiolist dialog to initialise a variable in a Bash function. The radiolist appears correctly when I use this example: simple_radiolist() { whiptail --title "Radiolist without variable assignment" --radiolist \ …
0
votes
0 answers

BASH:Run a command stored in variable

I want to run a command with separate options, so i created a variable which contains the command with options.. I want to run this, but it doesnt work: CHOICES=$("/usr/bin/whiptail $CHECKBOXCMD") the command echo $CHECKBOXCMD shows the good…
ant75
  • 1
0
votes
1 answer

(Bash) How do I display a command output in a whiptail textbox?

The whiptail command has a --textbox option A text box lets you display the contents of a text file in a dialog box I would like to use the output of a command in its place (yup, that's the same question posted here), but the difference is that…
user19897594
0
votes
2 answers

String starting with hyphen minus fails with whiptail

I have this simple script displaying msgbox using whiptail. #!/bin/bash str="-|foo\n" whiptail --title "test" --msgbox "$str" 20 78 When I run this script I get error: -|foo\n: unknown option If I make change str="+|foo\n" then it…
Logan Lee
  • 807
  • 9
  • 21
0
votes
1 answer

handle errors in whiptail gauge with a msgbox

I am trying to run a whiptail gauge where I am showing progress as multiple commands are run. I have some error checking, but since the commands are running in a subshell, I can't seem to display the error in a msgbox. Any help would be greatly…
jrod091
  • 51
  • 7
0
votes
1 answer

How to print list of strings in a pop up window and save the strings in a file with time stamp

When I run below script, it reads a report.txt file and whenever a message is matched in the file a pop up window will come with the message. How whiptail can be used out of for loop so that pop up windows comes only once with list of all messages.…
Fatima
  • 9
  • 4
0
votes
1 answer

Updating newt (snack.py) interface from separate python thread

The first time I update the list it works just fine, from the timer I get an unselectable copy of the last text item, i.e. two "forth", but only one of them working. I would like to update my newt interface asynchronously, but I am running out of…
Boris
  • 1
  • 1
0
votes
2 answers

Bash - Can't copy associative array if piping block output to command

With the following code I can't clone the associative array in Bash if piping to a command. I'm using Whiptail to display a progress bar: #!/bin/bash declare -Ar ARR1=( [a]='asdf' [b]='qwerty' [c]='yuio' ) declare -A ARR2=() clone() { { …
user5507535
  • 1,580
  • 1
  • 18
  • 39
0
votes
1 answer

Bash - multiline Whiptail backtitle

I'm trying to add multiple lines to Whiptail dialogs backtitles. I tried: whiptail --clear --backtitle "asdf \n asdf \n asdf" \ --title test --yesno test \ 0 0 "test" 3>&1 1>&2 2>&3 whiptail --clear --backtitle "asdf asdf asdf" \ …
user5507535
  • 1,580
  • 1
  • 18
  • 39
0
votes
1 answer

How to timeout inputbox in whiptail?

I would like to ask user for some data, and if inactive, then exit. But whiptail has no such option as --timeout. I have tried something like timeout 5 whiptail --inputbox "enter your name" 10 20 But will leave mess in the terminal windows. So is…
milanHrabos
  • 2,010
  • 3
  • 11
  • 45
0
votes
1 answer

BASH - Creating whiptail menu from array with equal menu option and description

I would like to create a menu that takes the ls output of a folder and creates menu options and descriptions that match. This doesn't error, but also doesn't give me a menu. I basically want this in the menu: array0 array0 array1 array1 array2…
0
votes
1 answer

How to use Perl with the Whiptail gauge?

I can track the rsync progress via Whiptail, using Awk to parse the rsync output, however, I'm puzzled by why the Perl counterpart doesn't work (the Whiptail gauge stays stuck at 0). This is the working Awk commandline: rsync --info=progress2…
Marcus
  • 5,104
  • 2
  • 28
  • 24
0
votes
1 answer

Use dynamic list in whiptail

I need to build a dynamic list with checkboxes in whiptail. But using a variable\dynamic bash output doesn't help me. I tryed used this command whiptail --title "Operations" --checklist "Select Operation" 22 80 14 $array Output of variable array…
Dargod
  • 27
  • 7
0
votes
1 answer

bash: how to sort or parse an array[id][name] by name alphabetic to inject into whiptail?

Full script is available on gitlab When started with steam-lr -g menu it is showing menu made with whiptail. Items in this menu are ordered by game id. My question: is there a way to order them by game name ? how items are generated: function…
mickro
  • 881
  • 2
  • 11
  • 26