More work on gettings things working.

This commit is contained in:
Storm Dragon
2026-04-21 16:44:05 -04:00
parent 93b7ad2ae5
commit a8fe5d1eab
4 changed files with 41 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
stateDir="${STORMUX_ALSA_STATE_DIR:-/home/stormux/.local/state/alsa}"
stateFile="${stateDir}/asound.state"
action="${1:-}"
usage() {
printf 'Usage: %s restore|store\n' "${0##*/}" >&2
}
case "$action" in
restore)
if [[ ! -f "$stateFile" ]]; then
exit 0
fi
exec /usr/bin/alsactl -f "$stateFile" restore
;;
store)
install -d -o root -g root -m 755 "$stateDir"
exec /usr/bin/alsactl -f "$stateFile" store
;;
*)
usage
exit 2
;;
esac