bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
617 stars 69 forks source link

Confusion about what binaries, etc. are available cross-stratum #168

Closed shadowrylander closed 4 years ago

shadowrylander commented 4 years ago

Hello!

So I've been having some trouble using binaries between strata, including fonts (tried using an arch font in Ubuntu's Gnome Tweaks), and I'd like to know how Bedrock initializes paths, and how I could add said paths to the shell I'm currently using, the python xonsh.

Thank you kindly for the help!

paradigm commented 4 years ago

Confusion about what binaries, etc. are available cross-stratum

Features expected to work cross-stratum are documented here.

So I've been having some trouble using binaries between strata, including fonts (tried using an arch font in Ubuntu's Gnome Tweaks),

As noted on that the feature compatibility page:

cross-stratum Xorg fonts | Reports of inconsistency | Deeper investigation needed

Cross-stratum Xorg Fonts work for me, but since my first pass at implementing them I've gotten inconsistent reports about whether they work for others. There's some part of the picture there I'm missing. I (or someone else) need to revisit the subsystem and see what's going on.

I think the issue is related to the font cache. On a normal system, there's two of them: a root-owned system one, and a per-user one. On Bedrock, the per-user one is global so you only have one on the system, but the root-owned one is local, which means you have one per stratum.

You could try running fc-cache -fv to update the cache, both root and non-root, and prepending strat when doing so to try for various strata. For example, sudo strat arch fc-cache -fv && strat arch fc-cache -fv might fix the font issue for Arch.

This isn't intended as the normal workflow here; I'd like this subsystem to just-work.

and I'd like to know how Bedrock initializes paths

Bedrock has a number of different strategies for different resources, but the most popular one is to:

Exactly how it configures resource consumers to look in /bedrock/cross depends on the resource. Most of those are configured in bedrock.conf in some fashion or another.

For fonts, Bedrock creates symlinks to font configuration files in /etc/X11 and /etc/fonts.

For things like executables and man pages, Bedrock sets a number of environment variables all over the system.

I'm not familiar with xonsh. Presumably it doesn't pick up /etc/environment or /etc/profile or other things Bedrock currently sets, and so we'll need to set some other configuration for it.

Per https://xon.sh/xonshrc.html it looks like the system-wide location would be /etc/xonshrc, and that it's populated in either python or some python-like language. I can look into having Bedrock automatically create and populate this file so it just-works for xonsh users in the future. It doesn't look like that file is created automatically when the package is installed, which Bedrock's current design expects. I'll have to think about a good way to handle that. I don't see a good way to detect when xonsh is installed and create the file then. It might be as simple as having Bedrock just always create that file, but I want to think it through.

As a work around for now, set these environment variables either in your ~/.xonshrc.

shadowrylander commented 4 years ago

Perfect! Thanks so much! Just wanted to confirm all of it, because as you mentioned before on a [Reddit] thread, the documentation might change quickly, so I wanted to make sure I wasn't missing anything. I'll go ahead and close this for now, then!