hyprland: remove lockhelper, use hyprlock directly

This commit is contained in:
2026-01-30 19:41:23 +01:00
parent 27dd1a5716
commit e8cee85f7c
6 changed files with 2 additions and 87 deletions

View File

@@ -1,21 +0,0 @@
{
writeShellApplication,
grim,
jq,
gawk,
hyprland,
hyprlock,
procps,
}:
writeShellApplication {
name = "lockhelper";
runtimeInputs = [
grim
jq
gawk
hyprland
hyprlock
procps
];
text = (builtins.readFile ./lockhelper.sh);
}

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
mkdir -p /tmp/lockscreen || true
monitor_lines=$(hyprctl monitors -j | jq -r '.[] | select (.name | contains ("DP")) | [.name, .description]| @tsv')
while IFS= read -r m; do
name=$(echo "$m" | awk -F $'\t' '{print $1}')
sum=$(echo "$m" | awk -F $'\t' '{printf $2}' | sha256sum | awk '{print substr($1,1,8)}')
grim -o "$name" "/tmp/lockscreen/$sum.png" || true
done <<< "$monitor_lines"
# Only lock if not already running
if [ -z "$(pgrep hyprlock)" ]
then
exec hyprlock
else
echo "Already locked"
fi