MrMEEE/ironhide — Issue #236: optirun issus
Author: XYYHun
Created: 2012-02-16 19:25:00+00:00
State: open

Some strange output is displayed when I run the following command.

```
Desktop$ optirun -f java -jar minecraft.jar
The application will be run with Ironhide even if it's not connected to a power supply (e.g. running on battery)
file: invalid option -- 'j'
file: invalid option -- 'a'
Usage: file [-bchikLNnprsvz0] [--apple] [--mime-encoding] [--mime-type]
[-e testname] [-F separator] [-f namefile] [-m magicfiles] file ...
file -C [-m magicfiles]
file [--help]
file: invalid option -- 'j'
file: invalid option -- 'a'
Usage: file [-bchikLNnprsvz0] [--apple] [--mime-encoding] [--mime-type]
[-e testname] [-F separator] [-f namefile] [-m magicfiles] file ...
file -C [-m magicfiles]
file [--help]
* Starting Ironhide X server ironhide _PS0 Enabling nVidia Card Succeded.
. [ OK ]

(java:14280): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(java:14280): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(java:14280): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(java:14280): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
* Stopping Ironhide X server ironhide _PS0 Disabling nVidia Card Succeded.
[ OK ]
```

Error might be here in optirun

```bash
for arg in $@; do

if [[ `echo $arg | grep wine` -eq 0 ]]; then

if [[ `file $arg | grep 64-bit |wc -l` -ne 0 ]];then
VGL_DRIVER=/usr/lib/nvidia-current
break
elif [[ `file $arg | grep 32-bit |wc -l` -ne 0 ]];then
VGL_DRIVER=/usr/lib32/nvidia-current
break
fi

fi

done
```

these code test aplication whether it is a 32-bit programs or 64-bit programs. but file command must use full path, and only works with binary files.