Skip to content

Commit e4f0ab3

Browse files
committed
retropiemenu: fix launching RetroArch from the menu
Due to the recent addition of the GameMode support, RetroArch needs access to the user's DBUS session socket. When starting RetroArch from the RetroPie menu, `su` is used to launch it as the install user, but the DBUS socket path is not preserved (`DBUS_SESSION_BUS_ADDRESS`), leading to a en error and then a crash. Prevent the crash by setting the XDG_RUNTIME_DIR when RetroArch is started with `su`. NOTE: this primarily affects X11/PC users, where GameMode is part of the desktop install.
1 parent 2d07a99 commit e4f0ab3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scriptmodules/supplementary/retropiemenu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function launch_retropiemenu() {
138138
joy2keyStop
139139
cp "$configdir/all/retroarch.cfg" "$configdir/all/retroarch.cfg.bak"
140140
chown $user:$user "$configdir/all/retroarch.cfg.bak"
141-
su $user -c "\"$emudir/retroarch/bin/retroarch\" --menu --config \"$configdir/all/retroarch.cfg\""
141+
su $user -c "XDG_RUNTIME_DIR=/run/user/$SUDO_UID \"$emudir/retroarch/bin/retroarch\" --menu --config \"$configdir/all/retroarch.cfg\""
142142
iniConfig " = " '"' "$configdir/all/retroarch.cfg"
143143
iniSet "config_save_on_exit" "false"
144144
;;

0 commit comments

Comments
 (0)