UltraStar-Deluxe / USDX

The free and open source karaoke singing game UltraStar Deluxe, inspired by Sony SingStar™
https://usdx.eu
GNU General Public License v2.0
803 stars 157 forks source link

[Linux] Themes are not detected in .ultrastardx/themes #715

Open jmfergeau opened 1 year ago

jmfergeau commented 1 year ago

Actual behaviour

Expected behaviour

If a theme (ini and folder sharing the same name) is found in the themes folder, it should be selectable in the themes list in options.

Steps to reproduce

  1. Put a custom theme (in the example, it's a copy of modern with a different name) in the .ultrastardx/themes folder
  2. Run ultrastardx
  3. Go to Options then Themes
  4. Custom theme doesn't appear in the themes list

Details

I noticed some people got problems with themes recently. Is this feature locked on purpose? Couldn't try on Windows or Mac so I don't know if it's a linux only issue or if it's even related on how appimage and flatpak works.

s09bQ5 commented 1 year ago

Which folders have you tried as "the themes folder" in the AppImage and in the Flatpak case?

barbeque-squared commented 1 year ago

You can ignore the logged errors in this context, see #697 for that.

Slightly offtopic, but can confirm that regular Linux also completely ignores the themes folder in ~/.ultrastardx. I have to put mine into /usr/share/ultrastardx/themes (and put them there again everytime I install/update, too)

s09bQ5 commented 1 year ago

Slightly offtopic, but can confirm that regular Linux also completely ignores the themes folder in ~/.ultrastardx.

You are right, we never supported themes in ~/.ultrastardx/themes. So with the AppImage the only way to use other themes is to unpack the AppImage, e.g.:

./UltraStarDeluxe-v2023.5.0-0-x86_64.AppImage --appimage-extract usr
sudo chown -R root:root squashfs-root/usr
sudo mv squashfs-root/usr /opt/UltraStar-Deluxe
rmdir squashfs-root
/opt/UltraStar-Deluxe/bin/ultrastardx

Themes can then be installed in /opt/UltraStar-Deluxe/share/ultrastardx/themes.

For the Flatpak the share/ultrastardx/themes directory has been declared as a merged extension point.

barbeque-squared commented 1 year ago

Should we support this? If Mac already does it, I don't see much reason why we can't on Linux. But there's some very real pro/cons to be deliberated:

the latter should be less of an issue once #697 is implemented imo, and even less if perhaps we can make USDX smart enough that if it detects a theme error it can't recover from, it just resets it back to the default and pops up some error message (that tells you to look in the Error.log). I'd like those to be in before we start making theme support better.

s09bQ5 commented 1 year ago

macOS does it by copying everything from the bundle to the user's home directory IIRC.

jmfergeau commented 1 year ago

Which folders have you tried as "the themes folder" in the AppImage and in the Flatpak case?

~/.ultrastardx/themes for appimage and ~/.var/app/eu.usdx.UltraStarDeluxe/.ultrastardx/themes for flatpak

Slightly offtopic, but can confirm that regular Linux also completely ignores the themes folder in ~/.ultrastardx.

I don't think it's off topic. I even thought it was the main problem actually. So I tried to install the custom theme directly in the flatpak install. But theme is also ignored there. Though, if I compile and install from git and put the theme in /usr/share/ultrastardx/themes/ the theme is recognized and works!

I'm still pretty sure .ultrastardx/themes used to work before.

s09bQ5 commented 8 months ago

Btw., the flatpak defines an extension eu.usdx.UltraStarDeluxe.Themes merged into the directory /app/share/ultrastardx/themes. So you can create a flatpak with that name that contains your custom themes.