12-04-2016, 01:13 PM
![[Image: vXW9ygl.png]](http://i.imgur.com/vXW9ygl.png)
Implementation:
Create the update notification script:
Code:
sudo touch /usr/local/sbin/updatenotifyCode:
sudo leafpad /usr/local/sbin/updatenotifyinsert:
Code:
#!/bin/bash
xhost local:$USER > /dev/null 2>&1
export DISPLAY=:0
apt-get update > /dev/null 2>&1
UPD=$(/usr/lib/update-notifier/apt-check --human-readable && echo && echo Click here to remove this message)
notify-send -i /usr/share/icons/Faenza/apps/48/system-software-installer.png -t 10 -u critical 'Install Updates' "$UPD"
exitfor message that must be clicked on to disappear.
Alternatively:
Code:
#!/bin/bash
xhost local:$USER > /dev/null 2>&1
export DISPLAY=:0
apt-get update > /dev/null 2>&1
UPD=$(/usr/lib/update-notifier/apt-check --human-readable && echo && echo Click here to remove this message)
notify-send -i /usr/share/icons/Faenza/apps/48/system-software-installer.png 'Install Updates' "$UPD"
exitfor default 5 second notification.
Code:
#!/bin/bash
xhost local:$USER > /dev/null 2>&1
export DISPLAY=:0
apt-get update > /dev/null 2>&1
UPD=$(/usr/lib/update-notifier/apt-check --human-readable && echo && echo Click here to remove this message)
notify-send -i /usr/share/icons/Faenza/apps/48/system-software-installer.png --expire-time=10000 'Install Updates' "$UPD"
exitfor 10 second notification (preferred).
Make the file executable:
Code:
sudo chmod +x /usr/local/sbin/updatenotifysave and close.
Add all users that have sudo access to /usr/local/sbin/updatenotify only.
Code:
sudo visudoadd:
Code:
$USER ALL=NOPASSWD: /usr/local/sbin/updatenotifyto the bottom of the file.
Create a cronjob as the user (to run hourly):
Code:
crontab -eCode:
0 * * * * /usr/local/sbin/updatenotify >/dev/null 2>&1Download your free copy of Linux Lite today.
Jerry Bezencon
Linux Lite Creator
"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."
![[Image: X5qGkCg.png]](https://imgur.com/X5qGkCg.png)

