NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.38k stars 14.33k forks source link

Can't install a new KDE theme #76615

Closed JonathanReeve closed 1 year ago

JonathanReeve commented 4 years ago

Describe the bug

Downloading and installing KDE look-and-feel themes fails silently.

To Reproduce Steps to reproduce the behavior:

  1. Open System Settings -> Look and Feel
  2. Click "get new look and feel themes"
  3. Click "install" on any theme. Wait for installation to finish.
  4. Notice that no new theme has actually been installed.

Expected behavior

The theme would be installed.

Metadata Please run nix run nixpkgs.nix-info -c nix-info -m and paste the result.

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
JonathanReeve commented 4 years ago

A peek into my logs reveals this error:

org.kde.knewstuff.core: Command ' "kpackagetool5 -t Plasma/LookAndFeel -i /tmp/Sweet.tar.gz" ' failed with code 4

And when I try to run that command manually, I get:

Error: Installation of /tmp/Sweet.tar.gz failed: Could not install dependency: 'kns://colorschemes.knsrc/api.kde-look.org/1294011'
fourdragons commented 4 years ago

Same. Seems it has trouble getting the dependencies. Here's my info, if it matters:

nix run nixpkgs.nix-info -c nix-info -m

matthewbauer commented 4 years ago

Also getting this on 19.09. Look related to this:

https://www.reddit.com/r/kde/comments/bp2r8h/cant_install_look_and_feel_themes/

codygman commented 4 years ago

I'm going to guess

Also getting this on 19.09. Look related to this:

https://www.reddit.com/r/kde/comments/bp2r8h/cant_install_look_and_feel_themes/

According to that link rolling back to frameworkintegration-5.57.0-1 fixed the issue.

I have the bug on current nixos unstable in 20.03pre which uses framework-integration-5.64.0 and the other user would have framework-integration-5.61.0 it appears.

If I knew how to write the overlay right now I'd make one to use the older version recommended as working from that reddit thread:

https://archive.archlinux.org/packages/f/frameworkintegration/frameworkintegration-5.57.0-1-x86_64.pkg.tar.xz

Maybe I'll get time to try again later.

mdedetrich commented 4 years ago

Can also confirm that I am having the same issue.

klorax commented 4 years ago

I am not a NixOS user and wasn't able to find out where you store your knsrc files, but while trying Kubuntu and OpenSUSE I got this problem (but for a GTK3 theme dependency). ~In Arch, where I don't have this problem, the files are stored in /etc/xdg/ whereas in the troublesome distributions they where stored in /usr/share/knsrcfiles/. After making them available in /etc/xdg/ this problem was solved.~

I don't know if this is a bug in KDE or in the distributions, just thought I share this.

Edit: see new comment below.

nova-nowiz commented 4 years ago

This issue is still present as of today

thouu commented 4 years ago

Checking in here, issue is still present.

klorax commented 4 years ago

Finally had some time to look into this.

knsrcfiles Path

My comment above is inaccurate, the new path (including in Arch) is: /usr/share/knsrcfiles/. /etc/xdg/ is a legacy path that still works: https://phabricator.kde.org/D21259

Error

This might be more than one issue, as @JonathanReeve above had problems with colorschemes.

To check for which specific error you get, download the look-and-feel theme (now called global theme) FILENAME.tar.xz and run:

kpackagetool5 -t Plasma/LookAndFeel -i FILENAME.tar.xz

Error with GTK2/3 Themes

The problem (for me) was that the filename for the GTK2/3 themes had changed from cgctheme.knsrc and cgcgtk3.knsrc to gtk2_themes.knsrc and gtk3_themes.knsrc: https://phabricator.kde.org/D26717

As a workaround one can make a copy with the old filenames, e.g.:

sudo cp /usr/share/knsrcfiles/gtk2_themes.knsrc /usr/share/knsrcfiles/cgctheme.knsrc
sudo cp /usr/share/knsrcfiles/gtk3_themes.knsrc /usr/share/knsrcfiles/cgcgtk3.knsrc

Solution for GTK2/3 Themes

The real solution is to update old themes. The global theme include a metadata.desktop file which includes one line with dependencies, e.g.:

X-KPackage-Dependencies=kns://cgcgtk3.knsrc/api.kde-look.org/IDNUMBER,...

which should be updated to:

X-KPackage-Dependencies=kns://gtk3_themes.knsrc/api.kde-look.org/IDNUMBER,...
afontaine commented 4 years ago

For whatever reason, my mimeapps.list seems to be messed up. What program should open the kns:// protocol URIs?

ebaday commented 3 years ago

