LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
8.19k stars 1.01k forks source link

Absolute home path written in .lmmsrc.xml #2933

Open MingcongBai opened 8 years ago

MingcongBai commented 8 years ago

Just found that .lmmsrc.xml in my home directory contains references to the absolute path of my home directory.

<paths workingdir="/home/jeffbai/lmms/" fldir="/home/jeffbai/" gigdir="/home/jeffbai/lmms/samples/gig/" backgroundartwork="" vstdir="/home/jeffbai/lmms/plugins/vst/" stkdir="/usr/share/stk/rawwaves/" sf2dir="/home/jeffbai/lmms/samples/sf2/" artwork="data:/themes/default/" laddir="/home/jeffbai/lmms/plugins/ladspa/" defaultsf2=""/>

It's quite a trivial issue, but when a user is trying to move his/her home directory, this can be problematic, as the home directory is different to what is specified here,

BaraMGB commented 8 years ago

The workingdir is set on first start of lmms. You can change the working directory in the preferences.

MingcongBai commented 8 years ago

The reason why I opened this issue is that it's not done automatically, and that can bring confusion when one would move his/her home directory.

MingcongBai commented 8 years ago

Say, I had a home directory at /home/jeffbai, one day I decided to rename myself as "jellybai" and moved the home directory to /home/jellybai. Then you have a mismatch in the XML file...

BaraMGB commented 8 years ago

Why should someone move her/his home directory?

MingcongBai commented 8 years ago

Why should someone move her/his home directory?

But it can happen though couldn't it... I marked this issue with "trivial" with this thought.

jasp00 commented 8 years ago

There could be a home: search path.

musikBear commented 6 years ago

If .lmmsrc.xml was not kept in current system-folder, but instead locally in the LMMS installation, it would be possible to have more than one lmms-installation in the partition. Why must this pested dot file exist as a dot-file, and why in a systemfolder for the partition? I suggest to not use dot-file-typ, and place it in root of the separate lmms-installation.

tresf commented 6 years ago

@musikBear, what you are describing is a portable install. By default, most applications write settings for persistent (system-installed) applications to some place within the user's home directory, which aids software developers and users through a sane upgrade process.

Portable installs can't really benefit from an upgrade process, since any self-contained settings will be... self-contained only. However, portable applications do have some advantages such as sandboxing, which allows different configurations, testing multiple versions, etc.

Today, we just assume it's a system-installed application however ideally, the config would be written in a way which tries to write relative to the portable install, yet fallback on a sane temporary location.

On Linux, AppImages have gone to great lengths to ensure portability in regards to file associations, mimetype icons, etc. These can be important to people who want to double-click a .mmpz file, for example. We could certainly move LMMS to be a "portable-first" application and just continue down this localized-install-centric design for all desktops.

In regards to the naming of the file -- $HOME/.lmmsrc.xml, I agree, it could be improved.

In regards to how this influences the LMMS WORKING DIRECTORY, we (hypothetically) can scale this problem and relavatize based on config path.

tresf commented 6 years ago

Just found that .lmmsrc.xml in my home directory contains references to the absolute path of my home directory.

To attack the original problem, simply supporting -- or more accurately -- writing relative paths using workingdir="./lmms" ... sf2dir="./lmms/samples/sf2/" should be enough to close out this bug report.

musikBear commented 6 years ago

Portable installs can't really benefit from an upgrade process,

-ok then i see a reason in it, just a shame. The dot-file is such a pain in the ...

tresf commented 6 years ago

just a shame. The dot-file is such a pain in the ..

I don't understand this comment. I think I properly explained that this old holdover will eventually go away.