WATTR(1)

πŸ’… WATTR(1) β€” get window attributes πŸͺŸβœ¨

okay so this page is from the General Commands Manual, and it’s literally the window-attributes bestie. no cap, she tells you stuff about a window and then dips. 🫢


πŸŽ€ NAME πŸŽ€

wattr β€” get window attributes 🌸


✨ SYNOPSIS ✨

wattr [bmiowhxy] wid

πŸ’– DESCRIPTION πŸ’–

wattr prints information about the window wid to stdout. slay. πŸ’…

What info gets presented depends on the commands you give to wattr. The queried arguments are printed in the order they are requested, separated by a space. very β€œrespect the queue” of it all. ✨

If no commands are given, wattr will return 0 if wid exists, and 1 otherwise. that’s the whole vibe check, bestie. 🫢

  • i β€” prints wid πŸ‘‘
  • b β€” prints wid’s border width πŸŽ€
  • x β€” prints wid’s x offset πŸ¦‹
  • y β€” prints wid’s y offset 🌈
  • w β€” prints wid’s width πŸ’–
  • h β€” prints wid’s height 🌸
  • o β€” wattr returns 0 if the override_redirect attribute is set on the window πŸ”₯
  • m β€” wattr returns 0 if wid is mapped on screen, and 1 otherwise πŸ’€

🌿 ENVIRONMENT 🌿

wattr acts on the X display specified by the DISPLAY variable. that’s her stage, and she’s main character energy on it. ✨


🌟 EXAMPLES 🌟

first up, the mapped check:

$ wattr m 0x01000006 && echo ismapped
ismapped

then width, height, x, y in that order:

$ wattr whxy 0x01000006
484 244 756 166

and x, y, height, width in that order:

$ wattr xyhw 0x01000006
756 166 244 484

and the no-window exit-status moment:

$ wattr 0x00000000; echo $?
1

from wmutils, dated December 13, 2014 β€” ty for coming to my TED talk πŸ’–πŸŽ€