mirror of
https://gitee.com/spark-store-project/spark-wine
synced 2026-08-06 13:33:58 +08:00
56 lines
1.4 KiB
Bash
56 lines
1.4 KiB
Bash
#!/bin/bash
|
|
|
|
PACK_NAME="" #软体套件名
|
|
BOTTLE_NAME="" #容器名
|
|
MIME_TYPE=""
|
|
ACTIVEX_NAME=""
|
|
MAKE_AUTOSTART="" #开机时自动执行,需要实现请填写1
|
|
SEND_TO_DESKTOP="" #将启动图示从工作管理员copy至系统桌面,需要实现请填写1
|
|
|
|
|
|
make_autostart()
|
|
{
|
|
for file in $(ls /home)
|
|
do
|
|
if [ -d "/home/${USER}/.config/autostart" ]
|
|
then
|
|
cp /opt/apps/$PACK_NAME/entries/applications/$PACK_NAME.desktop /home/${USER}/.config/autostart/
|
|
sed -i "s#%u#\"autostart\"#" /home/${USER}/.config/autostart/$PACK_NAME.desktop
|
|
fi
|
|
done
|
|
}
|
|
|
|
send_to_desktop()
|
|
{
|
|
for file in $(ls /home)
|
|
do
|
|
if [ -d "/home/${USER}/.config/autostart" ]
|
|
then
|
|
desktop=$(cat /etc/xdg/user-dirs.defaults | grep DESKTOP | awk -F= '{print $2}')
|
|
if [ -d "/home/${USER}/$desktop" ]; then
|
|
cp /opt/apps/$PACK_NAME/entries/applications/$PACK_NAME*.desktop /home/${USER}/$desktop
|
|
fi
|
|
fi
|
|
done
|
|
}
|
|
|
|
if [ -n "$MAKE_AUTOSTART" ]; then
|
|
make_autostart
|
|
fi
|
|
|
|
if [ -n "$SEND_TO_DESKTOP" ]; then
|
|
send_to_desktop
|
|
fi
|
|
|
|
if [ -n "$ACTIVEX_NAME" ]; then
|
|
if [ ! -d "/usr/lib/mozilla/plugins" ];then
|
|
mkdir -p /usr/lib/mozilla/plugins
|
|
fi
|
|
cp /usr/local/share/pipelight/libpipelight.so /usr/lib/mozilla/plugins/libpipelight-$ACTIVEX_NAME.so
|
|
fi
|
|
|
|
# Make sure the script returns 0
|
|
true
|
|
|
|
|