feat: Update hypr config

This commit is contained in:
2025-10-22 22:21:09 +11:00
parent 6d3b2e7445
commit 7f9b095859
5 changed files with 37 additions and 51 deletions

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env bash
echo "Preparing hyprlock configuration..."
# Path to hyprlock configuration file
CONF="$HOME/.config/hypr/hyprlock.conf"
# Get the list of outputs
mapfile -t outputs < <(hyprctl -j monitors | jq -r '.[].name')
@@ -25,44 +25,29 @@ awk -v content="$block" '
{ print }
' "$CONF" > "${CONF}.tmp" && mv "${CONF}.tmp" "$CONF"
echo "Starting hyprlock..."
/home/nathan/Git/hyprlock/build/hyprlock &
echo "Taking screenshots for lock screen..."
# Take a screenshot of each output before locking (!THIS IS SLOW!)
for output in "${outputs[@]}"; do
# grim -o "$output" "/tmp/${output}-lockscreen.png" &
$HOME/.config/hypr/scripts/spots.sh -s 8 <(grim -o "$output" -) "/tmp/${output}-lockscreen.png" &
done
while pgrep -x grim >/dev/null; do
sleep 0.1
done
# Start hyprlock while we process the images
# Apply image effect to each screenshot
# for output in "${outputs[@]}"; do
# # Apply blur effect using spots.sh
# /home/nathan/.config/hypr/scripts/spots.sh -s 8 "/tmp/${output}-lockscreen.png" "/tmp/${output}-lockscreen.png" &
# done
echo "Waiting for screenshots to complete..."
# Wait for all image processing to complete
while pgrep -x spots.sh >/dev/null; do
sleep 0.1
done
# Notify hyprlock to reload backgrounds
echo "Reloading hyprlock backgrounds..."
pkill -USR2 hyprlock
# Wait for hyprlock to exit
while pgrep -x hyprlock >/dev/null; do
echo "Waiting for hyprlock to exit..."
sleep 1
done
echo "Waiting for hyprlock to exit..."
wait
echo "Hyprlock exited. Cleaning up..."
# Cleanup: Restore hyprlock.conf to original state
sed -i '/^# AUTO BACKGROUND$/,/^# AUTO BACKGROUND END$/{//!d}' "$CONF"