一键修改emby的UI
项目地址:Nolovenodie/emby-crx: Emby 增强/美化 插件 (适用于 Chrome 内核浏览器 / EmbyServer)
一键脚本:
embyui.sh
安装后,重启emby生效
脚本内容:
plaintext
#! /bin/bash
echo "查找emby安装目录..."
# 查找 emby UI 的目录
UI_local=$(find / -type d -name "dashboard-ui" -print -quit 2>/dev/null)
# 如果找不到目录,退出脚本
if [ -z "$UI_local" ]; then
echo "emby安装目录未找到!"
exit 1
fi
# 切换到找到的目录
cd "$UI_local" || exit
# github加速
proxy="https://gh.llkk.cc/"
# 创建 emby-crx 目录并下载所需文件
rm -rf emby-crx
mkdir -p emby-crx
wget ${proxy}https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/css/style.css -P emby-crx/
wget ${proxy}https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/js/common-utils.js -P emby-crx/
wget ${proxy}https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/js/jquery-3.6.0.min.js -P emby-crx/
wget ${proxy}https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/js/md5.min.js -P emby-crx/
wget ${proxy}https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/content/main.js -P emby-crx/
# 检查 index.html 是否存在
if [ ! -f index.html ]; then
echo "index.html not found in $UI_local!"
exit 1
fi
# 检查 index.html 是否包含 emby-crx
if grep -q "emby-crx" index.html; then
echo "index.html already contains emby-crx, skipping insertion."
else
# 定义要插入的代码
code='\n\n\n\n'
# 在 之前插入代码
sed -i "/<\/head>/i $code" index.html
echo "Inserted emby-crx code into index.html."
fi