# 2.5. Commands

You can send commands to kwm with either:

`KWM::sendKWMCommand(QString)` (in KDE applications) or `kwmcom` command (from the command line)

This is especially of interest for kglobalshortcut developers.

At present kwm understands the following commands:

- refreshScreen refreshes the screen

- darkenScreen turns the screen dark. Careful: this one makes the desktop unresponsive to keyboard/mouse input.

- logout displays the logout dialog.

- commandLine opens the mini command-line window

- taskManager displays the "Current Session" manager.

- configure reloads configuration from kwmrc.

- - winMove

  - winResize

  - winRestore

  - winIconify

  - winClose

  - winShade

  - winSticky

  - winOperations

  These commands affect the currently active window and do pretty much what you would expect. (`winOperations` displays the window operations menu.)

- - deskUnclutter

  - deskCascade

  These commands reorganize windows on the desktop

- desktop[1-8] switches to the specified desktop

- - desktop+1

  - desktop+2

  - desktop-1

  - desktop-2

  - desktop%2

  These commands switch between desktops. `desktop%2` toggles between an odd desktop and the next higher even number. That means between 1 and 2 or between 3 and 4. This is useful to emulate "Up" and "Down" in a virtual n*2 matrix, which is used by the KDE pager. Similarly, `desktop+2` means "Right"; `desktop-1` means "Left".

- go:other The go command exits kwm and all its modules and launches other instead. other can for example be the name of another window manager such as fvwm. Note: you cannot pass a path to the go-command but only the executable name, since `kwmcom` is limited to 20 characters.