Page 1 of 1

Start any commandline application?

PostPosted: Tue Jan 13, 2015 7:58 am
by AzaIndustries
Hey, I was wondering how I can set up one of the emulators to just be a list of command-line apps.

For example Kodi.

But I can't work out how to get it to launch without needing an application location for the 'emulator' that I've used for the list.

I thought that if I left the application location blank it would just run the command line part by itself which I've setup to just be [name] but no dice.

Any ideas?

Re: Start any commandline application?

PostPosted: Tue Jan 13, 2015 9:23 am
by Zombie
I do that using a file called run.sh that Parses KDE Shortcuts.

Code: Select all
#!/bin/bash -
# workdir=$(cat "$1" | awk -F'=' '/^Path=/ {print $2}')
# workdir=$(sed -n 's,^Path[^/]*,,p' < "$1")
# runapp=$(cat "$1" | awk -F'=' '/^Exec=/ {print $3}')
# runapp=$(sed -n 's,^Exec[^/]*,,p' < "$1")
# pushd $workdir
# $runapp

unset runapp workdir
while read -r line
do case $line in Exec*) runapp=${line#*=};; Path*) workdir=${line#*=};; esac

done < "$1"
# runapp=$(sed -n '/^Exec/s,^[^=]*=,,p' $1);
# workdir=$(sed -n '/^Path/s,^[^=]*=,,p' $1);
cd "$workdir";
$runapp;


You can then define a Windows/DOS/Linux Section with the shortcut like so:

Code: Select all
[Desktop Entry]
Name=Steelstorm
Comment=A Shooter
Exec=/opt/var/public/Linux/steelstorm/steelstorm64
Path=/opt/var/public/Linux/steelstorm/
Icon=steelstorm
Terminal=false
StartupNotify=false
Type=Application
Categories=Game;Arcade;


I use this for Wine, DosBox, and Linux Applications. I don't think I'd use it for XBMC/Kodi however as WahCade can lock Kodi out of your Sound card.
It makes me wish WahCade had an "Exit and run XBMC/Kodi option.

Re: Start any commandline application?

PostPosted: Tue Jan 13, 2015 12:13 pm
by AzaIndustries
Ok thanks, I'll try it out.

I'm only using kodi because it's the only controller solution I could think of to be able to play music without a keyboard/mouse.
AAAND it's the only media player that I can get to still output audio when the TV is off.

Maybe I'll test some more media players out..
Might have to end up just using DLNA and my android phone as a remote.

Re: Start any commandline application?

PostPosted: Tue Jan 13, 2015 12:23 pm
by sairuk
Providing you pass the absolute path to a desktop file you can leave the emulator line empty and the desktop file plugin will pick it up and execute it


Code: Select all
emulator_title                          PCGAMES

### List Generation Settings ###
rom_path                                /usr/share/applications/
rom_extension                           desktop
dat_file                                                             
nms_file
catver_ini_file                                                   
list_generation_method                  rom_folder           

### Execution Settings ###
emulator_executable                                       
commandline_format                      [rompath]/[name].[romext]
alt_commandline_format_1                [name]
alt_commandline_format_2                [name]
game_specific_config_path

Re: Start any commandline application?

PostPosted: Wed Jan 14, 2015 5:06 am
by AzaIndustries
Great that helps a lot.

I'm having a different problem now, unrelated to this though.

Wahcade doesn't play any of the background music unless something else is playing sound before I start wahcade.
And if I run wahcade first nothing else will output audio.

This is frustrating I had everything working perfectly and I'm not sure what changed and now it doesn't.
And I'm sick of bothering you guys for stupid little problems all the time.
Man this week has just been 1 think breaking after the next for me.

So this is with youtube running before I start wahcade:
Image

And this is wahcade running first:
Image

Re: Start any commandline application?

PostPosted: Wed Jan 14, 2015 6:37 am
by Zombie
Do you use Pulse Audio?

Re: Start any commandline application?

PostPosted: Wed Jan 14, 2015 10:29 am
by AzaIndustries
ALSA, with pulse?
Isn't pulse just software between also and programs and ALSA?

I wanted to use just ALSA but I switch between a USB Dac, S/PDIF, HDMI and 3.5mm analog. It was getting frustrating manually switching between the various outputs.

EDIT: Just tried it without pulse using just ALSA, the same thing happens. =/

Re: Start any commandline application?

PostPosted: Sun Jan 18, 2015 1:35 am
by AzaIndustries
I solved it by reinstalling gstreamer. -_-

Not sure what would have effected it.

EDIT: NVM,still not working.
But I discovered if I start wahcade by itself then change the audio output to something else and back to HDMI it works.

Re: Start any commandline application?

PostPosted: Sun Jan 18, 2015 6:26 am
by Zombie
I have an asoundrc file for this issue. My Mame Console has Banana Plug red and white connections that are the default audio out path for ALSA.

Re: Start any commandline application?

PostPosted: Sun Jan 18, 2015 6:56 am
by AzaIndustries
Yeah I don't think I can make it work.
It mustn't like HDMI audio very much.

I don't really want to use analog audio because it's connected to an AVR.

So I'm going to just try optical out instead, using on board audio instead of GPU HDMI.

This will actually make it easier to do several other things, like play audio without the TV being on.

Just have to wait for a short optical cable I ordered to test it.