How to remove clock from panel in gnome-shell?

8,905

Solution 1

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

Solution 2

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();'

Solution 3

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

Share:
8,905

Related videos on Youtube

Laurynas
Author by

Laurynas

Updated on September 18, 2022

Comments

  • Laurynas
    Laurynas over 1 year

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

  • Laurynas
    Laurynas over 12 years
    Removed indicator-datetime, rebooted system, clock is still there
  • Laurynas
    Laurynas over 12 years
    Using Alt key while Right clicking clock doesn't seem to to anything, it just opens calendar like a simple Left click. Am I doing something wrong?
  • Bruno Pereira
    Bruno Pereira over 12 years
    That works in fallback mode with compiz disabled
  • all4naija
    all4naija over 12 years
    Yes! Press the Alt first and right click on the clock and a popup will ask you for 'Remove' and 'Remove from panel' choose 'remove from panel and select 'Don't reload'. Try it again.
  • Laurynas
    Laurynas over 12 years
    Great! Thank you! Really good way with a possibility to turn it back easily. [For anyone else who might use this: I had to run gedit lines with sudo!]
  • Gerard Roche
    Gerard Roche over 11 years
    @Laurynas seriously? I kinda want to remove the indicator now to see if your joking. The is really still there?
  • Old account
    Old account about 7 years
    doesn't work in the latest versions of Ubuntu
  • jonathan
    jonathan about 5 years
    Not working in 18.04
  • jonathan
    jonathan about 5 years
    This worked for me in 18.04 - extensions.gnome.org/extension/1110/hide-clock