Author Topic: Run a script from Attract-Mode in Linux (lakka)  (Read 259 times)

iOtero

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Run a script from Attract-Mode in Linux (lakka)
« on: December 26, 2018, 11:31:02 AM »
Let's see if any of you know how to do this.

I want to launch a script from Attract-Mode on Linux, in this case it's openELEC or Lakka, so i can get information about the system on the screen, but i do not get anything.

The script is this, and by ssh with the putty it works perfectly, but from Attract-Mode i do not know if it does something or not, because nothing remains on the screen.

Code: [Select]
#!/bin/bash
clear
echo "----------- SPACE -----------"
df -h
echo "----------- MEMORY -----------"
free -m
echo "----------- TEMPERATURE -----------"
vcgencmd measure_temp
echo "----------- IP -----------"
ip route get 8.8.8.8 2>/dev/null | awk '{print $NF; exit}'
echo "----------- EXIT -----------"
read -n 1 -s -r -p "Press any key to continue"

This another script runs perfectly:

Code: [Select]
#!/bin/bash
cd /usr/bin
retroarch

And the two have this romlist:

Code: [Select]
retroarch;RetroArch;Extras;;;;;;;;;;;;;;
systeminfo;System Information;Extras;;;;;;;;;;;;;;

and this configuration:

Code: [Select]
executable      /bin/bash
args            "[romfilename]"
rompath $HOME/systems/extras/roms
system Extras
romext .sh
artwork flyer $HOME/systems/extras/flyer
artwork marquee $HOME/systems/extras/marquee
artwork snap $HOME/systems/extras/snap
artwork wheel $HOME/systems/extras/wheel

I'm not a great expert in linux, and maybe you have to give some more command to display the information on the screen, i do not know.


I remind everyone that the biggest complication of working with lakka is that you have to compile Attract-Mode (and any other application) first in raspbian and then copy it with all your lakka libraries, since lakka does not allow native compilation or installation nor update anything that can not be done from within RetroArch or Attract-Mode. Take it into account when making any contribution to this topic.

Thanks in advance for the help.

Note: Yes, i am working on a fully operational Attract-Mode img with Retroarch in Lakka for Raspberry Pi, without Batocera, Retropie, Recalbox or Emulationstation.

« Last Edit: December 26, 2018, 11:45:20 AM by iOtero »
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 802
    • View Profile
Re: Run a script from Attract-Mode in Linux (lakka)
« Reply #1 on: December 26, 2018, 12:57:05 PM »
The only way I can think of to get data passed to attractmode is to write output to a file and have attractmode’s squirrels read the file.

iOtero

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Re: Run a script from Attract-Mode in Linux (lakka)
« Reply #2 on: December 27, 2018, 05:00:00 AM »
The only way I can think of to get data passed to attractmode is to write output to a file and have attractmode’s squirrels read the file.

It's a good idea, now to see if I can develop it.
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

iOtero

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Re: Run a script from Attract-Mode in Linux (lakka)
« Reply #3 on: December 27, 2018, 05:25:05 AM »
I modified the script like this:
Code: [Select]

#!/bin/bash
clear
echo "----------- SPACE -----------" >> info.txt
df -h >> info.txt
echo "----------- MEMORY -----------" >> info.txt
free -m >> info.txt
echo "----------- TEMPERATURE -----------" >> info.txt
vcgencmd measure_temp >> info.txt
echo "----------- IP -----------" >> info.txt
ip route get 8.8.8.8 2>/dev/null | awk '{print $NF; exit}' >> info.txt


And executed from putty, like ./systeminfo.sh, it generates well the file info.txt with the information requested, but from AM, it does not generate it.

There could be some error in the Extras.cfg?

Code: [Select]
executable      /bin/bash
args            "[romfilename]"
rompath $HOME/.systems/extras/roms
system Extras
romext .sh
artwork flyer $HOME/.systems/extras/flyer
artwork marquee $HOME/.systems/extras/marquee
artwork snap $HOME/.systems/extras/snap
artwork wheel $HOME/.systems/extras/wheel

The snaps, wheels, flyers, etc. they look good on the screen.
« Last Edit: December 27, 2018, 05:33:53 AM by iOtero »
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

iOtero

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Re: Run a script from Attract-Mode in Linux (lakka)
« Reply #4 on: December 29, 2018, 10:58:18 AM »
Solved, it was a problem of paths and permissions.
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D