From 2da23ff605aac60d2b70cd953c15e8ffaa38ac56 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Wed, 28 Nov 2012 16:28:11 +0100 Subject: [PATCH] Added gnome-shell extension --- gnome-shell/extension.js | 29 +++++++++++++++++++++++++++++ gnome-shell/metadata.json | 1 + in/wicd=wpath.py.in | 2 ++ setup.py | 9 +++++++++ 4 files changed, 41 insertions(+) create mode 100644 gnome-shell/extension.js create mode 100644 gnome-shell/metadata.json diff --git a/gnome-shell/extension.js b/gnome-shell/extension.js new file mode 100644 index 0000000..8302c94 --- /dev/null +++ b/gnome-shell/extension.js @@ -0,0 +1,29 @@ +/* + * Copyright © 2012, David Paleino + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +const StatusIconDispatcher = imports.ui.statusIconDispatcher; + +function init(metadata) { +} + +function enable() { + StatusIconDispatcher.STANDARD_TRAY_ICON_IMPLEMENTATIONS['wicd-client.py'] = 'wicd-gtk'; +} + +function disable() { + StatusIconDispatcher.STANDARD_TRAY_ICON_IMPLEMENTATIONS['wicd-client.py'] = ''; +} diff --git a/gnome-shell/metadata.json b/gnome-shell/metadata.json new file mode 100644 index 0000000..38b03f7 --- /dev/null +++ b/gnome-shell/metadata.json @@ -0,0 +1 @@ +{"shell-version": ["3.4.2"], "uuid": "wicd@code.hanskalabs.net", "name": "WICD Network Manager", "description": "Show status of WICD"} \ No newline at end of file diff --git a/in/wicd=wpath.py.in b/in/wicd=wpath.py.in index 8df15c9..17bbb73 100755 --- a/in/wicd=wpath.py.in +++ b/in/wicd=wpath.py.in @@ -51,6 +51,7 @@ daemon = '%DAEMON%' curses = '%CURSES%' gtk = '%GTK%' cli = '%CLI%' +gnome_shell_extensions = '%GNOME_SHELL_EXTENSIONS%' translations = '%TRANSLATIONS%' icons = '%ICONS%' pixmaps = '%PIXMAPS%' @@ -86,6 +87,7 @@ no_install_docs = %NO_INSTALL_DOCS% no_install_gtk = %NO_INSTALL_GTK% no_install_ncurses = %NO_INSTALL_NCURSES% no_install_cli = %NO_INSTALL_CLI% +no_install_gnome_shell_extensions = %NO_INSTALL_GNOME_SHELL_EXTENSIONS% no_use_notifications = %NO_USE_NOTIFICATIONS% def chdir(f): diff --git a/setup.py b/setup.py index f7200ae..6e20556 100755 --- a/setup.py +++ b/setup.py @@ -87,6 +87,7 @@ class configure(Command): ('curses=', None, 'set the curses UI directory'), ('gtk=', None, 'set the GTK UI directory'), ('cli=', None, 'set the CLI directory'), + ('gnome-shell-extensions=', None, 'set the Gnome Shell Extensions directory'), ('networks=', None, 'set the encryption configuration directory'), ('log=', None, 'set the log directory'), ('resume=', None, 'set the directory the resume from suspend script is stored in'), @@ -131,6 +132,7 @@ class configure(Command): ('no-install-ncurses', None, 'do not install the ncurses client'), ('no-install-cli', None, 'do not install the command line executable'), ('no-install-gtk', None, 'do not install the gtk client'), + ('no-install-gnome-shell-extensions', None, 'do not install the Gnome Shell extension'), ('no-use-notifications', None, 'do not ever allow the use of libnotify notifications') ] @@ -147,6 +149,7 @@ class configure(Command): self.curses = self.share + 'curses' self.gtk = self.share + 'gtk' self.cli = self.share + 'cli' + self.gnome_shell_extensions = '/usr/share/gnome-shell/extensions/' self.icons = '/usr/share/icons/hicolor/' self.pixmaps = '/usr/share/pixmaps/' self.images = self.share + 'icons' @@ -179,6 +182,7 @@ class configure(Command): self.no_install_gtk = False self.no_install_ncurses = False self.no_install_cli = False + self.no_install_gnome_shell_extensions = False self.no_use_notifications = False # Determine the default init file location on several different distros @@ -477,6 +481,11 @@ class install(_install): [(os.path.join(imgdir, f)) for f in os.listdir(imgdir) if not f.startswith('.')]) ) data.append((wpath.pixmaps, ['other/wicd-gtk.xpm'])) + if not wpath.no_install_gnome_shell_extensions: + data.append( + (wpath.gnome_shell_extensions + 'wicd@code.hanskalabs.net', + ['gnome-shell/' + f for f in os.listdir('gnome-shell')]) + ) if not wpath.no_install_ncurses: data.append((wpath.curses, ['curses/curses_misc.py'])) data.append((wpath.curses, ['curses/prefs_curses.py']))