-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amiberry insits or creating default directories and theme file even when user-defined paths have been defined #1613
Comments
…g the default ones (#1612, #1613) Change the behavior on startup, regarding the default directories. Check for the existence of the amiberry.conf file, and if found, load the settings from there, before attempting to create any missing directories. This should fix the behavior where the default directories were always created, even if you had other paths configured in the conf file. Also, add the config_path back to the amiberry.conf file, which was removed earlier.
This should be fixed with the commit above. Please confirm when you get a chance |
My workaround is to rename amiberry to amiberry.bin and, in place of the original amiberry, I wrote this executable script called amiberry... #!/bin/bash
# Use AMIBERRY_HOME_DIR if set, otherwise default to $HOME/Amiberry
AMIBERRY_HOME="${AMIBERRY_HOME_DIR:-$HOME/Amiberry}"
# Remove any trailing slash (if any) for consistency
AMIBERRY_HOME="${AMIBERRY_HOME%/}"
await_and_delete_defaults() {
while true; do
# Await until all default directories have been created, including the themes directory
if [ -d "$AMIBERRY_HOME/cdroms" ] && \
#[ -d "$AMIBERRY_HOME/conf" ] && \
#[ -d "$AMIBERRY_HOME/controllers" ] && \
[ -d "$AMIBERRY_HOME/floppies" ] && \
[ -d "$AMIBERRY_HOME/harddrives" ] && \
[ -d "$AMIBERRY_HOME/lha" ] && \
[ -d "$AMIBERRY_HOME/roms" ] && \
[ -d "$AMIBERRY_HOME/rp9" ] && \
[ -d "$AMIBERRY_HOME/savestates" ] && \
[ -d "$AMIBERRY_HOME/screenshots" ] && \
[ -d "$XDG_CONFIG_HOME/amiberry/themes" ]; then
break
fi
# Sleep for a short interval before checking again
sleep 1
done
while true; do
# Await until the Default.theme file appears and is complete
if [ -f "$XDG_CONFIG_HOME/amiberry/themes/Default.theme" ] && \
[ $(stat -c %s "$XDG_CONFIG_HOME/amiberry/themes/Default.theme") -eq 216 ]; then
break
fi
# Sleep for a short interval before checking again
sleep 1
done
# Sleep to give any handles time to close
sleep 1
# Delete all the default directories, including the themes directory
rm -rf "$AMIBERRY_HOME/cdroms"
#rm -rf "$AMIBERRY_HOME/conf"
#rm -rf "$AMIBERRY_HOME/controllers"
rm -rf "$AMIBERRY_HOME/floppies"
rm -rf "$AMIBERRY_HOME/harddrives"
rm -rf "$AMIBERRY_HOME/lha"
rm -rf "$AMIBERRY_HOME/roms"
rm -rf "$AMIBERRY_HOME/rp9"
rm -rf "$AMIBERRY_HOME/savestates"
rm -rf "$AMIBERRY_HOME/screenshots"
rm -rf "$XDG_CONFIG_HOME/amiberry/themes"
}
# Run the cleanup function in the background
await_and_delete_defaults &
# Run the original amiberry binary
/usr/local/bin/amiberry/amiberry.bin "$@" |
@midwan, please see #1612 (comment). |
Would it be more correct to place the themes directory under XDG_DATA_HOME? ...ie; |
Amiberry/conf was always created on startup, as part of the get_config_directory process. We should be able to skip that at that step, and only create it if it's missing after loading the amiberry.conf file, since the path might be different there.
New commit, changes behavior on startup to avoid creating @giantclambake I see themes files as global settings (related to the GUI), so I placed them in the XDG_CONFIG_HOME (unless you're using portable mode, in which case they default under the config_path you have). XDG_DATA_HOME is meant for "data" files, which to me at least means things like icons, fonts, etc. https://specifications.freedesktop.org/basedir-spec/latest/ |
@midwan I'll test this change next. |
@midwan, I have both good and bad news, but no ugly ones 😝. The good news is that conf is no longer created. The bad news, and this is a new one that I haven't reported before as I wasn't aware of the directory due to some dyslexia on my part, is that the ~/.local/share/amiberry directory is still created although, in my case, it is not used by any of the configured paths.
|
@mrandreastoth |
@midwan, yes, if using the defaults, then that would be the case, but I'm using the paths shown above, i.e., these are defined in amiiberry.conf, and, as you can tell, all the data is now self-contained within the Amiberry home directory. As such the ~/.local/share/amiberry directory is never referenced and should hence never be created. |
The |
Describe the bug
Amiberry automatically creates the default directories and Default.theme in their default locations completly ignoring the configuration settings in amiberry.conf.
To Reproduce
Steps to reproduce the behavior:
Stop Amiberry
Move ~/.config/amiberry/themes to your Amiberry home directory
Move/rename directories under the Amiberry home directory
Reflect your path changes in the amiberry.conf
Start Amiberry
Observe the ~/.config/amiberry and Amiberry directories as well as the configured paths under the Amiberry GUI
Close Amiberry
Confirm paths in amiberry.conf
Expected behaviour
Amiberry starts up and uses the new directory layout as-is. The GUI reflect the configured paths to be as defined in amiberry.conf. Closing Amiberry keeps the path configurations intact in amiberry.conf.
Actual behaviour
Amiberry starts up and recreates ~/.config/amiberry/themes/Default.theme and all the default Amiberry directories under the Amiberry home directory. The GUI correctly reflect the configured paths and the paths correctly remain intact after closing Amiberry.
Screenshots
User-defined paths...
User-interface using the paths...
Desktop (please complete the following information):
OS: EndeavourOS
Version: 2024.09.22
Additional context
Amiberry is built from source.
The text was updated successfully, but these errors were encountered: