Commit Graph

39 Commits

Author SHA1 Message Date
Asger Geel Weirsøe
2e40a0a23a updates readme.md
Some checks failed
Test / test (push) Has been cancelled
2026-05-06 15:37:53 +02:00
Asger Geel Weirsøe
3fae21c7a4 docs: add binary install section for Linux, Homebrew section for macOS
All checks were successful
Test / test (push) Successful in 6m8s
Linux x86_64 binary install covers both Wayland and X11 from the same
tarball — clarified with a table showing which file is used by which.

macOS section now leads with Homebrew (brew tap + brew install) as the
recommended path, with script and manual install as fallbacks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 15:31:29 +02:00
Asger Geel Weirsøe
57054a7c02 ci: auto-update Homebrew tap on release
Some checks failed
Test / test (push) Has been cancelled
After uploading the release asset, the workflow now:
1. Computes the SHA256 of the source tarball from the Gitea archive endpoint
2. Clones homebrew-ahfail via token auth, patches url + sha256 in Formula/ahfail.rb
3. Commits and pushes — so `brew upgrade ahfail` works without any manual steps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 15:26:39 +02:00
Asger Geel Weirsøe
b8a03d72bb fix: use build-time AHFAIL_INSTALL_DIR on macOS, not hardcoded /usr/local/lib
Some checks failed
Test / test (push) Has been cancelled
Apple Silicon Homebrew uses /opt/homebrew as prefix, so hardcoding
/usr/local/lib/ahfail/ahfail-display as DEFAULT_PATH breaks there.
build.rs now falls back to /usr/local/lib on macOS and /usr/lib on Linux
when AHFAIL_LIBDIR is not set; macOS uses the same concat!(env!(...))
approach as Linux.

install-macos.sh passes -Dlibdir so the baked-in path matches INSTALL_DIR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 15:24:34 +02:00
Asger Geel Weirsøe
f951cb9c6d docs: rewrite readme; add macOS install script
All checks were successful
Test / test (push) Successful in 6m2s
- Clarify that the sprite is the author's face on Nedry's body
- Explicit Wayland (gtklock module) vs X11/macOS (PAM module) comparison table
  with an explanation of how each integration works
- Accurate per-distro PAM paths (standard/Fedora multilib/Debian multiarch)
- scripts/install-macos.sh: one-shot installer for macOS — checks Homebrew,
  installs brew deps, builds from source, copies binaries, and patches
  /etc/pam.d/screensaverui (or screensaver) after the last auth line

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 15:16:26 +02:00
Asger Geel Weirsøe
e41ae1cd7f ci: use gitea-release-action@v1 for release upload
All checks were successful
Release / release (push) Successful in 5m23s
Test / test (push) Successful in 6m20s
Replaces the manual curl-based release creation with the standard action,
consistent with other Gitea repos. Also bumps checkout to @v4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v0.1.0
2026-05-06 13:24:20 +02:00
Asger Geel Weirsøe
3e7bc18f65 fix: pass absolute path to pam_smoke_test via meson.current_build_dir()
All checks were successful
Test / test (push) Successful in 6m15s
dlopen with a bare filename searches LD_LIBRARY_PATH/ld.so cache, not the
build dir. Using the explicit absolute path avoids the lookup failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 13:13:51 +02:00
Asger Geel Weirsøe
1f927bdbb2 fix: run cargo test under xvfb-run; clean up unused imports and mut warning
Some checks failed
Test / test (push) Failing after 6m22s
ahfail_tests.rs calls on_activation which initialises GTK — needs a virtual
display in CI just like the Meson test step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 13:04:56 +02:00
Asger Geel Weirsøe
2c2e693193 ci: add libgstreamer-plugins-bad1.0-dev for gstreamer-player-1.0.pc
Some checks failed
Test / test (push) Failing after 2m57s
gstreamer-player-1.0.pc is shipped by the -bad dev package, not -base.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 12:59:54 +02:00
Asger Geel Weirsøe
9dbca0ec51 ci: install meson via apt instead of pip (PEP 668 / Ubuntu 24.04)
Some checks failed
Test / test (push) Failing after 1m35s
ubuntu-latest now resolves to Ubuntu 24.04 which ships meson 1.3.2 (satisfies
>=1.3.0) and enforces PEP 668, blocking pip3 install without --break-system-packages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 12:57:30 +02:00
Asger Geel Weirsøe
702f449d0e fix: PID-based volume lock with state persistence and multiarch default path
Some checks failed
Test / test (push) Failing after 1m23s
Volume lock file now stores {pid}:{volume}:{muted} instead of "1":
- Allows recovery of saved volume state if the holder is SIGKILLed
- On stale lock detection (holder PID not alive), inherit saved volume state
  and take ownership — prevents permanent volume loss and infinite lockout

