enabling a plugin by default



I have a script that runs gnome-shell with my shellshape plugin added
to $XDG_DATA_DIRS. This is excellent for people trying out my plugin,
since they don't have to commit to installing anything or remember
where they put things.

One problem with gnome-shell 3.3+ is that you have to enable the
plugin via gnome-tweak-tool before it will actually be active. To fix
this, I delved into dconf to find what seems to be the right key. I'm
using the following python script to launch my plugin. Is there a
better way to do this?


#!/usr/bin/env python

import os, sys
from gi.repository import Gio

plugins = Gio.Settings.new('org.gnome.shell')['enabled-extensions']
shellshape = 'shellshape gfxmonk net'
if shellshape not in plugins:
	print >> sys.stderr, "Note: appending shellshape to the list of
enabled plugins automatically"
	plugins.append(shellshape)

# the script goes on to set up paths and launch gnome-shell itself


----
Cheers,
 - Tim.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]