mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-04-29 05:08:36 +00:00
Obtain the size from trayer main function
This commit is contained in:
parent
9a3055bbcb
commit
45fb7d05cf
1 changed files with 3 additions and 13 deletions
|
@ -8,7 +8,7 @@ MONITOR="$3"
|
||||||
exec 5>"$PANEL_FIFO"
|
exec 5>"$PANEL_FIFO"
|
||||||
|
|
||||||
main() {
|
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
|
# Trayer should always be on primary monitor
|
||||||
# TODO: If possible, it would be better to get the monitor trayer lives on dynamically
|
# TODO: If possible, it would be better to get the monitor trayer lives on dynamically
|
||||||
trayer_mon="$(bspc query -M -m primary --names)"
|
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
|
{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
|
main
|
||||||
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
|
print "$PREFIX $RESULT" >&5
|
||||||
;;
|
|
||||||
*)
|
|
||||||
size="$(echo "$line" | cut -d' ' -f 2)"
|
|
||||||
main "$size"
|
|
||||||
print "$PREFIX $RESULT" >&5
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue