Create and name your lighting effect in Freestyle mode.Go to keyboard settings (a cog icon in the upper left corner)In the lower right corner of the settings add your named effect to the keyboard memory, but DO NOT switch to the onboard mode yet.Exit the settings and go back to lighting editor.In the editor, change effect type to preset instead of freestyle. Open the drop-down with presets and you'll see your own custom lighting at the bottom of the list. Select it. Only presets from this list can be stored as default in onboard mode.Now go back to settings, turn on the onboard mode and select your default profile, for which you've set your custom effect. (Credits to yawor)
You can use default settings available from keyboard, by using * with any number from 0 - 9. It is working only temporary. After waking up keyboard from saving battery mode your chosen lighting will reset to default one.
G Hub software - not useful too much on Linux, but I saw that people try different solutions using G Hub software on Windows and switching back to Linux. More info is on GitHub thread in g810-led project
You can use Ratbagctl project - It's solution that I use on my Logitech G915 TKL keyboard and it is working good for me. But you need to be careful. It writes configuration to onboard flash (it overwrites the stored profile on your keyboard). Some people after using it had problems with power saving settings. I did not.
You can use G810-led PR for G915 - It is the most flexible solution available right now, but I had the same problem like with default settings. After waking up keyboard from saving battery mode my setups were gone. There is a workaround for that, but I didn't try it. Ratbagctl was enough for me.
If you are platform locked with Windows-only software from Logitech, you might also want to check with their documentation to see if it has on-board memory allowing you to keep your settings even when connected to a different PC or a different OS.
With G Hub, you can load your custom lighting and inactivity setup as the default profile (replacing the rainbow) with the onboard mode . Then you can use it with Ubuntu or any other computer and it will stay as the keyboard's default profile. I just wrote a tutorial about it : @alexis.j.boix/logitech-g915-onboard-custom-lightning-f9afb550c678
c80f0f1006