#!/bin/bash # Hammerspoon config. Dry run by default; pass `yes` to apply. set -euo pipefail # shellcheck source-path=SCRIPTDIR # shellcheck source=lib.sh source "$(dirname "$0")/lib.sh" "$@" link "$config_dir/hammerspoon/init.lua" "$xdg_config_dir/hammerspoon/init.lua" # The helpers init.lua and a machine's own local.lua both require. Linked as its # own file, not the directory: that directory is where local.lua lives. link "$config_dir/hammerspoon/dotlib.lua" "$xdg_config_dir/hammerspoon/dotlib.lua" if [[ "$(uname)" == "Darwin" ]] then if [[ -n "${is_dry_run}" ]] then echo "Will set: " echo "defaults write org.hammerspoon.Hammerspoon MJConfigFile \"~/.config/hammerspoon/init.lua\"" else defaults write org.hammerspoon.Hammerspoon MJConfigFile "$HOME/.config/hammerspoon/init.lua" fi fi