#!/usr/bin/python
from gi.repository import Gio

def on_change_event(settings, keys, n_keys):
    print settings, keys, n_keys

s = Gio.Settings.new("org.gnome.nautilus.preferences")
s.connect("change-event", on_change_event)
s["show-hidden-files"] = True


