![]() Since I intend over time to expand on this initial prototype I created a function to easily run Emacs Lisp: local function eval(sexp, callback)Ī small utility function I grabbed from helped to clean up the output for easier processing later on. Once I'd got a menubar working then the next item to tick off was to get a result from running emacsclient. To keep things nice I've created a Lua script called a which I can then import from a (that main script that Hammerspoon runs on start up).Ĭreating a menubar item using Hammerspoon is dead simple: local clockingMenu = hs.menubar.new()Īn impressively minimal API for this, and most other tasks - exactly what you want from an automation framework. Once Hammerspoon is installed and running it is relatively simple to write/install a script to perform all kinds of fun automation with macOS. This returns something used by Emacs and includes face information - however it's quite easy to extract what I need. The second is org-clock-get-clock-string. The first is org-clock-is-active - which will return nil if there isn't currently a clock running. Rather than writing any Emacs Lisp to accomplish this I'm using emacsclient and a couple of Org mode functions. This is a solved problem (for example /jordonbiondo/osx-org-clock-menubar), however I wanted to put something together myself and see if over time I could improve on previous attempts. This might sound odd for those of you who live in Emacs - but I have to spend quite a lot of time in Xcode and Android Studio. ![]() One issue with this has been I have to use Emacs to see if I've got a timer running. As well as saving $12 a month I'm keeping my records in plain text and can easily run scripts to get the kind of stats I'm interested in on my performance on a per client and per project basis. I've recently decided to stop using Harvest for tracking time and start using the ' clocking ' features of Org mode. ![]() I've dabbled with Lua in the past, even going so far as to make it a scripting language in my app Trunk Notes (now discontinued so don't go looking for it on the App Store.) Hammerspoon is a macOS automation scripting tool which uses the language Lua. I'm off mid morning today for my son's end of term church service - so rather than getting stuck into some serious coding I thought I'd have a play with Hammerspoon to bring the active Org mode clock to the macOS menu bar.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |