Author Topic: Any way to hide attract mode using scripts?  (Read 515 times)

secretdog

  • Newbie
  • *
  • Posts: 2
    • View Profile
Any way to hide attract mode using scripts?
« on: January 07, 2018, 03:47:36 AM »
I am trying to add a script to view PDF manuals, using fbgs. Attract mode is running on a Raspberry Pi without X.
I have set the script to run when custom2 (currently 'M') is pressed. The script is running, but attract mode still draws on top.
Is there any way to hide it without restarting it, or is this a different issue?

qqplayer

  • Sr. Member
  • ****
  • Posts: 243
    • View Profile
Re: Any way to hide attract mode using scripts?
« Reply #1 on: January 19, 2018, 04:13:17 AM »
Can you paste the code?
I made some attempts but have some problems sending the ritght "filename/path".


progets

  • Hero Member
  • *****
  • Posts: 604
    • View Profile
Re: Any way to hide attract mode using scripts?
« Reply #2 on: January 19, 2018, 11:54:39 AM »
I am trying to add a script to view PDF manuals, using fbgs. Attract mode is running on a Raspberry Pi without X.
I have set the script to run when custom2 (currently 'M') is pressed. The script is running, but attract mode still draws on top.
Is there any way to hide it without restarting it, or is this a different issue?

Try "Full Screen" mode instead of the default "Fill Screen". Pi FAQ #5 http://forum.attractmode.org/index.php?topic=1249.0

secretdog

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Any way to hide attract mode using scripts?
« Reply #3 on: February 10, 2018, 04:42:39 PM »
Try "Full Screen" mode instead of the default "Fill Screen". Pi FAQ #5 http://forum.attractmode.org/index.php?topic=1249.0

It was already set to Full Screen. Tried all the options, but it didn't work.
I decided to use retroarch's built in imageviewer instead and convert the PDFs. This does display when launched from attract mode, however the imageviewer seems to have various other issues, especially with JPEGs.

Can you paste the code?
I made some attempts but have some problems sending the ritght "filename/path".

As above, this "works" but not very well. Bear in mind that I only just understand what I'm doing. Also, I haven’t figured out how to get it to work on multiple systems yet.

Code: [Select]
function on_custom2(str) {
   if ( str == "custom2" ) {
      local gameName = fe.game_info(Info.Name)
      local manualFile = "\"/home/pi/RetroPie/roms/nes/manual/" + gameName + "/" + gameName + ".jpg\""
      print(manualFile)
      system("/opt/retropie/emulators/retroarch/bin/retroarch " + manualFile)
   }
   return false
}

fe.add_signal_handler(this, "on_custom2")