mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 06:00:09 +02:00
Installers: ask for sudo in the terminal, and cope with SteamVR off
- frame_sudo (scripts/_env.sh) replaces three copies of sudo_run. On the Frame it asks in the terminal even when stdin isn't one, which install.sh's steps never had: saying yes to the Bluetooth fixes or hand tracking stopped the install with "no terminal for sudo". From a PC it asks through ssh -t when .env has no password. - start_with_steamvr: the pointer, power, and gaze services restart when SteamVR runs (a re-install runs the new code) and are left to start with it when it doesn't, instead of failing the install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
12c42cd455
commit
0280e7441d
8 files changed
+62
-58
No files matched your search
+4
-19
@@ -4,10 +4,9 @@
|
||||
# SteamVR's eyetracking process into /dev/shm/frametop-eyes-cams for ft-eyes, and only while
|
||||
# ft-eyes wants them. The gaze service (gaze/ft-gazed) runs ft-eyes itself, when Eye tracker
|
||||
# is Own tracker or the gaze probe uses it.
|
||||
# Needs host sudo, for the binary (/etc/frametop/ft-eyegrab, root's) and the unit. On the
|
||||
# Frame, sudo asks for the password in the terminal, or runs SUDO_ASKPASS when that's set.
|
||||
# From a PC (or with no terminal), the password comes from steamos_root_pwd in the repo's .env
|
||||
# and is sent to sudo -S on stdin, never on a command line.
|
||||
# Needs host sudo, for the binary (/etc/frametop/ft-eyegrab, root's) and the unit: it asks for
|
||||
# the password in the terminal, on the Frame or from a PC, or runs SUDO_ASKPASS when that's set
|
||||
# (frame_sudo in scripts/_env.sh, which also takes it from the repo's .env).
|
||||
# Usage: gaze/tracker/install.sh [install|uninstall|status|log [lines]]
|
||||
set -euo pipefail
|
||||
|
||||
@@ -16,21 +15,7 @@ root=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
|
||||
src=$FRAME_REPO/gaze/tracker
|
||||
unit=frametop-eyegrab.service
|
||||
|
||||
sudo_run() {
|
||||
if [ "$FRAME_LOCAL" = 1 ] && [ -n "${SUDO_ASKPASS:-}" ]; then
|
||||
sudo -A bash -c "$1" # SUDO_ASKPASS supplies the password
|
||||
return
|
||||
fi
|
||||
if [ "$FRAME_LOCAL" = 1 ] && [ -t 0 ]; then
|
||||
sudo bash -c "$1" # asks for the password here
|
||||
return
|
||||
fi
|
||||
local pw
|
||||
pw=$(sed -n 's/^steamos_root_pwd=//p' "$root/.env" 2>/dev/null)
|
||||
pw=${pw#[\"\']}; pw=${pw%[\"\']} # .env values may be quoted
|
||||
[ -n "$pw" ] || { echo "no terminal for sudo, and steamos_root_pwd is missing from $root/.env" >&2; exit 1; }
|
||||
printf '%s\n' "$pw" | on_frame "sudo -S -p '' bash -c $(printf %q "$1")"
|
||||
}
|
||||
sudo_run() { frame_sudo "$1"; }
|
||||
|
||||
case ${1:-install} in
|
||||
install)
|
||||
|
||||
Reference in new issue
Block a user