1

In KDE it's really easy to setup window rules to be able to put application windows on specific desktop etc.

But how this can be done programmatically (not via keyboard shortcuts) but via scripting?

Particularly I'm interested to show the ksysguard application window (if it's running) on the current desktop after pressing a keyboard shortcut.

Te Ri
  • 998

1 Answers1

1

The wmctrl tool can do this easily.

Prerequisites

Install wmctrl:

sudo apt install wmctrl

Use

"System Monitor" is the window name of ksysguard tool, so we will use it:

# Switch window's desktop to current and activate that window:
wmctrl -R "System Monitor"

To make this even more robust, we can use window's WM_CLASS (for ksysguard tool it's ksysguard):

# Switch window's desktop to current and activate that window:
wmctrl -x -R ksysguard
Pang
  • 373
Te Ri
  • 998