如何在没有 Alacarte 的情况下重命名 gnome-shell 启动器应用程序名称?

use*_*331 5 gnome alacarte

可惜 gnome-shell 的启动器只显示了应用程序名称的几个字符。这就是为什么我想将例如“web-browser firefox”重命名为“firefox”。

以前版本的 gnome 有一个可以运行的 Alacarte 程序,它可以执行我需要的操作。
现在 Alacarte 在尝试输入应用程序首选项时显示此错误:

File "/usr/share/alacarte/Alacarte/MainWindow.py", line 391, in on_edit_properties_activate
    process = subprocess.Popen(['gnome-desktop-item-edit', file_path], env=os.environ)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
Run Code Online (Sandbox Code Playgroud)

如何在没有 alacarte 的情况下重命名应用程序?

Ale*_*dar 7

在 Ubuntu 中,应用程序在 .desktop 文件中描述

Gnome Shell、Unity、KDE ​​Plasma 等使用这些文件来获取应用程序名称。

他们通过在 .desktop 文件中查找 Name 参数来实现。

大多数 .desktop 文件位于 /usr/share/applications

因此,要更改应用程序的显示名称:

  1. 打开 gedit 并从 gedit 打开 /usr/share/applications/firefox.desktop // 也许它是 firefox-broswer.desktop (目前不使用 ubuntu)
  2. 找到 Name=Firefox Web Browser 行并将其更改为 Name=Firefox
  3. 保存文件并重新加载您的外壳

注意:您必须以 root 身份打开 gedit:

gksu gedit
Run Code Online (Sandbox Code Playgroud)

  • 好的,我只是复制了几个我想从 /usr/share/applications 更改为 ~/.local/share/applications 并更改的 .desktop 文件。主目录中的文件具有优先级,现在它们会根据我的需要显示在菜单中。谢谢。 (2认同)