Skip to main content
  1. Articles/

My macOS Setup

·4 mins

As I said in the previous article, I made some customizations, and I think it is worth sharing them, because maybe I will need them in the future, so this article is also my documentation!

Three-Finger Tap for Middle Click #

I don’t know why, but macOS introduced the three-finger tap to middle click, other operating systems implemented it, and now I have found that it has been removed. I use the middle click to close tabs, open links in new background tabs, paste a selection on the terminal, and close applications. It works on macOS if you use a mouse, but you don’t have an option when you use the trackpad. I found and installed the MiddleClick utility on GitHub. Give it a try!

Better Task Switcher #

I tried, but mission control tends to slow me down when I have to find a window. It takes me some time to scan and identify what to switch to. For this reason, I installed AltTab

AltTab
I also modified the shortcut, since I find it more ergonomic to use the Command key instead of the Alt for task switching (or maybe because I still have some muscle memory on the Windows Layout)
AltTab settings

Karabinier Elements #

No, I didn’t remap my keyboard to have the exact window layout. I don’t even recommend it since every macOS application can ignore remapping (especially Electron ones like VSCode, Slack, Notion, and so on).
Don’t waste your time writing rules to remap your keyboard for every application. Trust me. I’ve already been there and it’s not pleasant. Simply adapt and go with it. It’s part of the process. I still need Karabiner because I have an Italian keyboard, but I use it with an English layout. So the backtick key is usually mapped with this character, which does not have a real use for me; the backtick is mapped near the “Z” letter. If you write in Italian, you have to use accents (at least two types of them), and the backtick is used to act as a modifier key, because on the ISO keyboard, it is the only method. So I swapped the two letters with a simple rule. Here’s the configuration

{
  "profiles": [
    {
      "name": "Default profile",
      "selected": true,
      "simple_modifications": [
        {
          "from": { "key_code": "grave_accent_and_tilde" },
          "to": [{ "key_code": "non_us_backslash" }]
        },
        {
          "from": { "key_code": "non_us_backslash" },
          "to": [{ "key_code": "grave_accent_and_tilde" }]
        }
      ]
    }
  ]
}

Nix Package Manager #

As I said, I wanted to avoid homebrew and touching the base system. Lucky me, I found a port of the Nix package manager for macOS (I’m a big fan of NixOS, someday.. ) I installed Nix from determinate systems (it seems more straightforward, also to uninstall)

curl -fsSL https://install.determinate.systems/nix | sh -s -- install --determinate

Please don’t trust this code Once I installed Nix, I installed packages with

nix profile add nixpkgs#packagename

Here are my installed packages

awscli2
bashInteractive
curl
devenv
fish
git
jq
podman
podman-compose
ssm-session-manager-plugin
wget

You can see that there’s a strange devenv package, here’s the other trick

Devenv.sh #

Devenv.sh lets you create a development environment inside a directory without installing packages in the running systems. It works like a Python virtual environment but works for everything you can install using the Nix package manager.

Install it by going to deven.sh. Once in a directory, you can invoke devenv init and customize the devenv.nix file. Once you’re ready, you can activate the virtual environment by running

devenv shell

Here are some examples:

Python project #

  languages.python.enable = true;
  languages.python.venv.enable = true;

  # https://devenv.sh/packages/
  packages = [ pkgs.git ];

Hugo installation #

 env.LANG = "en_US.UTF-8";

  languages.go.enable = true;
  packages =
    with pkgs;
    [
      hunspell
      hunspellDicts.en_US
      hugo
      nodePackages.markdownlint-cli
    ]

It works like a charm, and my system packages are still intact!

iTerm2 with easy keyboard navigation #

I found that keyboard navigation is broken when using zsh. You still need to enter the codes instead of using Alt + cursor. There’s an iTerm setting to map this behavior:

iTerm settings
Select “Natural text edit” and you’re set!

Now I’m all set and ready to work. I hope that you found something useful for your daily workflow.

Damiano Giorgi
Author
Damiano Giorgi
Ex on-prem systems engineer, lazy and prone to automating boring tasks. In constant search of technological innovations and new exciting things to experience. And that’s why I love Cloud Computing! At this moment, the only ‘hardware I regularly dedicate myself to is that my bass; if you can’t find me in the office or in the band room try at the pub or at some airport, then!

comments powered by Disqus