#!/bin/sh

# ALSA softvol PCM override.
#
# If your ~/.asoundrc selects the default PCM using the PCM_CONFIG
# environment variable (example below), this allows the application
# to choose a specific PCM profile at runtime.
#
# Example:
# pcm.!default {
#   type plug
#   slave.pcm {
#     @func refer
#     name {
#       @func concat
#       strings [
#         "pcm."
#         {
#           @func getenv
#           vars [ PCM_CONFIG ]
#           default "dmix1_volume"
#         }
#       ]
#     }
#   }
# }
#
# Default to the "mednafen" PCM profile if PCM_CONFIG is not already set.
ALSA_SOFTVOL=${ALSA_SOFTVOL:-mednafen}
# DuckStation checks whether the XDG_SESSION_DESKTOP environment variable is set.
XDG_SESSION_DESKTOP=${XDG_SESSION_DESKTOP:-spectrwm}

export ALSA_SOFTVOL XDG_SESSION_DESKTOP
exec /opt/duckstation/bin/duckstation-qt "$@"
