4 ms·
One 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 us
by beaugunderson 5y ago
One 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()
for _, window in pairs(app:allWindows()) do
window:minimize()
end
end)
hs.hotkey.bind(cmdShift, 'u', function()
local app = hs.application.frontmostApplication()
for _, window in pairs(app:allWindows()) do
window:unminimize()
end
end)
- nighthawk454 5y agoInteresting, I knew about cmd+option+m which does the minimizing part already. Weirdly doesn't seem to be an un-minimize shortcut though.
- beaugunderson 5y ago> 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 :)
- beaugunderson 5y agoAnother 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+shift+2 brings my work Chrome profile to the foreground.
- NateEag 5y agoI've wanted to send YouTube links directly to VNC for ages, while having all others open in the default browser, but have never taken the time to hack up a listener. I already use Hammerspoon, so this should be a piece of cake to add. Thanks for mentioning this ability!
- beaugunderson 5y agoI believe this is the implementation I based mine on: https://github.com/zzamboni/dot-hammerspoon/blob/master/init.org#url-dispatching-to-site-specific-browsers https://github.com/zzamboni/dot-hammerspoon/blob/master/init...
- NateEag 5y agoAwesome. Again, thanks!
- yoyojojofosho 5y agoFor anyone else trying to determine how to switch between Chrome profiles on macOS, I found a superuser post [0] In short you can run: open -a "Google Chrome" --args --profile-directory=$NAME where $NAME for your current Chrome profile can be found by looking at Profile Path in chrome://version. The last directory in Profile Path is $NAME. The default $NAME is "Default" and another profile could be "Profile 5". [0] https://superuser.com/questions/377186/how-do-i-start-chrome-using-a-specified-user-profile https://superuser.com/questions/377186/how-do-i-start-chrome...
- beaugunderson 5y agoyup this is very similar to what I ended up with: -- open Chrome Canary with a specific named Profile function canaryWithProfile(profile, url) local t = hs.task.new("/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary", nil, function() return false end, { "--profile-directory=" .. profile, url }) t:start() end -- open Chrome with a specific named Profile function chromeWithProfile(profile, url) local t = hs.task.new("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", nil, function() return false end, { "--profile-directory=" .. profile, url }) t:start() end