#!/bin/bash # lock-fancy.sh — fancy swaylock: snapshot the screen, dim+blur it, and use as background. # grim + ffmpeg (both already installed). No swaylock-effects overlay needed. set -e TMP=/tmp/lock-bg-483833.png DIM=/tmp/lock-bg-dim-483833.png # Snapshot the current screen grim -t png "$TMP" 2>/dev/null # Dim + blur via ffmpeg (much faster than ImageMagick) if [ -f "$TMP" ] && command -v ffmpeg >/dev/null; then ffmpeg -loglevel error -y -i "$TMP" -vf "boxblur=12:1,eq=brightness=-0.30:saturation=0.6" -frames:v 1 "$DIM" IMG="$DIM" else # Fallback to the regular wallpaper IMG="$HOME/.local/share/wallpapers/teach-invaders-gruvbox.png" fi # Launch swaylock swaylock -f -i "$IMG" \ --indicator-radius 100 \ --indicator-thickness 6 \ --ring-color ebdbb2 \ --inside-color 1d202180 \ --key-hl-color fe8019 \ --bs-hl-color fb4934 \ --text-color ebdbb2 \ --separator-color 00000000 \ --fade-in 0.3 rm -f "$TMP" "$DIM" 2>/dev/null