Agent skill

automating-hammerspoon

Manage Hammerspoon hotkeys, launchd agents, Ghostty on macOS. Trigger: 'Hammerspoon 단축키', '핫키 설정', 'Ghostty 새 창', 'launchd agent', 'eventtap', '데스크탑 자동화'.

Stars 1
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/greenheadHQ/nixos-config/tree/main/.claude/skills/automating-hammerspoon

SKILL.md

Hammerspoon 자동화

Hammerspoon 단축키, launchd 서비스, Ghostty 연동 가이드입니다.

목적과 범위

macOS에서 Hammerspoon 자동화, launchd 연계, Ghostty 동작 이슈를 진단하고 복구하는 절차를 다룬다.

핵심 절차

  1. ~/.hammerspoon/init.lua와 LaunchAgent 상태를 함께 점검한다.
  2. launchctl list로 비정상 agent를 식별한다.
  3. Ghostty 다중 인스턴스/단축키 문제를 재현 후 설정을 수정한다.
  4. 재로드 후 핵심 단축키 동작을 검증한다.

Known Issues

darwin-rebuild 시 setupLaunchAgents 멈춤

  • launchd agent가 제대로 종료되지 않으면 멈출 수 있음
  • 해결: launchctl list | grep -v com.apple 확인 후 문제 agent 제거

한글 입력소스에서 Ctrl/Opt 단축키

  • macOS 기본 동작으로 한글 IME에서 Ctrl/Opt 키 조합이 동작 안 함
  • Hammerspoon에서 eventtap으로 강제 처리

Ghostty 새 인스턴스 문제

  • Ghostty 바이너리를 직접 실행하면 새 인스턴스로 열릴 수 있음 (Dock에 여러 아이콘)
  • 해결: 실행 중이면 hs.application.get("Ghostty") + Cmd+N, 미실행이면 open -a Ghostty

빠른 참조

주요 단축키

단축키 동작
Ctrl+Option+Cmd+T Finder에서 현재 폴더로 Ghostty 열기
Ctrl+; 영어 입력으로 전환
Cmd+Shift+Space 영어 전환 후 Homerow 실행
Ctrl+B 영어 전환 후 tmux prefix 전달
Ctrl+C/U/K/W/A/E/L/F Ghostty 전용 Ctrl 단축키 (CSI u 우회)
Opt+B/F 터미널 앱에서 단어 단위 이동

설정 파일 위치

파일 용도
modules/darwin/programs/hammerspoon/default.nix Nix 모듈 (파일 배포 선언)
modules/darwin/programs/hammerspoon/files/init.lua Hammerspoon 메인 설정 (소스)
modules/darwin/programs/hammerspoon/files/foundation_remapping.lua Caps Lock → F18 리매핑 (소스)
modules/darwin/programs/hammerspoon/files/ensure-chrome-autoconnect.sh Chrome DevTools MCP 자동연결 (소스)
~/Library/LaunchAgents/ launchd 사용자 에이전트

launchd 디버깅

bash
# 현재 로드된 에이전트 확인
launchctl list | grep -v com.apple

# 특정 에이전트 상태
launchctl list <label>

# 에이전트 언로드 (권장)
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/<plist>

# 에이전트 로드 (권장)
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/<plist>

# 레거시 명령 (deprecated, 호환용)
launchctl unload ~/Library/LaunchAgents/<plist>
launchctl load ~/Library/LaunchAgents/<plist>

자주 발생하는 문제

  1. darwin-rebuild 멈춤: launchd agent 충돌, 수동 언로드 필요
  2. HOME이 /var/root: launchd 환경에서 HOME 미설정
  3. open --args 무시: 이미 실행 중인 앱에 인수 전달 안 됨

레퍼런스

  • 트러블슈팅: references/troubleshooting.md
  • 단축키 목록: references/hotkeys.md

Expand your agent's capabilities with these related and highly-rated skills.

greenheadHQ/nixos-config

managing-mise

Manage mise runtime: Node.js, pnpm, shims. Trigger: 'mise 설정', 'pnpm not found', '.nvmrc', 'mise shims', 'mise activate', '런타임 버전 불일치'.

1 0
Explore
greenheadHQ/nixos-config

configuring-git

Configure Git via Home Manager: delta, lazygit, rerere. Trigger: 'git 설정 충돌', 'delta 설정', 'lazygit', 'rerere', 'git-cleanup', 'git 브랜치 정리'.

1 0
Explore
greenheadHQ/nixos-config

managing-tmux

Configure tmux: plugins (resurrect, thumbs, yank), Pane Notepad. Trigger: 'tmux 설정', 'tmux 플러그인', 'pane notepad', 'tmux-resurrect', 'tmux 단축키', 'tmux 세션 복원'. NOT for SSH (use managing-ssh). NOT for Atuin (use syncing-atuin).

1 0
Explore
greenheadHQ/nixos-config

configuring-neovim

Configure Neovim (LazyVim) via Nix: plugins, LSP, formatters, linters, themes, treesitter, im-select. Default editor skill — generic '에디터', '편집기', '코드 편집기' queries route here unless the request is explicitly about Zed or another editor-specific path. Trigger: 'neovim', 'LSP', 'lazy.nvim', 'treesitter', '한영 전환', 'im-select', '에디터', '코드 편집기', '편집기 설정', 'colorscheme', 'catppuccin', 'formatter', 'linter', 'extraPackages', '자동완성', 'syntax highlighting', 'language server', '코드 편집'. NOT for Zed/확장 (→ modules/darwin/programs/zed/). NOT for VSCode (제거됨, #329).

1 0
Explore
greenheadHQ/nixos-config

managing-secrets

Manage encrypted secrets with agenix: .age files, re-encryption, decryption failures. Trigger: '시크릿', '암호화', '복호화', 'agenix', 'secrets.nix', 'age key', '.age', '토큰 추가', 're-encrypt', '/run/agenix'. NOT for Vaultwarden 비밀번호 관리자 (use hosting-vaultwarden).

1 0
Explore
greenheadHQ/nixos-config

managing-ssh

Configure SSH, Tailscale VPN, mosh, sudo auth. Trigger: 'SSH 인증 실패', 'Tailscale', 'ssh-agent 문제', 'MagicDNS', 'mosh', 'authorized_keys 설정'. NOT for tmux (use managing-tmux). NOT for Atuin (use syncing-atuin).

1 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results