PAM module DEFAULT_PATH now baked in at build time via AHFAIL_LIBDIR env var
passed by Meson, fixing the wrong path on multiarch Debian/Ubuntu where libdir
is /usr/lib/x86_64-linux-gnu rather than /usr/lib.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 12:41:06 +02:00
Asger Geel Weirsøe
3323844c33 chore: remove accidental empty v file from remote merge
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 12:40:56 +02:00
Asger Geel Weirsøe
1f98f89fab Merge remote-tracking branch 'origin/master' 2026-05-06 12:40:52 +02:00
Asger Geel Weirsøe
c3bdb09bd3 fix: xvfb for headless CI, curl -f + set -euo pipefail in release, fix PAM paths in README 2026-05-06 12:13:47 +02:00
Asger Geel Weirsøe
2ddef2ac81 docs: add macOS build-from-source and PAM configuration instructions 2026-05-06 12:11:06 +02:00
Asger Geel Weirsøe
7323e08c95 ci: add Gitea Actions workflows for test and release 2026-05-06 12:10:55 +02:00
Asger Geel Weirsøe
692cd76ceb fix: separate cargo target-dirs to avoid parallel lock contention, add pam smoke test 2026-05-06 12:10:02 +02:00
Asger Geel Weirsøe
0f128d1c6f build: update meson.build for workspace — add PAM module and display binary targets 2026-05-06 12:06:49 +02:00
Asger Geel Weirsøe
4b9d69ffbc fix: pam_set_data error handling, setsid+fd sweep in grandchild, is_replace logic, null pamh guard 2026-05-06 12:05:43 +02:00
Asger Geel Weirsøe
c24bd26ba1 feat: add ahfail-pam PAM module with cleanup-based failure detection
Implements a C-ABI PAM shared library that registers a pam_set_data
cleanup callback to detect auth failures and spawn/kill ahfail-display
via a double-fork, without ever touching credentials.
2026-05-06 12:00:24 +02:00
Asger Geel Weirsøe
abf8aef1ef fix: defer volume lock to after setup, fix sighandler cast comment, check pkg-config status 2026-05-06 11:58:21 +02:00
Asger Geel Weirsøe
f93ca6267c feat: add ahfail-display standalone binary
Implements the ahfail-display binary crate: GTK popup window that spawns
the Nedry sprite and plays the audio clip, with SIGTERM handling, 15-minute
failsafe, deadzone CLI parsing, volume save/restore, and update check.
Adds a build.rs that compiles GResources via glib-compile-resources so the
binary can be built with plain `cargo build` outside of Meson.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 11:54:22 +02:00
Asger Geel Weirsøe
e1f8c1d58f fix: update check — handle spaced JSON, move cache touch after HTTP success, add timeouts and multi-monitor guard 2026-05-06 11:51:02 +02:00
Asger Geel Weirsøe
468699e316 feat: add rate-limited update check with desktop notification
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 09:55:11 +02:00
Asger Geel Weirsøe
355828d4d9 fix: remove redundant volume_state=None, improve pactl volume parser for stereo sinks 2026-05-06 09:53:27 +02:00
Asger Geel Weirsøe
74e0f544a0 feat: add volume save/restore on failure/unload
On the first failed unlock attempt, save the current system volume and
mute state then set volume to maximum unmuted; restore on g_module_unload.
A lock file under XDG_RUNTIME_DIR prevents double-acquisition when
multiple gtklock windows are active.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 09:50:49 +02:00
Asger Geel Weirsøe
7913ced403 chore: remove unused imports, stale deps, and unnecessary unsafe block in ahfail-gtklock 2026-05-06 09:47:39 +02:00
Asger Geel Weirsøe
097dd52998 refactor: wire ahfail-gtklock to use ahfail-ui for animation/audio/display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 09:38:35 +02:00
Asger Geel Weirsøe
f05e93b75e fix: image.show(), private ahfail_get_resource, saturating_sub in display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 09:35:02 +02:00
Asger Geel Weirsøe
3dc0733cd0 feat: add ahfail-ui crate with animation, audio, display, config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 09:28:14 +02:00
Asger Geel Weirsøe
2b89653be6 refactor: remove dead utils/bench.rs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 09:25:39 +02:00
Asger Geel Weirsøe
8dd06377fc refactor: convert to Cargo workspace, move gtklock crate
Replaces the single-crate Cargo.toml with a workspace containing
ahfail-gtklock (migrated from root src/) and three stub crates
(ahfail-ui, ahfail-pam, ahfail-display). Updates meson.build to
build with -p ahfail-gtklock.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 16:23:31 +02:00
Asger Geel Weirsøe
9c546c69ee Add implementation plan for PAM rewrite
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 16:17:05 +02:00
Asger Geel Weirsøe
3cdbc4fec9 Add design doc for PAM module + cross-platform rewrite
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 16:09:25 +02:00
Asger Geel Weirsøe
9492ddb50e test 2026-01-19 13:53:59 +01:00
4fdbe8efa5 Adds license 2025-12-01 08:57:48 +01:00
a40e6470bb Removes incorrect stuff 2025-12-01 08:53:19 +01:00
Asger Geel Weirsøe
382b5a489e Code 2025-11-30 21:08:42 +01:00
Asger Geel Weirsøe
8c08e33ba0 initial commit 2025-11-30 20:52:00 +01:00