mirror of
https://github.com/vee1e/moomer.git
synced 2026-09-01 18:28:08 +00:00
Fix macOS overlay launch: faster capture, no Space thrash, Raycast-safe
Drop osascript fullscreen exit and slow focus hacks; capture immediately and show a high-level CanJoinAllSpaces overlay. Avoid mutually exclusive NSWindowCollectionBehavior flags that aborted under Raycast, harden activation for non-UI script hosts, and document installing to PATH.
This commit is contained in:
parent
b2bf9b66ad
commit
0d6dcaa0c7
5 changed files with 843 additions and 151 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -993,6 +993,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cocoa",
|
"cocoa",
|
||||||
"image",
|
"image",
|
||||||
|
"libc",
|
||||||
"objc",
|
"objc",
|
||||||
"pixels",
|
"pixels",
|
||||||
"screenshots",
|
"screenshots",
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,10 @@ image = "0.24"
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
cocoa = "0.25"
|
cocoa = "0.25"
|
||||||
objc = "0.2"
|
objc = "0.2"
|
||||||
|
libc = "0.2"
|
||||||
|
|
||||||
|
# The old `objc` crate checks `feature = "cargo-clippy"` inside macros.
|
||||||
|
# Declare it so rustc's unexpected_cfgs lint stays quiet.
|
||||||
|
[lints.rust]
|
||||||
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("cargo-clippy"))'] }
|
||||||
|
|
||||||
|
|
|
||||||
20
README.md
20
README.md
|
|
@ -45,8 +45,28 @@ The following Rust crates are used:
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
$ cargo build --release
|
||||||
$ cargo run --release
|
$ cargo run --release
|
||||||
```
|
```
|
||||||
|
|
||||||
The application will immediately capture your screen and display it in fullscreen mode. Use your trackpad or mouse to zoom and pan around the screenshot.
|
The application will immediately capture your screen and display it in fullscreen mode. Use your trackpad or mouse to zoom and pan around the screenshot.
|
||||||
|
|
||||||
|
### Install to PATH (needed for Raycast)
|
||||||
|
|
||||||
|
Raycast scripts usually resolve `moomer` via `~/.local/bin`. After every rebuild:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cargo build --release
|
||||||
|
$ cp -f target/release/moomer ~/.local/bin/moomer
|
||||||
|
```
|
||||||
|
|
||||||
|
### Raycast Script Command
|
||||||
|
|
||||||
|
Import or paste `scripts/moomer-raycast.sh` as a Raycast Script Command:
|
||||||
|
|
||||||
|
- **Mode:** Silent
|
||||||
|
- Runs `~/.local/bin/moomer` detached (`nohup`) so Raycast doesn’t kill the overlay
|
||||||
|
- Logs: `/tmp/moomer.log` and `/tmp/moomer.raycast.out`
|
||||||
|
|
||||||
|
If Raycast “does nothing”, check those logs — a stale `~/.local/bin/moomer` was a common cause (it crashed on launch).
|
||||||
|
|
||||||
|
|
|
||||||
23
scripts/moomer-raycast.sh
Executable file
23
scripts/moomer-raycast.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Required parameters:
|
||||||
|
# @raycast.schemaVersion 1
|
||||||
|
# @raycast.title Moomer
|
||||||
|
# @raycast.mode silent
|
||||||
|
# @raycast.packageName Moomer
|
||||||
|
# @raycast.icon 🔍
|
||||||
|
# @raycast.description Screenshot + zoom overlay (boomer-style)
|
||||||
|
#
|
||||||
|
# Keep the installed binary in sync after builds:
|
||||||
|
# cp -f target/release/moomer ~/.local/bin/moomer
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
BIN="${MOOMER_BIN:-$HOME/.local/bin/moomer}"
|
||||||
|
if [[ ! -x "$BIN" ]]; then
|
||||||
|
BIN="$(cd "$(dirname "$0")/.." && pwd)/target/release/moomer"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Detach from Raycast so the GUI keeps running after the script exits.
|
||||||
|
nohup "$BIN" >>/tmp/moomer.raycast.out 2>&1 &
|
||||||
|
disown || true
|
||||||
|
exit 0
|
||||||
944
src/main.rs
944
src/main.rs
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue