Skip to content

Command File

Some dialog content can be updated on the fly after it has been launched. This is facilitated by sending commands to a command file which Dialog reads and interprets.


Dialog must be launched in the background to allow commands to be sent to it from the same script:

Terminal window
/usr/local/bin/dialog & sleep 0.1

The sleep 0.1 gives Dialog 100ms to initialise before the first command is sent.

The default command file path is /var/tmp/dialog.log. A custom path can be set with the --commandfile argument:

Terminal window
dialog --commandfile /var/tmp/my.log

Send commands using:

Terminal window
echo "<command>: <value>" >> /var/tmp/dialog.log

CommandDescription
title: <text>Update the dialog title
title: noneHide the title area
titlefont: <params>Update title font properties. Accepts space-separated key=value pairs: size=<float>, weight=<value>, colour=<color|hex>, name=<fontname>, shadow=<bool>
message: <text>Replace the message content. Supports Markdown.
message: + <text>Append to the existing message (adds a newline before the new content)
message: /path/to/file.mdLoad message content from a local Markdown file
alignment: [left|center|right]Set the message text alignment

CommandDescription
icon: <path|url|SF Symbol>Change the displayed icon
icon: noneHide the icon
icon: centre / icon: centerMove the icon to the centre position
icon: left / icon: defaultMove the icon back to the default left position
icon: size: <num>Change the icon size
iconalpha: <float>Set icon opacity (0.0 transparent → 1.0 opaque)
overlayicon: <path|url|SF Symbol>Set the overlay icon
overlayicon: noneHide the overlay icon

CommandDescription
bannerimage: <path|url>Set the banner image
bannerimage: noneRemove the banner image
bannertext: enableShow the title as banner text (sets font colour to white)
bannertext: disableRestore default title appearance
bannertext: shadowEnable drop shadow on banner title text
bannertext: <text>Set the banner title text and enable banner text mode

CommandDescription
image: <path|url>Display an image (appends to carousel if one is already shown)
image: showShow the current image
image: hideHide the current image
image: clearRemove all images
imagecaption: <text>Set the caption below the displayed image
video: <path|url>Display a video. Supports youtube=<id> and vimeo=<id> shortcuts.
video: noneRemove the video
webcontent: <url>Load a URL in the web content area
webcontent: noneRemove the web content

CommandDescription
button1: enable / button1: showEnable Button 1
button1: disable / button1: hideDisable Button 1
button1text: <text>Update Button 1 label
button2: enable / button2: showEnable Button 2
button2: disable / button2: hideDisable Button 2
button2text: <text>Update Button 2 label
buttonsize: [mini|small|regular|large]Set button size
infobutton: <text>Update the info button label
infotext: <text>Update the info text area
infotext: disable / infotext: hideHide the info text
infotext: reset / infotext: clearClear the info text value

CommandDescription
infobox: <text>Replace the info box content. Supports Markdown.
infobox: + <text>Append to the existing info box content
infobox: /path/to/file.mdLoad info box content from a local Markdown file

CommandDescription
progress: <int>Set the progress bar to a specific step value
progress: incrementIncrement the progress bar by one step
progress: increment <n>Increment the progress bar by n steps
progress: completeSet the progress bar to maximum
progress: reset / progress: indeterminateReset the progress bar to indeterminate mode
progress: show / progress: enable / progress: createShow the progress bar
progress: hide / progress: disable / progress: delete / progress: removeHide the progress bar
progresstext: <text>Update the label below the progress bar

CommandDescription
list: <csv>Replace the list with new comma-separated items
list: clearClear all list items and hide the list
list: showShow the list
list: hideHide the list without clearing its contents

Update an existing item by title (simple form):

Terminal window
echo "listitem: My Item: success" >> /var/tmp/dialog.log
echo "listitem: My Item: Processing..." >> /var/tmp/dialog.log

Update an item with full control using comma-separated properties:

Terminal window
echo "listitem: title: My Item, status: success, statustext: Done" >> /var/tmp/dialog.log
echo "listitem: index: 0, status: fail, statustext: Error occurred" >> /var/tmp/dialog.log

Add a new item to the end of the list:

Terminal window
echo "listitem: add:, title: New Item, status: wait, statustext: Pending" >> /var/tmp/dialog.log

Delete an item:

Terminal window
echo "listitem: title: My Item, delete:" >> /var/tmp/dialog.log
echo "listitem: index: 0, delete:" >> /var/tmp/dialog.log

Available listitem properties:

PropertyDescription
title: <text>Match item by title
index: <int>Match item by index (0-based)
subtitle: <text>Set the item subtitle
icon: <path|url|SF Symbol>Set the item icon
iconalpha: <float>Set item icon opacity
status: <status>Set the status icon. One of wait, success, fail, error, pending, progress, or an SF Symbol name (optionally with a colour suffix, e.g. lock.shield.fill-green)
statustext: <text>Set the status label text
progress: <float>Set an inline progress value (displays a progress-style status)
action: <url>URL to open when the item is clicked
add:Add a new item to the list
delete:Delete the matched item

CommandDescription
helpmessage: <text>Update the help message content. Supports Markdown.

CommandDescription
width: <num>Change the window width
height: <num>Change the window height
position: <position>Move the window. One of top, bottom, left, right, centre, or a combination (e.g. topright)

CommandDescription
activate:Bring the dialog window to the foreground
show:Unhide the dialog window
hide:Hide the dialog window
minimize: / minimise:Minimise the dialog window to the Dock
maximize: / maximise:Restore a minimised dialog window
blurscreen: enableEnable the blur screen effect
blurscreen: disableDisable the blur screen effect

CommandDescription
showdockicon: enable / showdockicon: true / showdockicon: 1Show the Dialog icon in the Dock
showdockicon: <any other value>Hide the Dialog icon from the Dock
dockicon: <file|url>Set a custom image as the Dock icon
dockicon: none / dockicon: defaultRestore the default Dialog Dock icon
dockiconbadge: <text>Display a badge on the Dock icon
dockiconbadge: none / dockiconbadge: removeRemove the Dock icon badge
bounce:Bounce the Dock icon once (informational)
bounce: criticalBounce the Dock icon continuously until the window is brought to the foreground

CommandDescription
quit:Quit Dialog with exit code 5