Hacker News new | comments | show | ask | jobs | submit login
~/.osx — a collection of sensible defaults for OS X Lion (github.com)
291 points by mathias 2264 days ago | hide | past | web | 87 comments | favorite

Cool. I don't know that I'd call them sensible in general, though, even if they are sensible for you. Disabling disk image verification permanently, for instance, is probably a bad idea.

Expanded save/load panel by default is awesome, though. So thanks!

I agree, the defaults that Apple set will probably be preferred by most people. This is more of a hacker optimized set of defaults.

I agree, but some of the new defaults Apple introduced are really weird.

For example, why does mounting a new volume no longer bring that window to the foreground? It used to be trivial to install an App by downloading a Disk Image from a web page: Safari would automatically open it when ready and it would pop into the foreground so you could install. Now, there is no feedback at all (apart from a quick "verifying image" dialog) that the volume was ever mounted. You have to remember to switch to Finder to locate the DMG. I'm sure Apple prefers you to use the App store to install apps, but this is still a big slap in the face for the usability of removable media like USB pen drives etc.

Other things, such as the press-and-hold special characters and especially the $%#@$@ autocorrect drive me mad personally, but I can at least see how they can be beneficial to people.

The rest, disabling animations, caches and everything are things I really would not call "sensible". I like optimising a lot of those little things for myself, but to say that is sensible for others is pushing it. Having said that, I do appreciate little gems like not having to expand the save dialog every damn time (why does it not remember that I prefer it that way?) :)

Windows never stealing focus isn't a weird default, it's a sensible one. The sensible thing to do in this situation is to display a desktop notification to select the volume. I haven't used OS X extensively, so I don't know if it has a built-in desktop notification system (I remember having to install Growl to get one), but this is something that Windows and Linux have had for a while now.

You have a point, stealing focus is utterly annoying and rarely acceptable, but that is not to say the window can not at least get to the foreground (without taking focus). In my case, new volume Finder windows are pop-unders that get lost on my messy desktop.

You initiated an action: Unzip or Mount an installer. 99% of the time I want that brought to front. Stealing focus is only bad when you did not initiate that action, hence why popups are hated so much.

I agree with your premise, but I would like to point out that there is often a significant delay between clicking on a .dmg download and there being some action.

I know that I am unlikely to sit idly and watch the download progress-bar; I'm far more likely to switch to some other tab or other application. And then, since my focus is elsewhere, we have returned to the focus stealing situation.

Have you ever once gotten a warning from disk image verification that saved you enough time to justify all the time you've spent waiting for it?

Yes. Many times.

Really? What corrupted disk images are you opening? I've never had it report an error, and I download software in .dmg files all the time (and wait for verification all the time).

iOS SKDs are where it usually happens for me, but it has happened other times as well.

When using Windows, one of my first troubleshooting steps is to reinstall the program. I (almost) never do that on the Mac. I'm guessing part of the reason is that Mac OS detects corrupt files before they are installed.

Once or twice it's tried to mount an image that didn't completely download.

For a larger list of "hidden" settings you might want to check out Secrets[1], a database of these 'defaults' settings that you can tweak from a preference pane.

[1] http://secrets.blacktree.com/

Whoa, cool! I had no idea this existed. I've occasionally had to tweak some defaults but never really knew where the seemingly arcane knowledge had been drawn from (I was usually lucky enough to find a mailing list where someone had mentioned a solution, but of course that eschewed where they had found their knowledge). It's great to have a repository to draw from. Thank you!

I'm sad that this is now necessary. Mac OS X 10.5 was the first version of OS X which I could start using for work immediately without installing any hacks (with the one exception of the Terminal Colors SIMBL plugin).

My dad says, "I don't want to upgrade! Things work fine! They always dick around with everything!" He's talking about QuarkXPress and MS Office and whatnot, which is understandable. But, for the first time ever, I'm not excited about the new version of the Mac operating system.

I'm really disappointed in Lion -- lots of gratuitous changes without much benefit. The Finder in particular is horrific.

I do like the new Terminal.app.

I concur with the disappointment in Lion. I don't even see 3+ GB in new features, much less features that I actually like.

I hadn't noticed anything different about the Terminal, so I see what you mean.

You can now set background image, you can redefine ANSI colors, there are a few new themes, and you can go full screen (useful on small screens).

another useful one to avoid creating .DS_Store files on network volumes:

  defaults write com.apple.desktopservices DSDontWriteNetworkStores true

