The following code will write the current game name to "/.attract/current_name.txt", the current game title to "/.attract/current_title.txt", and the current system to "/.attract/current_system.txt". Hopefully this will get you started, you can paste this into a new plugin or just as part of your layout script....
fe.add_transition_callback( "gamename_transition" );
function gamename_transition( ttype, var, ttime )
{
if (( ttype == Transition.EndNavigation )
|| ( ttype == Transition.StartLayout ))
{
system( "echo '" + fe.game_info( Info.Name ) + "' > ~/.attract/current_name.txt" );
system( "echo '" + fe.game_info( Info.Title ) + "' > ~/.attract/current_title.txt" );
system( "echo '" + fe.game_info( Info.System ) + "' > ~/.attract/current_system.txt" );
}
return false;
}
cheers