I managed to understand the cause of the malfunction, but I'm new NiX user, so I don't know how to fix it correctly.

When installing the theme kpackagetool tries to install the dependencies, which are described in the package by links in the form of kns://. To handle such links, the knshandler plugin was created. This plugin is part of the frameworkintegration package.

As far as I understood, the path to search the knshandler is hard-coded to the installation location of the kpackage package. As a result, on NixOS the search for knshandler occurs along the following path <hash>-kpackage-<version>/libexec/kf5/kpackagehandlers/knshandler.

But rigth path is: <hash>-frameworkintegration-<version>/libexec/kf5/kpackagehandlers/knshandler

I didn't find solution to change search direction without code changes. For test purposes was created symbolic link from -kpackage-/libexec to hash>-frameworkintegration-/libexec.

akazakov@werf> ls -al /nix/store/jl55h46yf5fgh0lmz7gf3ickg8f98fam-kpackage-5.73.0                                                                                           /nix/store
total 4
dr-xr-xr-x 1 root root        30 Feb  8 17:08 .
drwxrwxr-t 1 root nixbld 1080160 Feb  8 17:25 ..
dr-xr-xr-x 1 root root       114 Jan  1  1970 lib
lrwxrwxrwx 1 root root        79 Feb  8 17:08 libexec -> /nix/store/lnbhlm8a9c8xvqkr8j9l3d64dsh3kwvw-frameworkintegration-5.73.0/libexec
dr-xr-xr-x 1 root root        12 Jan  1  1970 share

Everything works without any troubles but it can't be normal solution.

There are no problem on the traditional Linux distributions i think.

pasqui23 commented 3 years ago

Weird, I'mon latest nixos and I'mnot encountering this problem,even through I have encountered this broblem befoore updating.

Nope,still a problem on latest

gardspirito commented 3 years ago

Well, I also tried to make a link from kpackage to frameworkintegration, but it didn't seem to work. Now the most often error I have in strace is:

536613 access("/nix/store/ln5w42yb97m7sz2vyxr7jvc69ksvach6-frameworkintegration-5.80.0/libexec/kf5/kpackagehandlers/qt.conf", F_OK) = -1 ENOENT (No such file or directory)
536613 access("/nix/store/ln5w42yb97m7sz2vyxr7jvc69ksvach6-frameworkintegration-5.80.0/libexec/kf5/kpackagehandlers/bearer/.", F_OK) = -1 ENOENT (No such file or directory)
ghost commented 3 years ago

I have the problem too.

Installation of /tmp/pNjiBY-Edna-Light.tar.gz failed: Could not install dependency: 'kns://colorschemes.knsrc/api.kde-look.org/1528959'

MikiVanousek commented 3 years ago

Same issue:

Installation of /tmp/WvprPu-com.github.vinceliuice.Fluent-dark.tar.xz failed: Could not install dependency: 'kns://colorschemes.knsrc/api.kde-look.org/1499840'

dogunbound commented 2 years ago

Same issue: Installation of /tmp/clEouS-Sweet.tar.xz failed: Could not install dependency: 'kns://colorschemes.knsrc/api.kde-look.org/1294011'

mrLuisFer commented 2 years ago

Same issue: Installation of /tmp/lTvbYf-Ant-Dark.tar.xz failed: Could not install dependency: 'kns://colorschemes.knsrc/api.kde-look.org/1464285' error screenshot

Raikiri commented 2 years ago

still happening

PerfMonk commented 2 years ago

Still happening here too.

nix run nixpkgs.nix-info -c nix-info -m

0x08088405 commented 2 years ago

yep, still happens on 22.05pre

milahu commented 2 years ago

When installing the theme kpackagetool tries to install the dependencies, which are described in the package by links in the form of kns://. To handle such links, the knshandler plugin was created. This plugin is part of the frameworkintegration package.

As far as I understood, the path to search the knshandler is hard-coded to the installation location of the kpackage package. As a result, on NixOS the search for knshandler occurs along the following path <hash>-kpackage-<version>/libexec/kf5/kpackagehandlers/knshandler.

But rigth path is: <hash>-frameworkintegration-<version>/libexec/kf5/kpackagehandlers/knshandler

yes. this works:

