Start one single process with only default gsettings

I have a few visible non-default settings on my desktop, notably a non-default accent color and different fonts.

But I’d like to make screenshots of specific applications I develop with default settings, for consistency and also because flathub mandates this.

So far I used to manually reset my desktop settings, make a screenshot, and restore my settings, but I feel that there should be a better process that’s less cumbersome and error-prone.

Can I start one specific application with only default settings as taken from the gsettings schemas? Perhaps by somehow pointing it to e.g. a separate empty dconf database?

What I did recently is to create a new user for taking the screenshots.

But now that I think about it, to not use dconf:

$ GSETTINGS_BACKEND=memory app

Documented in the GIO docs.

2 Likes

This… sort of works, but not completely. It appears to restore default fonts, but the Adwaita accent color remains on my non-default value…

I’ve considered a separate user, but that’s exceedingly tedious, especially when running directly from a Git repository. At this point it’s almost simpler to have a script which calls gsettings reset on relevant settings and afterwards restores the old settings.

That’s because the accent color (and the light/dark style) comes from the Settings portal, not from your application.

Hi,

Try setting ADW_DISABLE_PORTAL=1 too.

1 Like

For accent color, you could open the inspector and disable “Follow system accent color” in the Adwaita tab.

Thanks :pray: Combined with the memory gsettings backend the Adwaita environment variable makes my app start with default appearance :partying_face:

1 Like

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