Initial build setup for x86_64 Stormux.
This commit is contained in:
63
x86_64/airootfs/etc/profile.d/stormux_first_boot.sh
Executable file
63
x86_64/airootfs/etc/profile.d/stormux_first_boot.sh
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$(tty)" != "/dev/tty1" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if ! [[ -x /usr/local/bin/configure-stormux ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# Volume calibration FIRST
|
||||
echo "Setting up audio volume..."
|
||||
volume=50
|
||||
wait=0
|
||||
|
||||
# Wait for pipewire to become available
|
||||
while [[ $wait -lt 30 ]]; do
|
||||
if pgrep pipewire &> /dev/null ; then
|
||||
break
|
||||
else
|
||||
sleep 1
|
||||
((wait++))
|
||||
fi
|
||||
done
|
||||
|
||||
# Volume calibration - this should be the VERY FIRST interactive part
|
||||
while [[ $volume -le 130 ]]; do
|
||||
clear
|
||||
pactl set-sink-volume @DEFAULT_SINK@ "${volume}%" 2>/dev/null
|
||||
spd-say "If this is loud enough, press enter."
|
||||
if read -t4 ; then
|
||||
echo "Volume set to ${volume}%"
|
||||
break
|
||||
else
|
||||
((volume+=5))
|
||||
fi
|
||||
done
|
||||
|
||||
# For audible sudo prompts:
|
||||
unset sudoFlags
|
||||
if [[ -x /etc/audibleprompt.sh ]]; then
|
||||
export SUDO_ASKPASS=/etc/audibleprompt.sh
|
||||
export sudoFlags=("-A")
|
||||
fi
|
||||
|
||||
clear
|
||||
cat << "EOF"
|
||||
Hello, and welcome to Stormux!
|
||||
|
||||
Let's get you set up. After you press enter, you will be prompted for the sudo password.
|
||||
When that happens, type the word stormux and press enter.
|
||||
You will not receive any speech feedback for this process.
|
||||
That is completely normal, and speech will return after you have typed the password.
|
||||
Once again, the password is stormux in all lower case letters.
|
||||
|
||||
Please press enter to continue.
|
||||
EOF
|
||||
read -r
|
||||
sudo "${sudoFlags[@]}" configure-stormux
|
||||
Reference in New Issue
Block a user