Rework lockhelper for gunter
This commit is contained in:
@@ -3,11 +3,14 @@ set -eo pipefail
|
||||
|
||||
mkdir -p /tmp/lockscreen || true
|
||||
|
||||
monitors=$(hyprctl monitors -j | jq -r '.[] | select( .name | contains ("DP")) | .name')
|
||||
monitor_lines=$(hyprctl monitors -j | jq -r '.[] | select (.name | contains ("DP")) | [.name, .description]| @tsv')
|
||||
|
||||
while IFS= read -r m; do
|
||||
grim -o "$m" "/tmp/lockscreen/$m.png" || true
|
||||
done <<< "$monitors"
|
||||
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)" ]
|
||||
|
Reference in New Issue
Block a user