Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Whoremoan

Pages: [1]
1
General / Various shutdown options on exit in Linux
« on: December 13, 2020, 04:18:03 PM »
I was looking for a solution where I could have various shutdown options when exiting AM, like you get with Retropie / Emulation Station, where you can choose to shutdown, restart, exit do desktop, etc.
After a lot of searching, I didn't really find a suitable solution other than adding something to the Exit Command in AM.
I came up with the idea of running a shell script with a basic menu in it and putting it in the Exit command, but it didn't work. AM just locked up on exit and I would have to kill the AM process.
I then tried adding attract to the begining of the script to launch AM then when it exits then run the menu and running that when the OS started.
This worked when run from a terminal window, but when I launched it at startup, when AM exited, it didn't run the menu.
I have now found a solution that works, so thought i would share it in case anyone else wants to do a similar thing.

I'm running Ubuntu, so if you are using a different version of Linux, you may have to modify things slightly to get it to work.

So first of all I made the script, which has 3 options - Exit to desktop, reboot & shutdown. But you can obviously add more.

I called it Attract.sh and put it in the root of my home directory (in my case /home/sf)
The script uses dialog to make the menu, so if you don't have it, you will need to install it - sudo apt install dialog

to make the script

cd
sudo nano Attract.sh

copy this into it

Code: [Select]
#!/bin/bash

attract

HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=4
BACKTITLE="EXIT ATTRACT MODE"
TITLE="EXIT OPTIONS"
MENU="Choose one of the following options:"

OPTIONS=(1 "EXIT TO DESKTOP"
         2 "SHUT DOWN MACHINE"
         3 "RESTART MACHINE")

CHOICE=$(dialog --clear \
                --backtitle "$BACKTITLE" \
                --title "$TITLE" \
                --menu "$MENU" \
                $HEIGHT $WIDTH $CHOICE_HEIGHT \
                "${OPTIONS[@]}" \
                2>&1 >/dev/tty)

clear
case $CHOICE in
        1)
            echo ""
            ;;
        2)
            sudo shutdown now
            ;;
        3)
            sudo reboot
            ;;
esac


Now in the ubuntu desktop, go to your applications and select 'startup applications'
If you already have attract mode in there, you will need to remove it or untick it.
Click the Add button and give it a name. Then in the command option type
gnome-terminal --full-screen --hide-menubar --command /home/sf/Attract.sh
** replace sf with your user directory name **
Then click save

What this does on startup is, open a terminal window and run the script which launches AM then runs the menu when AM exits.
The terminal is run full screen and has the menu bar disabled.

inadvertently, this has also solved another issue I had where, during startup and when launching a game, the Ubuntu desktop would show for a brief second. Now it just shows the terminal screen.

Hope this is of some use to some people.

2
General / AM locks up after creating gamelist and restarting
« on: November 05, 2020, 03:14:42 PM »
I'm in the process of setting up AM on an Ubuntu PC build.
AM installed ok and I have set up a couple of emulators and everything seems fine.
However, when I generate the game list in an emulator, all looks good, but as soon as I exit AM and go back in again I cant do anything.
AM opens at the last emulator screen I was on but nothing works. It's as though AM has locked up, but the little packman animation is still playing.
If I remove the gamelist .txt file(s) from the romlists folder, go back in, it all works, but i obviously have no game list.
I have a test VM system and I set it up on that yesterday and that all worked fine.
I tried copying one of the game list files from that and placing it in place of my one and that worked.
The only difference between the two files is the VM one has only a couple of games in it and my one has a lot!
I've tried changing permissions of the file and directory after exiting AM to full control for all users.

I'm currently running Emulation Station with a view to switching to AM once it's working, but the VM has that on too, so don't think it's that causing the issue.

AM was installed from the version on the website, not from a 3rd party or Retropie build.

Pages: [1]