Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Xfconf Tutorial #4948

Merged
merged 11 commits into from
Jul 14, 2023
Merged

Xfconf Tutorial #4948

merged 11 commits into from
Jul 14, 2023

Conversation

eiskasten
Copy link
Contributor

@eiskasten eiskasten commented May 26, 2023

This PR adds a tutorial for Xfconf as mentioned in issue #280.

Basics

  • Short descriptions of your changes are in the release notes
    (added as entry in doc/news/_preparation_next_release.md which contains _(my name)_)
    Please always add them to the release notes.
  • Details of what you changed are in commit messages
    (first line should have module: short statement syntax)
  • References to issues, e.g. close #X, are in the commit messages.
  • The buildservers are happy. If not, fix in this order:
    • add a line in doc/news/_preparation_next_release.md
    • reformat the code with scripts/dev/reformat-all
    • make all unit tests pass
    • fix all memleaks
    • fix the CI itself (or rebase if already fixed)
  • The PR is rebased with current master.

Checklist

  • I added unit tests for my code
  • I fully described what my PR does in the documentation
    (not in the PR description)
  • I fixed all affected documentation (see Documentation Guidelines)
  • I fixed all affected decisions (see Decision Process)
  • I added code comments, logging, and assertions as appropriate (see Coding Guidelines)
  • I updated all meta data (e.g. README.md of plugins and METADATA.ini)
  • I mentioned every code not directly written by me in reuse syntax

Review

Labels

  • Add the "work in progress" label if you do not want the PR to be reviewed yet.
  • Add the "ready to merge" label if everything is done and no further pushes are planned by you.

@eiskasten
Copy link
Contributor Author

jenkins build libelektra please

@eiskasten eiskasten changed the title Tutorial/types Xfconf Tutorial May 28, 2023
@eiskasten eiskasten requested a review from tucek May 28, 2023 15:18
@hannes99 hannes99 self-requested a review May 29, 2023 18:39
Copy link
Contributor

@hannes99 hannes99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a short section on when what namespace makes sense. Other than that LGTM!

# Setting the value to `false` beforehand
xfconf-query -c thunar -p /misc-single-click -s false -t bool -n

kdb set /sw/xfce4/thunar/misc-single-click TRUE
Copy link
Contributor

@hannes99 hannes99 May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is dir: where this should end up? Maybe user: or spec: might make more sense, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review! You are right, the namespace which makes most sense to me are user: and system:. I just have overseen, that the default seemed to change.

Copy link
Contributor

@tucek tucek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eiskasten
Copy link
Contributor Author

jenkins build libelektra please

@eiskasten eiskasten requested a review from markus2330 June 6, 2023 21:17
Copy link
Contributor

@markus2330 markus2330 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tutorial is great and easy to follow but doesn't provide enough material to be actually able to reconfigure xfce4 and unfortunately did not work on Debian bullseye.

# Setting the value to `false` beforehand
xfconf-query -c thunar -p /misc-single-click -s false -t bool -n

