Is there something like this for python?
Hammerspoon – Lua-based powerful tool automation of macOS
31–40 of 84 posts
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#32One of my more useful things, cmd+shift+m and cmd+shift+u to minimize all windows and un-minimize all windows of the active application. The un-minimize gets used more often (e.g. I may have a few Chrome windows minimized during my workday that I want to un-minimize en masse after work is done). local cmdShift = {'cmd', 'shift'} hs.hotkey.bind(cmdShift, 'm', function() local app = hs.application.frontmostApplication(…
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#33One of my more useful things, cmd+shift+m and cmd+shift+u to minimize all windows and un-minimize all windows of the active application. The un-minimize gets used more often (e.g. I may have a few Chrome windows minimized during my workday that I want to un-minimize en masse after work is done). local cmdShift = {'cmd', 'shift'} hs.hotkey.bind(cmdShift, 'm', function() local app = hs.application.frontmostApplication(…
I've also setup cmd+shift+1/2/3 to brings the aforementioned profiles into the foreground, so e.g. cmd+shift+2 brings my work Chrome profile to the foreground.
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#34One of my more useful things, cmd+shift+m and cmd+shift+u to minimize all windows and un-minimize all windows of the active application. The un-minimize gets used more often (e.g. I may have a few Chrome windows minimized during my workday that I want to un-minimize en masse after work is done). local cmdShift = {'cmd', 'shift'} hs.hotkey.bind(cmdShift, 'm', function() local app = hs.application.frontmostApplication(…
Interesting, I knew about cmd+option+m which does the minimizing part already. Weirdly doesn't seem to be an un-minimize shortcut though.
Yup, the existing minimize shortcut's missing twin led me to learn a bit more Lua so I could implement it :)
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#35Re: Hammerspoon – Lua-based powerful tool automation of macOS
#36Since we've hit the front page of HN again, I've just released Hammerspoon 0.9.92, which contains a few fixes and some additions, but mostly refactored a significant amount of internal project structure to allow our build system to be replaced with something that isn't 5 years old and terrible. As a result, it's possible that something broke which we didn't find in our internal testing. Please file GitHub issues :) H…
Speaking of old and terrible... Are you planning to keep the project in Objective-C long term? Any chance of migrating to Swift?
Merry Christmas and thanks for a great project.
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#37I feel Hammerspoon's Lua is to macOS what elisp is to Emacs. You can use it to glue all sorts of wonderful things.
I wrote a bit about it here: https://xenodium.com/emacs-utilities-for-your-os (building my own Alfred/Quicksilver-like experience) and https://xenodium.com/cycling-window-layouts-via-hammerspoon (cycle through my preferred window layouts).
edit: typos
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#38It shows off a tiny bit of what you can do with Hammerspoon:
- window and app management
- keyboard shortcuts for common apps (eg. hyper+T for text editor, hyper+B for browser, hyper+S for shell)
- if you can code a tiny bit of Lua there's no need for apps like Spectacle, Rectangle, Moom, etc. because it's easy to position apps wherever you want. eg. hyper+L arranges my browser+editor+terminal in a standard layout, and I have other shortcuts to set apps to halves or thirds of the screen, or to another monitor.
- fuzzy-find popups (like Alfred/fzf) are built-in. I use it to choose audio input/output.
- a replacement for Caffeine (menubar icon to keep computer from going to sleep)
I have my "hyper" key bound to caps lock using Karabiner Elements (but it still works as a normal caps lock if you hold it for half a second). Here's that config: https://github.com/kbd/setup/blob/master/HOME/.config/karabi...Re: Hammerspoon – Lua-based powerful tool automation of macOS
#39One of my more useful things, cmd+shift+m and cmd+shift+u to minimize all windows and un-minimize all windows of the active application. The un-minimize gets used more often (e.g. I may have a few Chrome windows minimized during my workday that I want to un-minimize en masse after work is done). local cmdShift = {'cmd', 'shift'} hs.hotkey.bind(cmdShift, 'm', function() local app = hs.application.frontmostApplication(…
Another fun thing you can do is install Hammerspoon as your URL handler, and make certain URLs open in different Chrome profiles--any work websites open in my work Chrome profile, websites related to a game I play opens in a Chrome profile specific to that, and anything else opens up in a personal Chrome profile. I've also setup cmd+shift+1/2/3 to brings the aforementioned profiles into the foreground, so e.g. cmd+sh…
I already use Hammerspoon, so this should be a piece of cake to add.
Thanks for mentioning this ability!
Re: Hammerspoon – Lua-based powerful tool automation of macOS
#40At least a few years ago, OS X's window management when plugging/unplugging external monitors was pretty bad.
Thanks to Hammerspoon, I don't have to think about it at all - I plug in monitors when I want to and all my windows resize and move themselves based on rules I defined.
It means stepping away from my desk or coming back to it is a no-brainer.
Maybe it's not needed these days, but it sure was a lifesaver back when I first adopted it.
My config, if people are interested:
https://github.com/NateEag/dotfiles/blob/master/src/.hammers...