this post was submitted on 21 May 2024
7 points (100.0% liked)

KDE

5253 readers
74 users here now

KDE is an international technology team creating user-friendly free and open source software for desktop and portable computing. KDE’s software runs on GNU/Linux, BSD and other operating systems, including Windows.

Plasma 6 Bugs

If you encounter a bug, proceed to https://bugs.kde.org, check whether it has been reported.

If it hasn't, report it yourself.

PLEASE THINK CAREFULLY BEFORE POSTING HERE.

Developers do not look for reports on social media, so they will not see it and all it does is clutter up the feed.

founded 1 year ago
MODERATORS
 

I have a monitor with multiple modes which include "standard" (good for most things) and "movie". I want to conveniently switch modes when I change programs. Ideally giving keyboard focus to mpv or similar programs would switch the video mode to movie and taking keyboard focus away would switch it to standard.

Is there a way to do this in KDE Wayland? I looked at the "Window Rules" section in the settings but that doesn't seem to support such things. I googled it and there are some viable answers for X11 (like have a script that detects window focus and does what I want) but xdotool etc don't run on Wayland.

top 1 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 5 months ago

You can write a Kwin script and connect to the windowActivated function. Unfortunately you can't run arbitrary command from Kwin script, but as suggested in the comment you can use DBus to workaround that.

workspace.windowActivated.connect(function(client) {
    if (client != null && client.caption == "name") {
        callDBus(...); // call your DBus function which call ddcutil
    }
})

Just an example, you will have to do some trial and error yourself!