Yin-Yang
Yin-Yang copied to clipboard
Refactor DBus plugin and its child plugins
Working on the following:
- [x] refactor parent class of DBus plugin, avoid using cli but using pyside6 dbus package, since some distros like Arch using
qdbus6
as binary name but some distros are not. - [x] Port wallpaper(_kde) plugin to use DBus
- [x] Port gtk-kde-plugin to the new DBus plugin, using dconf and xsettingsd as fallback
- [x] konsole-plugin to the new DBus plugin
By the way, is it possible to push the linter/formater rules to the repo?
By the way, is it possible to push the linter/formater rules to the repo?
We are using flake8 with default configurations. Do you want to change something?
Refer to logging doc, the
basicConfig()
is called afteraddHandler
so it doesn't work.
Can't we just add the handlers after the config?
yes that's ok, but when debugging we maybe don't need the notification?
We are using flake8 with default configurations. Do you want to change something?
My flake8 complains a lot like line length and sort order. And I should manually turn off my formatter(black) in case it makes a lot of changes across code files. It's not a big problem but if we use the same formatter life will be easier😃
yes that's ok, but when debugging we maybe don't need the notification?
I'd like to keep it in, just to keep the variances between developer version and normal user version low. Also, it might help if something goes wrong at an unexpected time.
My flake8 complains a lot like line length and sort order. And I should manually turn off my formatter(black) in case it makes a lot of changes across code files. It's not a big problem but if we use the same formatter life will be easier😃
I see. I don't use any automatic formatter, but I also have many warnings from flake8 as I don't regularly run it (which I probably should). So yeah, please push it! Maybe in a different PR though, with all files formatted.
Might be interesting: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Wallpaper.html
Might be interesting: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Wallpaper.html
Surprised to know even wallpaper has its portal. I will change my code to use it.
Might be interesting: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Wallpaper.html
I only found xdg-portal-gtk impl this interface: https://github.com/flatpak/xdg-desktop-portal-gtk/blob/main/src/wallpaper.c , but can't find it on DBus session bus.
Also I don't see any similar/related code for xdg-portal-kde. But they have plasma-apply-wallpaperimage
and can apply wallpaper to all virtual desktop, maybe I will use that.
Have you tried to use setWallpaper
in org.kde.kuiserver
: PlasmaShell/org.kde.PlasmaShell
in the KDE plugin? It is also available in org.kde.plasmashell
.
I prefer to use the dbus over the command line, as I hope that we can get rid of the command line completely and can remove the flatpak permission at some point.
It seems like plasma-apply-wallpaperimage
just using dbus under the hood, so it's work fine!
But for Gnome, dbus-monitor suggests that they use Gvariant as serialization data 😢 , so I don't know how to get rid of gsettings...
There is a variant class in qts dbus lib
emmm, I don't know how to get this(I change /org/gnome/desktop/background/picture-options in dconf-editor and below is from dbus-monitor):
method call time=1713841847.551184 sender=:1.562 -> destination=ca.desrt.dconf serial=48 path=/ca/desrt/dconf/Writer/user; interface=ca.desrt.dconf.Writer; member=Change
array of bytes [
2f 6f 72 67 2f 67 6e 6f 6d 65 2f 64 65 73 6b 74 6f 70 2f 62 61 63 6b 67
72 6f 75 6e 64 2f 70 69 63 74 75 72 65 2d 6f 70 74 69 6f 6e 73 00 00 00
2e 31
]
signal time=1713841847.581724 sender=:1.53 -> destination=(null destination) serial=5 path=/ca/desrt/dconf/Writer/user; interface=ca.desrt.dconf.Writer; member=Notify
string "/org/gnome/desktop/background/picture-options"
array [
string ""
]
string ":1.53:user:1"
And unluckily: https://forum.qt.io/topic/140253/uint-argument-in-dbus-call-with-python/ . It seems if there is a method need uint as arguments , then we can't call it unless involve in another dependency like https://pypi.org/project/uint
Such as KDE's setWallpaper:
screenNum take a uint32 😢
It seems if there is a method need uint as arguments , then we can't call it unless involve in another dependency like https://pypi.org/project/uint
Seems like I already had that problem somewhere, as I have created that post :laughing: I probably should start documenting when I tried something, and it didn't work out.
Either way, in that case, I would prefer to stick to the old implementation using the dbus of the KDE wallpaper plugin.
Seems like I already had that problem somewhere, as I have created that post 😆
I didn't find out until you said it lol😂 Don't know why QT guys let such a regression remain till now... and reading their documentation is like a nightmare.
Still working on adding some tests and cleaning my code
Today I discover that I should edit katerc manully to make konsole profile within has correct color scheme... Maybe other KDE applications need similar terrible hacking 😢