mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-07-20 04:22:21 +08:00
修复:wayland下无法提示
Signed-off-by: shenmo <jifengshenmo@outlook.com>
This commit is contained in:
parent
7163f8ee80
commit
eb38f2af05
@ -3,16 +3,15 @@ LANGUAGE=en_US
|
||||
|
||||
# 发送通知
|
||||
function notify-send() {
|
||||
# Detect name of the display in use
|
||||
local display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)"
|
||||
|
||||
|
||||
# Detect user using the display
|
||||
local user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1)
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
|
||||
# Detect uid of the user
|
||||
local uid=$(id -u $user)
|
||||
|
||||
sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${uid}/bus notify-send "$@"
|
||||
sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${uid}/bus notify-send "$@"
|
||||
}
|
||||
|
||||
# 检测网络链接畅通
|
||||
@ -102,4 +101,4 @@ if [ $update_app_number -le 0 ] ; then
|
||||
fi
|
||||
|
||||
## 如果都是hold或者版本一致的那就直接退出,否则把剩余的给提醒了
|
||||
notify-send -a spark-store "星火更新提醒" "星火商店仓库中有$update_app_number个软件包可以更新啦!请到星火商店的菜单处理"
|
||||
notify-send -a spark-store "星火更新提醒" "星火商店仓库中有$update_app_number个软件包可以更新啦!请到星火商店的菜单处理"
|
Loading…
x
Reference in New Issue
Block a user