Answers:
要将自定义应用添加到“ 系统设置”(Gnome控制中心),请找到其桌面条目文件- /usr/share/applications/{appname}.desktop
对其进行编辑以确保存在以下条目:
Categories=Settings;X-GNOME-Settings-Panel;xxxxx;
X-GNOME-Settings-Panel={appname}
用{appname}
您要添加到“系统设置”中的应用的名称替换。
xxxxx
决定显示应用程序的部分。替换xxxxx
为以下可能的选项之一:
X-GNOME-PersonalSettings- 个人部分
HardwareSettings- 硬件部分(请注意,未使用前缀X-GNOME)
X-GNOME-SystemSettings- 系统部分
修改后,运行以下命令:
sudo update-desktop-database
这已在具有gnome-control-center版本3.4.2-0ubuntu0.12的Ubuntu 12.04 LTS 12.04上进行了尝试和测试。
注意事项:
~/.local/share/applications
因此,无法单独为一个用户将应用添加到系统设置中。gnome-control-center
与Ubuntu一起使用了
特定于Linux的补丁程序,从而可以添加自定义条目。结果,此方法是Ubuntu特定的,不适gnome-control-center
用于其他发行版使用的香草。X-GNOME-Settings-Panel;X-GNOME-SystemSettings;
在Categories
和增加X-GNOME-Settings-Panel=sample
就足够了。
目前,GNOME上游不支持将自定义项目添加到“系统设置”
Ubuntu修补了系统设置,gnome-control-center
以便它可以在其中包含其自己的ubuntu特定条目。
长话短说,您需要libgnome-control-center-dev
围绕应用程序安装并创建包装,该包装是针对gnome-control-center软件包使用的,libgnome-control-center-dev
用于pkg-config
现在没有GUI方法可以添加它。您需要使用C以编程方式进行操作,并且它仅在Ubuntu上有效。
David Zeuthen详细介绍了不允许第三方条目(称为专家组)的原因
> Thu, May 12, 2011 at 4:39 PM, Sergey Udaltsov wrote:
> My whole point was that in the ideal world GNOME could be extensible
> enough so that no _forking_ would be necessary. Extension modules, not
> patches. That would be not a side effect of the license but the
> fundamental feature of the architecture. Do you see the difference?
Yes. I also think we tried that with GNOME 2 and failed. I mean, look
at GNOME 2's control center - on all distros, it's a royal mess of
random crap from either GNOME, the distro or 3rd party app written by
a kid in a basement. With GNOME 3.2, we will have a simpler control
center (since the extension mechanism is going away) but it will be
_awesome_.
@lancer对Ubuntu 14.04 lts的答案的更新:
它可能来自ubuntu团队的gnome-system-settings,因为我可以在某个地方的一些博客文章中读到(无法回忆起..:/的位置)
无论如何,以下两行显示了这些差异,下面是一个更详尽的示例
X-Unity-Settings-Panel={appname}
Categories=GNOME;GTK;Settings;X-Unity-Settings-Panel;xxxx;
例如:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=TefApp
Name[C]=TefApp
Exec=/home/stephaneag/Documents/ubuntu_CustomSystemSettingsEntryApp/dummyScript.sh
Comment[C]=dumb dummy app
StartupNotify=true
Icon=utilities-terminal
Terminal=false
NoDisplay=false
# the following is necessary for the .desktop to be accepted in System Settings
# for our stuff to appear in "System" section:
#Categories=GNOME;GTK;Settings;X-Unity-Settings-Panel;X-GNOME-SystemSettings;
# for our stuff to appear in "Hardware" section:
#Categories=GNOME;GTK;Settings;X-Unity-Settings-Panel;HardwareSettings;
# for our stuff to appear in the "Personal" section:
Categories=GNOME;GTK;Settings;X-Unity-Settings-Panel;X-GNOME-PersonalSettings;
OnlyShowIn=Unity;
更新了14.04,其中包含有关使用users-admin替换默认Users程序的特定详细信息,以便可以更改组。
使用users-admin安装gnome系统工具
sudo apt-get install gnome-system-tools
移动旧的用户桌面,使其不会显示在Unity Control Center中
cd /usr/share/applications/
mv unity-user-accounts-panel.desktop unity-user-accounts-panel.desktop.ORIG
更新数据库
sudo update-desktop-database
这已在Ubuntu 14.04 LTS上进行了测试。不知道系统更新将如何影响更新的文件。下次升级时必须检查。
/usr/share/applications/users.desktop:
[Desktop Entry]
Version=1.0
Name=Users and Groups
Comment=Add or remove users and groups
Exec=users-admin
Icon=config-users
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Settings;X-Unity-Settings-Panel;X-GNOME-SystemSettings;
OnlyShowIn=Unity;
X-Unity-Settings-Panel=users