Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

241–250 of 454 posts

Re: macOS command-line tools you might not know about

#241

wait caffeinate exists natively? ive been using a third party caffeine tool for the longest time..

Now if only I could remember how to spell caffeinate.

Just make an alias to its other, easier to spell name `Methyltheobromine`. Simple.

Re: macOS command-line tools you might not know about

#243
post #190

Earlier quoted context omitted.

It creeps me out when the clipboard is unexpectedly shared between my phone and computer. And since the feature seems to turn on randomly but not reliably when I want it to, I’d rather it just didn’t exist.

For me it’s one of the top benefits of the Apple ecosystem. The only drawback is that yes it only works most of the time. And when it doesn’t I get infuriated. Glitches happen without any change to settings or network on my side - it works now, and 5 min later doesn’t.

Some of the “not working” cases may be due to the application you’re copying from setting the items as `localOnly`, ex: from a password manager. I don’t have an explanation for other failures.

https://developer.apple.com/documentation/uikit/uipasteboard...

Re: macOS command-line tools you might not know about

#244

You can use sips together with iconutil to generate a complete .icns file for your app from a single 1024 by 1024 PNG without any third party software: mkdir MyIcon.iconset cp Icon1024.png MyIcon.iconset/icon_512x512@2x.png sips -z 16 16 Icon1024.png --out MyIcon.iconset/icon_16x16.png sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_16x16@2x.png sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_32x32.png sips…

additional bonus, you can input an SVG at the start if you use qlmanage first instead of the cp command:

qlmanage -t -s 1024x1024 -o MyIcon.iconset/Icon1024.png icon.svg

Re: macOS command-line tools you might not know about

#245

Earlier quoted context omitted.

Last time I used macOS (which was 6 years ago) there was no extended expressions, or the regex syntax was limited. I forget (again, haven't used an apple product in years)

It's not necessary to install a suite of commands if you want updated grep. Just use Homebrew and you can install different versions of grep, including GNU's: brew install grep

Sure but with this you get all the other improved core utils like sed, etc. GNU utils just blow BSD/macOS out of the water. Personally, macOS seems to me like a half baked development platform in general

Re: macOS command-line tools you might not know about

#246
post #169

Not a command-line tool but the network link conditioner is also really great. Never seen such a tool on another OS You can simulate a really bad network. Latency, bandwidth, packet loss etc. Great for testing but also if people insist on cameras being on. Just screw up the connection so bad that everyone gets annoyed with your blocky image and robot voice and suggest you turn off video and then you make it 'magicall…

[Comcast]( https://github.com/tylertreat/comcast ) also does this for macOS, BSD, and Linux. And it's _brilliantly_ named.

Thanks! I'm on BSD so this is great to hear!

Re: macOS command-line tools you might not know about

#247
post #145

Not a big fan of command lines. but my most used shortkey is ALT+M with Maccy installed.

What does that do?

Maccy ( https://maccy.app/ ) is a clipboard manager for Mac and by Clicking ALT+M , it shows all the recent copied texts in a popup.

Re: macOS command-line tools you might not know about

#248

Years ago, I wrote a script to find something in a big blob of data and to alert me when it was done, I added a “say ” type phrase upon completion. I forgot about it and went to bed and was jolted awake hours later by what was clearly an “intruder” speaking to his accomplice, in my home office. Quite the relief when I realized what happened.

I often have multiple terminal tabs open. Sometimes I’ll run a command that ends up taking a while and switch away and forget about it.

So I added a fish command completion script that plays a beep with afplay if the task took longer than 5 seconds. It helps me get back on task for those “just long enough” tasks that I run.

Re: macOS command-line tools you might not know about

#249

You can use sips together with iconutil to generate a complete .icns file for your app from a single 1024 by 1024 PNG without any third party software: mkdir MyIcon.iconset cp Icon1024.png MyIcon.iconset/icon_512x512@2x.png sips -z 16 16 Icon1024.png --out MyIcon.iconset/icon_16x16.png sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_16x16@2x.png sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_32x32.png sips…

additional bonus, you can input an SVG at the start if you use qlmanage first instead of the cp command: qlmanage -t -s 1024x1024 -o MyIcon.iconset/Icon1024.png icon.svg

Note of caution: if qlmanage uses QuickLook SVG rendering, YMMV. I recently had to deal with SVGs that render broken in Finder but correctly in, say, Affinity or Adobe tools.

Rasterization feels sufficiently finicky that I personally would consider it part of designer’s workflow rather than automated conversion pipeline; but then some would say the same about raster versions at different sizes, so in the end it depends on what you can and want spend resources at.

If it does work for you, though, you could generate every size from SVG directly and skip sips altogether (but you should check both methods to see which gives you a better quality icon, at small sizes single pixels can matter and so it would depend on how qlmanage handles rasterization to different sizes).

Post reply on HN