Read the statement by Michael Teeuw here.
script or bash to exit MM and exit GUI and run a command in TTY mode
-
Hi to all,
i am trying to extend my MM for a second purpose -> Retropie.
Therefore i need a script or bash or any way to do the following:- exit MM (maybe exiting PM2 is also fine)
- exit the Raspian / Pixel GUI (as retropie dont run in GUI Mode)
- run the “emulationstation” command in the TTY terminal
Does anybody has hints for me to do that. For the beginning i would be also ok to run a script manual by entering the commands in terminal.
Thanks in advance.
AxLED
-
Hi to all interested,
i testet some hours and made little progress.
There are following requirements:
Tools:- pm2
- xdotool
Starting MagicMirror from Retropie works somehow, see the following lines:
- add a MagicMirror.sh file in the fork folder of retropie with the following code
#!/bin/bash echo "starting MagicMirror" sudo service lightdm start #to start GUI #pm2 stop emulationstation, final commands missing so far pm2 start mm #to start MagicMirror xdotool key Ctrl+Alt+F7 #to change to tty7 = Gui- make this file executable
Starting Retropie from MagicMirror works somehow, see the following lines:
-
editing file /opt/retropie/supplementary/runcommand/runcommand.sh, change links from tty to tty1. Make sure owner and group ist root after editing
-
add a es.sh file in a folder of your choice with the following code
#!/bin/bash echo 'starting Emulationstation/Retropie' sudo service lightdm stop #to quit GUI export DISPLAY=:0 emulationstation > /dev/tty1 #to execute this command in tty1 where emulationstation/retropie runs- make this file executable
- put this file into pm2
Difficulties:
I dont know how to put two .sh files into pm2 and set one to “start” and one to “stop”, if i only would have one of the to .sh files executed at one time (one .sh is for MagicMirror, second .sh is for emulationstation/retropie)AxLED
-
put the first one in
/home/pi/retropie/roms/portsand you can run it under ports section in ESthe closing script is a bit tricky you can use MM module that excute a terminal command to exit like this one MMM-TouchButtons and config it like that
{ text: 'Exit MM', icon: 'skull', action: 'exec', command: 'killall lightdm' }it should kicks you back to ES
-
@Ramez
Thanks for your reply, i want to have only one app (either mm or Retropie/Emulationstation) run at one time due the pi ressources.But i will try your approach.
AxLED
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login