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
This commit is contained in:
2026-06-28 18:17:53 +02:00
parent 833706f5a5
commit 7603975062
24 changed files with 862 additions and 1038 deletions
+13 -10
View File
@@ -1,10 +1,14 @@
# 🔒 RustLock
[![License](https://img.shields.io/badge/license-AGPL--3.0%2B-blue.svg)](https://github.com/yourusername/rustlock/blob/main/LICENSE)
[![License](https://img.shields.io/badge/license-GPL-3.0-blue.svg)](https://github.com/yourusername/rustlock/blob/main/LICENSE)
[![Version](https://img.shields.io/badge/version-0.1.0-green.svg)](https://github.com/yourusername/rustlock/releases)
A high-performance Wayland screen locker written in Rust, inspired by `swaylock-effects`.
<p align="center">
<img src="assets/rustlock-effects.webp" alt="RustLock effects demo" width="800">
</p>
---
## ✨ Features
@@ -13,7 +17,7 @@ A high-performance Wayland screen locker written in Rust, inspired by `swaylock-
- 🎨 **Visual Effects**:
- Gaussian blur (configurable radius and passes)
- Vignette effect (configurable base and factor)
- Pixelate, Swirl, and Melting effects
- Pixelate and Swirl effects
- Smooth fade-in animation
- 🔐 **Password Indicator**:
- Circular ring with configurable radius and thickness
@@ -123,7 +127,6 @@ Options can be provided via command line or a configuration file at `~/.config/r
| `--effect-vignette <B>:<F>` | — | Vignette: base : factor (e.g., `0.5:0.5`) |
| `--effect-pixelate <S>` | — | Pixelate effect with block size in pixels |
| `--effect-swirl <A>` | — | Swirl distortion with angle |
| `--effect-melting <F>` | — | Melting distortion with factor |
| **Colors** (hex `RRGGBB[AA]`) | | |
| `--ring-color <HEX>` | `#785412` | Outer ring color |
| `--line-color <HEX>` | `#00000000` | Separator line color |
@@ -135,14 +138,14 @@ Options can be provided via command line or a configuration file at `~/.config/r
| `--caps-lock-color <HEX>` | `#E5A445` | Caps lock indicator ring color |
| `--caps-lock-text-color <HEX>` | `#E5A445` | Caps lock text color |
| `--verifying-color <HEX>` | `#0072FF` | Verifying feedback ring color |
| `--show-caps-lock-text` | `true` | Show "CAPS" text when caps lock is active |
| `--show-caps-lock-text` | `false` | Show "CAPS" text when caps lock is active |
| **Display** | | |
| `--show-media` | `true` | Show MPRIS media player information |
| `--show-battery` | `true` | Show battery status |
| `--show-network` | `true` | Show WiFi SSID and signal strength |
| `--show-bluetooth` | `true` | Show Bluetooth status |
| `--show-album-art` | `true` | Show album art for media |
| `--show-keyboard-layout` | `true` | Show keyboard layout indicator |
| `--show-media` | `false` | Show MPRIS media player information |
| `--show-battery` | `false` | Show battery status |
| `--show-network` | `false` | Show WiFi SSID and signal strength |
| `--show-bluetooth` | `false` | Show Bluetooth status |
| `--show-album-art` | `false` | Show album art for media |
| `--show-keyboard-layout` | `false` | Show keyboard layout indicator |
| **Feedback & Timing** | | |
| `--fade-in <SECONDS>` | `0.2` | Fade-in animation duration |
| `--grace <SECONDS>` | `0` | Grace period — any key press unlocks within N seconds |