bluesabre / menulibre

MenuLibre is an advanced menu editor that provides modern features in a clean, easy-to-use interface.
https://bluesabre.org/menulibre
GNU General Public License v3.0
216 stars 17 forks source link

Many items from /usr/share/appliations not showing up in menulibre #192

Closed KAGEYAM4 closed 6 months ago

KAGEYAM4 commented 8 months ago

menuliber v2.4.0

Example ->

anki.desktop [Desktop Entry] Name=Anki Comment=An intelligent spaced-repetition memory training program GenericName=Flashcards Exec=anki %f TryExec=anki Icon=anki Categories=Education;Languages;KDE;Qt; Terminal=false Type=Application Version=1.0 MimeType=application/x-apkg;application/x-anki;application/x-ankiaddon; #should be removed eventually as it was upstreamed as to be an XDG specification called SingleMainWindow X-GNOME-SingleWindow=true SingleMainWindow=true
photoQT [Desktop Entry] Name=PhotoQt Name[ca]=PhotoQt Name[cs]=PhotoQt Name[de]=PhotoQt Name[es]=PhotoQt Name[fr]=PhotoQt Name[nl]=PhotoQt Name[sr]=ФотоQт Name[sr@ijekavian]=ФотоQт Name[sr@ijekavianlatin]=FotoQt Name[sr@latin]=FotoQt GenericName=Image Viewer GenericName[ca]=Visor d'imatges GenericName[cs]=Prohlížeč obrázků GenericName[de]=Bildbetrachter GenericName[es]=Visor de imagenes GenericName[fr]=Visualisateur d'images GenericName[nl]=Afbeeldingen-viewer GenericName[sr]=Приказивач слика GenericName[sr@ijekavian]=Приказивач слика GenericName[sr@ijekavianlatin]=Prikazivač slika GenericName[sr@latin]=Prikazivač slika Comment=View and manage images Comment[ca]=Visualitza i gestiona imatges Comment[cs]=Prohlížet and spravovat obrázky Comment[de]=Betrachte und manage Bilder Comment[es]=Visualizar y gestionar imágenes Comment[fr]=Voir et gérer des images Comment[nl]=Bekijk en beheer afbeeldingen Comment[sr]=Приказује и управља сликама Comment[sr@ijekavian]=Приказује и управља сликама Comment[sr@ijekavianlatin]=Prikazuje i upravlja slikama Comment[sr@latin]=Prikazuje i upravlja slikama Exec=photoqt %f Icon=org.photoqt.PhotoQt Type=Application Terminal=false Categories=Graphics;Viewer; MimeType=image/avif-sequence;application/x-fpt;image/bmp;image/x-ms-bmp;image/bpg;image/x-canon-crw;image/x-canon-cr2;image/x-win-bitmap;application/dicom;image/dicom-rle;image/vnd.djvu;image/x-dpx;application/postscript;application/eps;application/x-eps;image/eps;image/x-eps;image/x-exr;image/fits;image/avif;image/gif;image/heic;image/heif;image/vnd.microsoft.icon;image/x-icon;application/x-pnf;video/x-jng;image/jpeg;image/jp2;image/jpx;image/jpm;image/jxl;application/x-krita;image/x-miff;image/x-mvg;application/mxf;image/openraster;image/x-olympus-orf;font/opentype;application/vnd.ms-opentype;image/x-portable-arbitrarymap;image/x-portable-pixmap;image/x-portable-anymap;image/vnd.zbrush.pcx;image/x-pcx;application/pdf;application/x-pdf;application/x-bzpdf;application/x-gzpdf;image/x-pentax-pef;image/x-portable-greymap;image/x-xpmi;image/png;image/vnd.adobe.photoshop;image/tiff;image/sgi;application/vnd.rn-realmedia;image/svg+xml;image/x-targa;image/x-tga;image/tiff-fx;font/sfnt;image/vnd.wap.wbmp;video/webm;image/webp;image/x-xbitmap;image/x-xbm;image/x-xcf;image/x-xpixmap;
Bitwarden [Desktop Entry] Name=Bitwarden GenericName=Password Manager Comment=A secure and free password manager for all of your devices. Exec=bitwarden-desktop Terminal=false MimeType=x-scheme-handler/bitwarden Type=Application Icon=bitwarden Categories=Utility; StartupWMClass=Bitwarden
jrussell88 commented 7 months ago

Likewise on Ubuntu 22.04 and menulibre 2.2.2-1

timrichardson commented 6 months ago

How can this be reproduced? How did you install Bitwarden so that it ends up in /usr/share/applications? [I have the Appimage version]. I really like menulibre and I'm thinking of helping fix some bugs but could you provide details about how to reproduce the error, because that saves a lot of time for a volunteer contributor.

Also, you should say what version of menulibre you use.

KAGEYAM4 commented 6 months ago

Sorry for not mentioning the menulibre version, i have edited my first comment to include it.

How can this be reproduced? How did you install Bitwarden so that it ends up in /usr/share/applications?

i installed bitwarden for ArchLinux repository - https://archlinux.org/packages/extra/x86_64/bitwarden/

timrichardson commented 6 months ago

I copied your example for anki to /usr/share/applications/anki_test.desktop

I am using Ubuntu 22.04 for this.

I have many .desktops in /usr/share/applications

After doing this, it was not loaded by menulibre 2.4.0 but on the other hand, there was no executable "anki". I made /usr/local/bin/anki a link to /use/bin/more

sudo ln -s /usr/bin/more /usr/local/bin/anki

and after this, it worked.

(anki is packaged for Ubuntu/Debian so when I installed it, and after restarting menulibre, I saw two anki entries: the correct one from the installer, and my anki_test.deskop)

so in both cases when in worked, there was an executable on the path matching the name in the .desktop, and menulibre then presented the file.

I speculate that something is wrong with the path of the installed binary. Could you try reproducing my experiments?

Even if this finds the problem, there is still a problem: menulibre identifies "invalid desktop files" with a reason being "Exec program has not been found in the path". It looks like this is stopping my anki_test.desktop from being found, but it is not being reported as an invalid desktop file.

timrichardson commented 6 months ago

try this from terminal

menulibre-menu-validate 2>&1 | grep "anki"

timrichardson commented 6 months ago

Note: many invalid desktop files are not being reported in the UI because util.validate_desktop_file() fails to work out what is wrong with the desktop file, so it is silently ignored.

KAGEYAM4 commented 6 months ago

Note: many invalid desktop files are not being reported in the UI because util.validate_desktop_file() fails to work out what is wrong with the desktop file, so it is silently ignored.

On my system i can't reproduce these.

[phoenix@ArchLinux ~]$ pkgfile desktop-file-validate 
extra/bash-completion
extra/desktop-file-utils
[phoenix@ArchLinux ~]$ desktop-file-validate /usr/share/applications/anki.desktop
[phoenix@ArchLinux ~]$ which anki
/usr/local/bin/anki
[phoenix@ArchLinux ~]$ type -a anki
anki is /usr/local/bin/anki
anki is /usr/bin/anki
[phoenix@ArchLinux ~]$ menulibre-menu-validate 2>&1 | grep "anki"
Loading desktop entry "/usr/share/applications/anki.desktop"
 Adding to set 0x5a7720ada190 entry anki.desktop
[phoenix@ArchLinux ~]$ menulibre
WARNING:menulibre: getDefaultMenuPrefix() 'No menu prefix found, MenuLibre will not function properly.'
WARNING:menulibre: getDefaultMenuPrefix() 'No menu prefix found, MenuLibre will not function properly.'
WARNING:menulibre: getDefaultMenuPrefix() 'No menu prefix found, MenuLibre will not function properly.'
WARNING:menulibre: getDefaultMenuPrefix() 'No menu prefix found, MenuLibre will not function properly.'
WARNING:menulibre: getDefaultMenuPrefix() 'No menu prefix found, MenuLibre will not function properly.'
WARNING:menulibre: getDefaultMenuPrefix() 'No menu prefix found, MenuLibre will not function properly.'
^C

image

timrichardson commented 6 months ago

Oh, so you have the executable and the validation stage is working: the desktop file is parsed and loaded. So the problem I have found (incorrect reporting of missing executables) is a different problem.

Are you using gnome, by the way? I don't see that warning either. It sounds significant.

I will make a new issue for the incorrect handling of missing executables and work on that first.

KAGEYAM4 commented 6 months ago

menu_libre_error

I am using Hyprland.

So the above error appeared on my second user account where i tried to run it under Hyprland. This error on my first/main user account only shows up in terminal and menu_libre launches but on my second acount it refuse to launch. Not sure why it launched my first account ( maybe some environment varible )

On second user account under KDE6, no error were shown and all those missing .desktop entries were prefectly located and shown.

Can you show what's the value of those variables on your system?

KAGEYAM4 commented 6 months ago

I see that menulibre is more geared towards creating menu. What i was looking for was some application that locates all desktop file and provides option to edit them and save them.

timrichardson commented 6 months ago

Actually, it can do that too (edit and save).

@.:~$ echo $XDG_CURRENT_DESKTOP $XDG_MENU_PREFIX ubuntu:GNOME gnome- @.:~$ echo $XDG_CURRENT_DESKTOP $XDG_MENU_PREFIX ubuntu:GNOME gnome- @.:~$ echo $DESKTOP_SESSION ubuntu @.:~$ echo $MENUS

(There is no env var MENUS)

On Wed, 15 May 2024 at 13:07, KAGEYAM4 @.***> wrote:

I see that menulibre is more geared towards creating menu. What i was looking for was some application that locates all desktop file and provides option to edit them and save them.

— Reply to this email directly, view it on GitHub https://github.com/bluesabre/menulibre/issues/192#issuecomment-2111496208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHCNYSYE5QZQBNHKT3DLYTZCLGO5AVCNFSM6AAAAABFOEGXC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJRGQ4TMMRQHA . You are receiving this because you commented.Message ID: @.***>

--

Tim Richardson CPA, Director, BA, BSc, MAcc GrowthPath. Finance transformation for SMEs via Cloud ERP, advanced reporting, CRM

Mobile: +61 423 091 732 Office/Reception: +61 3 8678 1850. Book call: https://vyte.in/growthpath/15 Timezone is Melbourne AU. See this link for international time planning: https://www.timeanddate.com/worldclock/meeting.html?year=2020&month=5&day=16&p1=152 GrowthPath Pty Ltd ABN 18100392326

http://www.growthpath.com.au/

KAGEYAM4 commented 6 months ago

using XDG_MENU_PREFIX=gnome- worked. So it had to do with desktop enviroment and variables. I will close this issue now.

@timrichardson by the way, i see that in above output ***@***.***:~$ , how did you do that? Did you manually replaced the character before posting this output?

KAGEYAM4 commented 6 months ago

@jrussell88 check the last few message for solution.

timrichardson commented 6 months ago

"@.***:~$ ," is by github, I pasted literal text, my shell prompt is user name @ host ("tim" @ "black" in this case) and apparently it thought it was something sensitive

KAGEYAM4 commented 6 months ago

i tried it is not doing anything for me, did you have any settings turned on?