From 05da5993601e5c0ccdf9cf7dcedc5bac4d02aebf Mon Sep 17 00:00:00 2001 From: ShakedGold Date: Mon, 12 Jun 2023 13:10:47 +0300 Subject: [PATCH] fixed window naming --- scripts/daemon.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/daemon.sh b/scripts/daemon.sh index 8e385bd..dc8b710 100755 --- a/scripts/daemon.sh +++ b/scripts/daemon.sh @@ -7,20 +7,17 @@ rm -rf $missioncontroldir/windows/* 2> /dev/null while true; do new_window=$(hyprctl activewindow -j | jq --raw-output .title) - new_window=$(echo $new_window | sed 's/\[\([^]]*\)\]/\\[\1\\]/g') #add \ to [] - new_window=$(echo $new_window | sed -E 's/(['\''\.\*\\^])/\\\1/g') #add \ to special characters - new_window=$(echo $new_window | sed -E 's/([\{\}])/\\\1/g') #add \ to { and } if [[ "$window" == "$new_window" ]]; then continue fi window=$new_window - - at_size=$(hyprctl clients | sed -n "/$window/,/^\$/p" | grep -Ew 'at|size' | tr -d '[a-z]|:|\t| ') + window_str=$(echo $new_window | sed -e 's/[]\/$*.^[]/\\&/g') #| sed 's/\[\([^]]*\)\]/\\[\1\\]/g') #add \ to [] + + at_size=$(hyprctl clients | sed -n "/$window_str/,/^\$/p" | grep -Ew 'at|size' | tr -d '[a-z]|:|\t| ') at=$(echo $at_size | tr ' ' '\n' | head -1 | tail -1) size=$(echo $at_size | tr ' ' '\n' | head -2 | tail -1 | tr ',' 'x') - sleep 0.4 grim -g "$at $size" -t jpeg -q 50 "$missioncontroldir/windows/$window.jpeg" done