Commit Graph

60 Commits

Author SHA1 Message Date
jory 7603975062 refactor: changed effects, add shell completions
Nightly Release / nightly-build (push) Has been cancelled
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
- Extract all apply_* effect methods from screenshot.rs into dedicated
  src/effects.rs (blur, vignette, pixelate, swirl) — screenshot.rs
- Rewrite apply_blur: replace broken fastblur::gaussian_blur (horizontal-
  only box blur, backbuf dropped) with correct inline two-pass sliding-
  window box blur operating directly on Cairo surface bytes — ~10×
  faster, no ImageBuffer round-trip, no fastblur dependency
- Remove melting effect entirely (seems to be hard to implement
  properely, tried multiple itterations)
- Drop unused dependencies: fastblur, rand
- Add clap_complete dependency + --completions {bash,fish,zsh} flag,
  with CompletionShell enum in config.rs
- Fix show_* flags defaulting to true: remove default_value_t=true from
  show_media, show_battery, show_network, show_bluetooth, show_album_art,
  show_caps_lock_text — all now opt-in (matching user expectation)
- Convert peek toggle to hold: toggle_peek() → set_peek_held(held: bool),
  Press calls set_peek_held(true), new Release handler iterates all
  surfaces and calls set_peek_held(false), matching Ctrl-hold behavior
- Fix cursor rendering: increase font size 11→14 for peeked chars,
  handle cursor_position == 0 (prevent negative t wrapping to far ring
  end)
- Fix peek hit-test: use shape-aware point_in_shape() instead of simple
  circle pill/square/diamond/hexagon now detect clicks correctly within
  their area
- Remove per-frame DEBUG logs: PEEK/DOT mode in lock.rs,
  set_password_display/peek_password in render/mod.rs
- Update README: embed rustlock-effects.webp demo, remove melting
  references, correct show_* defaults and options table
2026-06-28 18:17:53 +02:00
jory 833706f5a5 feat: peek-to-reveal on click/ctrl, pre-commit hooks, devShell, fmt fixes
Nightly Release / nightly-build (push) Has been cancelled
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
- Click indicator ring to toggle password peek (persistent click-to-toggle)
- Ctrl-hold transient peek refactored to share peek path
- Cursor always visible (previously hidden at position 0, now shows at top of ring)
- .pre-commit-config.yaml: standard hooks + cargo fmt/clippy
- flake.nix: devShell with cargo, rustc, rustfmt, clippy, cargo-audit, prek
- cargo fmt pass across all source files (trailing whitespace, line wrapping)
- MPRIS error logging (silent failures now logged)
- Dependabot versioning-strategy: "increase" → "auto"
2026-06-21 20:44:59 +02:00
jory c2c093595a feat: ring shapes, auth reuse, input tests, README docs, CI improvements
Nightly Release / nightly-build (push) Has been cancelled
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
- Add --ring-shape (circle/square/diamond/hexagon/pill) with geometry module
- Reuse PAM context across auth attempts (no reload per-keystroke)
- Proper error propagation in screenshot effects (unwrap → Result + context)
- Remove theme presets (modern/pixel/glass) and --theme flag
- Add input cooldown after failed attempt (400ms debounce)
- Add Ctrl+held peek password, Home/End/Delete cursor keys
- Add all input unit tests (23 new tests)
- Add --max-dots, feedback duration, timeout, interval config options
- Add --log-path, --auth-timeout, verifying_color config fields
- Remove unused deps: futures, gio, env_logger, num-traits, thiserror, bytemuck
- Fix media bar: remove stop button, fix art+text overlap, uniform hit areas
- Fix CI: source-only releases, nightly prereleases, dependabot groups, labeler paths
- Update issue templates with structured forms
- Add stale workflow for inactive issues/PRs
- Update README: full options table (28 flags), remove theme docs, add shapes
2026-06-21 17:28:58 +02:00
jory db3e797e36 Merge pull request #7 from josephdunn/perf/lock-idle-redraw-dirty-tracking
perf: only redraw the lock screen when something changes
2026-06-20 14:54:35 +02:00
jory c4ae3e9651 Merge pull request #6 from josephdunn/fix/lock-surface-cleanup-order
fix: clean lock-surface teardown + roundtrip on unlock (Hyprland multi-output)
2026-06-20 14:54:22 +02:00
jory 4372c7f7c0 ci: audit and harden GitHub Actions workflows
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
- Bump all actions to latest versions (checkout@v6, upload-artifact@v7,
  download-artifact@v8, labeler@v6, gh-release@v3, gpg-import@v7)
