Hacker News new | ask | show | jobs
by nzentzis 1954 days ago
Seconded. I use both on a regular basis - a Mac laptop for work since I have to interact with the MS Office ecosystem there, and a Linux desktop/workstation for gaming and personal projects.

Between the two, I prefer the Linux machine on pretty much every axis. MacOS feels far too tied to the GUI-oriented way of doing things; it's often difficult or impossible to automate tasks/routines, and troubleshooting when things go wrong is painful.

2 comments

I haven't found much I couldn't script using built in automation [1] or if it's lower level one of the LUA based scripting tools like hammerspoon [2]. Mac automation is really robust. Even just the default provided tools like Automator or scripting GUI tasks via Javascript/Applescript can accomplish a lot.

Using a tool like Alfred [3] and having "workflows" attached to hotkeys for automated things works wonders. For example I have a "workflow" that lets me hit a hotkey on a playing video and it automatically creates a bookmark at that timestamp which is recorded to a SQLite DB. Any future times I open that video I get a list of bookmarks and the ability to jump to them. This script marks all the currently selected songs in iTunes as loved or the currently playing song as loved. [4]

I have a lot to complain about Mac/MacOS and the direction it's gone down recently, been using Mac since OSX came out, but automation isn't one of them. Out of curiosity what did you try to automate that you couldn't?

[1] https://developer.apple.com/library/archive/documentation/La...

[2] http://www.hammerspoon.org

[3] https://www.alfredapp.com

[4] https://gist.github.com/gmanley/750426aa91097aeef3aee5a73a1f...

First off, I hadn't run into Hammerspoon before, so thanks for that - it looks like it might help with some things.

Most things I've tried and failed to do involve silent/background interaction with apps. For example, my company's VPN software doesn't handle sleep well at all, so I wanted to automatically disconnect before sleeping. I couldn't work out how to do it. The Mac Automation stuff (Automator and AppleScript) work if the app supports them, but my experience has been that support isn't necessarily reliable. Electron apps, at least, ignored my attempts last time I tried.

I figured out a way to do things using keyboard/mouse automation, but that fails in any context where I'm either actively doing something or where input isn't being accepted (e.g. when the lid is closed or when I'm actively editing code). On Linux I can at generally resort to Stupid X11 Hackery to make that kind of thing happen, though it sometimes needs WM integration if the app isn't cooperating.

I wanted to use a different ssh-agent on OSx which is a very simple "I want to set a global environment variable." That's literally impossible in OSX. So, I had to open a shell and every app that I wanted to use my ssh-agent had to be launched from that shell.
It's not impossible at all, you can just set it through `launchctl` as shown in this StackOverflow: https://stackoverflow.com/questions/135688/setting-environme...
ah, nice! I haven't tried to figure this out since Yosemite was new and it looks like there's now instructions for how to do it. Thanks for this! If I ever have to go back to OSX, now I know!
In addition, there's AppleScript for automating UI apps, which is capable of calling bash scripts. The reverse of bash scripts calling AppleScripts is also possible. It's super powerful.
Very much in the same boat here. I have an M1 Macbook Pro provided by my employer, and I still find myself reaching for my Thinkpad 9/10 times. I don't think MacOS is bad, but it's not even in the same boat as Linux. Compared to the level of control you have on Linux, MacOS feels like a toy in comparison. A particularly fragile toy at that.
FYI, your comments all show up as "dead" to me. I vouched for this one, but not sure why they're dead.