nixos/home/scripts/lockhelper.sh

12 lines
267 B
Bash

#!/usr/bin/env bash
set -eo pipefail
mkdir -p /tmp/lockscreen || true
monitors=$(hyprctl monitors -j | jq -r '.[] | select( .name | contains ("DP")) | .name')
while IFS= read -r m; do
grim -o "$m" "/tmp/lockscreen/$m.png" || true
done <<< "$monitors"
hyprlock