- Replace fragile curl|bash tool install with taiki-e/install-action@v2
- Fix Swatinem/rust-cache ordering: must run AFTER toolchain install
  for correct cache key derivation
- Add --all-targets to clippy (CI now matches local testing)
- Add RUSTDOCFLAGS=-D warnings to doc step (fail on broken links)
- Fix ARM64 build order: install Rust toolchain before adding target
  and configuring linker
- Add rust-toolchain.toml pinning Rust 1.94.0 for deterministic builds
- Update Cargo.lock: rustls-webpki v0.103.11->v0.103.13 (fixes 3 CVEs)
- Fix softprops/action-gh-release@v3: include checksums in files list
  (v3 removed the checksum input parameter)
- Fix clippy manual_checked_ops lint in screenshot.rs
- Clean up trailing whitespace and missing newlines in YAML files
2026-06-20 12:57:48 +02:00
Joseph Dunn e9550f71f5 perf: only redraw the lock screen when something changes
The lock screen re-rendered and re-committed every output's full
screen-sized cairo surface on every 16ms timer tick regardless of
whether anything had changed, burning 60%+ of a core the entire time
the session was locked.

Track a dirty flag per surface and render only when state actually
changes: a keystroke, a system-status change, the clock minute rolling
over, or an in-flight animation. update() now reports whether it
redrew, so the timer commits only the surfaces that changed.

Also fix the fade-in never formally completing. The eased alpha
approaches 1.0 asymptotically while the 0.001 step throttle suppresses
the final sub-threshold increments, leaving fade_alpha stuck just under
1.0. Since "fade_alpha < 1.0" is the "still animating" signal, that kept
it permanently true and forced a full render every frame. Snap alpha to
exactly 1.0 once the fade duration elapses so the animation completes.

Idle CPU while locked drops from 60%+ to ~2%.
2026-06-04 11:02:08 -05:00
Joseph Dunn ff20423a84 fix: clean up lock surfaces and drain compositor events on unlock
Hyprland was treating multi-output rustlock unlocks as client
crashes and showing its "lockscreen died" failsafe instead of
unlocking. Two issues:

1. Order. ext-session-lock-v1 recommends destroying every
   ext_session_lock_surface_v1 before issuing unlock_and_destroy
   on ext_session_lock_v1. rustlock did the opposite. Move
   lock_surfaces.clear() into handle_auth_result so it runs
   before session_lock.unlock(), and drop the now-redundant
   clear from the auth-feedback callback.

2. Drain. After unlock_and_destroy the compositor sends
   keyboard/pointer leave events and delete_id acks; if the
   client disconnects before processing them, Hyprland treats
   the disconnect as unclean. Add a conn.roundtrip() after the
   main loop to drain those events before exit.