Ah, forgot about that one. Thanks! Added: https://github.com/mathiasbynens/dotfiles/commit/18044c4c882...

Is there a way to avoid creating .DS_Store files on specific local volumes?

I used to have my Dropbox folder on my secondary (NTFS formatted) harddrive so I could use a symlink to share my Dropbox folder across OSX and my Windows 7 Bootcamp install instead of having duplicate Dropbox folders for each OS. It ended up spewing .DS_Store files all over my employer's company dropbox folders.


Asepsis enables you to redirect creation of .DS_Store files into a special, dedicated folder. With redirection, Finder works the same way but .DS_Store files are isolated in the dedicated folder /usr/local/.dscache.

if i'm not mistaken, as long as you don't open the folder in Finder, they shouldn't be created. obviously not an ideal solution, so maybe periodic housekeeping is in order:

  find ~/Dropbox -name .DS_Store -exec rm {} \;

also missing:

# hidden icons in dock are semi transparent

defaults write com.apple.Dock showhidden -bool YES

Some of these are hard to understand from their one-line descriptions. e.g. 'Remove useless icons from Safari's bookmark bar'? Maybe a blog post is in order?

Yes! Mathias, if you could do something like this, it would be very helpful. I didn't even know about .osx.

Edit: And I don't even know how to search for information about it since the dot is ignored in Google and GitHub :D

I should probably point out that `.osx` is not a standard or anything. I just found myself collecting all these gems – not all of them are hidden settings, but most are – and decided to organize them into a single file :)

It’s pretty useful though; when I set up a new machine, I just clone my repo, run the bootstrapper, then `./.osx` and BOOM!

~/.osx is anything outside of this particular file.

It’s about these icons: http://i.imgur.com/RGRQy.png

Thanks! Here's mine if anyone's interested. https://github.com/tylerball/dotfiles/blob/master/.osx

If anybody else ran into the problem on OS X Lion where, even after turning on devmode on the Dashboard, you couldn't get widgets to show up on the desktop: first go to the Mission Control preference pane and uncheck "Show Dashboard as a space". Took me a while to figure that out.

What I want is something to reduce/eliminate the animation when switching spaces with the three finger swipe in Lion. It is so slow that I find it unusable.

A million times this. A temporary fix (if you have up to four spaces) is to assign the arrow hotkeys to go to a space directly -- that speeds up the super slow animation to about what Snow Leopard's animation was.

The ability to completely disable the animation (like we could in Snow Leopard) would be amazing though.

The intensity of the swipe seems to affect the speed if that helps any. A fast swipe switches spaces almost instantly... I don't know how practical this is on a magic mouse but it works ok on a trackpad.

The top of my list is always this.

# Show hidden files/folders

defaults write com.apple.finder AppleShowAllFiles TRUE

You can show hidden files in an open dialog by hitting "Cmd-Shift-period". It unfortunately doesn't work in finder though.

thanks! I've been poking around for how to do that for a week, but hadn't stumbled on it.

I got a new Macbook pro today and that was the second thing I did to it, after installing Chrome

I disable resume for Quicktime Player as well (I find it even more annoying than Preview):

  defaults write com.apple.QuicktimePlayerX NSQuitAlwaysKeepsWindows -bool false

OS X keyboard is so slow for me, so I set this one

    defaults write NSGlobalDomain KeyRepeat -int 0
To make it blasting fast almost like in Linux (Gnome).

I'm not on Lion, but I use an external keyboard with a 2008 MB and recently it's downright slow. So much that if I type after a long break it doesn't pick up on the keystrokes properly.

Is that what you mean by slow?

Yeah, delay until repeat and key repeat settings, with this you can make them faster and shorter than the UI allows you to.

I agree that the default keyboard repeat settings are far too slow. I always slide the Key Repeat and Delay Until Repeat options to the very right (fastest and shortest, respectively).

  defaults write com.apple.dock no-glass -bool true
It is interesting how many people don't like the 3D dock. Maybe Apple should think about this.

Side-dock is the only way to go.

Yeah, I don't know if I could use OS X without

  defaults write com.apple.dock pinning start
and either

  defaults write com.apple.dock orientation right

  defaults write com.apple.dock orientation left

I've always hated it and I tend to revert/like the defaults over time (out of simplicity). A 3 dimensional UI element smack bang on an otherwise 2D environment sticks out like a sore thumb and is totally unnecessary when the 2D variant is both attractive and direct.