kdb set system:/sw/xfce4/thunar/misc-single-click TRUE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 Sorry, 12 warnings were issued ;(
 1: Module backend issued the warning C01200:
        Installation: No storage plugin defined for kdbGet(). You probably forgot to set 'system:/elektra/mountpoints/proc:\/sw\/xfce4\/thunar/definition/positions/get/storage'. If the configuration is intentional, you can silence this warning by setting 'system:/elektra/mountpoints/proc:\/sw\/xfce4\/thunar/definition/positions/get/storage/omit' to any value. (Configuration of mountpoint: 'proc:/sw/xfce4/thunar')
 2: Module kdb issued the warning C01320:
        Interface: Calling the kdbInit function for the backend plugin ('backend') of the mountpoint 'proc:/sw/xfce4/thunar' has failed.
 3: Module backend issued the warning C01200:
        Installation: No storage plugin defined for kdbGet(). You probably forgot to set 'system:/elektra/mountpoints/dir:\/sw\/xfce4\/thunar/definition/positions/get/storage'. If the configuration is intentional, you can silence this warning by setting 'system:/elektra/mountpoints/dir:\/sw\/xfce4\/thunar/definition/positions/get/storage/omit' to any value. (Configuration of mountpoint: 'dir:/sw/xfce4/thunar')
 4: Module backend issued the warning C01200:
        Installation: You defined a set-resolver plugin, but no storage plugin for kdbSet(). You probably forgot to set 'system:/elektra/mountpoints/dir:\/sw\/xfce4\/thunar/definition/positions/set/storage'. (Configuration of mountpoint: 'dir:/sw/xfce4/thunar')
 5: Module kdb issued the warning C01320:
        Interface: Calling the kdbInit function for the backend plugin ('backend') of the mountpoint 'dir:/sw/xfce4/thunar' has failed.
 6: Module backend issued the warning C01200:
        Installation: No storage plugin defined for kdbGet(). You probably forgot to set 'system:/elektra/mountpoints/user:\/sw\/xfce4\/thunar/definition/positions/get/storage'. If the configuration is intentional, you can silence this warning by setting 'system:/elektra/mountpoints/user:\/sw\/xfce4\/thunar/definition/positions/get/storage/omit' to any value. (Configuration of mountpoint: 'user:/sw/xfce4/thunar')
 7: Module backend issued the warning C01200:
        Installation: You defined a set-resolver plugin, but no storage plugin for kdbSet(). You probably forgot to set 'system:/elektra/mountpoints/user:\/sw\/xfce4\/thunar/definition/positions/set/storage'. (Configuration of mountpoint: 'user:/sw/xfce4/thunar')
 8: Module kdb issued the warning C01320:
        Interface: Calling the kdbInit function for the backend plugin ('backend') of the mountpoint 'user:/sw/xfce4/thunar' has failed.
 9: Module backend issued the warning C01200:
        Installation: No storage plugin defined for kdbGet(). You probably forgot to set 'system:/elektra/mountpoints/system:\/sw\/xfce4\/thunar/definition/positions/get/storage'. If the configuration is intentional, you can silence this warning by setting 'system:/elektra/mountpoints/system:\/sw\/xfce4\/thunar/definition/positions/get/storage/omit' to any value. (Configuration of mountpoint: 'system:/sw/xfce4/thunar')
 10: Module backend issued the warning C01200:
        Installation: You defined a set-resolver plugin, but no storage plugin for kdbSet(). You probably forgot to set 'system:/elektra/mountpoints/system:\/sw\/xfce4\/thunar/definition/positions/set/storage'. (Configuration of mountpoint: 'system:/sw/xfce4/thunar')
 11: Module kdb issued the warning C01320:
        Interface: Calling the kdbInit function for the backend plugin ('backend') of the mountpoint 'system:/sw/xfce4/thunar' has failed.
 12: Module kdb issued the warning C01320:
        Interface: The init phase of kdbGet() has failed. See warnings for details.
Sorry, module backend issued the error C01200:
Installation: You defined a set-resolver plugin, but no storage plugin for kdbSet(). You probably forgot to set 'system:/elektra/mountpoints/proc:\/sw\/xfce4\/thunar/definition/positions/set/storage'. (Configuration of mountpoint: 'proc:/sw/xfce4/thunar')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4947 fixed this. Since I rebased this PR after you tried it, that should work now.


```shell
# Use Elektra instead of Xfconf system-wide
kdb xfconf-system-lib-replace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/lib/libxfconf-0.so.3.0.0 not found on my system it is in /usr/lib/x86_64-linux-gnu/libxfconf-0.so.3.0.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4960 Should solve this

kdb xfconf-user-lib replace

# When replacing only the users library, either restart the session or run
source ~/.xprofile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR: ld.so: object '/usr/lib/libxfconf-elektra-5.0.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.. It should be export LD_PRELOAD="/usr/lib/libxfconf-elektra.so" inestead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4960 should solve this

#> Create a new key system:/sw/org/xfce/xfconf/test/hello with string "world"

# Verify it with Xfconf
xfconf-query -c test -p hello
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Property "hello" does not exist on channel "test"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is solved by 5d83e51

However, Xfce also uses some properties that are not stored in Xfconf.
These properties will not work properly.
An example of such a property is the Gtk theme.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give a bit more examples what can be done. kdb set system:/sw/xfce4/thunar/misc-single-click TRUE didn't work for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it a bit in abb6523 which should work now

kdb xfconf-system-lib-replace

# Use Elektra instead of Xfconf only for the current user
kdb xfconf-user-lib replace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kdb xfconf-user-lib replace
kdb xfconf-user-lib-replace && source ~/.xprofile

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 8486a89


```shell
# Set an Xfconf property with Elektra
kdb set system:/sw/org/xfce/xfconf/test/hello world
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kdb: symbol lookup error: /usr/lib/libxfconf-elektra.so: undefined symbol: g_log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be solved by #4960

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some dependency is missing.

Did you test also on Debian bullseye? In general some additional testing would be great.

- infos/provides = storage/xfconf
- infos/provides = storage/xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in a different PR to merge it first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was actually an accident. I committed it in two different PRs, the other one was #4947. Since I rebased this PR with the master, this PR will not change anything regarding this.


The following table shows a comparison between the different type systems.

| Xfconf | Elektra | Note |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also a xfce4 example per type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xfce actually only uses a few of them. I added examples to the types I have found in abb6523.

@markus2330
Copy link
Contributor

Btw. I think also restart of xfconfd is needed so that some parts of the tutorial actually can work? (Logout/Login does not restart xfconfd for me, and without restart it cannot pick up a different library).

@eiskasten
Copy link
Contributor Author

Btw. I think also restart of xfconfd is needed so that some parts of the tutorial actually can work? (Logout/Login does not restart xfconfd for me, and without restart it cannot pick up a different library).

I do not think that this is necessary. Xfconfd is only used by the original libxfconf-0 for things such as caching or property monitoring. Since the Xfconf implementation of Elektra does not use it at all, it should be no problem. However, I do not know if some applications interact directly with it (which they definitely should not do at all). For that it should be enough to just kill it but I never run into problems with that.

@eiskasten
Copy link
Contributor Author

Tutorial is great and easy to follow but doesn't provide enough material to be actually able to reconfigure xfce4 and unfortunately did not work on Debian bullseye.

Thank you for the review. I provided corrections for the requested things.

@eiskasten
Copy link
Contributor Author

I have tested and fixed it for debian now and it works with the buster image within the repository. However, please make sure to use #4960 since this PR contains fixes which are mandatory to debian.

@eiskasten
Copy link
Contributor Author

jenkins build libelektra please

@eiskasten eiskasten mentioned this pull request Jul 11, 2023
19 tasks
@markus2330
Copy link
Contributor

jenkins build libelektra please

@markus2330 markus2330 merged commit 6fe5335 into ElektraInitiative:master Jul 14, 2023
@eiskasten eiskasten deleted the tutorial/types branch July 16, 2023 09:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants