hs.menubar.priorities[]
hs.menubar.new([inMenuBar]) -> menubaritem or nil
hs.menubar.newWithPriority(priority) -> menubaritem or nil
hs.menubar:delete()
hs.menubar:frame() -> hs.geometry rect
hs.menubar:icon() -> hs.image object
hs.menubar:isInMenuBar() -> boolean
hs.menubar:popupMenu(point[, darkMode]) -> menubaritem
true
to force the menubar dark (defaults to your macOS General Appearance settings)darkMode
uses an undocumented macOS API call, so may break in a future release.hs.menubar:priority([priority]) -> menubaritem | current-value
| | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Get or set a menubar item's priority | | Parameters |hs.menubar:removeFromMenuBar() -> menubaritem
hs.menubar:returnToMenuBar() -> menubaritem
hs.menubar:setClickCallback([fn]) -> menubaritem
fn
- An optional function to be called when the menubar item is clicked. If this argument is not provided, any existing function will be removed. The function can optionally accept a single argument, which will be a table containing boolean values indicating which keyboard modifiers were held down when the menubar item was clicked; The possible keys are:hs.menubar:setIcon(imageData[, template]) -> menubaritem or nil
hs.image
objectASCII:
which signifies that the rest of the string is interpreted as a special form of ASCII diagram, which will be rendered to an image and used as the icon. See the notes below for information about the special format of ASCII diagram.nil
if it could not be found or loadedif result == true then...
rather than the (unaffected) if result then...
.hs.menubar:setMenu(menuTable) -> menubaritem
menuTable
:nil
:hs.menubar:setTitle(title) -> menubaritem
title
- A string or hs.styledtext
object to use as the title, or nil to remove the titlehs.menubar:setTooltip(tooltip) -> menubaritem
tooltip
- A string to use as the tooltiphs.menubar:stateImageSize([size]) -> hs.image object | current value
| | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Get or set the size for state images when the menu is displayed. | | Parameters |checked
or state
key in a menu table definition. Defaults to a size determined by the system menu font point size. If you specify an explicit nil, the size is reset to this default.onStateImage
, offStateImage
, or mixedStateImage
keys. If you are not using these keys, then this method will have no visible effect on the menu's rendering. See hs.menubar:setMenu for more information.hs.menubar:title([styled]) -> string | styledtextObject
| | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Returns the current title of the menubar item object. | | Parameters |styled
is not set or is false, then a string is returned; otherwise a styledtextObject will be returned.