Page 1 of 1

About the GUI on linux and scripting

Posted: 29 Jan 2015, 13:24
by Reihar
Hi,

I've been using Filebot for a while and I love it. I'm runing it on Archlinux, using the "package" (sort of) in the AUR (a sort of community repository). Anyway, I've noticed after an update recently that Filebot stopped using my _JAVA_OPTIONS related to swing and the use of the gtk theme (other java software still use them). I suspected there was something wrong with the package's launcher, so I proceeded to manually launch filebot with a basic "java -jar" and it was still there. Did you guys change changed something regarding that or is there something wrong on my system?

The _JAVA_OPTIONS line that I'm using is :

Code: Select all

_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
My second question is regarding the cli and preferences. Is there a way to save preferences like the GUI does so that calling it assumes them. I'm thinking specifically about formats. I always use the same formats that are a bit different from the default. This would make my cli parameters a bit long. So is there a way to configure that in a file or should I just write some aliases/scripts to manually call the cli with the format more easily?

Thanks.

Re: About the GUI on linux and scripting

Posted: 30 Jan 2015, 11:44
by rednoah
1.
No idea. But the filebot.sh lauch script pretty much does a java -jar just with lots of extra options. The new version might be setting Nimbus as crossplatformlaf internally just to avoid people ending up with Metal for some reason.

2.
The CLI is pretty much stateless (except of OpenSubtitles login) so you're expected to make your own scripts that process files however you want. Actually, a quick look at filebot.sh should teach you all you need for that. :D

e.g.

Code: Select all

program arg1 arg2 arg3 "$@"

Re: About the GUI on linux and scripting

Posted: 30 Jan 2015, 14:08
by Reihar
2. I'll just write scripts, then. Thanks.

1. It is indeed hardcoded. Main.java : line 145. Is this choice definitive? I've been looking into patching it. Are there any ressources on building filebot?

Re: About the GUI on linux and scripting

Posted: 30 Jan 2015, 14:30
by rednoah
Assuming you're already set for Java development, thing should build out-of-the-box once you svn checkout:

Code: Select all

ant clean fatjar

Re: About the GUI on linux and scripting

Posted: 30 Jan 2015, 16:06
by rednoah
Looking at the code it definitely does try to set the System LaF regardless, and will only default to Cross-Platform LaF if that fails. Since you're setting system LaF via Java properties it should work... then again, I haven't looked at the getSystemLookAndFeelClassName implementation...

Code: Select all

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

Re: About the GUI on linux and scripting

Posted: 30 Jan 2015, 17:49
by Reihar
Thank you for your help. Commenting the line 145 worked. It uses my _JAVA_OPTIONS. I tried unseting it to see what happened, it launched with the default theme that was used before the update and that I always forget the name of.

It also took me some time to understand that I needed Oracle's jdk and not openjdk. I'm going to experiment a bit more. I am likely to post a package on Archlinux's AUR (a community-driven packaging script repository) so that I can easily get my patched filebot on all my machines.

Re: About the GUI on linux and scripting

Posted: 31 Jan 2015, 18:20
by rednoah
I'm curious why your swing.systemlaf property doesn't work. Looking at the FileBot & JRE code swing.systemlaf is clearly the LaF that should be set.

@see http://grepcode.com/file/repository.gre ... r.java#600

Re: About the GUI on linux and scripting

Posted: 31 Jan 2015, 18:42
by Reihar
I have no idea. If you know how, I'd be willing to troubleshoot it to find out why.

Re: About the GUI on linux and scripting

Posted: 31 Jan 2015, 19:09
by rednoah
Mystery solved: You're not setting swing.systemlaf but some other properties that don't matter in this case

Solution: Just set swing.systemlaf to your preferred LaF and it'll work without having to modify the code ;)