hs.alert.show(str, [style], [screen], [seconds]) -> uuid
Shows a message in large words briefly in the middle of the screen; does tostring() on its argument for convenience.
str - The string or
hs.styledtext object to display in the alert
style - an optional table containing one or more of the keys specified in hs.alert.defaultStyle. If
str is already an
hs.styledtext object, this argument is ignored.
screen - an optional
hs.screen userdata object specifying the screen (monitor) to display the alert on. Defaults to
hs.screen.mainScreen() which corresponds to the screen with the currently focused window.
seconds - The number of seconds to display the alert. Defaults to 2. If seconds is specified and is not a number, displays the alert indefinately.
a string identifier for the alert.
The optional parameters are parsed in the order presented as follows:
if the argument is a table and
style has not previously been set, then the table is assigned to
if the argument is a userdata and
screen has not previously been set, then the userdata is assigned to
duration has not been set, then it is assigned the value of the argument
if all of these conditions fail for a given argument, then an error is returned
The reason for this logic is to support the creation of persistent alerts as was previously handled by the module: If you specify a non-number value for
seconds you will need to store the string identifier returned by this function so that you can close it manually with
hs.alert.closeSpecific when the alert should be removed.
Any style element which is not specified in the
style argument table will use the value currently defined in the hs.alert.defaultStyle table.