Skip to content

cantecim/dotfiles

Repository files navigation

.files

These are my dotfiles. Take anything you want, but at your own risk.

It mainly targets macOS systems (should install on e.g. Ubuntu as well for many tools, config and aliases etc).

TODOs

  • empty for now

Highlights

  • Minimal efforts to install everything, using a Makefile
  • Mostly based around Homebrew, Caskroom and Node.js, zsh + latest GNU Utils
  • Oh my Zsh included
  • Great Window management (using Hammerspoon)
  • Fast and beautiful theme
  • Updated macOS defaults
  • Well-organized and easy to customize
  • The installation and runcom setup is tested weekly on real Ubuntu and macOS machines (Monterey/12 and Ventura/13) using a GitHub Action
  • Installs spoofdpi with homebrew, you can use with unblock alias (A local proxy server to bypass DPI procedures of your ISP)
  • Incognito mode for zsh thanks to Stephan Sokolow
  • Supports both Apple Silicon (M1) and Intel chips
  • dot update command to automate upgrades across all package managers
  • NEW: Johnny.Decimal supports
    • jd_* prefixed functions to help your JD file system
  • EXTRA: Lightweight command help via tldr CLI tool

Packages Overview

Installation

On a sparkling fresh installation of macOS:

sudo softwareupdate -i -a
xcode-select --install

The Xcode Command Line Tools includes git and make (not available on stock macOS). Now there are two options:

  1. Install this repo with curl available:
curl -fsSL https://raw.githubusercontent.com/cantecim/dotfiles/main/remote-install.sh | bash

This will clone or download this repo to ~/.dotfiles (depending on the availability of git, curl or wget).

  1. Alternatively, clone manually into the desired location:
git clone git@github.com:cantecim/dotfiles.git ~/.dotfiles
  1. Use the Makefile to install the packages listed above, and symlink runcom and config files (using stow):
cd ~/.dotfiles
make

Running make with the Makefile is idempotent. The installation process in the Makefile is tested on every push and every week in this GitHub Action. Please file an issue in this repo if there are errors.

Post-Installation

  1. Install Avast Security

    You can skip this step if you'd like to.

open "`brew list --cask -v avast-security | grep Security.pkg`"
  1. Set your Git credentials:

    It is configured for me by default

git config --global user.name "your name"
git config --global user.email "your@email.com"
git config --global github.user "your-github-username"
  1. Install zsh extra features, set macOS Dock items and system defaults:
dot zsh
dot mas
dot dock
dot macos
  1. Start Hammerspoon once and set "Launch Hammerspoon at login".

  2. Populate this file with tokens (example: export GITHUB_TOKEN=abc):

nano ~/.dotfiles/system/.exports
  1. Restore your application configurations
mackup restore

See this section for more info

  1. Enable special env setup for Claude Code
touch ~/.claude_env

WARNING

⚠️ do not use empty env file, it might break shell tool, see the issue #40977 for more info

Put special env setup needs for Claude Code into the file

Using mackup

You can use mackup to backup and restore your application settings with ease.

If you don't have any backup yet, after installing these dotfiles for the first time, you might want to run mackup backup

Or, if you'd like to backup from another mac, you can login to your iCloud account and run

echo "[storage]" >> .mackup.cfg
echo "engine = icloud" >> .mackup.cfg
echo "" >> .mackup.cfg
echo "[applications_to_ignore]" >> .mackup.cfg
echo "zsh" >> .mackup.cfg
brew install mackup
mackup backup

Default settings

Mackup is configured to use iCloud as storage engine, this means it will backup to and restore from there.

WARNING

⚠️ before switching to another device, make sure you backup your data!

Backup your data

If you're migrating from an existing Mac, you should first make sure to backup all of your existing data. Go through the checklist below to make sure you didn't forget anything before you migrate.

  • Did you commit and push any changes/branches to your git repositories?
  • Did you remember to save all important documents from non-iCloud directories?
  • Did you save all of your work from apps which aren't synced through iCloud?
  • Did you remember to export important data from your local database?
  • Did you update mackup to the latest version and ran mackup backup?

tldr CLI: simplified help for commands

tldr provides simplified and community-driven manual pages. It's helpful to learn and recall common usage patterns.

Example:

tldr tar

Install:

npm install -g tldr

Included in npmfile and installed during make.


The dot (or dotfiles) command

$ dot help
Usage: dot <command>

Commands:
   clean            Clean up caches (brew, cargo, gem, pip)
   dock             Apply macOS Dock settings
   duti             Set default apps for file types (UTI)
   edit             Open dotfiles in IDE ($VISUAL) and Git GUI ($VISUAL_GIT)
   help             This help message
   macos            Apply macOS system defaults
   zsh              Install zsh extra stuff
   mas              Install macOS apps from App Store using mas CLI
   logioptions      Install Logi Options+ app for Logitech devices
   startuphook      Inject startup hook daemon
   rm-startuphook   Remove startup hook daemon
   test             Run tests
   update           Update packages and pkg managers (brew, casks, cargo, pip3, npm, gems, macOS)

What is included in dot update?

Runs system-wide update routines across various environments. It ensures all developer tools are up-to-date in a single command.

  • brew upgrade (packages and casks)
  • npm update -g (npmfile)
  • pip3 install --upgrade for global packages
  • gem update
  • cargo install-update
  • Runs system update hooks like dot macos

Useful after long breaks or machine migrations to sync environments fast.

What is included in dot zsh?

Install extra zsh plugins

  • zsh-syntax-highlighting

What is included in dot mas?

Install macOS apps defined in install/Masfile using mas CLI

  • Xcode
  • Microsoft To Do
  • 1Focus
  • Flow
  • Day Progress
  • Menu Bar Calendar
  • MoneyWiz
  • Pages
  • Numbers
  • etc.

What does startup hook daemon injection do?

It registers the startup daemon as launch agent under GUI of current user (user agents of current user, i.e. login item for current user) using launchctl, startup daemon basically runs the script daemon/startuphook.sh (see plist file)

What startuphook.sh do then?

When it started (so when computer runs) it executes unblock-discord command, and when shutting-down executes unblock-quit

Basically, runs unblocker automatically to use discord without any break


The JD utilities

jd_rename <target_id> <new_id>

If you would like to rename/shift/move your IDs use this function

more TBImplemented

How to use incognito mode

Type anonsh to go incognito in your current shell, but beware that you still need to run clean up commands before exiting

  • Use clear to clear both the screen and scrollback buffer
  • Use fc -p to clear command history without affecting your usual HISTFILE

Customize

To customize the dotfiles to your likings, fork it and be the king of your castle!

Credits

  • This project is based on webpro's dotfiles repository (thanks webpro!)
  • Inspired from driesvints/dotfiles esp. on mackup
  • Also inspired from codfish/dotfiles esp. on zsh-autosuggestions plugin
  • And many thanks to the dotfiles community.

About

Dotfiles for macOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors