Tuesday, February 21, 2012

GNOME Shell Extension development document

I don't know why it is so hard to search for the right development document for GNOME Shell Extension. The Gjs seems wraps all the functionalities to call the shell, but hard to find out how.
After searching and coding. I find out this may be a good one:


Wednesday, February 15, 2012

Recursively chmod directories only

find . -type d -exec chmod 755 {} \;

This will recursively search your directory tree (starting at dir ‘dot’) and chmod 755 all directories only.

Similarly, the following will chmod all files only (and ignore the directories):

find . -type f -exec chmod 644 {} \;

Wednesday, February 8, 2012

Shell eliminate warning messages

When I grep the directory, the warning message is really annoying.
$ grep ........  2 > /dev/null
This will write warnings to /dev/null

Tuesday, February 7, 2012

Python regex replace part of matched string

myRe = re.compile(r"(myFunc\(.+?\,.+?\,)(.+?)(\,.+?\,.+?\,.+?\,.+?\))")
print myRe.sub(r'\1"noversion"\3', val)

Saturday, February 4, 2012

GNOME Shell Extensions development

In order to develop the GNOME Shell Extensions, a few resources may be extremely helpful:

As the extensions will not be loaded it self when GNOME Shell starts, the extension uid need to be added:
$gsettings set org.gnome.shell enabled-extensions "['LittleRabbit@gosteven.com']"
$gsettings get org.gnome.shell enabled-extensions
it will be there

Few tips for development:

1. See the log and debug information: Press Alt+F2, type lg to open the Looking Glass. P.S. Currently the debug method is logging everything. Actually You can also force a gdb breakpoint from _javascript_ with "global.breakpoint();"
2. Make GNOME Shell reload extensions after modified js files without log out: Press Alt+F2, type r to refresh.