Skip to content

If rc.xml doesn't exist in the user's home .config directory the program produces a empty rc.xml #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zeusgoose opened this issue Mar 7, 2025 · 7 comments

Comments

@zeusgoose
Copy link

Which takes presidence over the system's default rc.xml.
If a packager edits rc.xml for custom defaults of the labwc package in /etc/xdg/labwc, labwc-tweaks-gtk will break it.
output of ~/.config/labwc/rc.xml when it did not originally exist and program touches it:

<?xml version="1.0"?>
<labwc_config>
  <core>
  </core>
</labwc_config>
^@

Reproduce:
copy your custom rc.xml to /etc/xdg/labwc/
delete ~/.config/labwc/rc.xml
run labwc-tweaks-gtk and change the openbox theme

If you do not wish you mess up your configs: I put together a goofy little demo livecd with the scenario setup.
ISO here, checksum here
Audit the livecd here. The .kiwi file is the iso configuration and package selection. The config.sh file is a chroot script that puts the final touches on the image's filesystem before it is squashfs'ed, my custom configs are written in there. Repos used are in the project's meta file. Labwc-tweaks-gtk package here.

Propose solution:
Have the program check if rc.xml exists in the user's home config dir, If not try to copy /etc/xdg/labwc/rc.xml to the user's home dir.
My noobish workaround was to launch the program from a bash script that does that.

@johanmalm
Copy link
Contributor

If a packager edits rc.xml for custom defaults of the labwc package in /etc/xdg/labwc, labwc-tweaks-gtk will break it.

You can run with labwc --merge-config to avoid that.

Propose solution: Have the program check if rc.xml exists in the user's home config dir, If not try to copy /etc/xdg/labwc/rc.xml to the user's home dir.

Might it be simpler to prompt the user to confirm that they actually want an empty rc.xml to be created?

@zeusgoose
Copy link
Author

zeusgoose commented Mar 11, 2025

Might it be simpler to prompt the user to confirm that they actually want an empty rc.xml to be created?

Yes

I should have mentioned: If rc.xml doesn't exist, and the program creates it, the new settings aren't written. ie the new openbox theme selection. I'm assuming that is the desired behavior? apologies

@johanmalm
Copy link
Contributor

@01micko Thoughts on way forward?

@01micko
Copy link
Contributor

01micko commented Mar 12, 2025

Yeah saw this a few days ago and have some thoughts, but no idea of a way forward as yet.

  • certainly not all distros ship an rc.xml in /etc/xdg/labwc/; for example debian ships it in /usr/share/doc/labwc as does slackware.
  • perhaps if no ~/.config/rc.xml exists pop a system notification via execl() and exit the program.

@01micko
Copy link
Contributor

01micko commented Mar 12, 2025

Also, perhaps shipping an rc.xml in /etc/skel (or where ever a particular distro stores generated user configs) would be a better idea than shipping the /etc/xdg/labwc/rc.xml.

@zeusgoose
Copy link
Author

zeusgoose commented Mar 12, 2025

The packaging angle is unimportant. Apologies.
The rc.xml the program creates is not parse-able by the program.

My non-coder eye sees it wants

	/* Ensure all relevant nodes exist before we start getting/setting */
	xpath_add_node("/labwc_config/theme/cornerRadius");
	xpath_add_node("/labwc_config/theme/name");
	xpath_add_node("/labwc_config/libinput/device/naturalScroll");
 

But the template it creates is

<?xml version="1.0"?>
<labwc_config>
  <core>
  </core>
</labwc_config>
^@

Million apologies for the packaging thought
I was thinking copy a parse-able/workable rc.xml from the system. But then I don't know how easy it is to do in C. Is it easier to copy the file or fully flesh out the template inside the program?

@zeusgoose
Copy link
Author

Whelp, looks like I'm just generating noise. I should have checked the other project first: labwc/labwc-tweaks#68
Apologies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants