Promote UCM2/HiFi (Jack-driven) as the primary delivery, add HISTORY.md, remove ProAudio/REPRO docs and non-UCM scripts, and fix repo-wide references. Made-with: Cursor
56 lines
1.9 KiB
Bash
Executable File
56 lines
1.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
# 卸载本仓库安装的 Kaisa UCM2 overlay 与系统级 60-kaisa-ucm.lua(需 sudo)。
|
||
# 不卸载 alsa-ucm-conf 整包;仅删除 install-kaisa-ucm-overlay.sh 写入的路径。
|
||
# 用法:在仓库根目录执行 ./scripts/remove-kaisa-ucm-overlay.sh
|
||
# 卸载后请按发行版默认策略重新选择输出配置。
|
||
set -euo pipefail
|
||
|
||
if ! command -v sudo &>/dev/null; then
|
||
echo "需要 sudo。" >&2
|
||
exit 1
|
||
fi
|
||
|
||
removed=0
|
||
|
||
echo ">>> 删除 /usr/share/alsa/ucm2/GoogleKaisa/(若存在)"
|
||
if [[ -d /usr/share/alsa/ucm2/GoogleKaisa ]]; then
|
||
sudo rm -rf -- /usr/share/alsa/ucm2/GoogleKaisa
|
||
removed=1
|
||
echo " 已删除。"
|
||
else
|
||
echo " (不存在,跳过)"
|
||
fi
|
||
|
||
echo ">>> 删除 /usr/share/alsa/ucm2/conf.d/sof-rt5682/(若存在)"
|
||
if [[ -d /usr/share/alsa/ucm2/conf.d/sof-rt5682 ]]; then
|
||
sudo rm -rf -- /usr/share/alsa/ucm2/conf.d/sof-rt5682
|
||
removed=1
|
||
echo " 已删除。"
|
||
else
|
||
echo " (不存在,跳过)"
|
||
fi
|
||
|
||
LUA="/usr/share/wireplumber/main.lua.d/60-kaisa-ucm.lua"
|
||
echo ">>> 禁用 $LUA(若存在)"
|
||
if [[ -f "$LUA" ]]; then
|
||
sudo mv -n -- "$LUA" "${LUA}.disabled"
|
||
removed=1
|
||
echo " 已移至 ${LUA}.disabled"
|
||
elif [[ -f "${LUA}.disabled" ]]; then
|
||
echo " (已是 .disabled,跳过)"
|
||
else
|
||
echo " (不存在,跳过)"
|
||
fi
|
||
|
||
if systemctl --user is-system-running &>/dev/null; then
|
||
echo ">>> systemctl --user restart wireplumber pipewire pipewire-pulse"
|
||
systemctl --user restart wireplumber pipewire pipewire-pulse
|
||
else
|
||
echo "(无 user 会话,请登录后执行: systemctl --user restart wireplumber pipewire pipewire-pulse)" >&2
|
||
fi
|
||
|
||
echo "完成。sof-rt5682 将不再使用本仓库的 HiFi UCM(HDMI1/2/3 等端口名来自该 overlay)。"
|
||
if [[ "$removed" -eq 1 ]]; then
|
||
echo "提示:卸载后将回到发行版默认音频配置;如需继续使用 HDMI,请按 docs/linux-hdmi/OPERATION_PipeWire_Kaisa_UCM_HiFi.md 重新安装。"
|
||
fi
|