2 Star 1 Fork 0

向日葵/向日葵脚本二代本体仓库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
plug-in 14.32 KB
一键复制 编辑 原始数据 按行查看 历史
向日葵 提交于 2024-10-08 01:25 . pilot again
#!/bin/bash
cd "$HOME"
# 清屏函数
clear_menu() {
for ((i = 0; i < forin; i++)); do
printf "\e[1A\e[K"
done
}
# 检查 dialog 是否安装,安装对应的版本
if ! command -v dialog &>/dev/null; then
if grep -Eqi "Ubuntu" /etc/issue && grep -Eq "Ubuntu" /etc/*-release; then
apt install dialog -y
elif [ -f /etc/arch-release ]; then
pacman -S dialog --noconfirm
else
echo "未知系统,请在支持的系统上运行此脚本"
exit 1
fi
fi
# 检查 ffmpeg 是否安装
if ! command -v ffmpeg &>/dev/null; then
echo "ffmpeg 未安装,开始安装 ffmpeg"
cd "$HOME" || exit
if grep -Eqi "Ubuntu" /etc/issue && grep -Eq "Ubuntu" /etc/*-release; then
apt update
bash <(curl -s https://gitee.com/baihu433/ffmpeg/raw/master/ffmpeg.sh)
elif [ -f /etc/arch-release ]; then
pacman -Syu --noconfirm
pacman -S ffmpeg --noconfirm
else
echo "未知系统,请在支持的系统上运行此脚本"
exit 1
fi
else
ffmpeg_version=$(ffmpeg -version | grep "ffmpeg version" | awk '{print $3}')
required_version="4.0"
if [[ "$(printf '%s\n' "$required_version" "$ffmpeg_version" | sort -V | head -n1)" != "$required_version" ]]; then
echo "ffmpeg 版本号太低,开始升级"
if grep -Eqi "Ubuntu" /etc/issue && grep -Eq "Ubuntu" /etc/*-release; then
bash <(curl -s https://gitee.com/baihu433/ffmpeg/raw/master/ffmpeg.sh)
elif [ -f /etc/arch-release ]; then
pacman -Syu --noconfirm
pacman -S ffmpeg --noconfirm
fi
fi
fi
if ! command -v ffmpeg &>/dev/null; then
echo "ffmpeg 未安装,开始安装 ffmpeg"
cd "$HOME" || exit
bash <(curl -s https://gitee.com/baihu433/ffmpeg/raw/master/ffmpeg.sh)
else
ffmpeg_version=$(ffmpeg -version | grep "ffmpeg version" | awk '{print $3}')
required_version="4.0"
if [[ "$(printf '%s\n' "$required_version" "$ffmpeg_version" | sort -V | head -n1)" != "$required_version" ]]; then
echo "ffmpeg 版本号太低,开始升级"
bash <(curl -s https://gitee.com/baihu433/ffmpeg/raw/master/ffmpeg.sh)
fi
fi
# 定义插件安装目录
jh="$ys/plugins"
# 定义 Python 安装函数
py_install() {
echo "接下来安装 Python,这是个非常难过的过程哦,嘤嘤嘤"
sleep 3
# 更新系统和安装 Python 及其相关工具
if grep -Eqi "Ubuntu" /etc/issue && grep -Eq "Ubuntu" /etc/*-release; then
apt-get update
apt-get upgrade -y
apt-get install python3 python3-pip python3.10-venv -y
elif [ -f /etc/arch-release ]; then
pacman -Syu --noconfirm
pacman -S --noconfirm python python-pip python-virtualenv
else
echo "请在支持的系统上运行此脚本"
exit 1
fi
echo "pip 和 Python 安装成功"
# 设置 pip 镜像源
python3.10 -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
# 安装 Poetry
python3.10 -m pip install poetry
echo "Poetry 安装成功"
# 开始安装 py-plugin
echo "开始安装 py-plugin"
cd "$jh" || exit
git clone --depth=1 https://gitee.com/realhuhu/py-plugin.git
echo "开始安装 py-plugin 的依赖"
cd py-plugin || exit
pnpm install iconv-lite @grpc/grpc-js @grpc/proto-loader -w
poetry install
echo "py 配置成功"
}
# 插件安装函数
install_plugin() {
local plugin_name="$1"
local git_repo="$2"
local target_dir="$jh/$plugin_name"
if [ ! -d "$target_dir" ]; then
echo "检测到您未安装 $plugin_name 插件,正在安装 $plugin_name 插件"
cd "$ys" || exit
git clone --depth=1 "$git_repo" "$target_dir"
else
echo "$plugin_name 插件已安装"
fi
}
# dialog 菜单函数
dialog_install() {
primary_options=(
"1" "功能型插件" \
"2" "娱乐型插件"
)
selected_layer=$(dialog --stdout --title "向日葵集中营qq:674752705" --menu "请选择一个选项:" 10 45 15 "${primary_options[@]}")
if [ "$selected_layer" = "1" ]; then
options=(
"1" "安装锅巴插件[人机设置]" OFF \
"2" "安装戏天插件[插件管理]" OFF \
"3" "安装向日葵插件[脚本作者插件]" OFF \
"4" "安装喵喵插件[基础插件]" OFF \
"5" "安装椰奶插件[群管插件]" OFF \
"6" "安装优纪插件[b站动态推送]" OFF \
"7" "安装自动化插件[插件自动更新]" OFF \
"8" "安装Python插件[onebot类]" OFF
)
selected_plugins=($(dialog --stdout --title "向日葵集中营qq:674752705" --checklist "请选择一个或多个功能插件[空格选择,回车确认]:" 20 45 10 "${options[@]}"))
elif [ "$selected_layer" = "2" ]; then
options=(
"9" "安装e插件[e帮助]" OFF \
"10" "安装土块插件[土块帮助]" OFF \
"11" "安装落落插件[落落帮助]" OFF \
"12" "安装DIY帮助插件[看使用文档]" OFF \
"13" "安装绝云间修仙插件[修仙帮助]" OFF \
"14" "安装小飞插件[小飞帮助]" OFF \
"15" "安装无用插件[无用帮助]" OFF \
"16" "安装榴莲插件[榴莲帮助]" OFF \
"17" "安装Atlas[图鉴]插件" OFF \
"18" "安装群互动插件[互助帮助]" OFF \
"19" "安装GPT插件" OFF \
"20" "安装清凉插件[清凉帮助]" OFF \
"21" "安装蔚蓝插件[蔚蓝帮助]" OFF \
"22" "安装qq签名插件[星点签名帮助]" OFF \
"23" "安装枫叶插件[枫叶帮助]" OFF \
"24" "安装ap插件[ap帮助]" OFF \
"25" "安装阴天插件[阴天帮助]" OFF \
"26" "安装R插件[R帮助]" OFF
)
selected_plugins=($(dialog --stdout --title "向日葵集中营qq:674752705" --checklist "请选择一个或多个娱乐插件[空格选择,回车确认]:" 20 45 10 "${options[@]}"))
else
echo -e "${red}未检测到有效选择,脚本退出${bg}"
exit 1
fi
for option in "${selected_plugins[@]}"; do
select_uu "$option"
done
}
# 定义文字菜单函数
menu_type_1(){
echo
echo -e "${caidan3}╭──────────────────────────────╮${bg}"
echo -e "${caidan2} 功能型插件菜单 ${bg}"
echo -e "${caidan1} ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ${bg}"
echo -e "${caidan2} 1. 安装锅巴插件[人机设置]${bg}"
echo -e "${caidan2} 2. 安装戏天插件[插件管理]${bg}"
echo -e "${caidan2} 3. 安装向日葵插件[脚本作者插件]${bg}"
echo -e "${caidan2} 4. 安装喵喵插件[基础插件]${bg}"
echo -e "${caidan2} 5. 安装椰奶插件[群管插件]${bg}"
echo -e "${caidan2} 6. 安装优纪插件[b站动态推送]${bg}"
echo -e "${caidan2} 7. 安装自动化插件[插件自动更新]${bg}"
echo -e "${caidan2} 8. 安装Python插件[onebot类]${bg}"
echo -e "${caidan1} ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ${bg}"
}
menu_type_2(){
echo
echo -e "${caidan3}╭──────────────────────────────╮${bg}"
echo -e "${caidan2} 娱乐型插件菜单 ${bg}"
echo -e "${caidan1} ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ${bg}"
echo -e "${caidan2} 9. 安装e插件[e帮助]${bg}"
echo -e "${caidan2} 10. 安装土块插件[土块帮助]${bg}"
echo -e "${caidan2} 11. 安装落落插件[落落帮助]${bg}"
echo -e "${caidan2} 12. 安装DIY帮助插件[看使用文档]${bg}"
echo -e "${caidan2} 13. 安装绝云间修仙插件[修仙帮助]${bg}"
echo -e "${caidan2} 14. 安装小飞插件[小飞帮助]${bg}"
echo -e "${caidan2} 15. 安装无用插件[无用帮助]${bg}"
echo -e "${caidan2} 16. 安装榴莲插件[榴莲帮助]${bg}"
echo -e "${caidan2} 17. 安装Atlas[图鉴]插件${bg}"
echo -e "${caidan2} 18. 安装群互动插件[互助帮助]${bg}"
echo -e "${caidan2} 19. 安装GPT插件${bg}"
echo -e "${caidan2} 20. 安装清凉插件[清凉帮助]${bg}"
echo -e "${caidan2} 21. 安装蔚蓝插件[蔚蓝帮助]${bg}"
echo -e "${caidan2} 22. 安装qq签名插件[星点签名帮助]${bg}"
echo -e "${caidan2} 23. 安装枫叶插件[枫叶帮助]${bg}"
echo -e "${caidan2} 24. 安装ap插件[ap帮助]${bg}"
echo -e "${caidan2} 25. 安装阴天插件[阴天帮助]${bg}"
echo -e "${caidan2} 26. 安装R插件[R帮助]${bg}"
echo -e "${caidan2} 27. 退出${bg}"
echo -e "${caidan1} ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ${bg}"
}
# 显示插件选项
select_uu() {
case $1 in
1)
install_plugin "guoba-plugin" "https://gitee.com/guoba-yunzai/guoba-plugin.git"
;;
2)
install_plugin "xitian-plugin" "https://gitee.com/XiTianGame/xitian-plugin.git"
;;
3)
install_plugin "xrk-plugin" "https://gitee.com/xrk114514/xrk-plugin.git"
;;
4)
install_plugin "miao-plugin" "https://gitee.com/yoimiya-kokomi/miao-plugin.git"
;;
5)
install_plugin "yenai-plugin" "https://gitee.com/yeyang52/yenai-plugin.git"
;;
6)
install_plugin "yuki-plugin" "https://gitee.com/snowtafir/yuki-plugin.git"
;;
7)
install_plugin "auto-plugin" "https://gitee.com/Nwflower/auto-plugin.git"
;;
8) py_install ;;
9)
install_plugin "esca-plugin" "https://mirror.ghproxy.com/https://github.com/hzqlingmou/esca-plugin"
;;
10)
install_plugin "earth-k-plugin" "https://gitee.com/SmallK111407/earth-k-plugin.git"
;;
11)
install_plugin "luoluo-plugin" "https://gitee.com/yll0614/luoluo-plugin.git"
;;
12)
install_plugin "help-plugin" "https://gitee.com/tu-zhengxiong0925/help-plugin.git"
;;
13)
install_plugin "xiuxian@1.3.0" "https://gitee.com/hutao222/DDZS-XIUXIAN-V1.3.0/.git"
;;
14)
install_plugin "xiaofei-plugin" "https://gitee.com/xfdown/xiaofei-plugin.git"
;;
15)
install_plugin "useless-plugin" "https://gitee.com/SmallK111407/useless-plugin.git"
;;
16)
install_plugin "liulian-plugin" "https://gitee.com/huifeidemangguomao/liulian-plugin.git"
;;
17)
install_plugin "Atlas" "https://gitee.com/Nwflower/atlas.git"
;;
18)
install_plugin "Gi-plugin" "https://gitee.com/qiannqq/gi-plugin.git"
;;
19)
install_plugin "gpti-plugin" "https://mirror.ghproxy.com/https://github.com/CikeyQi/gpti-plugin.git"
;;
20)
install_plugin "ql-plugin" "https://gitee.com/xwy231321/ql-plugin.git"
;;
21)
install_plugin "BlueArchive-plugin" "https://gitee.com/all-thoughts-are-broken/blue-archive.git"
;;
22)
install_plugin "starlight-qsign" "https://gh-proxy.com/https://github.com/wuliya336/starlight-qsign"
;;
23)
install_plugin "hs-qiqi-plugin" "https://gitee.com/kesally/hs-qiqi-cv-plugin.git"
;;
24)
install_plugin "ap-plugin" "https://gitee.com/yhArcadia/ap-plugin.git"
;;
25)
install_plugin "y-tian-plugin" "https://gitee.com/wan13877501248/y-tian-plugin.git"
;;
26)
install_plugin "rconsole-plugin" "https://gitee.com/kyrzy0416/rconsole-plugin.git"
;;
27)
echo "退出喽,但是先打个依赖"
cd $ys && pnpm i
exit 1
;;
esac
}
# 主菜单
function show_menu {
echo -e "${caidan3} ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ \e[0m"
echo -e "${caidan1}╭──────────────────────────────╮${bg}"
echo -e "${caidan2} 向日葵插件菜单 ${bg}"
echo -e "${caidan1} ─────────────────────────────── ${bg}"
echo -e "${caidan2} 1. 安装插件包列表${bg}"
echo -e "${caidan2} 2. 安装李素裳js插件${bg}"
echo -e "${caidan2} 3. 插件文件管理 ${bg}"
echo -e "${caidan1}╰──────────────────────────────╯${bg}"
echo -e "${caidan3} ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ \e[0m"
}
# 主循环
while true; do
show_menu
read -p "输入你想安装哪个:" uuuu
forin=10 clear_menu
case $uuuu in
1)
# 触屏版或文字版菜单选择
echo -e "${caidan3}╭──────────────────╮${bg}"
echo -e "${caidan1}╭──────────────────╮${bg}"
echo -e "${caidan2} 1.触屏版菜单 ${bg}"
echo -e "${caidan2} 2.文字版菜单 ${bg}"
echo -e "${caidan1}╰──────────────────╯${bg}"
echo -e "${caidan3}╰──────────────────╯${bg}"
read -p "选一种菜单吧:" uuuuu
forin=7 clear_menu
case $uuuuu in
1) dialog_install; break ;;
2)
while true; do
# 选择插件菜单
echo -e "${caidan3}╭──────────────────╮${bg}"
echo -e "${caidan1}╭──────────────────╮${bg}"
echo -e "${caidan2} 1.功能型插件 ${bg}"
echo -e "${caidan2} 2.娱乐型插件 ${bg}"
echo -e "${caidan1}╰──────────────────╯${bg}"
echo -e "${caidan3}╰──────────────────╯${bg}"
read -p "选一种菜单吧:" uuuu
forin=7 clear_menu
case $uuuu in
1) menu_type_1 ;;
2) menu_type_2 ;;
*) echo -e "${red}退喽${bg}"; exit 1 ;;
esac
read -p "请输入你想安装的插件吧(可以多选,多选请数字间空格隔开):" number
forin=31 clear_menu
plugin_number=$(echo "${number}" | sed "s/\"//g")
for option in ${plugin_number}; do
select_uu "$option"
done
done
break
;;
*) echo -e "${red}退喽${bg}"; exit 1 ;;
esac
;;
2)
bash /xrk/smallpieces/js
;;
3)
bash /xrk/smallpieces/deletion
;;
*)
echo -e "${red}乱点就退,我人性化嘤嘤嘤${bg}"; exit 1 ;;
esac
done
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xrk114514/sunbody.git
git@gitee.com:xrk114514/sunbody.git
xrk114514
sunbody
向日葵脚本二代本体仓库
master

搜索帮助