Obtain the size from trayer main function

This commit is contained in:
ItsDrike 2022-08-23 19:17:22 +02:00
parent 9a3055bbcb
commit 45fb7d05cf
No known key found for this signature in database
GPG key ID: B014E761034AF742

View file

@ -8,7 +8,7 @@ MONITOR="$3"
exec 5>"$PANEL_FIFO"
main() {
size="$1"
size="$(xprop -name panel -f WM_SIZE_HINTS 32i ' $5\n' WM_NORMAL_HINTS | cut -d' ' -f 2)"
# Trayer should always be on primary monitor
# TODO: If possible, it would be better to get the monitor trayer lives on dynamically
trayer_mon="$(bspc query -M -m primary --names)"
@ -21,16 +21,6 @@ main() {
}
{print init; stdbuf -oL xprop -name panel -f WM_SIZE_HINTS 32i ' $5\n' -spy WM_NORMAL_HINTS} | while read line; do
case ${line} in
init)
size="$(xprop -name panel -f WM_SIZE_HINTS 32i ' $5\n' WM_NORMAL_HINTS | cut -d' ' -f 2)"
main "$size"
print "$PREFIX $RESULT" >&5
;;
*)
size="$(echo "$line" | cut -d' ' -f 2)"
main "$size"
print "$PREFIX $RESULT" >&5
;;
esac
main
print "$PREFIX $RESULT" >&5
done