如何从gnome-shell中的面板中删除时钟?

如何从gnome-shell的顶部面板中删除时钟? 在此处输入图像描述

可以通过创建扩展名来实现。

mkdir -p ~/.local/share/gnome-shell/extensions/Disable_Clock@ocelot cd ~/.local/share/gnome-shell/extensions/Disable_Clock@ocelot 

制作metadata.json文件。

 gedit metadata.json 

剪切以下代码,然后粘贴到编辑器中,然后保存。

 {"shell-version": ["3.2"], "uuid": "Disable_Clock@ocelot", "name": "Disable Clock", "description": "Disable Clock from the top of panel"} 

制作extension.js文件。

 gedit extension.js 

剪切以下代码,然后粘贴到编辑器中,然后保存。

 const St = imports.gi.St; const Main = imports.ui.main; function init(meta) { } function enable() { Main.panel._centerBox.remove_actor(Main.panel._dateMenu.actor); } function disable() { Main.panel._centerBox.add_actor(Main.panel._dateMenu.actor); } 

重启gnome-shell并通过gnome-tweak-tool启用“禁用时钟”扩展

使用以下命令隐藏当前会话中的时钟:

 dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.panel._dateMenu.actor.hide();' 

按Alt +右键单击时钟,应该有一个条目说从面板中删除

在teminal键入以下内容:

 sudo apt-get remove indicator-datetime