diff --git a/host_applications/linux/apps/dtoverlay/dtoverlay-post b/host_applications/linux/apps/dtoverlay/dtoverlay-post index 6d8c66d..bce6721 100755 --- a/host_applications/linux/apps/dtoverlay/dtoverlay-post +++ b/host_applications/linux/apps/dtoverlay/dtoverlay-post @@ -4,7 +4,14 @@ if [ "$DISPLAY" == "" ]; then fi CMD="which lxpanelctl >/dev/null 2>&1 && lxpanelctl alsastart >/dev/null" if [ $EUID -eq 0 ]; then - exec su pi -c "$CMD" + if [ "$SUDO_USER" != "" ]; then + user=$SUDO_USER + elif [ "$LOGNAME" != "" ]; then + user=$LOGNAME + else + user=pi + fi + exec su $user -c "$CMD" else - exec $CMD + exec $CMD fi diff --git a/host_applications/linux/apps/dtoverlay/dtoverlay-pre b/host_applications/linux/apps/dtoverlay/dtoverlay-pre index 5065fc5..4de822f 100755 --- a/host_applications/linux/apps/dtoverlay/dtoverlay-pre +++ b/host_applications/linux/apps/dtoverlay/dtoverlay-pre @@ -4,7 +4,14 @@ if [ "$DISPLAY" == "" ]; then fi CMD="which lxpanelctl >/dev/null 2>&1 && lxpanelctl alsastop >/dev/null" if [ $EUID -eq 0 ]; then - exec su pi -c "$CMD" + if [ "$SUDO_USER" != "" ]; then + user=$SUDO_USER + elif [ "$LOGNAME" != "" ]; then + user=$LOGNAME + else + user=pi + fi + exec su $user -c "$CMD" else exec $CMD fi