I want to use the dark cosmic theme with kweather from flatpak. I’ve tried lots of stuff, but I don’t understand how to determine what is a valid theme from terminal, or how to add to use it with a flatpak.



I want to use the dark cosmic theme with kweather from flatpak. I’ve tried lots of stuff, but I don’t understand how to determine what is a valid theme from terminal, or how to add to use it with a flatpak.



I finally looked at the source for kweather, and saw
if (qEnvironmentVariableIsEmpty("QT_QPA_PLATFORMTHEME")) { qputenv("QT_QPA_PLATFORMTHEME", "kde"); }I tried
export QT_QPA_PLATFORMTHEME=qt6ctAfter installing qt6ct and configuring it. It didn’t work. I don’t really think this is going to be easily resolvable if it’s possible. The app looks mostly good, so I’m just not going to worry about it.
The QT theme can be set under cosmic. I think it’s some kind of issue with using
qt6ctwith flatpak. If I install qbittorrent throughapt install qbittorrentthen addalias qbittorrent="export QT_QPA_PLATFORMTHEME=qt6ct; /usr/bin/qbittorrent"To my
~/.bashrcfile, then I can launch qbittorrent with the settings from qt6ct when usingqbittorrentfrom cosmic-term.
This doesn’t change
qbittorrentin the applications launcher. I think that requires changing the.desktopfile. I haven’t been able to determine how to launch qbittorrent with qt6ct with the version from flatpak yet.edit: If this fails, it’s usually because qbittorrent was already running. I’m able to have it work consistently by opening the “System Monitor” and killing all processes under
qbittorrentthen laucnhing it fromcosmic-term.
edit: I found out later that editing
~/.profilewith exports is more frequently recommended. I haven’t tested it, but I just used the discouraged system wide/etc/environmentfile. This works for the other shortcut like ways to open files. The reason I used the/etc/environmentwas because I didn’t really care, and also wanted to fix the mouse and resolution issues I was having that I found very annoying.export XCURSOR_SIZE=24 export QT_SCALE_FACTOR=1 export QT_QPA_PLATFORMTHEME=qt6ctI guess I might end facing consequences for it sometime? I don’t know, I think the worse I’m expecting is that it just applies automatically to new users, but I guess I’ll find out…
After seeing this post I managed to get mixed themes with Kvantum between Qt5 and Qt6 with flatpaks. Though, kweather uses Qt6.

edit: I did also confirm it is possible to theme Qt6 applications with Kvantum on Cosmic.

There’s a discussion here about adding support to Ubuntu, but I just used the install instructions for Ubuntu directly from the Kvantum repository.
I finally managed to theme the
org.kde.kweatherflatpak, but I didn’t useqt6ct.
I just ended up doing
sudo apt install plasma-desktopThen opening
KDE Settings, changing the theme toBreeze Darkand thensudo apt remove plasma-desktop sudo apt autoremoveI think these steps should also work for other applications that were originally made for KDE, but I’m new to using Desktop Linux as a primary DE. I don’t really know if there are any consequences for doing this, but it seemed to work…
I think
org.kde.kweatheruses abnormal theming intended for KDE. I did a bunch of testing, I went back to older versions of it from months ago. I finally found a version that was compatible with Kvantum, and installed a package that makes Kvantum work with qt6ct.The kvantum theme was mostly broken with
org.kde.kweatherin the older verison. And, then I found out that KDE applications read from~/.config/kdeglobals,so I found a sample version and confirmed that I could in fact change the theme by creating the file. After this, I realized just using KDE to change the theme was probably going to be the easiest way forward, and that’s how I ended up at the above solution.I forgot to say, it’s also possible to use Kvantum with KDE applications that are flatpaks.

I just had to set the theme to Kvantum in the
KDE Settings. I also noticed that the theme works slightly better if the platform theme on KDE applications is exported asQT_QPA_PLATFORMTHEME=kde, though it’s not necessary. One other note, QT works by using plugins. I think the export is specifying the installed plugin. That was confusing to me, I was searching for config files but it’s a plugin to QT.
edit: When opening the KDE settings, I think I also had to change the export to
QT_QPA_PLATFORM=kdetemporarily so that KDE recognized that it was supposed to change configuration files on the filesystem. Otherwise, I think it expects that qt6ct is managing it, and it shouldn’t do anything. (because qt6ct was likely set earlier in in either the/etc/environmentor in the~/.profile)I don’t remember it was a requirement or not. Just that I had to change it so that
KDE Settingswould use the theme when I opened it.

