Make Apps Always Open on the Active Screen in KDE Plasma

Improve your KDE Plasma workflow by always opening apps on the active screen. Check out this guide for a simple and easy solution.

Are you tired of constantly rearranging your windows and applications when switching between screens in KDE Plasma? When switching workspaces or monitors, manually moving apps to the active screen can be frustrating and time-consuming.

Fortunately, thereโ€™s an easy solution to this problem: by configuring KDE Plasma always to open applications on the active screen, you can streamline your workflow and boost your productivity.

In this easy-to-follow guide, we’ll walk you through the steps to achieve this simple but powerful customization, allowing you to stay focused on your work without worrying about app placement.

Step 1: Set Active Screen to Follow Mouse

First, check the โ€œActive screen follows mouseโ€ option is enabled. Note that it is only visible when several monitors are connected. So, open โ€œSystem Settingsโ€ and choose โ€œWindow Management.โ€

KDE Plasma System Settings.
KDE Plasma System Settings.

Then, choose “Window Behavior” from the left pane, pick the “Focus” tab, and if the “Multiscreen behavior” option “Active screen follows mouse” is not checked, check it, then click the “Apply” button to save the changes.

Enable the "Active screen follow mouse" option.
Enable the “Active screen follow mouse” option.

The active screen (where new windows appear) contains the mouse pointer when this option is enabled. In contrast, when disabled, the active screen contains the focused window.

Step 2: Install “Always Open on Active Screen” KWin Script

KWin scripts allow users to extend and customize the behavior and appearance of the KDE Plasma desktop environment. They provide a flexible and powerful way for users to enhance their KDE Plasma desktop experience.

For example, users can use KWin scripts to add new window behavior, create custom desktop effects, or modify existing features in KWin.

To achieve our goal, namely to make apps always open on the active screen in the KDE Plasma desktop, we will use just that, namely “Always Open on Active Screen,” which makes new windows always open on the monitor that has the mouse cursor.

But first, make sure your system has the โ€œgitโ€ package installed. Depending on your distribution, you can quickly get it if you donโ€™t have it.

Ubuntu, Debian, and Linux Mint users should run “sudo apt install git.” For Fedora and other RHEL-based distributions, the command is “sudo dnf install git.” For Arch and Arch-based “sudo pacman -S git.” openSUSE users should run “sudo zypper in git.”

Once you’ve installed the “git” package, execute the three commands below in the displayed order.

git clone https://github.com/nclarius/KWin-window-positioning-scripts.git
cd KWin-window-positioning-scripts/always-open-on-active-screen
./install.shCode language: JavaScript (javascript)
Installing the โ€œAlways Open on Active Screenโ€ KWin script.
Installing the โ€œAlways Open on Active Screenโ€ KWin script.

That’s all! From now on, your apps will open on the screen where your mouse cursor is positioned.

If you navigate to “System Settings” -> “Window Management” -> “KWin Scripts,” you’ll find the “Always Open on Active Screen” script, among others (if you have any). Additionally, you can fine-tune the behavior of certain applications by clicking on the script’s cog icon.

The "Always Open on Active Screen" is successfully installed and enabled.
The “Always Open on Active Screen” is successfully installed and enabled.

Conclusion

The KDE Plasma desktop environment provides a powerful and customizable platform for users to personalize their computing experience. By using KWin scripts, users can extend the functionality of KWin and enhance their workflow even further.

This guide provides a simple and easy solution for improving your KDE Plasma workflow by always opening apps on the active screen. Following the steps outlined in this guide, you can quickly set up this feature and enjoy the benefits of a more streamlined and efficient workflow.

Last but not least, we welcome any feedback or suggestions you may have in the comments section.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%