Page 1 of 1
[FEATURE] Initial folder
Posted: 12 Jul 2016, 09:44
by j1simon
Hi,
It would be very useful to define a starting directory to display when I click the "Load" button.
Thanks.
Re: [FEATURE] Initial folder
Posted: 12 Jul 2016, 13:26
by rednoah
"Load" will restore whatever folder you loaded last time. That being said, using
drag-and-drop tends to be far more efficient if you want to load files into some application.
@see
https://www.youtube.com/watch?v=RRq2_Pjyko8
Re: [FEATURE] Initial folder
Posted: 12 Jul 2016, 13:55
by j1simon
Yes, I know. But if the folder loaded last time doesn't exist, it shows "/home/juan/.config/filebot". The idea is define an initial folder when the folder loaded last time doesn't exist.
Re: [FEATURE] Initial folder
Posted: 12 Jul 2016, 14:27
by rednoah
That is indeed strange. The system default is good on Windows and Mac and on Linux it'll probably default to $HOME or $PWD depending on what the GTK file dialog does by default.
You might be able to set the working directory in the .desktop launcher and then that should be the default.
PS: This is why the sysinfo output should be included in every thread. How am i supposed to know you're on Linux? And what Linux? And what desktop environment? etc

Re: [FEATURE] Initial folder
Posted: 13 Jul 2016, 19:12
by j1simon
I didn't include the sysinfo because this wasn't a bug report. But this is the info:
Code: Select all
Arch Linux 64 bits
FileBot 4.7 (r3923) / OpenJDK Runtime Environment 1.8.0_92
I have added "
Path=/dunehd/Descargado" to .desktop file but its ignored by Filebot. Filebot is a java program, it doesn't respect some desktop standards. The problem is in filebot launcher:
Code: Select all
... -Dapplication.dir=$HOME/.config/filebot ... -Duser.home=$HOME/.config/filebot
If the folder loaded last time doesn't exist, it loads that location: "
$HOME/.config/filebot"
Re: [FEATURE] Initial folder
Posted: 13 Jul 2016, 19:28
by rednoah
Well, that explains why none of this makes sense. It's not my code.
The AUR maintainers made their own
filebot.sh startup script for Arch Linux:
https://aur.archlinux.org/packages/filebot/
I have no idea why they would override
user.home but I'm sure somebody had a good reason.

Re: [FEATURE] Initial folder
Posted: 13 Jul 2016, 22:46
by j1simon
ok, I've installed your version (extracted from deb package) and now it opens my home folder, but not the folder defined in desktop file with "Path=/dunehd/Descargado".
Re: [FEATURE] Initial folder
Posted: 14 Jul 2016, 05:06
by rednoah
I guess it's defaulting to your user home then. It's different for each platform.
If you really really want this, then just set -Duser.home to the folder you want as default.

Re: [FEATURE] Initial folder
Posted: 14 Jul 2016, 08:39
by j1simon
rednoah wrote:If you really really want this, then just set -Duser.home to the folder you want as default.

I want define an initial folder when the folder loaded last time doesn't exist. But with your
solution I change the location of filebot data too, like presets. What's the point of "
-Dapplication.dir" then?
Moreover, when I update filebot to new version, the init script will be overwritten.
Re: [FEATURE] Initial folder
Posted: 14 Jul 2016, 10:21
by rednoah
application.dir is used by FileBot for all the application data files.
Preferences are managed by the Java Preferences API which stores them in a platform-specific way (e.g. Registry on Windows). On Arch Linux it's probably gonna default to some implementation that uses text files. That'll probably default to the user home, but I'm sure that this can be override with some additional system properties.
@see
http://stackoverflow.com/a/21999054/1514467
Re: [FEATURE] Initial folder
Posted: 14 Jul 2016, 10:42
by j1simon
In this case, "-Djava.util.prefs.userRoot=$HOME/.config/filebot/" with "-Duser.home=/dunehd/Descargado" works. But all changes done in filebot.sh will be overwritten when I update the app. This is a workaround but not the solution.
Thank you anyway.
Re: [FEATURE] Initial folder
Posted: 14 Jul 2016, 13:47
by rednoah
You'll probably want to talk to the AUR maintainers to include a proper solution in the official package.
Also,
filebot.sh will respect your
JAVA_OPTS environment variable. That you can set in your user profile:
Code: Select all
export JAVA_OPTS="-Djava.util.prefs.userRoot=$HOME/.config/filebot/ -Duser.home=/dunehd/Descargado"
Re: [FEATURE] Initial folder
Posted: 14 Jul 2016, 14:48
by j1simon
rednoah wrote:You'll probably want to talk to the AUR maintainers to include a proper solution in the official package.
This isn't related to AUR package. It is related to official package, the program itself.
rednoah wrote:Also,
filebot.sh will respect your
JAVA_OPTS environment variable. That you can set in your user profile:
Code: Select all
export JAVA_OPTS="-Djava.util.prefs.userRoot=$HOME/.config/filebot/ -Duser.home=/dunehd/Descargado"
An environment variable is for all applications, this isn't the case.
Re: [FEATURE] Initial folder
Posted: 14 Jul 2016, 15:04
by rednoah
The AUR maintainers probably mean to override java.util.prefs.userRoot but they do override user.home which has strange side-effects, odd initial folder for dialogs being one of them.