You are not logged in.
Pages: 1
I created a tiny script to display a notification when package updates are available:
#!/bin/bash
updates=`pacman -Syup | grep "pkg.tar.xz" | wc -l`
if [[ $updates != 0 ]]; then
DISPLAY=:0 zenity --info --text="Updated packages: $updates"
fiThis works whether run with sudo or from a root terminal.
I made the script a cronjob of root. It is being executed but it does not show any notifications. I tried to run the zenity command using "sudo -u myself ..." but that also did not work.
How can I make it display that notification when run as a cronjob?
Last edited by Markus00000 (2011-10-11 16:57:54)
Offline
Have you tried http://promberger.info/linux/2009/01/02 … y-problem/ ?
There's also another script for what you're doing http://bashlnx.blogspot.com/2011/05/hey … rt-ii.html (you can copy just the pacman part and add your zenity stuff)
Offline
Excellent help! Thanks a lot.
Offline
I use this for cron-job notifications:
export DISPLAY=:0.0
export XAUTHORITY=/home/myusername/.Xauthority
su myusername -c 'notify-send -t 0 "hello" 'Offline
Pages: 1