DBus Command for Zoom-In/Out

Hello,

what is the dbus command for zooming window contents? The shortcut-setting of which is in: System Settings → Shortcuts → General Actions → Display → Zoom-In/Out (translated by myself from German).

Can anyone help me with this?

Hi - as far as I know, global shortcuts in general can be triggered through the org.kde.kglobalaccel service. For example, on my system, this command activates the KWin Zoom effect, similar to what by default is mapped to the Meta++ key combination:

qdbus-qt6 org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut "view_zoom_in"

For what it’s worth, in the little bit of poking around I’ve done with D-Bus, QDBusViewer has been much easier to use for exploration than listing everything out repeatedly via the command line:

1 Like

Thank you, johnandmegh!

But I want to zoom window contents not the whole screen.

The default shortcut for this would be Ctrl++ instead of Meta++.

:-/

Ah, whoops! I was playing around with the full desktop Zoom feature recently and must have jumped straight to that :sweat_smile: I’m not sure how the “common actions” ones would work - hopefully someone with more knowledge of D-Bus and/or how those specific types of shortcuts are customized can give some further insight!

Also, it might be worth checking if there’s a method that can be used for the specific application you’re looking to zoom, though, since as far as I can tell, that kind of zooming action is actually being performed by the individual application and not KWin. For example, when you use Ctrl++ to zoom in your web browser, the whole window isn’t actually zoomed, your browser just enlarges the rendered content. So, perhaps there’s a more direct path if that’s desired?

Well, Ctrl++ works in Firefox, Thunderbird, Konsole, Okular, … and I want to create a scrollwheel-mouse-gesture to zoom in and out (systemwide).

I got it to work with xdotool, but would rather take the direct path via a dbus-call (if possible).

Maybe drilling into that a bit - what’s an example of an application that you’re trying to zoom into, but currently can’t?

All of them: Firefox, Thunderbird, Konsole, Okular, …

With keyboard-shorcut and xdotool I can, but not with DBus.