Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,26 @@ Already have your own atlas? Drag-drop the `pet.json` + `spritesheet.webp` pair

The bundled `skill/hatch-pet/` is the format reference + atlas validator (`validate_atlas.py`). It does not generate sprite images itself — bring your own image-gen tool (MidJourney, DALL-E, hand-drawn pixel art) and use the per-row prompts in [`SKILL.md`](skill/hatch-pet/SKILL.md).

## Customization

The default scale is `0.75`, which suits most screens. Override it with the `CLAWDEX_SCALE` env var (read once at daemon startup, clamped to `0.25`–`4.0`):

- `0.5` → pixel-perfect on Retina (1 source px = 1 native px)
- `0.75` → default
- `1.0` → 2× pixel-doubled, still crisp via nearest-neighbor

To make it stick across reboots, set it in the launchd plist `~/Library/LaunchAgents/dev.clawdex.daemon.plist`:

```xml
<key>EnvironmentVariables</key>
<dict>
<key>CLAWDEX_SCALE</key>
<string>0.5</string>
</dict>
```

Then reload: `launchctl kickstart -k gui/$(id -u)/dev.clawdex.daemon`.

## How it works

```
Expand Down
10 changes: 9 additions & 1 deletion Sources/ClawdexApp/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
// a single binary without an Info.plist app bundle.
NSApp.setActivationPolicy(.accessory)

window = PetWindow()
// Optional CLAWDEX_SCALE env var lets users override the on-screen size
// without rebuilding. Clamped to a sensible range so a typo can't
// produce a window larger than the screen or smaller than a pixel.
let scale: CGFloat = {
guard let raw = ProcessInfo.processInfo.environment["CLAWDEX_SCALE"],
let value = Double(raw), value.isFinite else { return 0.75 }
return CGFloat(min(max(value, 0.25), 4.0))
}()
window = PetWindow(scale: scale)

// Pick first available pet. If user prefers a specific one, ClawdexCLI
// can send a "select" event over the socket later.
Expand Down
Loading