Rofi: Rofi doesn't find all desktop files

Created on 4 Jun 2016  Â·  11Comments  Â·  Source: davatorium/rofi

Version

Version: 1.0.1-48-g9149e35 (master)

Configuration
https://gist.github.com/bendem/e01a7b4c3fb72cd1cede4372c6106ef4

Launch Command

rofi -show drun

Steps to reproduce

cd ~/.local/share/applications/
mkdir bob && cd bob
echo '[Desktop Entry]
Name=Bob
Exec=/usr/bin/read
Terminal=true
Type=Application' > bob.desktop
rofi -show drun # Bob is not listed
i3-dmenu-desktop # Bob is listed
rm bob.desktop
cd ..
rmdir bob

More

SardemFF7 | rofi uses too much non-GLib stuff on that for me…
        · | but I /think/ it tries to parse dirs as .desktop files, without any sanity check
        · | IOW, it doesn’t recurse
Needs Testing

All 11 comments

Should be fixed in master. please test!

Works fine now.

I have the same issue with Rofi 1.2.0.

@lars-becker Can you provide some information? This does not help.

Sorry, which information do you need?

I have a few .desktop files in /.local/share/applications; which were not displayed in rofi. For example a second Firefox Desktop File which starts Firefox in a new instance. This is the file content:

[Desktop Entry]
Comment=Startet eine neue Instanz des Firefox Browsers
Encoding=UTF-8
Exec=firefox -new-instance -ProfileManager %u
GenericName=Firefox (neue Instanz)
Icon=firefox
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;application/x-xpinstall;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;
Name=Firefox (neue Instanz)
NoDisplay=false
Path[$e]=
StartupNotify=true
Terminal=0
TerminalOptions=
TryExec=firefox
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=

I also tried the example from above which doesn't work too. I use rofi 1.2.0 from the ArchLinux community repository.

But there seem to be another error in the parser. While playing around I found another error:

Failed to parse: '{cmd}'
Error: The text endet before matching quote was found for ". ( The text was 'krusader -caption "')'

I don't know if this is related or not. The desktop file can be found under /usr/share/applications/kde4/krusader.desktop if you use Krusader from the Arch community repository. You can find it here: krusader.desktop

Tried validating your file, 3 warnings and one error. Also, this has nothing to do with the original bug report.

$ desktop-file-validate ff.desktop                                                                                                             1
ff.desktop: warning: key "Encoding" in group "Desktop Entry" is deprecated
ff.desktop: error: file contains key "Path[$e]" in group "Desktop Entry", but key names must contain only the characters A-Za-z0-9- (they may have a "[LOCALE]" postfix)
ff.desktop: warning: boolean key "Terminal" in group "Desktop Entry" has value "0", which is deprecated: boolean values should be "false" or "true"
ff.desktop: warning: key "TerminalOptions" in group "Desktop Entry" is deprecated

Try

[Desktop Entry]
Comment=Startet eine neue Instanz des Firefox Browsers
Exec=firefox -new-instance -ProfileManager %u
GenericName=Firefox (neue Instanz)
Icon=firefox
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;application/x-xpinstall;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;
Name=Firefox (neue Instanz)
TryExec=firefox
Type=Application

I think the krusader desktop file does not follow the spec:

Field codes must not be used inside a quoted argument, the result of field code expansion inside a quoted argument is undefined.

So -caption "%c" %i is not valid.

Thanks @bendem; I changed the file and now it rofi uses it and gives me the choice to choose between the firefox profiles.

@DaveDavenport If I copy the desktop file to ~lars/.local/share/applications and delete the quotes it works as it should. Thanks!

So I guess rofi is not to blame since it works according to the specs. However maybe would a warning in case of erroneous files helpful, since the krusader file came defect from the upstream and the Firefox desktop file was made with an older, but not very old, version of kmenuedit. dmenu and other tools which I use(d) before worked fine, which was the reason why I put the blame on rofi. Sorry.

@lars-becker That is being worked on in git. People seems to be unhappy if rofi follows spec, and unhappy if it does :smile:

Sorry for reviving old issues, but I have this problem in rofi 1.6.0r9.g6ba878e4-1,
it does not show lxqt-config

Please follow guidelines. don't revive an 4 years old issue, create a new one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benjumanji picture benjumanji  Â·  5Comments

pigmonkey picture pigmonkey  Â·  5Comments

khughitt picture khughitt  Â·  3Comments

icf20 picture icf20  Â·  4Comments

Spindlyskit picture Spindlyskit  Â·  4Comments