Skip to content

Instantly share code, notes, and snippets.

@kellya
Created December 18, 2014 19:42
Show Gist options
  • Save kellya/ca4e9b83faed33a4ac7c to your computer and use it in GitHub Desktop.
Save kellya/ca4e9b83faed33a4ac7c to your computer and use it in GitHub Desktop.
Toggle an Gnome Extension
#!/usr/bin/env python
from gi.repository import Gio
topbar = 'hidetopbar@mathieu.bidon.ca'
settings = Gio.Settings(schema='org.gnome.shell')
extensions = settings.get_strv('enabled-extensions')
if topbar in extensions:
print "HideTopBar is enabled, disabling"
extensions.remove(topbar)
else:
print "HideTopBar not found, enabling"
extensions.append(topbar)
settings.set_strv('enabled-extensions', extensions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment