Skip to content

Instantly share code, notes, and snippets.

@kiinoda
Created November 2, 2022 07:42
Show Gist options
  • Save kiinoda/a11089ad8b14943298ba009f5ab01bcf to your computer and use it in GitHub Desktop.
Save kiinoda/a11089ad8b14943298ba009f5ab01bcf to your computer and use it in GitHub Desktop.
Hammerspoon - simple menu
menubar = hs.menubar.new(true)
menubar:setTitle("Menu")
menubarCount = 0
function menubarClicked()
menubar:setTitle("Updated! "..menubarCount)
menubarCount = menubarCount + 1
-- menubar:removeFromMenuBar()
-- menubar:delete()
end
if menubar then
menubar:setClickCallback(menubarClicked)
else
print("menubar could not be created")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment