Elektra
0.8.22
|
This plugin works on Mozilla preference files and is used in Elektra’s Firefox autoconfig script.
pref(....
, keys below mountpoint/pref/
.user_pref(....
, keys below mountpoint/user/
.lockPref(....
, keys below mountpoint/lock/
.sticky_pref(....
, keys below mountpoint/sticky/
.Only Keys below one of these points are valid, everything else will be dropped
integer
string
boolean
In Mozilla preference files .
is used to separate sections, while elektra uses /
. For simplification, and because /
isn't allowed in preference keys, the plugin treats .
and /
equally.
kdb set system/prefs/lock/a/lock/key lock kdb set system/prefs/lock/a/lock.key lock kdb set system/prefs/lock/a.lock.key lock
will all result in lockPref("a.lock.key", "lock");
```
sudo kdb mount prefs.js /examples/prefs mozprefs
kdb setmeta user/examples/prefs/lock/a/lock/key type boolean kdb set /examples/prefs/lock/a/lock/key true kdb setmeta user/examples/prefs/pref/a/default/key type string kdb set /examples/prefs/pref/a/default/key "i'm a default key" kdb setmeta user/examples/prefs/user/a/user/key type integer kdb set /examples/prefs/user/a/user/key 123
kdb export user/examples/prefs ini #> [lock/a/lock] #> # type = boolean #> key = true #> [pref/a/default] #> # type = string #> key = i'm a default key #> [user/a/user] #> # type = integer #> key = 123
cat kdb file user/examples/prefs
#> lockPref("a.lock.key", true); #> pref("a.default.key", "i'm a default key"); #> user_pref("a.user.key", 123);
kdb rm -r /examples/prefs sudo kdb umount /examples/prefs ```