this post was submitted on 23 Jul 2024
28 points (100.0% liked)

KDE

5253 readers
96 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 always see:

  • people being told they can contribute to KDE with C++/QML
  • people being told they can contribute to KDE without code

But I don't often see:

  • people being told that they can contribute to KDE with code that is not C++

I like C++, QML, and even CMake, but you might not be interested in them or you might just not be willing to spend time learning another language, and that's perfectly fine.

In this blog post I list a few KDE projects that you might not know about that might be written in your preferred language or in a specialized format you have expertise or interest in.

By far, the most popular programming language actively used in KDE other than the expected languages is Python.

We also have stuff that would interest sysadmins (containers), packagers (snap/flatpak) and web developers.

top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 3 months ago (1 children)

I remember trying to write a python script to control windows on KDE and could for the life of me not find the libraries, let alone APIs to call.

It's quite simple: when watching tournaments and other events that have multiple streams/stages, I have multiple windows streaming the content and different layouts.

  • 1 full screen above every thing else when one stream has something important happening
  • tiled: 2 windows 1x1, 3 windows 1x2, 4 windows 2x2, >4 windows 1 main with others on the side
  • tiled with overlays: 1 main maximized and 1-2 overlayed windows above the main window in static places and a static size on the screen

I would like to be able to:

  • initialise the script by selecting the windows by clicking on them
  • define a main window
  • define the overlay windows, their positions, and sizes
  • apply the layouts as needed

It's not many API calls, but in python, without going down all the way to some X11 library, I haven't found a way to do it using KDE libraries.

There are other usecases for example switching between audio sinks with key strokes, updating window positions depending on which window has been opened and which activity is active, and a bunch of other stuff. Unless I write C++, or know where to find the library, or know how to bind to C++, or want to take the time to bind to C++ with FFI, I'm SOL.

Anti Commercial-AI license

[–] [email protected] 2 points 3 months ago (1 children)

I’ve had good luck interfacing with KDE windows using dbus in python, although if I remember right the more granular control also required javascript (still passed thru dbus with python). The only python library I needed was Qt (for their dbus implementation because I was already using their event loop, but any other lightweight dbus package should work fine).

[–] [email protected] 1 points 3 months ago (1 children)

Is there documentation on the dbus interfaces that's easily searchable? For example, I can't find out something as simple as listing all the windows or even setting a window property. org.kde.KWin doesn't seem to have it, nor does org.kde.plasmashell. Nor do I know what value to pass when it's a "QString` but clearly an enum.

Anti Commercial-AI license

[–] [email protected] 2 points 3 months ago* (last edited 3 months ago)

I remember being able to figure out a solution with the kwin docs and dfeet for introspection, but it was a while ago and my memory is less than stellar lol. I ended up running all my window-related logic in the kwin script (js) and just using python+dbus to see if the script had been injected and do it if not. If you go the same route (though the python is unnecessary this way if you aren’t using it for something else, like running one of the windows you wanna manipulate) the workspace global variable stores all windows in stackingOrder, so looping through that list (for (window of workspace.stackingOrder) {…}) is an easy way to check each window. I definitely remember docs on the workspace/windows part, but tbh I think I just introspected with the jsconsole.log and the log kwin prints it to (journalctl maybe?). Sorry I don’t remember more about the process, I got into the kwin scripting for all of an hour cuz of the Wayland regression of not being able to control your own window’s size/position in qt so it was a bit of a hack fix I haven’t had to think about since.

[–] [email protected] 3 points 3 months ago (1 children)

you can click on the “Explore projects” button in the corner and click on the huge search field in the middle of the screen: it will list the option “Language”.

I didn't know it supported this mode of searching; thanks for pointing it out. I just wish there was a way to collapse all of a project's forks into one entry. The search results take forever to sift through because there are about fifty bazillion forks of each project.

[–] [email protected] 1 points 3 months ago

When you search using the Starred filter, usually you get the main project at the top since that's the one with the most stars.

I added a KRunner web shortcut for this that automatically searches using that filter: https://rabbitictranslator.com/kfluff-web-shortcuts/