The wm Command

The wm command has about 20 operations that interact with the window manager. The general form of the command is:

wm operation win ?args?

In all cases the win argument must be a toplevel. Otherwise, an error is raised. In many cases, the operation either sets or queries a value. If a new value is not specified, then the current settings are returned. For example, this command returns the current window geometry:

wm geometry .
=> 300x200+327+20

This command defines a new geometry:

wm geometry . 400x200+0+0

There are lots of wm operations, and this reflects the complex protocol with UNIX window managers. The summary below lists the subset of operations that I find useful. The operations can be grouped into four main categories: ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.