Increase font size in TBrowser with snap version 6.30.02


Hello, I installed the snap version on my Ubuntu20.04 laptop. I would like to increase the font size for TBrowser, e.g. . However, I cannot edit (as sudo) the file system.rootrc, nor can I add the file .rootrc: The directory is read-only. sudo chmod cannot make directories writable neither.
Any suggestion?
Thanks,
Christian Kiesling

Put this file in your home folder.

Thanks, it worked: Using sudo I copied system.rootrc into my home directory and changed the Gui.DefaultFont etc accordingly. This was not sufficient. But then I copied system.rootrc to .rootrc. This then finally worked.

For refrence, check out “configure ROOT at start-up” in the Primer:

The system wide files are intentionally read only on snaps.

The expected place for user specific root config files would be $HOME/snap/root-framework/current/.rootrc. $HOME/.rootrc might also happen to work in some use cases because it might be implicitly being treated as the local folder config, if e.g opened via the start menu. But the $HOME/snap path is the one you probably want to use generally.

Maybe by “mistake”, my ROOT system is installed in /snap, not in $HOME/snap.
In any case .rootrc in the directory where I run ROOT is working.
But there is one more “soucis”: The mouse pointer within the TBrowser window is very small, especially when using it to snap on the dividing line between the directory window on the left and the histogram area on the right. I did not find a way to increase the size within .rootrc. I also in the documentation (ROOT primer) I could not find a hint for increasing the pointer size.

/snap isn’t incorrect, it’s where the program data files are exposed (I use the phrase exposed because there are not actually any files there for real, they’re mounted in memory temporarily, which is why they can’t be edited directly). $HOME/snap is where user config lives by default, unless a snap happens to use elsewhere as a conscious decision. For ROOT, there’s not much of interest in there for most people, since it’s mostly just generic stuff like font caches.

If you run os.GetEnv(“home”) in Pyroot, or the equivilent in C++ ROOT, you’d see $HOME is actually $HOME/snap/root-framework/current, rather than your normal home, which is why the .rootrc file would preferably go there, rather than the real $HOME. Rewriting $HOME is also a thing all snaps do by default since it’s needed to aid with the sandboxing they have by default.

Regarding the rest, I’m not the best person to talk about the nuances of .rootrc itself unfortunately, although I’m wondering if you might have an high resolution screen and ROOT, being almost pure X11, isn’t doing an ideal job at scaling to fit the physical display, in which case this might be searchable as a more general high DPI problem for Linux rather than a ROOT specific quirk.

Thanks for the useful explanations. Indeed, I have a high-resolution screen. Fonts and cursor are adjusted using the Ubuntu tools to give reasonable reading. Same is true when I enter the TBrowser screen on the right (histogram) area: The arrow cursor retains its size. But as soon as I move the mouse to the left side, and into the area between right and left, where I can, e.g. increase the relative sizes of the areas, then the cursor becomes almost invisibly small. Any further ideas/suggestions?

You’d essentially need to trick the XWayland/X11 server into claiming to have a smaller resolution. I’m vaguely aware this can be done on a per-app level, but it’s not something I’ve done personally and searching the web for it myself is giving a lot of information but nothing that stands out as particularly ideal. This essentially revolves around the xrandr tool and using nested X11 servers to trick an app into thinking the monitor resolution is different to what it really is, but beyond this I’m clueless on how it’s actually achieved.

For ROOT specifically, the ROOT 7 future is to begin transitioning the legacy GUI stuff over into the web browser, which wouldn’t have the scaling issues because the browser itself will usually scale just fine. Try creating an instance of RBrowser rather than TBrowser, which will hopefully pop up in a web browser for you with the same functionality as the native windows. Similarly RCanvas would be TCanvas in the browser too.

From what I’ve seen, this will be the default (again, it was before but has since been reverted) in Root 6.32, i.e, TBrowser/TCanvas would have RBrowser/RCanvas GUI’s by default.

Ideally this would mean you could avoid messing with system settings that might have caveats, and preps you for future versions of ROOT that will default to the web browser anyway.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.