为什么新程序没有出现在 KDE 菜单中?

为什么新程序没有出现在 KDE 菜单中?

我在 Kubuntu 12.10 中遇到了一个非常奇怪的问题。每当我通过 Muon 或 `apt-get` 添加程序时,它都不会显示在菜单中。例如,我从 deb 包安装了 Opera,从存储库安装了 Code::Blocks,但它们都不在菜单中。我可以从命令行打开它们。

我打开了 KMenuEdit,但它们不在那里。我尝试添加它们,但当我按下保存时,它说正在更新配置。每当进度条达到 90% 时,它就会重置为 0%。这是终端中的输出:

kmenuedit(18316)/kdecore (services) KServicePrivate::init: The desktop entry file  "/home/andrew/.local/share/applications/Opera.desktop"  has Type= "Application"  but no Exec line 

Could not resolve property : pattern6664
Could not resolve property : linearGradient4636
Could not resolve property : linearGradient4592
Could not resolve property : linearGradient4247
Could not resolve property : linearGradient11897
Could not resolve property : linearGradient11897
couldn't create image from  "" 
Could not resolve property : linearGradient5167

如果我查看 Opera.desktop,该exec行是Exec=opera

我正在使用kubuntu-ppa/ppa存储库中的 KDE 4.9.5。

编辑

我的 /home/andrew/.local/share/applications/Opera.desktop 看起来像这样:

[Desktop Entry]
Comment=
Exec=opera
GenericName=Web Browser
Icon=opera-browser
Name=Opera
NoDisplay=false
Path[$e]=
StartupNotify=true
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=

我的 /usr/share/applications/opera-browser.desktop 如下所示:

[Desktop Entry]
Type=Application
Version=1.0
Name=Opera
GenericName=Web browser
GenericName[bs]=Web preglednik
GenericName[de]=Web-Browser
GenericName[eo]=TTT-rigardilo
GenericName[es]=Navegador web
GenericName[et]=Veebibrauser
GenericName[eu]=Web arakatzailea
GenericName[fi]=WWW-selain
GenericName[fr]=Un navigateur web
GenericName[is]=Vafri
GenericName[it]=Browser Web
GenericName[nb]=Nettleser
GenericName[nl]=webbrowser
GenericName[nn]=Nettlesar
GenericName[pt]=Navegador Web
GenericName[pt_BR]=Navegador
GenericName[ro]=Navigator de web
GenericName[ru]=Веб-браузер
GenericName[sl]=Spletni brskalnik
GenericName[ven]=Buronza ya Webu
GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo
GenericName[zu]=Umkhangeli zincwadi we Web
Comment=Fast and secure web browser and Internet suite
Icon=opera-browser
TryExec=/usr/bin/opera
Exec=/usr/bin/opera %U
Terminal=false
MimeType=text/html;text/xml;application/xhtml+xml;text/vnd.wap.wml;text/wml;application/x-mimearchive;application/mime;application/xml;application/rss+xml;application/rdf+xml;image/svg+xml;application/x-opera-extension;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/mailto;video/ogg;audio/ogg;video/webm;image/webp;
Categories=Network;WebBrowser;
StartupNotify=true
X-AppInstall-Package=opera

答案1

编辑:经过进一步思考,我引用了您提供的第一行代码:

The desktop entry file  "/home/andrew/.local/share/applications/Opera.desktop"  has Type= "Application"  but no Exec line  

看起来你可能有opera.desktop 文件:一个在~/.local/share/applications,另一个在/usr/share/applications。我的理解是第一个优先,但可能会发生一些奇怪的混淆?


请再次查看 Opera.desktop。看看是否能找到一行或多行这样的行:

OnlyShowIn=Unity

其他选项列表OnlyShowIn=如下这里

如果有这样的行,请使用文本编辑器(和 sudo)打开 Opera.desktop,并通过添加 注释掉该行#。保存文件。现在您可以在菜单中看到 Opera。

您可以阅读更多相关内容这里。的“对立面”OnlyShowIn=NotShowIn=,如果有一条线NotShowIn=KDE 可能是罪魁祸首。

您可能需要通过运行来刷新

sudo update-desktop-database

根据这个答案

当然,完全有可能存在其他解决方案!

相关内容