Authenticate with sudo using Touch ID

Turns out it’s possible to authenticate with sudo using Touch ID, as per this (old) tweet by Cabel:

Note that this will work against when SSH’ing into your machine, and then trying to run sudo:

If you set this up, do realize that anyone who can access your account using their finger (*) can now also do wrong things.

~

(*) It’s possible to add more than one fingerprint to Touch ID.

In addition to my 2 index fingers, my wife can also access my computer using Touch ID.

Using the Numpad in vi over SSH

One of the things that kept on bothering me when SSH’ing is that the keys of the numpad would not work in vi: when pressing any key on the numpad, another key would be sent somehow.

Should’ve Google’d this a lot earlier because the fix is very simple: in the preferences of Terminal, go to Profiles → Your Profile → Advanced and uncheck the “Allow VT100 application keypad mode” option.

You can also tweak this setting from the CLI using PlistBuddy:

/usr/libexec/PlistBuddy -c "Delete 'Window Settings':Pro:StrictVTKeypad" ~/Library/Preferences/com.apple.Terminal.plist > /dev/null 2>&1
/usr/libexec/PlistBuddy -c "Set 'Window Settings':Pro:StrictVTKeypad bool true" ~/Library/Preferences/com.apple.Terminal.plist

There, much better 🙂

☝ I’ve also added this tweak to ./freshinstall, a tool which I built to automatically configure my MacBook (Preferences, Dotfiles, Installed Software, etc)

Did this help you out? Like what you see?
Thank me with a coffee.

I don't do this for profit but a small one-time donation would surely put a smile on my face. Thanks!

☕️ Buy me a Coffee (€3)

To stay in the loop you can follow @bramus or follow @bramusblog on Twitter.

Mirror Displays — A Mac app and command-line tool for fiddling with display mirroring

MirrorDisplays a simple application that toggles between mirrored and extended desktop modes. It’s the easiest way to turn on, or turn off display mirroring.

Also comes with a (separately installable) CLI tool which makes this pretty interesting

The command line tool is good for giving shell-scripts the power to control display mirroring and opens up the possibility of controlling mirroring remotely over ssh.

usage: mirror [option]    Only the first option passed will be applied
  -h            Print this usage and exit.
  -t            Toggle mirroring (default behavior)
  -on           Turn Mirroring On
  -off          Turn Mirroring Off
  -q            Query the Mirroring state and write "on" or "off" to stdout
  -l A B        Makes display at index B mirror the display at index A

Unfortunately not installable using Homebrew, so you’ll have to get the app from the GitHub releases page. You’ll also have to explicitly allow the mirror CLI tool to be opened through the Security & Privacy

mirror-displays (GitHub) →
Mirror Displays Introductory Post →

💡 If you’re using a MacBook with only one external display connected you might not need this app, and can use the CMD+F1 shortcut to toggle display mirroring/extending.

Automatically Fix Bluetooth Audio Balance Drift in macOS with “Balance Lock”

It’s been over 10 years that I’ve been using macOS (then OS X) and every now and then I notice that the audio balance of my Bluetooth headset is off for no apparent reason.


Hmm, why is the balance for my headphone suddenly off?

Back in 2014 I was lucky enough to see this tweet by Shaun Inman float by, in which he linked to a manual solution using macOS’s built-in Audio Midi Setup.app:

Ever since then I’ve been taking those manual steps to fix it whenever the issue occurred (which is quite often).

☝️ I know, you can also do it through the System Preferences nowadays. Back then that wasn’t the case though.

~

As I encountered the issue again today, I wondered if there was no automatic way to fixing this issue. Turns out there is, with the utility app Balance Lock

Headphones a little off or noticing your audio isn’t quite centered? Balance Lock will keep your audio centered and fix the annoying left/right drift bug.

It’s simple to use and runs in the background un-intrusively.

You can find Balance Lock for free on the App Store, or install it using mas

mas install 1019371109

Come on Apple, fix this longstanding bug or Sherlock the shit out of this app 😉

Balance Lock →

💁‍♂️ I’ve also added this handy tool to ./freshinstall, a tool which I built to automatically configure macOS (Preferences, Dotfiles, Installed Software, etc).

~

Did this help you out? Like what you see?
Thank me with a coffee.

I don't do this for profit but a small one-time donation would surely put a smile on my face. Thanks!

☕️ Buy me a Coffee (€3)

To stay in the loop you can follow @bramus or follow @bramusblog on Twitter.

Watch PIP YouTube videos on macOS with pipcorn

With pipcorn you can spawn a picture-in-picture YouTube player on your Mac without installing anything!

Install it globally using npm, or run it directly using npx:

npx pipcorn https://www.youtube.com/watch?v=dQw4w9WgXcQ

Basically it’s a wrapper around ytdl (to get the MP4 URL) and open-pip-cli (to open a PIP player).

Love the name, too.

pipcorn Source (GitHub) →

Display the macOS Dock in Touch Bar using Pock

Display macOS Dock in Touch Bar. It’s free and open source!

Not that I’d use it (I always use the “Expanded Control Strip” to make the Touch Bar show the “regular” keys), but I found this one quite interesting and it looks really cute.

Installation possible per brew cask:

brew cask install pock

You can opt to show all Dock icons in there, or only those of the active applications. App thumbnailing also possible. And oh, a Kit to write your own Pock plugins is in the making.

Pock →
Pock Source (GitHub) →

⚠️ If you’re running Catalina 10.15, it will ask you for a few permissions. These are explained in the Pock docs.

macOS Mojave: Disable the floating screenshot thumbnail (using defaults write)

A tweet that’s been making rounds this week is on how to disable macOS Mojave’s floating screenshot preview thumbnail (and remove that delay along with it).

Nice, but there’s also a way to do this from the CLI:

defaults write com.apple.screencapture show-thumbnail -bool FALSE
killall SystemUIServer

There, much better 😉

Happy Screenshotting! 📸

☝ I’ve also added this tweak to ./freshinstall, a tool which I built to automatically configure my MacBook (Preferences, Dotfiles, Installed Software, etc)

Did this help you out? Like what you see?
Thank me with a coffee.

I don't do this for profit but a small one-time donation would surely put a smile on my face. Thanks!

☕️ Buy me a Coffee (€3)

To stay in the loop you can follow @bramus or follow @bramusblog on Twitter.