2011-02-17 19:43:48 +00:00
|
|
|
#!@PYTHON@
|
|
|
|
# -*- mode: Python; indent-tabs-mode: nil; -*-
|
|
|
|
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
import optparse
|
|
|
|
|
2019-07-11 16:16:41 +00:00
|
|
|
def extension_command(args):
|
|
|
|
print("gnome-shell-extension-tool is deprecated, use gnome-extensions instead",
|
|
|
|
file=sys.stderr)
|
|
|
|
subprocess.run(["@bindir@/gnome-extensions"] + args)
|
2011-06-23 01:32:08 +00:00
|
|
|
|
2011-10-16 18:24:20 +00:00
|
|
|
def create_extension():
|
2019-07-11 16:16:41 +00:00
|
|
|
extension_command(["create", "--interactive"])
|
2011-10-16 18:24:20 +00:00
|
|
|
|
|
|
|
def enable_extension(uuid):
|
2019-07-11 16:16:41 +00:00
|
|
|
extension_command(["enable", uuid])
|
2011-10-16 18:24:20 +00:00
|
|
|
|
|
|
|
def disable_extension(uuid):
|
2019-07-11 16:16:41 +00:00
|
|
|
extension_command(["disable", uuid])
|
2011-10-16 18:24:20 +00:00
|
|
|
|
2016-10-08 18:23:45 +00:00
|
|
|
def reload_extension(uuid):
|
2019-08-27 08:55:54 +00:00
|
|
|
print("Reloading extensions does not work correctly and is no longer supported",
|
2019-07-11 16:16:41 +00:00
|
|
|
file=sys.stderr)
|
2016-10-08 18:23:45 +00:00
|
|
|
|
2011-10-16 18:24:20 +00:00
|
|
|
def main():
|
|
|
|
parser = optparse.OptionParser()
|
|
|
|
parser.add_option("-d", "--disable-extension", dest="disable",
|
|
|
|
help="Disable a GNOME Shell extension")
|
|
|
|
parser.add_option("-e", "--enable-extension", dest="enable",
|
|
|
|
help="Enable a GNOME Shell extension")
|
|
|
|
parser.add_option("-c", "--create-extension", dest="create", action="store_true",
|
|
|
|
help="Create a new GNOME Shell extension")
|
2016-10-08 18:23:45 +00:00
|
|
|
parser.add_option("-r", "--reload-extension", dest="reload",
|
|
|
|
help="Reload a GNOME Shell extension")
|
2011-10-16 18:24:20 +00:00
|
|
|
options, args = parser.parse_args()
|
|
|
|
|
|
|
|
if args:
|
|
|
|
parser.print_usage()
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
if options.disable:
|
|
|
|
disable_extension(options.disable)
|
|
|
|
|
|
|
|
elif options.enable:
|
|
|
|
enable_extension(options.enable)
|
|
|
|
|
|
|
|
elif options.create:
|
|
|
|
create_extension()
|
|
|
|
|
2016-10-08 18:23:45 +00:00
|
|
|
elif options.reload:
|
|
|
|
reload_extension(options.reload)
|
|
|
|
|
2011-10-16 18:24:20 +00:00
|
|
|
else:
|
|
|
|
parser.print_usage()
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|