Single-output setups tolerate both of these (which is why the
bug does not show up on the upstream author's laptop). The
failsafe only reproduces with multiple outputs.
2026-05-22 16:43:31 -05:00
jory 6c2e3fca5a Renamed pam module to rustlock
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
2026-04-12 11:54:41 +02:00
jory c6ec65c851 chore: add GitHub automation and fix rand vulnerability
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
GitHub Actions:
- Add Dependabot for weekly dependency updates (cargo, github-actions)
- Add PR labeler workflow with file-based auto-labeling
- Add issue/PR templates (bug report, feature request, PR template)
- Fix release.yml artifact paths and labeler.yml config syntax
Security:
- Upgrade rand 0.8 → 0.10 to fix RUSTSEC-2026-0097 unsoundness
- Update screenshot.rs for rand 0.10 API (thread_rng → rng, gen_range → random_range)
2026-04-11 18:18:41 +02:00
jory 7a0adc4d82 docs: updated README.md
Code Quality / quality-checks (push) Has been cancelled
2026-04-11 15:49:26 +02:00
jory 016038aca0 feat: full password editing with cursor navigation
- Add arrow key support (Left/Right/Home/End) for cursor movement
- Add Delete key to remove character at cursor position
- Render cursor between password dots with visual indicator
- Modularize render.rs into separate modules (indicator, media_bar, status_bar, feedback)
- Add cubic ease-in-out for fade-in animation
- Optimize media_rects to use &'static str instead of String allocations
2026-04-11 15:43:11 +02:00
jory 05cf0c1d7e Merge pull request #4 from Almamu/fix/image-scale-position
fix: scale up or down images that do not fit the screen
2026-04-11 14:11:06 +02:00
Alexis Maiquez Murcia dab90e081e fix: use serde for toml parsing so all settings are loaded from config file and properly overriden from the commandline
Code Quality / quality-checks (push) Has been cancelled
2026-04-11 14:04:30 +02:00
jory 07d1921bd3 Merge pull request #1 from taladar/fixes_niri
Fix rustlock interaction with niri compositor
2026-04-11 13:13:28 +02:00
jory 5e0fe39304 refactor: Fixed binstall URL and added install as fallback
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
2026-04-11 13:05:31 +02:00
jory 05593e0959 refactor: fixed security.yml and improved play/pause
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
- New `--media-pause-icon` option
- Unified play/pause button action
- Move MPRIS lookup to spawn_blocking
- Speed up security CI with cargo-binstall
2026-04-11 12:55:45 +02:00
jory 37fb09c7c6 refactor: Fixed code with the updated dependencies
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
2026-04-10 20:31:37 +02:00
jory 92dc3a983e refactor: resolve security advisories and update core dependencies
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
2026-04-10 18:29:33 +02:00
jory 50a445937f refactor: Fixed code quality and fixed sec audit
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
2026-04-10 17:50:43 +02:00
jory 61daf52906 feat: add media controls and fixed icon resolution
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
- Implement Wayland pointer handling for interactive media buttons.
- Add pure-Rust SVG loading via resvg.
- Refactor status indicators for consistent icon and layout handling.
2026-04-10 17:32:52 +02:00
jory 49438ecd62 Refactor: curve password text and small change
Code Quality / quality-checks (push) Has been cancelled
Curve password text around the circle instead of straight dots
Cleared text is displayed on top of the circle instead of in the middle
2026-04-10 13:34:18 +02:00
jory fbd7aee9d2 feat: add cli option and ctrl+u clears password
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
- Add `--hide-password` CLI flag
- Show temporary "CLEARED" feedback on password clear
2026-04-10 12:59:39 +02:00
Alexis Maiquez Murcia 3a9be7c696 fix: scale up or down images that do not fit the screen 2026-04-06 05:02:07 +02:00
Matthias Hörmann f8c4381a11 fix: handle dynamic output changes while session is locked
When monitors are powered off (e.g. via niri power-off-monitors or
physical power switches), niri destroys and re-advertises the Wayland
outputs as they come back. Previously all three OutputHandler callbacks
were no-ops, causing two bugs:

- new_output: no lock surface was created for outputs that appeared
  after the initial lock, so the slowest monitor to wake up would show
  the compositor's red fallback instead of the lock screen.
- output_destroyed: stale LockedSurface, SessionLockSurface, output,
  and captured_background entries accumulated for gone outputs.

Fix new_output to create a lock surface (and register it with the lock
manager) whenever a new output appears while the session is locked.

Fix output_destroyed to remove the corresponding entries from
lock_surfaces, lock_manager.surfaces, outputs, and
captured_backgrounds, keeping all parallel vecs in sync. Add
LockManager::remove_surface_by_output to support this, returning the
removal index so lock_surfaces can be updated with the same index.

The all-monitors-off scenario (all outputs destroyed simultaneously)
is handled naturally: the vecs are emptied and repopulated as each
monitor fires new_output on wake.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:57:20 +01:00
jory caa448680e Changed to GPL license as AGPL doesnt make sense
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
2026-03-26 17:43:34 +01:00
jory c352a7cb16 Use flake.nix instead
Code Quality / quality-checks (push) Has been cancelled
2026-03-26 17:29:03 +01:00
jory 1cc69bcc61 Add flake.nix for easy building 2026-03-26 15:45:38 +01:00
Matthias Hörmann 9171f0771a fix: properly unlock on niri by flushing Wayland connection before exit
The ext-session-lock-v1 protocol does not guarantee a `finished` event
after the client calls `unlock_and_destroy` — that event is only sent
when the compositor independently terminates the lock. Waiting for it
caused rustlock to hang forever on niri (and any spec-compliant
compositor).

The previous attempt to fix this by setting exit=true immediately broke
unlocking because the while loop stopped calling event_loop.dispatch,
leaving the unlock_and_destroy bytes unflushed in the client-side
Wayland send buffer and never reaching the compositor.

Store the Connection in WaylandLock and explicitly call conn.flush()
after session_lock.unlock(), ensuring the unlock request is sent before
we exit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:33:51 +01:00
jory 601c9677b7 Probably fix release.yml
Code Quality / quality-checks (push) Has been cancelled
Release / release-build (, arch, default) (push) Has been cancelled
Release / release-build (, debian, default) (push) Has been cancelled
Release / release-build (, fedora, default) (push) Has been cancelled
Release / release-build (, ubuntu, default) (push) Has been cancelled
Release / release-build (--no-default-features, ubuntu, no-networking) (push) Has been cancelled
Release / release (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
v1.0
2026-03-17 22:30:11 +01:00
jory 4d90e52c36 Probably fix release.yml
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
2026-03-17 22:22:48 +01:00
jory 55c8fc0a4f refactor: Simplify deny.toml configuration
Release / release-build (, arch, default) (push) Has been cancelled
Release / release-build (, debian, default) (push) Has been cancelled
Release / release-build (, fedora, default) (push) Has been cancelled
Release / release-build (, ubuntu, default) (push) Has been cancelled
Release / release-build (--no-default-features, ubuntu, no-networking) (push) Has been cancelled
Release / release (push) Has been cancelled
2026-03-17 22:06:34 +01:00
jory aa59067bb3 fix: replace vulnerable users crate with whoami
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
The users crate (RUSTSEC-2025-0040) has an unfixable vulnerability.
Replace it with the maintained whoami crate for getting the current
username. Also remove metrics.yml workflow as it provided no value.
2026-03-17 21:46:09 +01:00
jory c05d987ff1 fix(ci): update depgraph argument and formatting
Code Quality / quality-checks (push) Has been cancelled
Metrics Collection / collect-metrics (push) Has been cancelled
- metrics.yml: use correct --dedup-transitive-deps flag
- render.rs: apply cargo fmt fixes
2026-03-17 20:51:14 +01:00
jory a5115c0a15 Fixed typo in metrics.yml
Metrics Collection / collect-metrics (push) Has been cancelled
Code Quality / quality-checks (push) Has been cancelled
2026-03-17 20:26:28 +01:00
jory 20cc6e210e Fix all warnings previously generated by clippy 2026-03-17 20:24:12 +01:00
jory 3038c29c57 refactor(ci): extract system deps to reusable action
Metrics Collection / collect-metrics (push) Has been cancelled
Code Quality / quality-checks (push) Has been cancelled
2026-03-17 20:07:34 +01:00
jory 50c5de5371 refactor(ci): streamline GitHub workflows
Metrics Collection / collect-metrics (push) Has been cancelled
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
- remove build.yml (redundant with release.yml)
- security.yml: remove duplicate cargo deny check (advisories redundant with full check)
- metrics.yml: remove unused rustfmt/clippy components and no-op summary step
- quality.yml: remove duplicate cargo deny check (already runs in security workflow)
2026-03-17 19:52:38 +01:00
jory 446426ea47 Fix formatting 2026-03-17 19:26:42 +01:00
jory f4f8e94e6e Added professional ci/cd pipelines to be tested
Metrics Collection / collect-metrics (push) Has been cancelled
Code Quality / quality-checks (push) Has been cancelled
Security Scan / security-audit (push) Has been cancelled
Multi-Distro Build / build-fedora (--no-default-features, no-default-features) (push) Has been cancelled
Multi-Distro Build / build-ubuntu (, default) (push) Has been cancelled
Multi-Distro Build / build-ubuntu (--no-default-features, no-default-features) (push) Has been cancelled
Multi-Distro Build / build-debian (, default) (push) Has been cancelled
Multi-Distro Build / build-debian (--no-default-features, no-default-features) (push) Has been cancelled
Multi-Distro Build / build-fedora (, default) (push) Has been cancelled
Multi-Distro Build / build-arch (, default) (push) Has been cancelled
Multi-Distro Build / build-arch (--no-default-features, no-default-features) (push) Has been cancelled
Multi-Distro Build / build-opensuse (, default) (push) Has been cancelled
Multi-Distro Build / build-opensuse (--no-default-features, no-default-features) (push) Has been cancelled
2026-03-17 19:01:09 +01:00
jory 0309522e25 Add caps lock indicator and keyboard layout support
CI / build-ubuntu (, default) (push) Has been cancelled
CI / build-ubuntu (--features networking, networking) (push) Has been cancelled
CI / build-ubuntu (--no-default-features, no-default-features) (push) Has been cancelled
CI / build-debian (push) Has been cancelled
CI / build-fedora (push) Has been cancelled
CI / build-arch (push) Has been cancelled
CI / build-opensuse (push) Has been cancelled
- Add caps lock ring color change when caps lock is enabled (matching swaylock-effects)
- Add configurable caps lock colors: ring, text, key highlight, backspace highlight
- Add show_caps_lock_text config option (enabled by default)
- Add keyboard layout display with show_keyboard_layout option (disabled by default)
- Change keyboard_layout from u32 to String for proper display
- Add rust-cache to CI and dbus-1-dev dependency
2026-03-16 17:32:54 +01:00
jory 5e47f8a69c Added capslock functionality
Added keyboard layout func
2026-03-16 15:10:23 +01:00
jory f489a6e46e feat: Add a lot more features
CI / build-ubuntu (, default) (push) Has been cancelled
CI / build-ubuntu (--features networking, networking) (push) Has been cancelled
CI / build-ubuntu (--no-default-features, no-default-features) (push) Has been cancelled
CI / build-debian (push) Has been cancelled
CI / build-fedora (push) Has been cancelled
CI / build-arch (push) Has been cancelled
CI / build-opensuse (push) Has been cancelled
- Add new system.rs module for system monitoring via D-Bus:
  - Battery status (UPower)
  - Media player controls and metadata (MPRIS)
  - WiFi/Bluetooth status (NetworkManager)
  - Keyboard layout tracking
- Add media key support (XF86 Play/Pause/Next/Prev)
- Add function keys F1-F3 for Suspend/Reboot/PowerOff
- Replace deprecated timer.rs with async system management
- Add GitHub Actions CI/CD workflows (CI + Release)
- Update dependencies and add optional networking feature
2026-03-16 14:12:43 +01:00
jory 1dc4d68cf7 fix: update Rust edition to 2021 (valid edition) 2026-03-07 23:05:00 +01:00
jory add5c9f4f6 Added todo list to README.md 2026-03-07 22:59:10 +01:00
jory ab960c5f0c Add license and update README.md 2026-03-07 22:28:49 +01:00
jory 5b3377a15b Added grace implementation 2026-03-07 22:06:22 +01:00
jory 88f7833d8d First working version with all options except grace 2026-03-07 21:48:24 +01:00
jory 7cdcf19415 Add diagnostic logging to troubleshoot screenshot display issue 2026-03-06 22:08:38 +01:00
jory 3637accaa6 Delay lock UI rendering until screenshots are captured
- Add pending_screenshots counter to WaylandLock
- Set pending_screenshots = output_count in locked() if screenshots enabled
- Timer skips rendering while pending_screenshots > 0
- Decrement pending_screenshots on Ready or Failed events
- When all screenshots done, timer starts rendering
- This ensures screenshots capture the desktop, not the lock UI

Fixes grey screenshot issue caused by capturing lock surface itself.
Matches swaylock-effects behavior: wait for screenshots before initial render.
2026-03-06 21:56:36 +01:00