12/30/2023 0 Comments Hammerspoon appSix years ago I was a Windows power user, and when I got my first Mac, Command Tabbing through apps felt very weird. When an app with multiple windows is focused, Command backtick will cycle through the windows of that app. well, windows, on macOS you Command Tab through apps by default. As opposed to Microsoft Windows where you just Alt-Tab through. There’s an important distinction between switching windows and switching apps on the Mac. Well it turns out it’s pretty darn hard, and I’m still working on this window switching thing to this day. I remember something about Accessibility permissions not being available in the sandbox, but I just used an App Store app that was able to request the permissions so there has to be a way, how hard could it be? I don’t even care why anymore, let’s just release this fix on the App Store.Īnd while I’m at it, why not try to add that window switching capability that people have been asking about? Run open /System/Volumes/Data/Applications/Firefox.app, huh? no websites load? THAT WAS IT?!Īdd path.replacingOccurrences(of: "/System/Volumes/Data", with: ""), build, run, hold Right Command, press F, Firefox launches and holy cow everything works!! or was it the other way around? Anyway let’s just try it for the sake of it, I’m desperate. ![]() Try open /Applications/Firefox.app in a terminal, it works, websites load as expected.īreakpoint on launchApp, check the debugger again, let’s be rigorous, what am I really calling open on?Īrgument is /System/Volumes/Data/Applications/Firefox.app which is just a symlink to /Applications/Firefox.app right?. Launch Xcode, open the rcmd project, check the launchApp function code, it’s just a NSWorkspace.open call on Firefox.app, what does Alfred do differently?ĭisassemble Alfred.app in Hopper, look for NSWorkspace.open, of course it’s there, it’s the exact same thing. Please fix ASAP!! I’m gonna fix this Firefox issue once and for all! Not without annoying workarounds and a confusing user experience.Īnother email, another annoyed user: Firefox not loading websites when launched through rcmd! It works when launched from Alfred. I tried revamping that from inside the confines of an App Store app. If you don't know Lua and don't want to learn Lua (It's quick and easy!), or don't want to get involved in learning a new tool as deep as Hammerspoon, you can just follow the above instructions changing the key binding to whatever you want.Home Blog Notes Stuff Contact Résumé RSS A window switcher on the Mac App Store? Is it even possible? Focusing a specific window on macOS felt too cumbersome. You can find more information on exactly what is happening up there in the documentation for hs.layout.apply, and more generally in the Hammerspoon documentary. To install, first install Hammerspoon, then put this code into your ~/.hammerspoon/a file. This code has been loosely tested, but should work as a starting point. Hs.hotkey.bind(, 'space', cascadeWindows) (i-1)*(yMargin/(#windows-1)), - y, you might end up having to add some number here Local xMargin, yMargin = screen.w/5, screen.h/5 - This is equal to the gap between the edge of the topleft window and the edge of the screen. ![]() To implement this functionality in Hammerspoon, you could do something like: function cascadeWindows() ![]() It exposes many OS-level operations to a Lua scripting engine, including positioning of windows, among very many other things. Hammerspoon is a low-level automation tool which is great for this type of thing, if a little clumsy. I don't know of any way to do this natively, aside from Mission Control.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |