fix window title, screenshots not working, added default window image

This commit is contained in:
ShakedGold 2023-06-13 00:52:41 +03:00
parent 0dcb6cb2d7
commit 28f0103bd3
14 changed files with 8 additions and 4 deletions

View file

@ -3,7 +3,7 @@
missioncontroldir=$HOME/.config/hyprmsn
mkdir $missioncontroldir/windows 2> /dev/null
window=$(hyprctl activewindow -j | jq --raw-output .title)
rm -rf $missioncontroldir/windows/* 2> /dev/null
rm -rf $missioncontroldir/windows/*.jpeg 2> /dev/null
while true; do
new_window=$(hyprctl activewindow -j | jq --raw-output .title)
@ -13,11 +13,13 @@ while true; do
fi
window=$new_window
window_str=$(echo $new_window | sed -e 's/[]\/$*.^[]/\\&/g') #| sed 's/\[\([^]]*\)\]/\\[\1\\]/g') #add \ to []
window_str=$(echo $window | sed -e 's/[]\/$*.^[]/\\&/g') #| sed 's/\[\([^]]*\)\]/\\[\1\\]/g') #add \ to []
window_no_slash=$(echo $window | sed 's|/||g')
echo $window_no_slash
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"
grim -g "$at $size" -t jpeg -q 50 "$missioncontroldir/windows/$window_no_slash.jpeg"
done