Mafia, Dropbox and Ubuntu

lostcalpolydude

Developer
Staff member
I set up a launcher (shortcut) on my desktop that launched "~/Dropbox/kolmafia.jar -DuseCWDasROOT=true"

That said, it still seemed to grab the settings that it would have had I not added "-DuseCWDasROOT=true" to it.

I'm pretty sure the first line of that launcher needs to be
Code:
cd ~/Dropbox
 

Theraze

Active member
Go to terminal, go to the folder, run it there. If it still doesn't work, then you have something. Else, all you have is an inability to create working batch scripts. :)
 

xKiv

Active member
You might want to run it as "java -DuseCWDasROOT=true -jar ~/Dropbox/kolmafia.jar" instead, I think. Which probably works as "java -jar ~/Dropbox/kolmafia.jar -DuseCWDasROOT=true" too.
 

Lxndr

Member
So an additional week... no luck with anything I've tried.
Are we sure:

-DuseCWDasROOT=true

is what I should be trying to invoke?
 

xKiv

Active member
I just did
Code:
java -DuseCWDasROOT -jar KoLmafia-12892.jar
from command line, and it ran ... but it doesn't work:
Code:
KoLmafia v16.0 r12892
Released on May 17, 2013

Currently Running on Linux
Local Directory is /home/xkiv/.kolmafia
Using Java 1.7.0_25

... got it, Boolean.getBoolean("x") only returns true when the value of x is true ...
so you need to
Code:
java -DuseCWDasROOT=true -jar KoLmafia-12892.jar
instead ...
(and the -D... can't be after the jar, because that would be an argument to the mafia application instead, and you want an argument to java itself)


ETA: try running that (with the correct path to your .jar) from command line - what does it say?
 

Lxndr

Member
Just got home. Trying it now.

That worked from the command line! YAY! Thank you.

Now I just need to figure out how to make it work from a launcher on the desktop.
 

xKiv

Active member
The important things are:
1) it's a text file that cointains a sequence of shell commands (like on the command line), one for each line. [1]
2) it should be executable (that's what the chmod +x !@#$ does), otherwise you can't execute it directly
3) the #!/bin/bash on the first line is nice, but not necessary
4) don't torture yourself with vi (or emacs, or ed) unless you are already comfortable with it

ETA: [1] this is a "lie to the children" - commands can span multiple lines, and there can be multiple commands on a single line, and there are subtle differences between putting something on a command line and putting it in a shell script; but the general idea is a good starting point
 

Lxndr

Member
Don't worry. Whenever I see 'vi' or 'vim', I just automatically substitute pico. ;)

I got it to work! At least from a terminal. Now I need to figure out how to launch it by double-clicking it (or something else) on the desktop...
 

xKiv

Active member
If it's anything like my system, just having the script in ~/Desktop should make it doubleclick-runnable.
 

Lxndr

Member
Still can't make it double-click runnable, but at least I can run it from the CLI and get my preferences. :D

thanks everyone for your help!
 
Top