Skip to main content
3 of 4
deleted 4 characters in body
kenn
  • 783
  • 2
  • 12
  • 23

format output of xdotool window geometry

I have the following xdotool output from the shell:

Window 98566146
  Position: 5,279 (screen: 0)
  Geometry: 960x480

I want it to be :

 x=5
 y=279
 width=960
 height=480

with awk, sed, or other tools.

CLARIFICATION: I want to format output of xdotool search --sync --class mpv getwindowgeometry the way I described above using regular expression replace techniques via awk, sed or other tools. There is an example in the following link sed/awk replace a specific pattern under another pattern.

Such as

echo -e "Window 98566146\n  Position: 5,279 (screen: 0)\n  Geometry: 960x480\n" | awk ....
kenn
  • 783
  • 2
  • 12
  • 23