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
+17 -2
View File
@@ -14,10 +14,16 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: ./.github/actions/deps
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Set version
id: version
run: |
@@ -26,10 +32,19 @@ jobs:
VERSION=$(grep -m1 '^version =' Cargo.toml | cut -d'"' -f2)
echo "VERSION=${VERSION}-nightly.$DATE.$SHA" >> $GITHUB_OUTPUT
- name: Build release binary
run: cargo build --release
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: rustlock-${{ steps.version.outputs.VERSION }}
path: target/release/rustlock
- name: Create nightly release
uses: softprops/action-gh-release@v3
with:
tag_name: nightly-${{ steps.version.outputs.VERSION }}
tag_name: ${{ steps.version.outputs.VERSION }}
name: Nightly Build ${{ steps.version.outputs.VERSION }}
prerelease: true
generate_release_notes: true
+1 -4
View File
@@ -14,7 +14,7 @@ jobs:
quality-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- uses: ./.github/actions/deps
@@ -31,9 +31,6 @@ jobs:
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
- name: Run unit tests (default features)
run: cargo test --quiet
- name: Run unit tests (all features)
run: cargo test --all-features --quiet
+12 -4
View File
@@ -11,7 +11,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Determine tag
id: tag
@@ -29,13 +29,21 @@ jobs:
publish-crates:
runs-on: ubuntu-latest
needs: [release]
if: secrets.CARGO_REGISTRY_TOKEN != ''
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- uses: ./.github/actions/deps
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish
run: |
if [ -z "$CARGO_REGISTRY_TOKEN" ]; then
echo "CARGO_REGISTRY_TOKEN not set — skipping publish"
exit 0
fi
cargo publish
+9 -1
View File
@@ -11,6 +11,14 @@ on:
- 'Cargo.lock'
- 'deny.toml'
- '.github/workflows/security.yml'
pull_request:
branches: [main, master]
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'deny.toml'
- '.github/workflows/security.yml'
types: [opened, synchronize, reopened]
env:
CARGO_TERM_COLOR: always
@@ -19,7 +27,7 @@ jobs:
security-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable