/usr/share/gnome-shell/extensions/Move_Clock@jonathan.bluemosh.com/extension.js is in gnome-shell-extension-move-clock 1.01-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | // Copyright (C) 2011-2013 R M Yorston
// Copyright (C) 2016 Jonathan Carter
// Licence: GPLv2+
const Main = imports.ui.main;
const SessionMode = imports.ui.sessionMode;
function init() {
}
function enable() {
let mode = Main.sessionMode.currentMode;
let center = SessionMode._modes[mode].panel.center;
// do nothing if the clock isn't centred in this mode
if ( center.indexOf('dateMenu') == -1 ) {
return;
}
let centerBox = Main.panel._centerBox;
let rightBox = Main.panel._rightBox;
let dateMenu = Main.panel.statusArea['dateMenu'];
let children = centerBox.get_children();
// only move the clock if it's in the centre box
if ( children.indexOf(dateMenu.container) != -1 ) {
centerBox.remove_actor(dateMenu.container);
children = rightBox.get_children();
rightBox.insert_child_at_index(dateMenu.container, children.length-1);
}
}
function disable() {
let mode = Main.sessionMode.currentMode;
let center = SessionMode._modes[mode].panel.center;
// do nothing if the clock isn't centred in this mode
if ( center.indexOf('dateMenu') == -1 ) {
return;
}
let centerBox = Main.panel._centerBox;
let rightBox = Main.panel._rightBox;
let dateMenu = Main.panel.statusArea['dateMenu'];
let children = rightBox.get_children();
// only move the clock back if it's in the right box
if ( children.indexOf(dateMenu.container) != -1 ) {
rightBox.remove_actor(dateMenu.container);
centerBox.add_actor(dateMenu.container);
}
}
|