mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 04:12:03 +08:00
modify: 加入了配置系统,不再用瞳孔地震的方式处理升级
This commit is contained in:
@@ -8,7 +8,7 @@ endloop=0
|
||||
#####################检测是否启动过了更新检测工具
|
||||
while [ $endloop -eq 0 ] ;do
|
||||
|
||||
if [ -e /etc/systemd/system/multi-user.target.wants/spark-update-notifier.service ];then
|
||||
if [ ! -e $HOME/.config/spark-union/spark-store/ssshell-config-do-not-show-upgrade-notify ];then
|
||||
text_update_open="${TRANSHELL_CONTENT_CLOSE}"
|
||||
#已经开启了就显示关闭
|
||||
else
|
||||
@@ -21,14 +21,12 @@ option=`zenity --list --text="${TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN}
|
||||
|
||||
case $option in
|
||||
0)
|
||||
if [ -e /etc/systemd/system/multi-user.target.wants/spark-update-notifier.service ];then
|
||||
zenity --info --icon-name=spark-store --height 150 --width 200 --text "${TRANSHELL_CONTENT_CLOSING_UPGRADE_CHECK}" --timeout=2
|
||||
pkexec systemctl disable spark-update-notifier
|
||||
if [ ! -e $HOME/.config/spark-union/spark-store/ssshell-config-do-not-show-upgrade-notify ];then
|
||||
mkdir -p $HOME/.config/spark-union/spark-store/
|
||||
touch $HOME/.config/spark-union/spark-store/ssshell-config-do-not-show-upgrade-notify
|
||||
zenity --info --icon-name=spark-store --height 150 --width 200 --text "${TRANSHELL_CONTENT_CLOSED}" --timeout=2
|
||||
else
|
||||
zenity --info --icon-name=spark-store --height 150 --width 200 --text "${TRANSHELL_CONTENT_OPENING_UPGRADE_CHECK}" --timeout=2
|
||||
pkexec systemctl enable spark-update-notifier
|
||||
pkexec service spark-update-notifier start
|
||||
rm -f $HOME/.config/spark-union/spark-store/ssshell-config-do-not-show-upgrade-notify
|
||||
zenity --info --icon-name=spark-store --height 150 --width 200 --text "${TRANSHELL_CONTENT_OPENED}" --timeout=2
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -20,6 +20,8 @@ function notify-send() {
|
||||
sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${uid}/bus notify-send "$@"
|
||||
}
|
||||
|
||||
|
||||
|
||||
# 检测网络链接畅通
|
||||
function network-check()
|
||||
{
|
||||
@@ -106,4 +108,14 @@ fi
|
||||
update_transhell
|
||||
|
||||
## 如果都是hold或者版本一致的那就直接退出,否则把剩余的给提醒了
|
||||
|
||||
##TODO:除了apt-mark hold之外额外有一个禁止检查列表
|
||||
|
||||
## 如果不想提示就不提示
|
||||
|
||||
user=$(who | awk '{print $1}' | head -n 1)
|
||||
if [ -e "$user/.config/spark-union/spark-store/ssshell-config-do-not-show-upgrade-notify" ];then
|
||||
exit
|
||||
else
|
||||
notify-send -a spark-store "${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_NOTIFY}" "${TRANSHELL_CONTENT_THERE_ARE_APPS_TO_UPGRADE}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user