How to remove clock from panel in gnome-shell?

How to remove clock from the top panel in gnome-shell? enter image description here


It is possible by creating an extension.

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

Make a metadata.json file.

gedit metadata.json

Cut following code, and Paste into the editor ,and Save.

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

Make an extension.js file.

gedit extension.js

Cut following code, and Paste into the editor ,and Save.

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);
}

Restart gnome-shell and Turn on "Disable Clock" extension by gnome-tweak-tool


Hide the clock in your current session with this command:

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

Press Alt+Right click the clock, there should be an entry saying Remove from panel.