Datastore & backup - request for help

Martin Langhoff martin.langhoff at
Tue May 20 04:48:30 EDT 2008

On Tue, May 20, 2008 at 8:16 PM, Tomeu Vizoso <tomeu at> wrote:
> What about ~/.sugar/default?

Ok. I can store the flag straight there. For the locks, it might make
sense to make a "lock" directory, as those have a different semantic
(ie: you never want to copy them in a backup, for example).

>>  - Can we trigger scripts on network changes easily? I want to hook up
>> on the same hook that switches gabble on :-) (hmmm, I found
>> /etc/NetworkManager/dispatcher.d , looks promising)
> Not sure about gabble, but I would expect it to listen for some dbus
> signal. If you are curious about which signals/methods happen at some
> point, try snooping with dbus-monitor.

I thought about it, but I don't want to eat up resources with a
sleeping process that may or may not be called someday. The kind of
behaviour that /etc/NetworkManager/dispatcher.d is far better: write a
throwaway script, just make sure it's cheap.

I'm cheap :-)

>>  - Can we check cheaply from shell whether we are on battery power,
>> and what the level of the battery is? Is it safe to just read
>> /sys/class/power_supply/olpc-battery/capacity and
>> /sys/class/power_supply/olpc-ac/status?
> What about using HAL? Sugar uses it like this:

Looks like a ton of work. cat
/sys/class/power_supply/olpc-battery/capacity beats the pants out of
that :-)

> Hope you are not fed up of D-Bus at this point ;)

Not in the least :-) it's a super-duper socket signalling thingy, and
for the kind of work that the core Sugar UI and Activities have to do
is fantastic. But my needs are not fancy - I'm a plumber at best, and
my scripts need to run cheaply and as simple as possible.


 martin.langhoff at
 martin at -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff - working code first

More information about the Devel mailing list