mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 04:55:44 +00:00
* feat(native): run the desktop, its apps and shells as an ordinary user instead of fake root * fix(native): a script's interpreter takes DDNATV_BECOME, so sudo runs scripts as root * fix(desktop): keep the Plasma start line the pipewire tests slice the script at
16 lines
723 B
Bash
Executable File
16 lines
723 B
Bash
Executable File
#!/bin/sh
|
|
# Runs COMMAND, or a shell, as an ordinary user ("deck", the app's own Android user) instead of
|
|
# root, for programs that refuse root or check who owns their files. Everything started from it
|
|
# stays that user; sudo and su still give root, and exit goes back.
|
|
case ${1:-} in
|
|
-h|--help) echo "usage: droiddeck-user [COMMAND [ARG...]]"; exit 0 ;;
|
|
esac
|
|
if [ -z "${DDNATV_ROOT:-}" ]; then
|
|
echo "droiddeck-user: needs the native userland (Settings > Performance > Run without proot)" >&2
|
|
exit 1
|
|
fi
|
|
export DDNATV_BECOME=app USER=deck LOGNAME=deck
|
|
[ $# -gt 0 ] && exec "$@"
|
|
[ -t 2 ] && echo "Programs here run as an ordinary user (deck), not root. sudo still works; exit goes back." >&2
|
|
exec "${SHELL:-/bin/bash}"
|