Przejdź do treści
Biblioteka skilli
Produktywność osobista · Automatyzacja

hammerspoon

/hammerspoon

Steruje macOS przez Hammerspoon: jednorazowy Lua przez hs -c (aplikacje, karty, głośność, wifi, caffeinate, schowek) albo trwałe skróty, obserwatory i elementy paska menu w ~/.hammerspoon.

Repozytorium
claude-toolkit ↗
Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Steruje macOS przez Hammerspoon: jednorazowy Lua przez hs -c (aplikacje, karty, głośność, wifi, caffeinate, schowek) albo trwałe skróty, obserwatory i elementy paska menu w ~/.hammerspoon.

Oryginalny opis (EN)

Operate macOS via Hammerspoon, either one-off `hs -c` Lua (launch, quit, or focus apps and browser tabs; volume, wifi, caffeinate, alerts, clipboard) or persistent hotkeys, watchers, and menubar items in ~/.hammerspoon. Use when asked to control an app, tab, or Mac system state, keep the Mac awake, or write a Hammerspoon module. Not for web page content.

Jak działa

  1. Readiness
  2. One-off mode
  3. Persistent mode
  4. Safety
Sekcje z nagłówków SKILL.md, w oryginale · 43 linii, 492 słów
Podgląd SKILL.md
---
name: hammerspoon
description: Operate macOS via Hammerspoon, either one-off `hs -c` Lua (launch, quit, or focus apps and browser tabs; volume, wifi, caffeinate, alerts, clipboard) or persistent hotkeys, watchers, and menubar items in ~/.hammerspoon. Use when asked to control an app, tab, or Mac system state, keep the Mac awake, or write a Hammerspoon module. Not for web page content.
---

# hammerspoon

Host scope: mini/macOS. Keep this skill disabled on joi/Linux; shared source may remain in the repository. Do not sync activation links between hosts or switch to SSH merely because the local host lacks Hammerspoon. Remote actions follow the session's host-authorization policy.

One-off action = one `hs -q -c '<lua>'` call. Lasting behavior (hotkeys, watchers, menubar) = a module in `~/.hammerspoon/`. Recipes: [REFERENCE.md](REFERENCE.md).

## Readiness

`hs -q -c 'return "ok"'` must print `ok`. If not:

- exit 69 / "can't access message port" → Hammerspoon not running (`open -a Hammerspoon`) or `hs.ipc` not loaded → ensure `require("hs.ipc")` is in `~/.hammerspoon/init.lua`; the pathwatcher auto-reloads config, retry after ~2s.
- `hs` binary missing → tell the user to run `hs.ipc.cliInstall("/opt/homebrew")` in the Hammerspoon console.
- Window/app calls silently no-op → `hs -c 'return hs.accessibilityState()'` must be true; if false, user grants it in System Settings → Privacy & Security → Accessibility.

## One-off mode

```bash
hs -q -c 'hs.application.launchOrFocus("Obsidian") return "ok"'
hs -q -t 15 -c '<anything touching AppleScript or many windows>'   # default IPC timeout is 4s; busy main loop can also cause one-off "receive timeout" — retry
```

- `return` the final value or you get no output; tables print as addresses — `return hs.json.encode(tbl)` (`hs.geometry` rects need `.table`; NaN values make encode silently return nil — `tostring()` is the safe fallback).
- Single-quote the shell argument, double quotes inside Lua. Multiline: heredoc `hs -q <<'EOF' ... EOF` or `hs -q /path/file.lua` (path must start with `~`, `./`, or `/`).
- Exit codes: 65 = Lua error (message on stderr), 69 = not running / ipc missing.
- One-shot state dies: timers, watchers, and callbacks created via `hs -c` are GC'd after the call and never fire — anything that must persist or fire later is persistent mode.
- Sequencing: async state (focus change, tab load) won't settle inside one chunk, and `hs.timer.usleep` blocks Hammerspoon itself. Act in one call, `sleep` in the shell, read state in the next call.

## Persistent mode

For hotkeys/watchers/menubar items: write `~/.hammerspoon/<name>.lua`, add `require("<name>")` to `~/.hammerspoon/init.lua`. **Read `~/.hammerspoon/AGENTS.md` first** — it has the house conventions.

- Anchor timers/watchers/menubar objects in globals or module-level vars, or GC destroys them silently.
- The pathwatcher reloads config on every file save — write complete files (Write, not incremental edits), and expect `hs.reload()` to wipe all interactive globals.
- Verify after save: `hs -q -c 'return "alive"'` (reload takes ~1-2s), then check for load errors with `hs -q -c 'return hs.console.getConsole()' | tail -20`.

## Safety

- Prefer `:kill()` (graceful quit) over `:kill9()`; confirm with the user before quitting apps that may hold unsaved work.
- Never open modal dialogs (`hs.dialog`) or trigger alerts in other apps — they block event processing.
- `hs.execute` blocks Hammerspoon's main loop (freezes all its hotkeys/menubar); prefer running shell commands directly, or `hs.task` from a module.
- `hs.eventtap.keyStrokes`/clicks go to whatever is focused — only use when the user asked for exactly that.
Pliki w paczce (2)
  • REFERENCE.md 6 KB
  • SKILL.md 4 KB

Wersje

W bazie nie ma innych skilli o nazwie hammerspoon.

Migawka bazy z 13.11.2026 · wersja paczki 8eb4e0566de2 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100macos
    Steruje macOS przez AppleScript i osascript: okna (przesuwanie, zmiana rozmiaru, kafelkowanie), aplikacje, system (głośność, tryb ciemny, powiadomienia), Spotify, przeglądarki, Kalendarz, Przypomnienia, Finder i schowek.
  • 100nosleep4mac
    Tworzy dla użytkownika LaunchAgent macOS, który utrzymuje Maca w stanie czuwania na zasilaniu sieciowym poleceniem caffeinate -s.
  • 100terminal-mac
    Steruje odizolowanym wirtualnym macOS przez zrzuty, kliknięcia i skróty, by testować aplikacje bez zmian na pulpicie.
  • 100computer
    Obsługuje ten komputer Mac: jego aplikacje, okna, ekran i schowek, gdy praca toczy się w aplikacji poza przeglądarką.
  • 100firefox
    Steruje przeglądarką Firefox na macOS: otwiera adresy URL, zamyka i przełącza karty, pobiera dane aktywnej karty oraz wysyła skróty klawiszowe.
  • 90os-integrations
    Pomaga w głębokich integracjach aplikacji macOS: skróty klawiszowe, pasek menu, panele, sterowanie oknami, przechwytywanie ekranu, schowek i uprawnienia.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.