forked from jdpedersen1/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updicon.sh
executable file
·43 lines (37 loc) · 1.49 KB
/
updicon.sh
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
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
# Created By: Jake@Linux
# Created On: Thu 25 Aug 2022 02:20:52 PM CDT
# Project: sys tray icon for system updates
upd="$(sudo xbps-install -SunM | wc -l)"
list="$(sudo xbps-install -nuM | awk {'print $1'})"
inst="$(pidof yad)"
if [[ $inst -eq " " ]]
then
if (( $upd == 0 ));
then
yad --text "$upd Updates" --notification --image=$HOME/Desktop/icon/noupdate.png
elif (( $upd <= 5 ));
then
yad --text "$upd Updates: Right click to see all updates, Left click to perform update" --notification\
--image=$HOME/Desktop/icon/modupdate.png --menu="$list" --command "kitty -e sudo xbps-install -Su"
elif (( $upd > 5 ));
then
yad --text "$upd Updates: Right click to see all updates, Left click to perform update" --notification\
--image=$HOME/Desktop/icon/lotsupdate.png --menu="$list" --command "kitty -e sudo xbps-install -Su"
fi
elif [[ $inst -gt "1" ]]
then
pkill yad
if (( $upd == 0 ));
then
yad --text "$upd Updates" --notification --image=$HOME/Desktop/icon/noupdate.png
elif (( $upd <= 5 ));
then
yad --text "$upd Updates: Right click to see all updates, Left click to perform update" --notification\
--image=$HOME/Desktop/icon/modupdate.png --menu="$list" --command "kitty -e sudo xbps-install -Su"
elif (( $upd > 5 ));
then
yad --text "$upd Updates: Right click to see all updates, Left click to perform update" --notification\
--image=$HOME/Desktop/icon/lotsupdate.png --menu="$list" --command "kitty -e sudo xbps-install -Su"
fi
fi