NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.3k stars 13.54k forks source link

[KDE] KIO/KApplicationTrader never seems to remember default? #104932

Open cirno-999 opened 3 years ago

cirno-999 commented 3 years ago

Describe the bug KIO/KApplicationTrader never remembers default apps on KDE. Perhaps that's a non-NixOS way of picking them, but I don't see a option for doing that declaratively.

To Reproduce Steps to reproduce the behavior:

  1. use KDE
  2. open renpy
  3. edit some script with system editor (choose system editor in Preferences)
  4. pick preferred app to open ad infinitum

Expected behavior Next time you open the script, it just opens in your preferred editor.

Screenshots image

Additional context console log: kf.service.sycoca: Service type not found: "text/.rpy" kf.service.services: KApplicationTrader: mimeType "text/.rpy" not found

Notify maintainers @ttuegel (kdeFrameworks.kio maintainer.)

Metadata

ttuegel commented 3 years ago

If you are inclined to debug this further, you should check if that MIME type text/.rpy actually is defined on your system. (It's not defined on mine, for example.) There would be an entry in /run/current-system/sw/share/mime for it.

cirno-999 commented 3 years ago

If you are inclined to debug this further, you should check if that MIME type text/.rpy actually is defined on your system. (It's not defined on mine, for example.) There would be an entry in /run/current-system/sw/share/mime for it.

No, and I can't create it through KDE settings (attachement.) - and it creates a position for .rpy, but does not remember the default editor image

[cirno@berlin:~]$ ls /run/current-system/sw/share/mime/text
cache-manifest.xml                  x-iptables.xml
calendar.xml                        x-java.xml
css.xml                             x-katefilelist.xml
csv-schema.xml                      x-ldif.xml
csv.xml                             x-lilypond.xml
enriched.xml                        x-literate-haskell.xml
htmlh.xml                           x-log.xml
html.xml                            x-lua.xml
markdown.xml                        x-makefile.xml
plain.xml                           x-matlab.xml
rfc822-headers.xml                  x-maven+xml.xml
richtext.xml                        xmcd.xml
rust.xml                            x-meson.xml
sgml.xml                            x-microdvd.xml
spreadsheet.xml                     x-moc.xml
tab-separated-values.xml            x-modelica.xml
troff.xml                           x-mof.xml
turtle.xml                          x-mpsub.xml
vcard.xml                           x-mrml.xml
vnd.abc.xml                         x-ms-regedit.xml
vnd.graphviz.xml                    x-mup.xml
vnd.kde.kcrash-report.xml           x-nfo.xml
vnd.qt.linguist.xml                 x-objcsrc.xml
vnd.rn-realtext.xml                 x-ocaml.xml
vnd.senx.warpscript.xml             x-ocl.xml
vnd.sun.j2me.app-descriptor.xml     x-ooc.xml
vnd.wap.wmlscript.xml               x-opencl-src.xml
vnd.wap.wml.xml                     x-opml+xml.xml
vtt.xml                             x-pascal.xml
x-adasrc.xml                        x-patch.xml
x-authors.xml                       x-python3.xml
x-bibtex.xml                        x-python.xml
x-changelog.xml                     x-qml.xml
x-c++hdr.xml                        x-readme.xml
x-chdr.xml                          x-reject.xml
x-cmake.xml                         x-rpm-spec.xml
x-cobol.xml                         x-rst.xml
x-copying.xml                       x-sass.xml
x-credits.xml                       x-scala.xml
x-csharp.xml                        x-scheme.xml
x-c++src.xml                        x-scons.xml
x-csrc.xml                          x-scss.xml
x-dbus-service.xml                  x-setext.xml
x-dcl.xml                           x-ssa.xml
x-dsl.xml                           x-subviewer.xml
x-dsrc.xml                          x-svhdr.xml
x-eiffel.xml                        x-svsrc.xml
x-emacs-lisp.xml                    x-systemd-unit.xml
x-erlang.xml                        x-tcl.xml
x-fortran.xml                       x-texinfo.xml
x.gcode.xml                         x-tex.xml
x-genie.xml                         x-troff-me.xml
x-gettext-translation-template.xml  x-troff-mm.xml
x-gettext-translation.xml           x-troff-ms.xml
x-gherkin.xml                       x-twig.xml
x-google-video-pointer.xml          x-txt2tags.xml
x-go.xml                            x-uil.xml
x-gradle.xml                        x-uri.xml
x-groovy.xml                        x-uuencode.xml
x-haskell.xml                       x-vala.xml
x-hex.xml                           x-verilog.xml
x-idl.xml                           x-vhdl.xml
x-imelody.xml                       x-xmi.xml
x-install.xml                       x-xslfo.xml

Is there a recommended way to create one?

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

cirno-999 commented 3 years ago

I marked this as stale due to inactivity. → More info

I believe this is not fixed in 21.05.

datMaffin commented 2 years ago

Hm.. I believe I have the same issue with nextcloud-client and gtkwave, which I both installed via nix-env. I (sometimes) get the following printout when running xdg-open (which is pretty annoying):

~> xdg-open .
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-fst"
kf.service.sycoca: Service type not found: "application/vnd.nextcloud"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-evcd"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-vzt"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-gtkw"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-vcd"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-ghw"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-lxt2"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-lx2"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-lxt"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-ae2"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-aet"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-fst"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-vzt"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-evcd"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-gtkw"
kf.service.sycoca: Service type not found: "application/vnd.nextcloud"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-vcd"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-ghw"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-lx2"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-lxt2"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-lxt"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-ae2"
kf.service.sycoca: Service type not found: "application/vnd.gtkwave-aet"
...

I can also not get KDE to remember a default application nor add any (default) applications with the help of the KDE System Settings.

While they do not appear in /run/current-system/sw/share/mime/, they can be found in /home/user/.nix-profile/share/mime/packages.

Not quite sure how to solve this yet. Will definitely try to look more into it, though.

Metadata

I am on an updated NixOs 21.05

datMaffin commented 2 years ago

~Ok I have a theory: nix-env forgets to create necessary folders in .nix-profile. (in this case it forgot the application folder):~

~Current theory: KDE seems to get confused when there are no intermediate folders after the packages folder.~

~I now believe that the installed applications are ~at fault by~ not adding in the (application) folder:~

Why are they put into a packages and not into an application folder?

Error messages by SystemSettings5 when taking a look at "File Associations":

No file found for "application/vnd.gtkwave-ae2.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.gtkwave-aet.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.gtkwave-evcd.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.gtkwave-fst.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.gtkwave-ghw.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.gtkwave-gtkw.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.gtkwave-lx2.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.gtkwave-lxt.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.gtkwave-lxt2.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.gtkwave-vcd.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.gtkwave-vzt.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
No file found for "application/vnd.nextcloud.xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/user/.local/share/mime", "/nix/store/mm0q2dsggqirsmcvyrjzwk3fyw8w3syi-kcoreaddons-5.81.0-bin/share/mime", "/home/user/.nix-profile/share/mime", "/run/current-system/sw/share/mime")
"application/vnd.gtkwave-lxt" hasDefinitionFile: false

How my mime files in .nix-profile look like (they all decided to go into a packages folder...):

tree .nix-profile/share/mime/
.nix-profile/share/mime/
└── packages
    ├── nextcloud.xml -> /nix/store/z77mqqnm0mdapff3gydpgzrh2bc42ifc-nextcloud-client-3.3.5/share/mime/packages/nextcloud.xml
    ├── x-gtkwave-extension-ae2.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-ae2.xml
    ├── x-gtkwave-extension-aet.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-aet.xml
    ├── x-gtkwave-extension-evcd.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-evcd.xml
    ├── x-gtkwave-extension-fst.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-fst.xml
    ├── x-gtkwave-extension-ghw.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-ghw.xml
    ├── x-gtkwave-extension-gtkw.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-gtkw.xml
    ├── x-gtkwave-extension-lx2.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-lx2.xml
    ├── x-gtkwave-extension-lxt2.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-lxt2.xml
    ├── x-gtkwave-extension-lxt.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-lxt.xml
    ├── x-gtkwave-extension-vcd.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-vcd.xml
    └── x-gtkwave-extension-vzt.xml -> /nix/store/7n6f477gby0rgzcky9ix129hg576x5af-gtkwave-3.3.109/share/mime/packages/x-gtkwave-extension-vzt.xml

1 directory, 12 files

All the application mime xmls in /run/current-system/sw/share/mime are inside of various folders (there is also an application folder):

tree sw/share/mime/
sw/share/mime/
├── aliases
├── application
│   ├── andrew-inset.xml
│   ├── annodex.xml
│   ├── atom+xml.xml
...
│   ├── zlib.xml
│   └── zstd.xml
├── audio
│   ├── aac.xml
│   ├── ac3.xml
│   ├── amr-wb.xml
...
│   ├── x-xi.xml
│   ├── x-xmf.xml
│   └── x-xm.xml
├── font
│   ├── collection.xml
│   ├── otf.xml
│   ├── ttf.xml
│   ├── woff2.xml
│   └── woff.xml
├── generic-icons
├── globs
├── globs2
├── icons
├── image
│   ├── bmp.xml
│   ├── cgm.xml
...
│   └── x-xwindowdump.xml
├── inode
│   ├── blockdevice.xml
│   ├── chardevice.xml
...
│   └── vnd.kde.service.xmpp-server.xml
├── magic
├── message
│   ├── delivery-status.xml
│   ├── disposition-notification.xml
│   ├── external-body.xml
│   ├── news.xml
│   ├── partial.xml
│   ├── rfc822.xml
│   └── x-gnu-rmail.xml
├── mime.cache
├── model
│   ├── iges.xml
│   ├── stl.xml
│   └── vrml.xml
├── multipart
│   ├── alternative.xml
│   ├── appledouble.xml
...
│   ├── signed.xml
│   └── x-mixed-replace.xml
├── packages
│   ├── freedesktop.org.xml -> /nix/store/jnz15vf7y1aq8x14gblzwwhm94jqadj6-shared-mime-info-1.13.1/share/mime/packages/freedesktop.org.xml
...
│   └── kf5_network.xml -> /nix/store/7p7w7ib5x6ispd6kb6yvwm61blgq1pbs-kio-extras-21.04.0/share/mime/packages/kf5_network.xml
├── subclasses
├── text
│   ├── cache-manifest.xml
│   ├── calendar.xml
...
│   └── x-theora+ogg.xml
├── x-content
│   ├── audio-cdda.xml
...
│   └── win32-software.xml
├── x-epoc
│   └── x-sisx-app.xml
└── XMLnamespaces

13 directories, 956 files
stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info