Announcement

Collapse
No announcement yet.

Plasma ignoring some .desktop files...

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Plasma ignoring some .desktop files...

    I have just swapped from using Ubuntu Gnome to using Kubuntu and I am having an issue:

    About 1 in every 10 to 15 programs that I install from Discover do not appear in the KDE menus even though they ARE installed. I have checked and these missing apps DO have appropriate .desktop files in /usr/share/applications. I have opened these in Kate and can find nothing wrong or unusual about the syntax... mind you, I am no expert on this.

    A perfect example of this is what happens when you install, FLTK Block Attack! It installs FLTK Checkers & FLTK Sudoku along with it. All three have .desktop files but only the last two appear in the menu. There seems to be nothing ostensibly different about the three .desktop files which are all present and and all created in the same install process... but one of them is ignored by KDE. There is NO problem under gnome with any of the apps which do this under KDE.

    I know this is a somewhat trivial app but the reason I give it as an example is because it seems perfectly to highlight the problem and quite a number of more important apps behave the the same way.

    Any help appreciated. I'm loving Kubuntu but this issue is driving me crazy...

    #2
    Try rebuilding the menu index for KDE Plasma in CLI (Konsole):
    Code:
    kbuildsycoca5
    Perhaps additionally log out and in again after that.
    Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
    Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

    get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
    install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

    Comment


      #3
      ​Thankyou for the suggestion. I have tried it. It did not work but the terminal gave an warning of some type that I do not understand. Perhaps it has something to do with my problem:

      Code:
      ~$ kbuildsycoca5
      kbuildsycoca5 running...
      kf.service.sycoca: The menu spec file ( "" ) contains a Layout or DefaultLayout tag without the mandatory Merge tag inside. Please fix it.
      kf.service.sycoca: The menu spec file ( "" ) contains a Layout or DefaultLayout tag without the mandatory Merge tag inside. Please fix it.
      ​

      Comment


        #4
        Hm, I am beginning to guess a bit - but you could also try deleting the caches within your home-directory.

        I do this on a regular (two-monthly?) basis in Konsole from another user account who has sudo rights. According to a KDE developer this does no harm at all and can solve several issues:
        Code:
        sudo i
        cd /home/User-Main
        rm -r .cache/*
        exit
        Log out User-OtherOne and log in with User-Main again.

        If you don't have another suited user account you can also do this from a tty (" [Ctrl] [Alt] [F1-x] ") - before logging in with a GUI.
        When you log in with your user account on the machine via tty you need to do the following:
        Code:
        cd
        sudo rm -r .cache/*
        exit
        Press [Ctrl] [Alt] [F1-x] to find the GUI and log in.

        Perhaps this helps…
        Last edited by Schwarzer Kater; Nov 21, 2022, 08:31 PM. Reason: Typos & corrected the commands for Kubuntu - was on another distro when I wrote this…
        Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
        Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

        get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
        install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

        Comment


          #5
          Firstly, there are many .desktop files that aren't supposed to be in the menu. In my /usr/share/applications/ there are 22 .desktop files for okular, but only one in the menu (maybe they get used by okular). I've no idea whether this applies to your software.

          When I install random non-plasma stuff I've had low expectations as to how well it will get in the K menu. I understand superficially that there's a desktop standard and it should work, but in the past there's been a lot that could go wrong.

          So, I learned to use the menu editor, and the entries I set up stay put, and keep tweaks I make to them, such as changing the icon or adding options to commands. You can right-click the app menu and choose "Edit Applications", and if you expand some menu then drag a .desktop file from dolphin on to it an entry for it will be created. The interface is from 20 years ago but works so well it hasn't been changed.
          Regards, John Little

          Comment


            #6
            Originally posted by jlittle View Post
            Firstly, there are many .desktop files that aren't supposed to be in the menu. In my /usr/share/applications/ there are 22 .desktop files for okular, but only one in the menu (maybe they get used by okular). […]
            Slightly OT:
            Afaik if the entries in a .desktop file for Name and GenericName are identical, only one .desktop file shows up in the menu.
            The reason why Okular has several .desktop files seems to be that they contain different MIME types and are prioritized for this purpose by the InitialPreference entry.

            One can find some more information here: https://gitlab.gnome.org/GNOME/glib/-/issues/1721
            and here: https://developer-old.gnome.org/desktop-entry-spec/
            Last edited by Schwarzer Kater; Nov 22, 2022, 06:16 AM. Reason: typos, as usual
            Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
            Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

            get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
            install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

            Comment


              #7
              I would try to install via terminal instead of discover
              Code:
              sudo apt install fltk1.3-games
              You may have to remove the package installed by discover first.
              I found they all appear in the menu when installed from the terminal. Don't know exactly why but it worked for me. If that works repeat for other programs.
              Good luck!
              Last edited by kc1di; Nov 22, 2022, 07:38 AM.
              Dave Kubuntu 20.04 Registered Linux User #462608

              Wireless Script: http://ubuntuforums.org/showthread.p...5#post12350385

              Comment


                #8
                Hi everyone,

                Thanks so much for your suggestions. I have tried them all. Unfortunately, none of them solved the issue. Deleting the cache from a secondary administrative account did not help nor did uninstalling in Discover and re-installing in the terminal.

                I cannot understand this as when I upgraded to Kubuntu 22.04 just the other day, I did a complete clean install and re-installed all my programs manually. There should be no reason for this if it is not a major bug... but no one else seems to be noticing this problem...

                Am I right in assuming the menu items are not missing after installing these apps for anyone else?

                What else could it be?

                Comment


                  #9
                  Suggestions:

                  1. Try comparing the .desktop files of the missing entries with one that does show up in the menu - preferably a simpler one (Kompare or KDiff3 make this quite easy).
                  Perhaps there is something fundamentally wrong with these .desktop files…

                  2. Write an according .desktop file yourself and put it in $HOME/.local/share/applications/ (the programs do start from Konsole, don't they?)
                  Last edited by Schwarzer Kater; Nov 23, 2022, 04:55 AM.
                  Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
                  Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

                  get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
                  install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

                  Comment


                    #10
                    This is what the flblocks .desktop file should look like. compare it to yours.
                    Code:
                    [Desktop Entry]
                    Name=FLTK Block Attack!
                    Comment=Block Attack! Game
                    TryExec=/usr/games/flblocks
                    Exec=/usr/games/flblocks
                    Icon=flblocks
                    Terminal=false
                    Type=Application
                    Categories=Game;BlocksGame;​
                    Sometimes if the Categories is not right it can cause problems.
                    You could also always manually edit the menu adding the item by copying the Exec line and the Icon line see if that works.
                    Good luck.


                    Dave Kubuntu 20.04 Registered Linux User #462608

                    Wireless Script: http://ubuntuforums.org/showthread.p...5#post12350385

                    Comment


                      #11
                      Thanks so much again to you both for these great suggestions.

                      (the programs do start from Konsole, don't they?)​
                      Yes, they certainly do. Not only that, they can be searched for in the search field of the menuing system and show up with their correct name and icon, which can be clicked on and made to run... they just don't appear in the alphabetical listing or the listing by category (or the menu editor). They MUST be searched for.

                      I have had a bit more of a play around. The code in my .desktop entry is identical to yours, kc1di. Just to be sure, I have created a new file from scratch and that file also does not work.
                      Last edited by MusicalCoda; Nov 23, 2022, 10:06 AM.

                      Comment


                        #12
                        All I can say is there must be something in your set that is different than mine because it shows in mine just fine. Have you tried editing the menu and adding it by hand will it show then?
                        Dave Kubuntu 20.04 Registered Linux User #462608

                        Wireless Script: http://ubuntuforums.org/showthread.p...5#post12350385

                        Comment


                          #13
                          I have done some further testing as it is becoming obvious that this problem is NOT affecting other users.

                          Thus, I started to believe that my Kubuntu installation was corrupted OR alternatively that the Kubuntu .iso image I had downloaded and installed from was corrupted, since this might offer an explanation for some random erratic behaviour.

                          To rule out that the .iso image was corrupt, I double-checked its hash value. The result was that my .iso image hash and the hash value reported by Kubuntu devs matched. So, my .iso file is not corrupt.

                          To rule out that my installed files were corrupt and thus, causing the issue, I decided to install the problematic apps into a live booted Kubuntu running from my SD card, since we know that my disk image is ok. The result was that while the menu items behaved slightly differently than on my main hard drive installation, they still did not behave as expected AT ALL.

                          While all items (that I tired) DID place an entry in the menu, some items appeared in the menu's categorically sorted listing but not under 'All Application' which is impossible... or should be. Others were the reverse. They appeared in 'All applications' but were not present under any category in the left panel. The most mysterious of all was one item that at first glance appeared missing but WAS present. The reason that I could not initially find it was because its name started with 'O' but it wasn't listed with the other applications whose name started with 'O' in the 'All Applications' menu. Instead, it was listed under a new second 'O' heading that appeared at the bottom the menu under the letter 'X'! That ain't right!

                          How can this not be a major bug? I'm absolutely baffled that no one else experiences this problem. If it isn't the desktop files themselves (which it isn't as I've checked them), my disk image is not corrupt (and it's not, I've checked), my installation and hard drive have been removed as suspects by live booting, my computer responds properly in this regard in both Ubuntu Gnome and Linux Mint... then what else is left other than KDE bugs?

                          Comment


                            #14
                            Originally posted by MusicalCoda View Post
                            How can this not be a major bug?
                            Partial non-compliance with some aspect of a vague desktop standard, so that something doesn't appear on a menu, a major bug? I don't wish to defend this at all, but perspectives on this sort of thing vary. Such as, say, "Menus? How 20th century."
                            Regards, John Little

                            Comment


                              #15
                              Are you using a different icon theme, or perhaps any scaling or screen resizing? do you have the relevant icon file for the game?
                              I have two, in /usr/share/icons/hicolor/128x128/apps/ and /usr/share/icons/hicolor/32x32/apps/
                              These icons are PNG files, and not the usual scalable svg types usually found in icons of any recent vintage. This might be related to the issue.

                              maybe it is the actual package for the game that is corrupted, maybe? If the icon is missing, or the desktop file points to a nonexistent file iirc it won't show in the menu (maybe)
                              Try opening the menu editor (right-click on the application launcher icon) and see if the game is present there

                              Also to rule out some basic things, let's see where the game comes from:

                              $ apt policy fltk1.3-games
                              fltk1.3-games:
                              Installed: 1.3.8-4
                              Candidate: 1.3.8-4
                              Version table:
                              *** 1.3.8-4 500
                              500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
                              100 /var/lib/dpkg/status

                              This package unfortunately only has 'commununity' support in Ubuntu, as it is one of those simply copied over directly from Debian, and not physically packaged by Ubuntu proper. There is exactly one bug report about it, from 2013.
                              A bug is a bug, even if it only seen by one person. But it is hard to determine what the cause is, or where the blame may be.

                              fwiw, I can see the icons just fine as well.

                              Comment

                              Working...
                              X