RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    BGM in Ubuntu Desktop 18.04

    Scheduled Pinned Locked Moved Help and Support
    linuxubunturetropieamd64bgm
    14 Posts 3 Posters 2.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wmarcioW
      wmarcio
      last edited by wmarcio

      Hi, i use this script for BGM on emulationstation, i use Lubuntu 18.04.
      https://retropie.org.uk/forum/topic/347/background-music-continued-from-help-support
      Install pygame from terminal, and copy the script somewere to PC hdd, and start it from terminal, in my case: python /home/pi/bgm.py.
      After add to autostart on ubuntu.

      D 1 Reply Last reply Reply Quote 0
      • D
        dbrown1986 @wmarcio
        last edited by

        @wmarcio I've tried that script too. I was on lubuntu earlier this week too. I just can't seem to find the proper startup location on either Ubuntu or lubuntu.

        mituM 1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator @dbrown1986
          last edited by mitu

          @dbrown1986 Add a '.desktop' file in $HOME/.config/autostart/ that will start your script. This is how RetroPie starts Emulationstation - through a retropie.desktop file:

          [Desktop Entry]
          Type=Application
          Exec=gnome-terminal --full-screen --hide-menubar -e emulationstation
          Hidden=false
          NoDisplay=false
          X-GNOME-Autostart-enabled=true
          Name[de_DE]=RetroPie
          Name=rpie
          Comment[de_DE]=RetroPie
          Comment=retropie
          Icon=/usr/local/share/icons/retropie.svg
          Categories=Game
          

          More details about .desktop files - https://wiki.archlinux.org/index.php/Desktop_entries.

          1 Reply Last reply Reply Quote 0
          • wmarcioW
            wmarcio
            last edited by

            I am away from my PC now, i am on work, but the reference from @mitu works fine.

            1 Reply Last reply Reply Quote 0
            • D
              dbrown1986
              last edited by

              Hey again...

              So I did as suggested, using retropie.desktop as a base, modifying it to exec=python ./path/to/script.py (/home/pi/RetroPie/bgm.py in my case). I also gave it a unique name and saved it as a new file (music.desktop), not only did it not execute on reboot, but it also broke ES autostart, so I've butchered it. Any suggestions, or perhaps an example .desktop with it working?

              I'm so lost...

              mituM 1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @dbrown1986
                last edited by

                @dbrown1986 Can you post the complete desktop file you have and it's not working ?
                Btw, if you modify the existing rpie.desktop, then of course Emulationstation would not start, you need to copy it first and then rename the copy to music.py.

                D 1 Reply Last reply Reply Quote 0
                • D
                  dbrown1986 @mitu
                  last edited by

                  @mitu said in BGM in Ubuntu Desktop 18.04:

                  @dbrown1986 Can you post the complete desktop file you have and it's not working ?
                  Btw, if you modify the existing rpie.desktop, then of course Emulationstation would not start, you need to copy it first and then rename the copy to music.py.

                  That's what I did, I copied it and modified the copy. Neither worked after.

                  [Desktop Entry]
                  Type=Application
                  Exec=python /home/pi/RetroPie/bgm.py
                  Hidden=false
                  NoDisplay=false
                  X-GNOME-Autostart-enabled=true
                  Name[de_DE]=music   
                  Name=music
                  Comment[de_DE]=music   
                  Comment=music   
                  Icon=/usr/local/share/icons/retropie.svg
                  Categories=Game
                  
                  mituM 1 Reply Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator @dbrown1986
                    last edited by

                    @dbrown1986 The entry seems fine. You can probably put Hidden=True and NoDisplay=true. If you click on the icon, as you would do on a desktop icon, does it start the background music ?

                    1 Reply Last reply Reply Quote 0
                    • D
                      dbrown1986
                      last edited by

                      I figured it out. Nano wasn't writing the changes because I forgot to run it in sudo. facepalms
                      Working fine now. Stops when ES is quit, starts when ES is ran and pauses when game is run.

                      mituM 1 Reply Last reply Reply Quote 0
                      • mituM
                        mitu Global Moderator @dbrown1986
                        last edited by

                        @dbrown1986 You shouldn't need to write it with sudo - the file is not a system file, it's a user owned file. You may have inadvertently broken some permissions in your $HOME folder.

                        D 1 Reply Last reply Reply Quote 0
                        • D
                          dbrown1986 @mitu
                          last edited by

                          @mitu That's what I thought, but I think Ubuntu wouldn't allow it since it was a 'hidden' folder.

                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @dbrown1986
                            last edited by mitu

                            @dbrown1986 said in BGM in Ubuntu Desktop 18.04:

                            I think Ubuntu wouldn't allow it since it was a 'hidden' folder.

                            First time I hear this kind of - obviously wrong - explanation. Check the permissions on the folder and make sure your $USER owns the folder where the scripts are saved. You don't need to use sudo to edit something that's in your home folder.

                            D 1 Reply Last reply Reply Quote 0
                            • D
                              dbrown1986 @mitu
                              last edited by

                              @mitu said in BGM in Ubuntu Desktop 18.04:

                              @dbrown1986 said in BGM in Ubuntu Desktop 18.04:

                              I think Ubuntu wouldn't allow it since it was a 'hidden' folder.

                              First time I hear this kind of - obviously wrong - explanation. Check the permissions on the folder and make sure your $USER owns the folder where the scripts are saved. You don't need to use sudo to edit something that's in your home folder.

                              Could also been something I mucked up; since I installed using net-inst, I checked the permissions and they looked fine.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post

                              Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                              Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.