Setting last-selected-power-profile in gnome declaratively

Setting dconf.settings."org/gnome/shell".last-selected-power-profile = "performance" doesn’t seem to work in home-manager. Do I have to set this at the system level?

for gnome I usually set it once manually then once that setting is saved its in the dconf dump.

gsettings set org.gnome.shell last-selected-power-profile 'balanced'

So future dconf load will always have that setting applied.

Then I declare with home-manager to load dconf.

So there’s no way to do it purely declaratively? Is there a file dconf can load with extra user settings, for example?

I’m sure there is a way but it gets messy in my testing as I was trying to do so for keybinds, extensions and customization and it caused more errors than anything else. Maybe someone else had more luck but the clean way that I was able to do it was set it once then use dconf to remember that change forever.

Got it. Do you have to do this for every new system you provision?

Additionally, I thought the dconf settings set by home-manager are overridden by manual user settings? What errors did you encounter?

Yes they are overwritten by user customization but will always be reapplied when you rebuild so pointless for the user in the long run.

Errors i encountered were many using the nix way vs the dconf.ini method from nix issues.

  1. Gnome not making any changes, to customizations
  2. Gnome crashing
  3. Nix not having all the options i want for customizations
  4. The favorite dash bar not remembering my favs
  5. Locking down settings options

To name a few. There were more issues. So the dconf method i outlined was the only clean reproducible way i captured my exact settings, keybinds, gnome shell, dash, bar, fonts,clocks etc customizations.

But if there is a better way to capture all of this without the issues i am open to use it.

Perfect. I think I’ll switch to your implementation for gnome and dconf, then. Thanks for the heads up!

Most welcome

Feel free to use my repo as a guide

Took a while to get it right now it just works

Only thing you need to remember the very first time you run it you need to reboot OR restart gnome OR log out and back in again.

Every other dconf change however seems to read fine after first implementation

1 Like

As usual. :joy_cat: Thanks for all the help!

1 Like