- Shell 91.5%
- Lua 8.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Prepending the coreutils/findutils/gnu-sed/grep gnubin dirs put GNU stat, date, sed, grep and find on the PATH under their un-prefixed names, which silently breaks any script written against the macOS versions. Portable scripts typically probe BSD-first and fall back to GNU, so the BSD probe succeeds against a GNU binary that means something else entirely and the fallback never fires. The Claude Code statusline was a live example: it reads a cache file's mtime with `stat -f %m`, which GNU stat parses as a *filesystem* format string. That emits a multi-line blob, the following arithmetic hits a syntax error, and because an arithmetic error aborts the shell the enclosing function returned early - so the git branch segment silently vanished on every warm-cache render. Its `date -j -r` reset timestamps failed the same way. Homebrew installs the g-prefixed variants into $HOMEBREW_PREFIX/bin regardless, so gstat / gdate / gsed / ggrep / gfind still give GNU behaviour on demand. Note BSD sed needs `sed -i ''` rather than `sed -i`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
| bin | ||
| claude | ||
| ghostty | ||
| gnupg | ||
| neovim | ||
| zsh | ||
| bootstrap.sh | ||
| brew.sh | ||
| delta-themes.gitconfig | ||
| gitconfig | ||
| gitignore | ||
| hushlogin | ||
| LICENSE | ||
| macos.sh | ||
| README.md | ||
| sheldon.toml | ||
| tmux | ||
| zshrc.zsh | ||
dotfiles
Here’s my dotfiles, inspired by people like Mathias. See his dotfiles at
https://github.com/mathias/dotfiles.
The idea I’m currently going down is to create a symlink from $HOME to this
directory. There is one exception to this, the .gitconfig file. I don’t want actual commiter details committed into this repo. So my git credentials are
stored in a .extra file which gets sourced. This then calls the relavent git
command, which causes git to edit $HOME/.gitconfig. If that file was a symlink
to this repo, then the repo would see the file as edited and the repo would then
be in a dirty state, permanently.
Usage
First clone the repo.
As mentioned above my git credentials are stored in an untracked file:
$HOME/.extra. This must be manually created, mine looks something like:
# Git credentials
GIT_AUTHOR_NAME="Jonny Barnes"
GIT_COMMITER_NAME="$GIT_AUTHOR_NAME"
git config --global user.name "$GIT_AUTHOR_NAME"
GIT_AUTHOR_EMAIL="jonny@jonnybarnes.uk"
GIT_COMMITER_EMAIL="$GIT_AUTHOR_EMAIL"
git config --global user.email "$GIT_AUTHOR_EMAIL"
Run ./boostrap.sh, this will create all the necessary symlinks, then source
.zshrc.
Warning
This is a destructive process, so backup your dotfiles first.
Auto switch between light and dark mode
To switch between dark and light mode automatically, we use a helper lib.
Clone it from https://github.com/bouk/dark-mode-notify then run make and make install.
Then make a script to run is automatically, put the plist where your system can find it: ~/Library/LaunchAgents/ke.bou.dark-mode-notify.plist with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ke.bou.dark-mode-notify</string>
<key>KeepAlive</key>
<true/>
<key>StandardErrorPath</key>
<string>/Users/jonny/.local/var/log/dark-mode-notify-stderr.log</string>
<key>StandardOutPath</key>
<string>/Users/jonny/.local/var/log/dark-mode-notify-stdout.log</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/dark-mode-notify</string>
<string>/Users/jonny/git/dotfiles/zsh/dark-mode-notify.zsh</string>
</array>
</dict>
</plist>
Make the log file and script file point to the right location. For clarity dark-mode-notify.zsh is in this repo.