Author: Josh

Automatically hide and show menu bar in full screen

I use full screen mode on my MacBook pretty frequently. Swiping back and forth between full screen apps has always been a workflow that just comes naturally to me. One downside is that I’ve always had to move my mouse to the top of the screen to show the menu bar in order to check the current time.

On the new MacBook Pros, full screen mode hides the notch by default. Where the menu bar would be is just black. You can have the menu bar show even in full screen mode though. I haven’t found a way to conditionally show the menu bar only on the MacBook display, but on my external displays there is enough screen real estate that I think I prefer having the menu bar always visible anyway.

From the command line:

defaults write NSGlobalDomain AppleMenuBarVisibleInFullscreen -int 1

Or from System Preferences, Dock → Menu Bar:

Yet Another 14″ MacBook Pro Review

Physically the new MacBook Pros look sturdier than the previous generation. I’ve seen them compared the last generation of PowerBooks. The new design is growing on me, but I wasn’t initially a fan of the bulkier look. One interesting side effect of the bigger case is that even though they are a bit heavier, they feel lighter than they look.

I don’t have much to say about the display or notch that hasn’t already been said elsewhere. The existence of the notch is a trade-off, but one that seems so obviously worth it to me. Getting uniform bezels in return for sacrificing part of the screen I rarely used is a win in my book.

I’ll miss the fourth USB-C / Thunderbolt port, but SDXC, HDMI, and MagSafe ports more than make up for it. I’m also glad we didn’t have to sacrifice charging over USB-C to get the MagSafe port back. At my desk I like to “dock” to an external display with a single Thunderbolt cable (where it’s unlikely anyone is going to trip over the power cable that is zip-tied to the underside of my desk). MagSafe is clearly superior for charging on the go, however.

Almost every app I use has been compiled as a Universal app at this point. I’ve heard from some M1 early adopters that setting up homebrew was a pain at first, but it works great now. Docker still requires Rosetta for some of the binaries, but I haven’t had any problems there either. It seems like so many developers are now using Apple Silicon computers that any apps that hadn’t been updated are in the process now.

I appreciate the return of real function keys more than I anticipated. (I’m regaining the muscle memory to mute/unmute and play/pause without having to look down at the TouchBar.) As a bonus, the Magic Keyboard with Touch ID works with these new machines as well. There was initially a weird trackpad bug causing gestures to stop working, but I haven’t had any problems in the past week.

Overall it’s a great computer. There are still a couple of rough edges related to the architecture change, but they’re quickly disappearing and I think worth dealing with in the short term.

Block Remote Content in MacOS 12 Mail.app

MacOS 12 and iOS 15 introduced Mail Privacy Protection, which is meant to prevent tracking pixels from revealing when and where you open an email. This is a good change that improves privacy for most people.

However, if you previously had remote content disabled in Mail.app on iOS or MacOS, it seems that you have to do it again after upgrading. By default, Protect Mail Activity is enabled, which allows remote content to be download, albeit in the background. If you want to fully block remote content, you have to disable Protect Mail Activity, and enable Block All Remote Content. This works in both iOS and MacOS.

Home Office Setup

In March of 2020, I finally started putting together my home office. I’ve been working from home since 2013, but for various reasons, I never put that much thought into a home office until the beginning of the COVID-19 pandemic.

A lot of this was purchased through a home office allowance that Automattic graciously provides. I’m lucky to work for a company that has always been fully distributed and understands the value of ensuring everyone has a good workspace. I know home office setups weren’t everyone’s top priority a year and a half ago.

Desk

The desk is an UPLIFT V2 with a 60″x30″ Rubberwood top. I previously had a much smaller desk with a manual crank. The manual crank was actually fine but I wanted something that was big enough for two monitors and a lamp, at least. The extra space helps it feel less cluttered, which is important for my ability to concentrate.

Desk Chair

The chair is a Herman Miller Mirra 2. I’ve had this one for over 8 years and it’s showing no signs of wearing out any time soon. I know this is a clichĂ©, but if anything is worth spending extra money on, it’s a good chair. Your back will thank you.

Armchair

I love having a comfy armchair in my office. This was a March 2020 addition and I think it’s my favorite thing in here. (It’s definitely my dog’s favorite thing.) This is the IKEA STRANDMON. It’s the perfect place to meditate, catch up on some reading, or just find a slightly comfier place to work through a coding problem.

Displays

There are two monitors — an LG 27″ UltraFine 5K and a Dell U2417H.

The LG connects to my MacBook over USB-C, which also provides power. The Dell uses a DisplayPort to USB-C adapter. In an ideal world, I could daisy chain these monitors and just have one cable going to the MacBook. Unfortunately, the 5K version of the LG doesn’t support daisy-chaining. I added the Dell later on. It’s not high-DPI, so switching back and forth between the two displays can be a little jarring. In hindsight, I should have splurged for two 24″ 4K displays from the start.

Keyboard and Mouse

For input, I use the Apple Magic Mouse, Magic Keyboard, and Magic Trackpad combo. I had been using just the Magic Keyboard and Magic Trackpad for many years, but recently got the mouse as well. The consistency of having a Trackpad available regardless of whether I’m at my desk is nice, but I’m appreciating a mouse for the big screens. I know the Magic Mouse is a little controversial. I do a lot of navigating on the keyboard, so the ergonomics aren’t really a problem.

I’ve also tried the Keychron K2. It’s very fancy but just can’t get used to it. I really want to like it — every couple of months I take it out again. I think years of primarily using the MacBook keyboard make it easy to use the Apple keyboard compared to the slightly different layout of the K2.

Audio

Behind the desk is a shelf with Q Acoustics 3020i Bookshelf Speakers, a Sony STRDH190 Reciever, and a Fluance RT80 Record Player. I also have an old AirPort Express plugged into the receiver so I can stream music to the speakers over AirPlay. I have a small vinyl collection and I love listening to it while I work from time to time, but it isn’t exactly compatible with the blocks of uninterrupted time needed to solve complex programming problems.

I also have a pair of WordPress-branded Sony WH-1000XM4s that are great on a plane or when I need noise-canceling to help me concentrate.

Lighting

There’s a Philips Hue Beyond lamp on the desk and another lamp in the corner with a Hue bulb. I’ve used Hue lights throughout the house for many years. With HomeKit’s Adaptive Lighting feature, they start out warm in the morning, transition to cooler colors in the middle of the day, and go back to warm colors at night. I don’t know how much this does to help with concentration, but it sounds nice.

Miscelaneous

  • A plant from Wildewood, a local plant shop in Madison.
  • A PUGG wall clock from IKEA.
  • A fantasy football trophy.
  • Prints with Andrew McMahon lyrics.
  • A Martin LX1E (not pictured) for when I’m stuck on a problem and it’s too cold or wet to take a walk.

git add -p

I have auto-formatting and linting configured in my text editor. It’s great for automatically fixing most code format issues and I highly recommend it. However, when working with legacy codebases, this can make for some messy diffs.

I’ll usually try to disable auto-formatting if I anticipate an issue, but sometimes I’m not expecting it or forget. Rather than manually reverting the changes, it’s usually easier to stage the changes I want, commit, and then reset the unstaged changes.

To interactively choose which parts I want to stage, I use git add -p.

From the manpage:

-p --patch Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives the user a chance to review the difference before adding modified contents to the index. This effectively runs add --interactive, but bypasses the initial command menu and directly jumps to the patch subcommand. See “Interactive mode” for details.
Code language: plaintext (plaintext)

When you run the command, you’ll initially see the first part of the patch with a prompt for how you want to handle it.

(1/55) Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]?
Code language: plaintext (plaintext)

From the Interactive Mode docs:

y - stage this hunk n - do not stage this hunk q - quit; do not stage this hunk or any of the remaining ones a - stage this hunk and all later hunks in the file d - do not stage this hunk or any of the later hunks in the file g - select a hunk to go to / - search for a hunk matching the given regex j - leave this hunk undecided, see next undecided hunk J - leave this hunk undecided, see next hunk k - leave this hunk undecided, see previous undecided hunk K - leave this hunk undecided, see previous hunk s - split the current hunk into smaller hunks e - manually edit the current hunk ? - print help
Code language: plaintext (plaintext)

After staging all the relevant hunks, you can commit and push as normal. Then git reset --hard resets the other pending changes.

The GitHub Desktop app as similar functionality to commit parts of a given change using a GUI interface.