Wow thanks, I've been looking for this.

Is there a way to disable that awful grey-blue void at the top of every webpage in Safari, that the bounce-scroll resorts to on an overshot?

Switch to a sensible browser like Chrome. ;)

But really, Safari feels incredibly slow compared to Chrome. I always get these strange delays/beachball moments when simply browsing and opening a new tab in Safari.

Is there any way to disable or shorten the animation that happens when you switch spaces or whatever they renamed them to. I like being able to switch between MacVim in one space and my terminal in another and the animation slows me down that by the time it is done animating it has missed all of my keystrokes for running make or other build tools ...

The first one is BRILLIANT. I've been wanting this forever. The one thing that I miss from being a Windows user back in the day.

Is this somehow different from the "Full Keyboard Access: All controls" setting under System Preferences > Keyboard > Keyboard Shortcuts?


And many of the ones I skimmed can be set from various other GUIs as well. This is just an easy way to apply one person's set of preferences to your machine.

Ah, I see. I assumed that this was a selection of mostly-hidden features like http://secrets.blacktree.com/. Anything that helps me avoid dialog-diving on a new machine is good in my book.

Totally agree - just set this on Snow Leopard (enable tab in modal dialogs), and has come in handy already.

I'm looking for the setting that stops OSX from asking me to retype my admin password 1000 times per hour.

ME: Cmd+c

Macbook Air: Seriously??? OK, if you really want to copy that text I'll let you, but first you'll need to prove that you're an administrator.

Are you talking about editing system files through finder? Finder isn't (and shouldn't be) running as an administrator. But it is possible to run finder as root if you really want, just google it. I bet it something like

    killall Finder; sudo /application/Finder;

I've been developing on OSX for years and have never run into that scenario. What, pray tell, are you doing where CMD+C requires privilege elevation?

C'mon, that was a joke. It was meant to illustrate how trivial an operation you can run and still have OSX pull you up on it.

Basically, anything you do that alters the computer in any way causes it to complain at you. I'm looking for the setting where you can say "yes, seriously, I'm admining. leave me alone."

On the command line, you get sudo, which remembers your password for a while after you've entered it. As far as I can tell, there's no equivalent for OSX, so installing a single piece of software can involve half a dozen password prompts.

It's been a long time since I came up with this solution, and not necessary anymore for TextMate, but something along these lines may help you:


It's the graphical "sudo make me a sandwich"

Except sudo remembers that you entered your password < N minutes ago instead of asking every time.

The Mac Kung Fu book from Pragmatic Bookshelf describes lots of hidden defaults settings. http://pragprog.com/book/ktmack/mac-kung-fu

Just wish I could figure out how to disable the damn Spaces/Mission Control 'swoosh' switch animation like you could in Leopard :(

What gets me is the option-click that hides the window you're moving away from. Does anyone know how to disable that?

Release the option key before clicking?

What usually happens: I select line(s) in MacVim and option-click on xterm to paste, hiding MacVim which prevents me Cmd-Tabbing back to it.

Is there also a setting to make a current-gen MBA wake up reliably from deep sleep?

I always used this to enable horizontal buttons for iTunes in favor of the odd vertical buttons.

defaults write com.apple.iTunes full-window -1

Nowadays this is the default again, no?

so this disables resumes for Preview:

defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool false

Is there a way to disable resume for every app? Maybe it's just this?

defaults write com.apple.* NSQuitAlwaysKeepsWindows -bool false

I believe you can do that via Settings > General.

I’d love to get a command-line version though :)

    defaults write .GlobalPreferences NSQuitAlwaysKeepsWindows -bool NO

Instead of saying that so many times, why not just toggle the system-wide preference and look at the file that was changed? And then toggle it again and diff the two.

well now i feel dumb


    defaults write com.apple.TextEdit NSQuitAlwaysKeepsWindows -bool false
work as well? This feature is infuriating and buggy.

Yes, that works.

If — like me — you hate the Resume feature so much, you can disable it system-wide in System Preferences. I’m still looking for a command that does this :)

And there we go:

    defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false
Commit: https://github.com/mathiasbynens/dotfiles/commit/7346f4c4592...

Thank you very, very much. I hadn't even thought to look for such an option. It still took Googling to find it. Much, much better. :)

Why not then tell people where it is then! :)

After I googled for it as well, I can tell you it is in General (top left icon), near the bottom.

What specifically makes you think it is buggy? Did you file a bug?

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact