-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy patheos-reboot-required3
executable file
·33 lines (28 loc) · 1.03 KB
/
eos-reboot-required3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
DoNotify() {
local -r msg="Reboot is recommended due to the upgrade of core system package(s)."
local icon=/usr/share/icons/Qogir/scalable/apps/system-reboot.svg
[ -e $icon ] || icon=system-reboot
local cmd=(
eos_notification_all # function to notify all users
$icon # icon
critical # urgency
0 # expire time (not used!)
"'EndeavourOS notification'" # appname
"Reboot recommended!" # title
"$msg" # message
RED # message color on TTY
)
"${cmd[@]}"
}
Wait-for-some-processes() {
# Wait for all pacman-like processes to finish.
systemctl disable --now eos-reboot-required.timer
sleep 1
source /usr/share/endeavouros/scripts/eos-script-lib-yad --limit-icons || return
while ps -C pacman,yay,paru,makepkg >/dev/null ; do
sleep 1
done
DoNotify
}
Wait-for-some-processes "$@"