Skin changes to default when rebooting after changing in guisettings.xml

I am trying to modify /home/osmc/.kodi/userdata/guisettings.xml with sed, so I can change screen resolution and audio output when rebooting through a script. However each time I run the script (changing the lines in guisettings.xml) and reboot - my OSMC has changed back to the default skin.

This hasn’t been a problem earlier but yesterday reinstalled OSMC because of corrupted SD-card.

Does anyone have an idea how to make my changes in guisettings.xml stay after rebooting and prevent OSMC from booting up in the default OSMC skin?

If you are making the changes while Kodi is running, then they will be reset when Kodi restarts. Kodi writes guisettings when it’s stopped.

Depending on what you are trying to change, you could use the Kodi JSON to achieve it. Otherwise Kodi must be stopped (sudo systemctl stop mediacenter) for your changes to stick.

This did not solved my problem. OSMC is still turning back to default skin after a reboot :frowning:

Try exit Kodi instead of rebooting

Hi sam_nazarko,

I have to reboot since one of the configuration during the script is to rotate the screen.

The script creates new settings for resolution, sound-output and rotates the screen (changing a line in /boot/config.txt).

All this for my projector hanging from the ceiling…

Any other good suggestions? :slight_smile:

You should stop Kodi if you are editing settings programmatically.

I tried to stop Kodi with “sudo systemctl stop multimedia” and then do the changes to guisettings.xml and afterwards reboot. Same problem appeared after the reboot… :frowning: ?

It should be mediacenter, not multimedia.

Yeah yeah… My bad wrong spell… Of course I used mediacenter :smiley:

Run grab-logs -g, stop mediacenter, make the changes, run grab-logs -g again, then reboot. Finally, (you guessed it) run grab-logs -g

Provide the three URLs.

Will do that tomorrow. Can’t be now. Hope that’s okay.

No problems.

Found this: Reddit - Dive into anything

Copy the GUI settings you wish to force to an advancedsettins.xml file. That will force/overwrite anything in guisettings.xml.

1 Like

Hi again, just checked it out.

How would you suggest that I could implement the following lines in my own created “advancedsettings.xml” in .kodi/userdata/

sed -i ‘15s# default=“true”>PI:HDMI#ALSA:@:CARD=Device,DEV=0#g’ /home/osmc/.kodi/userdata/guisettings.xml

sed -i ‘215s%true% default=“true”%g’ /home/osmc/.kodi/userdata/guisettings.xml

sed -i ‘320s#29#33#g’ /home/osmc/.kodi/userdata/guisettings.xml

sed -i ‘322s# default=“true”>DESKTOP#00128000720060.00000pstd#g’ /home/osmc/.kodi/userdata/guisettings.xml

The above lines is the changes I need to happen, when I reboot (and the screen rotates because of “display_rotate=2” in /boot/config.txt). This will change my screen resolution to 1280x720p and my audio output to USB audio.

However when doing it like the above code - the OSMC skin is set to default, when rebooting… :smiley:

I’m out of time for today, but I’d have thought that the simplest solution would be to have several versions of advancedsettings.xml, one for each of the configurations you want, and simply copy whichever one you need to advancedsettings.xml, overwriting the previous settings.

Hi again Dillthedog,

Could you maybe specify further how the file “advancedsettings.xml” would look, if I would like my sed commands to run before rebooting for rotating the screen? :slight_smile:

The information you need is found here. You would just copy whatever lines you wanted from the guisettings.xml file. I believe this would be something like…

<advancedsettings version="1.0">
1 Like
  1. There’s no guarantee that using advancedsettings.xml will work for all settings. Just because someone on Reddit says it’ll work, doesn’t guarantee that it will. :wink: I was hoping that you’d give it a try.

  2. Looking at your sed scripts, I’d say that guisettings.xml file is probably failing to parse correctly and Kodi will therefore reset everything back to default settings. You suggested in post #1 that it was working before a reinstall of OSMC but I don’t understand how that might be so. If the advancedsettings.xml method doesn’t work, I’ll comment on the sed code.

I’ll give it a try with the “advancedsettings.xml”, just wasn’t sure how to implement - but I will try to do like darwindesign showed me. :slight_smile:

Hey again! I fixed it! Well a lot easier way but it is solved. I have just created two guisettings.xml.normal and guisettings.xml.projector. With my bash script I am now instead just renaming and moving around each time I am rebooting. This works! Amazing… :slight_smile:

Another question you maybe can answer: is it possible to “safely” reboot, what should I do to prevent the power from just cutting to my external harddisk when using “sudo reboot”. Could I maybe somehow unmount the disks before the reboot, so it doesn’t hurt in my heart each time it reboots and the harddisks hard shuts down and boot up again right after :smiley: ?