Move volume check to run first, before anything else.
This commit is contained in:
@ -24,6 +24,31 @@ if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# make sure the system is at a decent volume
|
||||||
|
volume=50
|
||||||
|
wait=0
|
||||||
|
|
||||||
|
# Wait for pipewire to become available
|
||||||
|
while [[ $wait -lt 30 ]]; do
|
||||||
|
if pgrep pipewire &> /dev/null ; then
|
||||||
|
wait=30 # We don't want to continue the loop
|
||||||
|
else
|
||||||
|
sleep 1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
while [[ $volume -le 130 ]]; do
|
||||||
|
clear
|
||||||
|
spd-say "If this is loud enough, press enter."
|
||||||
|
if read -t4 ; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
((volume+=5))
|
||||||
|
fi
|
||||||
|
pactl set-sink-volume @DEFAULT_SINK@ "${volume}%"
|
||||||
|
done
|
||||||
|
((wait++))
|
||||||
|
done
|
||||||
|
|
||||||
export DIALOGOPTS='--insecure --no-lines --visit-items'
|
export DIALOGOPTS='--insecure --no-lines --visit-items'
|
||||||
|
|
||||||
set_timezone() {
|
set_timezone() {
|
||||||
@ -52,32 +77,6 @@ set_timezone() {
|
|||||||
ln -sf /usr/share/zoneinfo/${region}/${city} /etc/localtime
|
ln -sf /usr/share/zoneinfo/${region}/${city} /etc/localtime
|
||||||
timedatectl set-ntp true
|
timedatectl set-ntp true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# make sure the system is at a decent volume
|
|
||||||
volume=50
|
|
||||||
wait=0
|
|
||||||
|
|
||||||
# Wait for pipewire to become available
|
|
||||||
while [[ $wait -lt 30 ]]; do
|
|
||||||
if pgrep pipewire &> /dev/null ; then
|
|
||||||
wait=30 # We don't want to continue the loop
|
|
||||||
else
|
|
||||||
sleep 1
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
while [[ $volume -le 130 ]]; do
|
|
||||||
clear
|
|
||||||
spd-say "If this is loud enough, press enter."
|
|
||||||
if read -t4 ; then
|
|
||||||
break
|
|
||||||
else
|
|
||||||
((volume+=10))
|
|
||||||
fi
|
|
||||||
pactl set-sink-volume @DEFAULT_SINK@ "${volume}%"
|
|
||||||
done
|
|
||||||
((wait++))
|
|
||||||
done
|
|
||||||
# Offer to switch fenrir layout.
|
# Offer to switch fenrir layout.
|
||||||
echo "Would you like to switch Fenrir to laptop layout?"
|
echo "Would you like to switch Fenrir to laptop layout?"
|
||||||
echo "Press y for yes or n for no followed by enter."
|
echo "Press y for yes or n for no followed by enter."
|
||||||
|
Reference in New Issue
Block a user