-
Notifications
You must be signed in to change notification settings - Fork 123
Plugin/xfconf #4396
Plugin/xfconf #4396
Changes from 8 commits
7896583
482186f
1d7d50a
c248ca0
1ff0012
1df5489
c3add37
7b606e3
f53341a
d5d13fc
11ab4a5
a2af438
c3fa140
2fcbaeb
5c8ec2a
2994614
e9defcf
031a867
f043490
eaeb180
a7a9803
0542aef
b6fd319
e7f3d2c
35b88ad
39e5add
e42b17f
87be411
2ba4bb3
c5d4f43
a96b6b0
2a61c05
b516e8a
0eb9abb
8a8beb8
75c9abc
0574de0
8467ad5
c0ce8e9
7e92e98
c197cda
77911dc
f279bb8
4d7dd47
fb53711
1a1a6b5
cc209dc
002660d
266ab67
d69fa38
6e9f6a7
4b915d7
c38088b
cadd132
7b480c4
15deb99
07d2a23
969be62
76145b7
f1ca0f6
82a05d6
d10ac3a
dcbc968
beefc56
7b26e96
390413e
6d48838
1d0d552
368b059
6add862
1458711
49cd309
b135305
487ecce
a599135
e18c08c
210f415
0f5f854
d1e4892
1b1307a
e282a32
56e94e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,9 +13,38 @@ | |||||
|
||||||
This is a storage plugin to mount the xfconf configuration settings. | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The template has |
||||||
## Xfconf Terminology | ||||||
|
||||||
### Property | ||||||
|
||||||
A property in xfconf is the same as a key in libelektra i.e. it has a name and can hold one or more values. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A key only has one value (or none). Can you please give an example of how a property in xfconf would be represented in Elektra. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely, this was may fault. I corrected this with d1e4892. |
||||||
|
||||||
### Channel | ||||||
|
||||||
A channel is a type of namespace used in the xfconf library. | ||||||
Usually, it is used to separate the properties of different applications which is helpful if different applications rely on a property with the same name but require them to hold different values. | ||||||
For example Thunar uses a channel named `thunar`, Xfwm uses a channel named `xfwm4` and so on. | ||||||
Keep in mind that channels are only used to separate the properties such as namespaces. | ||||||
They are not a security feature i.e. every application has read/write access to every channel. | ||||||
|
||||||
The list of all channels is stored in the `system:/elektra/modules/xfconf/channels` which is an array of all channel names. | ||||||
Channel cannot be explicitly created or removed. | ||||||
They only exist in an implicit manner when you pass the `channel=...` argument. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this sentence. Do you mean "plugin configuration" when you say argument? Please describe how channels are used within xfce4, and how they map to Elektra. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope the commit e282a32 makes it more clear. |
||||||
|
||||||
### Locks | ||||||
|
||||||
Xfconf uses so-called locks to prevent users or applications to set properties to a new value. | ||||||
They can be referred as a type of constant. | ||||||
As of now, locks cannot be set or unset in xfconf which makes locked properties read-only forever. | ||||||
|
||||||
## Dependencies | ||||||
|
||||||
xfconf from the XFCE project | ||||||
The xfconf library from the XFCE project is the main dependency of this plugin. | ||||||
Usually, this library is called something such as `xfconf` (Arch, Fedora, `xfconf-devel` for compiling), `libxfconf-0` (Debian, `libxfconf-0-dev` for compmiling) or `xfce4-conf` (FreeBSD) in the package manager. | ||||||
As xfconf itself depends on dbus and glib, these are dependecies too but should be installed with the package manager automatically. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please also write that dbus must be running. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done with 1b1307a. |
||||||
This plugin is tested with the xfconf versions `4.16` and above. | ||||||
|
||||||
Note that this plugin does not support macOS since Xfce is not commonly used there, Mac Ports only provides a very old version (`4.12`) and Brew does not provide Xfce at all. | ||||||
|
||||||
## Usage | ||||||
|
||||||
|
@@ -27,20 +56,23 @@ The usage is identical to most storage plugins except that the channel option du | |||||
# Backup-and-Restore: user:/tests/xfconf | ||||||
|
||||||
# mount the xfwm channel | ||||||
kdb mount /dev/null /test/xfwm xfconf "channel=xfwm4" 2&>/dev/null | ||||||
kdb mount /dev/null /test/xfwm xfconf "channel=xfwm4" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This plugin also needs new-backend and new-style mounting. Let us discuss this later in the meeting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, I realized it is the same issue as for @flo91 has with the relational database backend There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This must be tests, see doc/TESTING.md line 196:
Suggested change
|
||||||
|
||||||
# store old button layout | ||||||
set "OLD_LAYOUT=$(kdb get /test/xfwm/general/button_layout 2&>/dev/null)" | ||||||
set "OLD_LAYOUT=$(kdb get /test/xfwm/general/button_layout)" | ||||||
|
||||||
# set only a close button | ||||||
kdb set system:/test/xfwm/general/button_layout "C|" 2&>/dev/null | ||||||
kdb set system:/test/xfwm/general/button_layout "C|" | ||||||
|
||||||
# read the new layout | ||||||
kdb get /test/xfwm/general/button_layout 2&>/dev/null | ||||||
kdb get /test/xfwm/general/button_layout | ||||||
#> C| | ||||||
|
||||||
# restore old layout | ||||||
kdb set /test/xfwm/general/button_layout "$OLD_LAYOUT" 2&>/dev/null | ||||||
kdb set /test/xfwm/general/button_layout "$OLD_LAYOUT" | ||||||
|
||||||
# umount the channel | ||||||
kdb umount /test/xfwm | ||||||
``` | ||||||
markus2330 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
## Limitations | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ static void test_basics (void) | |
} | ||
|
||
printf ("test basics\n"); | ||
printf ("open plugin...\n"); | ||
PLUGIN_OPEN ("xfconf"); | ||
|
||
KeySet * ks = ksNew (0, KS_END); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are only very basic tests. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain what this plugin can do, how to use it, what works, ... E.g. see src/plugins/augeas/README.md for a similar plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a much better introduction with 56e94e4.