kde_version=$(kdeinit5 --version | grep KDE | cut -d' ' -f2)
knshandler=$(ls /nix/store/*-frameworkintegration-$kde_version/libexec/kf5/kpackagehandlers/knshandler | head -n1)
$knshandler kns://colorschemes.knsrc/api.kde-look.org/1528959

installing...

also this works, the message is just a warning:

$knshandler kns://colorschemes.knsrc/api.kde-look.org/1473366

installing...
kf.newstuff.core: Could not determine type of archive file ' "/tmp/MNngcQ-RedDotBlackDarkColor.colors" '

the other knshandler seems gone

find /nix/store/*kpackage* -name knshandler
trace trace trace ... brute force ... ```sh find /nix/store/ -name knshandler ``` nope strace! ``` strace -f -v systemsettings 2>&1 | tee trace.txt ``` this is trying to open `/nix/store/*-kpackage-5.94.0/libexec/kf5/kpackagehandlers/knshandler` but no such file metadata of installed themes are in `~/.local/share/knewstuff3/` handler programs are defined in `/nix/store/*-plasma-workspace-5.24.5/share/knsrcfiles/` `~/.local/share/knsrcfiles/` /nix/store/*-systemsettings-5.24.5-bin/share/knsrcfiles/lookandfeel.knsrc ``` grep -hr Command /nix/store/*-plasma-workspace-5.24.5/share/knsrcfiles/ AdoptionCommand=plasma-apply-cursortheme %f AdoptionCommand=plasma-apply-lookandfeel --apply %f AdoptionCommand=plasma-apply-wallpaperimage %f AdoptionCommand=plasma-apply-wallpaperimage %f AdoptionCommand=plasma-apply-colorscheme %f AdoptionCommand=plasma-apply-desktoptheme %f AdoptionCommand=/nix/store/lrvjmfpl6jds4xbyzpq2yi7d2pnva0ai-plasma-workspace-5.24.5/libexec/plasma-changeicons %d ``` hmm. lets grep for the error message ``` grep "Could not install dependency" -r /nix/store/*kpackage* grep: /nix/store/0s3jv0a4p7aqqkwnfnpz79qnamhz042q-kpackage-5.84.0/share/locale/sv/LC_MESSAGES/libkpackage5.mo: binary file matches grep: /nix/store/0s3jv0a4p7aqqkwnfnpz79qnamhz042q-kpackage-5.84.0/share/locale/sr@latin/LC_MESSAGES/libkpackage5.mo: binary file matches grep: /nix/store/0s3jv0a4p7aqqkwnfnpz79qnamhz042q-kpackage-5.84.0/share/locale/sr@ijekavianlatin/LC_MESSAGES/libkpackage5.mo: binary file matches ... ``` better : ) ``` kde_version=$(kdeinit5 --version | grep KDE | cut -d' ' -f2) ls /nix/store/*-kpackage-$kde_version* -d /nix/store/mij35ir9d5zgfg1qkg1n4kvr9g3w1kpm-kpackage-5.94.0-bin /nix/store/y0snsnbq4ixa3wcs6wfalinwlgfm9l88-kpackage-5.94.0 ```

so probably, the problem is in /nix/store/*-kpackage-5.94.0/lib/libKF5Package.so

related

There must be something wrong with the "candidatePath"! Therefore I tried linking /usr/lib/kf5 to /usr/lib/libexec/kf5 and the issue just went away, cheers! (kde topic 138995)

We fixed installing look and feel packages, but the error message is still there. It happens for all plugins installed in /usr/lib/qt/plugins/kcms, but doesn't seem to cause any actual issue. (kde bug 376764)

should be fixed since KDE Frameworks 5.91 (kde bug 448237)

NielsGx commented 2 years ago

I still get Erreur : l'installation de /home/niels/Téléchargements/KDE/kde-store-archives/global-theme/catppuccin.tar.gz a échoué : Impossible d'installer la dépendance : « kns://colorschemes.knsrc/api.kde-look.org/1690362 » same in terminal or in global theme settings. on NixOS unstable

vinny-silveira commented 2 years ago

Any updates? Same here :(

milahu commented 2 years ago

in systemsettings installing "plasma style" works for me with nixpkgs b00aa8ded743862adc8d6cd3220e91fb333b86d3

also works for the catppuccin themes ("scratchy" dark theme and "itchy" light theme)

removing themes fails with

removing theme failed: error: plugin x is not installed

vinny-silveira commented 2 years ago

I want to install Edna theme, Its a fresh install of my NixOs (minimal version) and a simple theme install fail 🥲 any workaround? Manually install dont work too...

Artturin commented 1 year ago

Assuming fixed by https://github.com/NixOS/nixpkgs/pull/198287

SuperSandro2000 commented 1 year ago

Can confirm that this now better works on my end

I-Want-ToBelieve commented 5 months ago

kde 6 same issues

raiseerco commented 1 week ago

Issue is still present on KDE6 on Ubuntu 24.10