[FEATURE] Initial folder

All your suggestions, requests and ideas for future development
Post Reply
j1simon
Posts: 24
Joined: 10 Nov 2015, 10:52

[FEATURE] Initial folder

Post by j1simon »

Hi,
It would be very useful to define a starting directory to display when I click the "Load" button.
Thanks.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [FEATURE] Initial folder

Post 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
:idea: Please read the FAQ and How to Request Help.
j1simon
Posts: 24
Joined: 10 Nov 2015, 10:52

Re: [FEATURE] Initial folder

Post 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.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [FEATURE] Initial folder

Post 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 ;)
:idea: Please read the FAQ and How to Request Help.
j1simon
Posts: 24
Joined: 10 Nov 2015, 10:52

Re: [FEATURE] Initial folder

Post 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"
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [FEATURE] Initial folder

Post 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. :lol:
:idea: Please read the FAQ and How to Request Help.
j1simon
Posts: 24
Joined: 10 Nov 2015, 10:52

Re: [FEATURE] Initial folder

Post 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".
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [FEATURE] Initial folder

Post 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. :D
:idea: Please read the FAQ and How to Request Help.
j1simon
Posts: 24
Joined: 10 Nov 2015, 10:52

Re: [FEATURE] Initial folder

Post by j1simon »

rednoah wrote:If you really really want this, then just set -Duser.home to the folder you want as default. :D
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.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [FEATURE] Initial folder

Post 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
:idea: Please read the FAQ and How to Request Help.
j1simon
Posts: 24
Joined: 10 Nov 2015, 10:52

Re: [FEATURE] Initial folder

Post 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.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [FEATURE] Initial folder

Post 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"
:idea: Please read the FAQ and How to Request Help.
j1simon
Posts: 24
Joined: 10 Nov 2015, 10:52

Re: [FEATURE] Initial folder

Post 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.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [FEATURE] Initial folder

Post 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.
:idea: Please read the FAQ and How to Request Help.
Post Reply