Giter VIP home page Giter VIP logo

hammerspoon / hammerspoon Goto Github PK

View Code? Open in Web Editor NEW
11.5K 117.0 569.0 153.12 MB

Staggeringly powerful macOS desktop automation with Lua

Home Page: http://www.hammerspoon.org

License: MIT License

Objective-C 51.37% Lua 24.89% Makefile 0.15% Ruby 0.02% C 16.25% Shell 0.70% HTML 5.57% CSS 0.04% C++ 0.15% Python 0.51% Roff 0.18% Smarty 0.02% Rich Text Format 0.16%
macos objective-c lua hammerspoon osx automation mjolnir irc

hammerspoon's Introduction

Hammerspoon

CI codecov.io Downloads current release Downloads all releases Latest tag Latest release

Discord: Click to join

What is Hammerspoon?

This is a tool for powerful automation of OS X. At its core, Hammerspoon is just a bridge between the operating system and a Lua scripting engine.

What gives Hammerspoon its power is a set of extensions that expose specific pieces of system functionality, to the user. With these, you can write Lua scripts to control many aspects of your OS X environment.

How do I install it?

Manually

  • Download the latest release
  • Drag Hammerspoon.app from your Downloads folder to Applications

Homebrew

  • brew install hammerspoon --cask

What next?

Out of the box, Hammerspoon does nothing - you will need to create ~/.hammerspoon/init.lua and fill it with useful code. There are several resources which can help you:

What is the history of the project?

Hammerspoon is a fork of Mjolnir by Steven Degutis. Mjolnir aims to be a very minimal application, with its extensions hosted externally and managed using a Lua package manager. We wanted to provide a more integrated experience.

What is the future of the project?

Our intentions for Hammerspoon broadly fall into these categories:

  • Ever wider coverage of system APIs in Extensions
  • Tighter integration between extensions
  • Smoother user experience

hammerspoon's People

Contributors

aldur avatar asmagill avatar cmsj avatar du-song avatar fanf2 avatar habbie avatar halfwit avatar heptal avatar ihodes avatar jasonm23 avatar jhgg avatar jsoref avatar kjslag avatar kkharji avatar knu avatar latenitefilms avatar lowne avatar luckman212 avatar malob avatar muescha avatar ocurr avatar peterhajas avatar rkalis avatar s1ngs1ng avatar sdegutis avatar tmandry avatar trishume avatar von avatar wvierber avatar zzamboni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hammerspoon's Issues

extensions rebuild on every build or run

which makes cmd-r in xcode take a long time for no reason. Should figure out how to make this better - have the Makefiles actually know about all the invidual targets?

Get a Mac Dev cert

gdoc says 'Chris', and I'm fine with this. Alternatively an 'organisation' cert might make sense. We can indeed revisit this later.

Get rid of AXAPIEnabled build warning

It's annoying me. We can probably use the same weak import trick that is used for the newer Accessibility API in the same file, to get rid of the build warning. Maybe. Worth a shot and will guard us against the point where AXAPIEnabled is removed, probably.

Developer procedure

Normal users ('the 99%') will make do with the modules we include, and will not have to bother with brew or rocks or whatever.

For the rest, being developers, and users who want beta stuff, we need to document how to submit and how to use third party mods. Probably comes down to how Mjolnir works right now for all modules.

hs.mjomatic

as a matter of standard module practice, should the act of simply requiring a module have immediate side-effects? In particular, I noticed it cause an alert to pop up just from requiring it, but this could apply to other things as well: setting hotkeys, etc.

Automatic updates

Mjolnir has automatic updates, but it's a homegrown sdegutis thing. No idea whether it's any good. Wondering whether we should be using Sparkle?

Stop copying makefiles around in build_extensions.sh

There must be a way to use make -f with the generic Makefile, and still be able to infer the name of the module within the Makefile itself. Right now it doesn't work because of the first two lines of the generic Makefile.

modules that require 10.10

Some modules (by _asm) require 10.10. Right now, if we simply import those, Xcode forces us to build the whole app with a 10.10 requirement.

Request: figure out how to have 10.10-only modules without forcing the whole app to 10.10. I'm okay with this meaning building requires 10.10, especially after we cover #6 for working on specific modules 'out of band'.

Investigate when we should fire off hotkey events

Right now hotkeys take effect when the specified key triggers KEY_UP, but usually the modifiers are still sending KEY_DOWN at that point, which means they are falling through to the focussed window. This can have very surprising side effects.
Perhaps we should look at waiting until the modifiers are released before triggering events, or at least having it as an option.

API deprecation

Allow modules to notify Hammerspoon if a user is using a call that will go away in a future version. Then we can show all of these warnings in a single place in the prefs.

Reintroduce ARC

As far as i can see, the only reason ARC is not being used now is that the luarocks build scripts for osx use compiler flags (like supporting old OSX versions) that prevent it. This is not a good reason for not having ARC.

Diffing window.m between Hydra and Mjolnir mostly shows ARC removal, suggesting that in general the changes between ARC and non-ARC are minor.

Go over Mjolnir issues

and figure out whether any of them make sense for us to address before public release.

I have a local backup, current as of 5 minutes ago, of all issues+comments on sdegutis/mjolnir, just in case, and also of the wiki there.

Improve Accessibility enabling

Slate triggers OSX to present a nice dialog that has a button to enable accessibility access. Figure out how and do the same :)

Pick a name

Did we accidentally already choose Hammerspoon? ;)

I think we might have!

hs.ipc and hammerspoon commandline

Should these be part of the default core? If so, I'll issue a pull later today.

Related -- what other modules of mine should be "builtin"? I'll prioritize appropriately.

Going public

Soft public

Meaning: make our repo public at hammerspoon/hammerspoon

  • Agree that the repo can be flipped to public
  • Transfer repo from ~cmsj to ~hammerspoon
  • Close #20
  • Close #33
  • Close #26

Hard public

Meaning: we announce to the mjolnir mailing list.

  • hammerspoon.org is up with some content
  • README is written
  • all other documentation is either gone or correct

Get third party mods in

  • define procedure for importing and updating third party mods
  • invite authors (or just ask for their permission) (or just take their stuff, it's MIT ;) )

(maybe make separate issues for tracking the imports of the third party mods we like, when item 1 is done)

LUA_USE_MACOSX not set for CocoaPod Lua build

Needed to add the following to Pods-Hammerspoon-environment.h to get io.popen() to work:

define LUA_USE_MACOSX 1

Since lua is being built outside of the Hammerspoon project (unlike Mjolnir), the Hammerspoon.pch file doesn't carry it's defines over. This could go into the pod pch file, I suppose, but since you set some defines for Lua in the .h file, I figure it's as good a place as any.

(Not in a place where I can reliably do my own fork and pull request yet, so I post it here for consideration)

Write a default config

Right now the out-of-box experience is "please write your init.lua". We could offer a button that installs a sensible/fun init.lua that people can start editing. Later on (make a new ticket after closing this one when we have a default config?) we could think about having a wizard.

Publish docs

Fix up doc generation (it's pretty messy now because of all the third party module support). Publish on web. Publish on Dash. Perhaps include with app?

CocoaPods?

As far as I can see, this would allow us to remove Lua from our git tree without suddenly relying on brew. Also makes it easier to pull in other things (although sadly Sparkle is not usefully present in pods)

Out-of-box experience

  • include core modules (#3)
  • include 3rd party modules (#4)
  • fix up accessibility (#8)
  • default config?
  • some wizard?
  • write getting started doc
  • Module discovery is hard - any ideas beyond the above?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.