I would like to get the size of the current window from a shell script...
Really not much else to say... I would prefer to use wmctrl.
|
I would like to get the size of the current window from a shell script... Really not much else to say... I would prefer to use wmctrl. |
||||
|
|
Will give you something like:
With this you can To quote the man page so you understand exactly what the columns are:
|
|||||||||
|
|
I'm using in my scripts this solution:
|
|||
|
|
|
Use Usage examples:Both commands turn cursor into square/cross to allow selecting a particular window.
Alternatively, one can specify window on command line in XID form
Other posts where these were usedIn particular, |
|||||||||
|
|
I belive wmctrl does not have any option for finding the active window Id directly. This is: wmctrl + xdotool ...(not using sed).
This is: xwininfo + xdotool + sed
|
||||
|
|
|
Shell scripts do not know or care about windows. At best they run in a terminal ( which may or may not be displayed in a window ). If you want to get the width and height of the terminal in characters, use the stty utility. |
|||||||||||||
|