BGM in Ubuntu Desktop 18.04
-
@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.
-
@dbrown1986 Add a '.desktop' file in
$HOME/.config/autostart/
that will start your script. This is how RetroPie starts Emulationstation - through aretropie.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. -
I am away from my PC now, i am on work, but the reference from @mitu works fine.
-
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...
-
@dbrown1986 Can you post the complete
desktop
file you have and it's not working ?
Btw, if you modify the existingrpie.desktop
, then of course Emulationstation would not start, you need to copy it first and then rename the copy tomusic.py
. -
@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 existingrpie.desktop
, then of course Emulationstation would not start, you need to copy it first and then rename the copy tomusic.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
-
@dbrown1986 The entry seems fine. You can probably put
Hidden=True
andNoDisplay=true
. If you click on the icon, as you would do on a desktop icon, does it start the background music ? -
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. -
@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. -
@mitu That's what I thought, but I think Ubuntu wouldn't allow it since it was a 'hidden' folder.
-
@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. -
@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.
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.