<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=2641&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Software update notifications in XFCE]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=2641</link>
		<description><![CDATA[The most recent posts in Software update notifications in XFCE.]]></description>
		<lastBuildDate>Sat, 08 Jun 2019 10:51:24 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=16384#p16384</link>
			<description><![CDATA[<div class="quotebox"><cite>Head_on_a_Stick wrote:</cite><blockquote><div><div class="quotebox"><cite>MiyoLinux wrote:</cite><blockquote><div><p>Okay, I&#039;ve worked on the package, and this is the only warning that I&#039;m getting...</p><div class="codebox"><pre><code>W: miyo-update-notifier: binary-without-manpage usr/bin/show-updates</code></pre></div><p>So, my question is...</p><p>Is this detrimental to whether the package can be trusted by people who may want to use it?</p></div></blockquote></div><p>I don&#039;t think so, no. Man pages are nice but hardly essential for a script which has no options.</p><p>For scripts that do have options you can use the <a href="https://packages.debian.org/stretch/help2man" rel="nofollow">help2man</a> package to generate a simple man page without having to actually write one yourself.</p><p>I would test your package but I use unattended-upgrades and I don&#039;t run the notification daemon, sorry.</p><p>It looks like it should work though, FWIW.</p><p>EDIT: if you wanted to add a man page then include it at (for example) debian/show-updates.1 and then add a file at debian/miyo-update-notifier.manpages with a line listing the location of the man page:</p><div class="codebox"><pre><code>debian/show-updates.1</code></pre></div><p>The page will then be placed correctly by dpkg-buildpackage.</p><p>That command should be listed under section 1 of the man pages, <span class="bbc">man man</span> gives an overview of these in the DESCRIPTIONS section:</p><div class="quotebox"><cite>man man wrote:</cite><blockquote><div><p>&#160; &#160; &#160; &#160;The&#160; table below shows the section numbers of the manual followed by the types of pages they<br />&#160; &#160; &#160; &#160;contain.</p><p>&#160; &#160; &#160; &#160;1&#160; &#160;Executable programs or shell commands<br />&#160; &#160; &#160; &#160;2&#160; &#160;System calls (functions provided by the kernel)<br />&#160; &#160; &#160; &#160;3&#160; &#160;Library calls (functions within program libraries)<br />&#160; &#160; &#160; &#160;4&#160; &#160;Special files (usually found in /dev)<br />&#160; &#160; &#160; &#160;5&#160; &#160;File formats and conventions eg /etc/passwd<br />&#160; &#160; &#160; &#160;6&#160; &#160;Games<br />&#160; &#160; &#160; &#160;7&#160; &#160;Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)<br />&#160; &#160; &#160; &#160;8&#160; &#160;System administration commands (usually only for root)<br />&#160; &#160; &#160; &#160;9&#160; &#160;Kernel routines [Non standard]</p></div></blockquote></div></div></blockquote></div><p>Thank you HoaS! </p><p>I want to be like you when I grow up! <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>It works; I tested it before I uploaded it. It works perfectly. I think that I&#039;ll let it stand &quot;as-is&quot; for now. Thank you so much for your help...I learned a few things from what you posted. <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>EDITED TO CORRECT A WORD...&#160; <img src="https://dev1galaxy.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p>]]></description>
			<author><![CDATA[dummy@example.com (MiyoLinux)]]></author>
			<pubDate>Sat, 08 Jun 2019 10:51:24 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=16384#p16384</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=16381#p16381</link>
			<description><![CDATA[<div class="quotebox"><cite>MiyoLinux wrote:</cite><blockquote><div><p>Okay, I&#039;ve worked on the package, and this is the only warning that I&#039;m getting...</p><div class="codebox"><pre><code>W: miyo-update-notifier: binary-without-manpage usr/bin/show-updates</code></pre></div><p>So, my question is...</p><p>Is this detrimental to whether the package can be trusted by people who may want to use it?</p></div></blockquote></div><p>I don&#039;t think so, no. Man pages are nice but hardly essential for a script which has no options.</p><p>For scripts that do have options you can use the <a href="https://packages.debian.org/stretch/help2man" rel="nofollow">help2man</a> package to generate a simple man page without having to actually write one yourself.</p><p>I would test your package but I use unattended-upgrades and I don&#039;t run the notification daemon, sorry.</p><p>It looks like it should work though, FWIW.</p><p>EDIT: if you wanted to add a man page then include it at (for example) debian/show-updates.1 and then add a file at debian/miyo-update-notifier.manpages with a line listing the location of the man page:</p><div class="codebox"><pre><code>debian/show-updates.1</code></pre></div><p>The page will then be placed correctly by dpkg-buildpackage.</p><p>That command should be listed under section 1 of the man pages, <span class="bbc">man man</span> gives an overview of these in the DESCRIPTIONS section:</p><div class="quotebox"><cite>man man wrote:</cite><blockquote><div><p>&#160; &#160; &#160; &#160;The&#160; table below shows the section numbers of the manual followed by the types of pages they<br />&#160; &#160; &#160; &#160;contain.</p><p>&#160; &#160; &#160; &#160;1&#160; &#160;Executable programs or shell commands<br />&#160; &#160; &#160; &#160;2&#160; &#160;System calls (functions provided by the kernel)<br />&#160; &#160; &#160; &#160;3&#160; &#160;Library calls (functions within program libraries)<br />&#160; &#160; &#160; &#160;4&#160; &#160;Special files (usually found in /dev)<br />&#160; &#160; &#160; &#160;5&#160; &#160;File formats and conventions eg /etc/passwd<br />&#160; &#160; &#160; &#160;6&#160; &#160;Games<br />&#160; &#160; &#160; &#160;7&#160; &#160;Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)<br />&#160; &#160; &#160; &#160;8&#160; &#160;System administration commands (usually only for root)<br />&#160; &#160; &#160; &#160;9&#160; &#160;Kernel routines [Non standard]</p></div></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Sat, 08 Jun 2019 10:27:24 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=16381#p16381</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=16380#p16380</link>
			<description><![CDATA[<div class="quotebox"><cite>Dutch_Master wrote:</cite><blockquote><div><div class="quotebox"><cite>MiyoLinux wrote:</cite><blockquote><div><p><em>....now where did I put that chmod?</em></p><p><img src="https://dev1galaxy.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /> <img src="https://dev1galaxy.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p></div></blockquote></div><p>I think you&#039;d need to look for it in <em>Lost + Found</em> <img src="https://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /> <img src="https://dev1galaxy.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p><p>(sorry, couldn&#039;t resist!)</p></div></blockquote></div><p>LOLOL!!! <img src="https://dev1galaxy.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" />&#160; Good one!</p><p>Okay, I&#039;ve worked on the package, and this is the only warning that I&#039;m getting...</p><div class="codebox"><pre><code>W: miyo-update-notifier: binary-without-manpage usr/bin/show-updates</code></pre></div><p>So, my question is...</p><p>Is this detrimental to whether the package can be trusted by people who may want to use it? Good grief...going in and fixing the issues caused other issues that caused me to have to fix other issues in order to fix the original issues...&#160; <img src="https://dev1galaxy.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p><p>I&#039;ve looked at the man folder on my system to try and get some clue, but there are so many sub-folders, I&#039;m not sure where to begin to put a man-page for the notifier!</p><p>Goodgrief&#039;amightyIt&#039;salmostasthoughDebianhassometypeofstandardsthattheywanttobemetforsomereasonStinkin&#039;hotdogwithoutrelishandI&#039;mabouttohaveanervous-jerkdownandmightymorphinpowerrangers!!!</p><p><img src="https://dev1galaxy.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" />&#160; <img src="https://dev1galaxy.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p><p>If anyone is willing to test it again, it is version 1.1, and it can be downloaded from...</p><p><a href="https://sourceforge.net/projects/miyolinux/files/deb_files/" rel="nofollow">https://sourceforge.net/projects/miyoli … deb_files/</a></p>]]></description>
			<author><![CDATA[dummy@example.com (MiyoLinux)]]></author>
			<pubDate>Sat, 08 Jun 2019 10:04:30 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=16380#p16380</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=16371#p16371</link>
			<description><![CDATA[<div class="quotebox"><cite>MiyoLinux wrote:</cite><blockquote><div><p><em>....now where did I put that chmod?</em></p><p><img src="https://dev1galaxy.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /> <img src="https://dev1galaxy.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p></div></blockquote></div><p>I think you&#039;d need to look for it in <em>Lost + Found</em> <img src="https://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /> <img src="https://dev1galaxy.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p><p>(sorry, couldn&#039;t resist!)</p>]]></description>
			<author><![CDATA[dummy@example.com (Dutch_Master)]]></author>
			<pubDate>Fri, 07 Jun 2019 21:42:40 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=16371#p16371</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=16370#p16370</link>
			<description><![CDATA[<p>YIKES!&#160; </p><p>Thank you so much HoaS!</p><p><em>....now where did I put that chmod?</em></p><p><img src="https://dev1galaxy.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /> <img src="https://dev1galaxy.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p>]]></description>
			<author><![CDATA[dummy@example.com (MiyoLinux)]]></author>
			<pubDate>Fri, 07 Jun 2019 21:21:41 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=16370#p16370</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=16366#p16366</link>
			<description><![CDATA[<div class="quotebox"><cite>MiyoLinux wrote:</cite><blockquote><div><p><a href="https://sourceforge.net/projects/miyolinux/files/deb_files/" rel="nofollow">https://sourceforge.net/projects/miyoli … deb_files/</a></p></div></blockquote></div><p>Lintian has some comments about your .deb package:</p><div class="codebox"><pre class="vscroll"><code>E485:~$ lintian --no-tag-display-limit miyo-update-notifier_1.0_all.deb 
E: miyo-update-notifier: changelog-file-missing-in-native-package
E: miyo-update-notifier: file-in-etc-not-marked-as-conffile etc/cron.d/update_notifier
E: miyo-update-notifier: file-in-etc-not-marked-as-conffile etc/xdg/autostart/update-notifier.desktop
E: miyo-update-notifier: no-copyright-file
W: miyo-update-notifier: description-synopsis-starts-with-article
W: miyo-update-notifier: description-too-long
E: miyo-update-notifier: extended-description-is-empty
E: miyo-update-notifier: maintainer-address-missing MiyoLinux
W: miyo-update-notifier: essential-no-not-needed
W: miyo-update-notifier: no-section-field
E: miyo-update-notifier: wrong-file-owner-uid-or-gid etc/ 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid etc/cron.d/ 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid etc/cron.d/update_notifier 1000/1002
E: miyo-update-notifier: bad-permissions-for-etc-cron.d-script etc/cron.d/update_notifier 0755 != 0644
E: miyo-update-notifier: wrong-file-owner-uid-or-gid etc/xdg/ 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid etc/xdg/autostart/ 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid etc/xdg/autostart/update-notifier.desktop 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid usr/ 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid usr/bin/ 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid usr/bin/show-updates 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid usr/share/ 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid usr/share/update-notifier/ 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid usr/share/update-notifier/update-notifier.py 1000/1002
E: miyo-update-notifier: wrong-file-owner-uid-or-gid usr/share/update-notifier/updates.svg 1000/1002
W: miyo-update-notifier: binary-without-manpage usr/bin/show-updates
E: miyo-update-notifier: python-script-but-no-python-dep usr/share/update-notifier/update-notifier.py #!python
W: miyo-update-notifier: executable-not-elf-or-script etc/xdg/autostart/update-notifier.desktop
W: miyo-update-notifier: executable-not-elf-or-script etc/cron.d/update_notifier
W: miyo-update-notifier: executable-not-elf-or-script usr/share/update-notifier/updates.svg
E485:~1$</code></pre></div><p>So I think you need to correct the ownership &amp; permissions for the various files, make the desktop file &amp; .svg non-executable, add a debian/copyright file (GPL ftw!) and debian/conffiles<a href="https://www.debian.org/doc/debian-policy/ch-files.html#configuration-files" rel="nofollow">[1]</a> listing the cron &amp; autostart entries.</p><p>For the description try this in debian/control:</p><div class="codebox"><pre><code>Description: basic update notifier
 A basic update notifier that checks for updates every four hours.
 .
 When updates are available, a notification and icon will appear in the system 
 tray and on the desktop. Clicking the icon in the system tray will present a 
 notification on the desktop that tells what updates are available.
 .
 The user will still need to upgrade their system via the terminal or Synaptic.</code></pre></div><p>HTH</p><p>EDIT: corrected typo in the description.</p>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Fri, 07 Jun 2019 18:00:13 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=16366#p16366</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=16344#p16344</link>
			<description><![CDATA[<p>Hello everyone; I hope you&#039;re doing well! <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>I&#039;ve created&#160; a .deb package for the update notifier that has been discussed here...</p><p>It&#039;s a simple notifier that checks for updates every 4 hours. When updates are available, a desktop notification will appear as well as a system tray notification. If you click on the icon in the system tray, a notification window will open that presents the updates that are available (thanks fsr!). Please be aware that you will still have to update manually through your terminal or Synaptic...it&#039;s just a notifier. <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" />&#160; I chose this route, because I wanted the user to be able to decide if they wanted to install the updates &quot;now&quot; or &quot;later&quot;. </p><p>Also, please be aware that if you&#039;re using an obscure window manager (such as i3), you will need to add the update-notifier.py to your autostart file. The update-notifier.py will be found in /usr/share/update-notifier/</p><p> I would appreciate anyone who is willing to test it for me. <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" />&#160; After installing it, you will need to at least log out and log in for it to start working.</p><p>It can be downloaded from...</p><p><a href="https://sourceforge.net/projects/miyolinux/files/deb_files/" rel="nofollow">https://sourceforge.net/projects/miyoli … deb_files/</a></p>]]></description>
			<author><![CDATA[dummy@example.com (MiyoLinux)]]></author>
			<pubDate>Wed, 05 Jun 2019 06:32:01 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=16344#p16344</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=15759#p15759</link>
			<description><![CDATA[<p>Hi to all, <br />a simpler solution I used with KDE and use now with XFCE is to install the cron-apt package for taking care of the updating part<br />and to add this script to the application autostart settings of the DE:</p><div class="codebox"><pre class="vscroll"><code>#!/bin/sh
NAME=`basename $0`
LIST=`pgrep $NAME`
# Sometimes this process is not killed 
# when you log out of the DE so kill
# any leftovers
for ITEM in $LIST
do
        if [ $ITEM -ne $$ ] ; then
               # I suppose you cannot kill other people&#039;s processes
               # ....unless you are root
                /bin/kill $ITEM
        fi
done

# at KDE start wait 30 secs
sleep 30

while true
do
        NUM=$(aptitude search &quot;~U&quot; | wc -l)
        if [ $NUM -eq 1 ] ; then
                notify-send  -t 590000 &quot;There is $NUM update&quot; &amp;
        fi
        if [ $NUM -gt 1 ] ; then
                notify-send -t 590000 &quot;There are $NUM updates&quot; &amp;
        fi
        sleep 600
done</code></pre></div><p>This could eventually be enhanced to display a list of updates as shown in previous posts and an icon.<br />If I recall correctly notify-send cannot launch an application by clicking on the notification dialog or at least<br />I was not able to find a way do so.</p><p>Just my 2 cents.</p>]]></description>
			<author><![CDATA[dummy@example.com (farmatito)]]></author>
			<pubDate>Mon, 29 Apr 2019 20:22:07 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=15759#p15759</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=15572#p15572</link>
			<description><![CDATA[<p>Tried to map [0][1] to python3, with Gio.Application and its dbus connection, but it seems to need a bit more knowledge. Though, an indicator should be possible without Gtk and AppIndicator3. I just need my basic variant.</p><p>If anyone is interested:</p><p>[0] <a href="https://askubuntu.com/questions/690769/how-to-develop-a-system-indicator-for-unity/752750#752750" rel="nofollow">https://askubuntu.com/questions/690769/ … 750#752750</a><br />[1] <a href="https://github.com/sneetsher/mysystemindicator_minimum/blob/master/indicator-test-service.c" rel="nofollow">https://github.com/sneetsher/mysystemin … -service.c</a></p>]]></description>
			<author><![CDATA[dummy@example.com (geki)]]></author>
			<pubDate>Tue, 16 Apr 2019 17:11:02 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=15572#p15572</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=15571#p15571</link>
			<description><![CDATA[<p>I added AppIndicator3 as tray icon. <strong>UPDATE</strong> Got my problems sorted out. Reorder updating of notification and tray indicator and using Gio.SimpleAction as callback mechanism. <strong>UPDATE #2</strong> Depend on packages ayatana-indicator-application and mate-indicator-applet or xfce-indicator-plugin.&#160; A round of cleanup. <strong>UPDATE #3</strong> mate-indicator-applet needs a <a href="https://github.com/mate-desktop/mate-indicator-applet/issues/42" rel="nofollow">patch</a> to send the &quot;secondary-activate&quot; event. I send the patch to Debian maintainer. Hopefully we will see an update to the package with the patch applied. xfce4-indicator-plugin already generates the &quot;secondary-activate&quot; event.</p><div class="codebox"><pre class="vscroll"><code>#!/usr/bin/env python3

################################################################################
# Configuration Section Begins Here                                            #
################################################################################

config = dict(
    # The title to be shown on the pop-up and the icon tooltip.
    title = &quot;Updates Available&quot;,

    # The message to be shown in the pop-up.
    message = &quot;There are updates available to install.&quot;,

    # Icon to use in the system tray and pop-up.
    icon = &quot;/usr/share/update-notifier/updates.svg&quot;,

    # Frequency to check for available updates.
    #interval = 900, # 15 minutes
    #interval = 14400, # 4 hours
    interval = 3600, # 1 hour

    # Command to run to check for available updates, and the expected status
    # code that indicates updates are available.
    check = &quot;/usr/bin/apt-get -s dist-upgrade | /bin/grep -c &#039;^Inst &#039;&quot;,
)

################################################################################
# Configuration Section Ends Here                                              #
################################################################################

try:
    import gi
    gi.require_version(&#039;Gtk&#039;, &#039;3.0&#039;)
    from gi.repository import Gio, GLib, Gtk
    gi.require_version(&#039;AyatanaAppIndicator3&#039;, &#039;0.1&#039;)
    from gi.repository import AyatanaAppIndicator3 as appindicator

    import sys
    import subprocess
    from time import time
    from random import random
except ImportError:
    print(&quot;Failed to import Gio, GLib, Gtk or AyatanaAppIndicator3 or other helpers&quot;)
    raise NotImplementedError

# hide tray icon from application
def on_action_hide(action, parameter):
    global tray
    tray.set_status(appindicator.IndicatorStatus.PASSIVE)

# hide tray icon from app indicator
def on_menu_hide(menu_item):
    global tray
    tray.set_status(appindicator.IndicatorStatus.PASSIVE)

def on_connect_changed(indicator, connected):
    global app
    if (connected == False):
        print(&#039;packages missing: ayatana-indicator-application and mate-indicator-applet for MATE not installed (other DEs may have similar indicator-applet package for ayatana indicators)&#039;)
        app.quit()

# app indicator tray icon
def tray_icon():
    global config
    tray = appindicator.Indicator.new(&#039;update.notifier.tray&#039;, config[&#039;icon&#039;],
        appindicator.IndicatorCategory.SYSTEM_SERVICES)
    tray.set_title(config[&#039;title&#039;])
    tray.connect(&#039;connection-changed&#039;, on_connect_changed)

    # minimalistic menu for tray
    menu = Gtk.Menu()
    item_hide = Gtk.MenuItem.new_with_label(&#039;Hide&#039;)
    item_hide.connect(&#039;activate&#039;, on_menu_hide)
    menu.append(item_hide)
    menu.show_all()
    tray.set_menu(menu)
    tray.set_secondary_activate_target(item_hide)
    return tray

def query_update():
    global app, tray, config, next_check

    # keep application running
    app.hold()

    if (int(time()) &gt;= next_check):
        status = subprocess.getoutput(config[&#039;check&#039;])

        # Updates?
        if (status != &quot;0&quot;):
            # show tray icon
            tray.set_status(appindicator.IndicatorStatus.ACTIVE)

            # show notification popup
            icon = Gio.Icon.new_for_string(config[&#039;icon&#039;])
            notifier = Gio.Notification.new(config[&#039;title&#039;])
            notifier.set_body(config[&#039;message&#039;])
            notifier.set_default_action(&#039;app.hide&#039;)
            notifier.set_icon(icon)

            app.send_notification(&#039;update-notifier-popup&#039;, notifier)

        next_check = next_check + config[&#039;interval&#039;] + int(random() * 300)

    # keep application running
    app.release()

    return GLib.SOURCE_CONTINUE;

# + 200 for cron job to run at boot
next_check = int(time()) + 200 + int(random() * 300)

# service to run only one instance and allow to functioning as-is
app = Gio.Application.new(&#039;update.notifier.app&#039;, Gio.ApplicationFlags.IS_SERVICE)

# have a globally accessible tray instance 
tray = None

try:
    if (app.register() == True):
        # keep application running
        app.hold()

        # application hide action
        action_hide = Gio.SimpleAction.new(&#039;hide&#039;)
        action_hide.connect(&#039;activate&#039;, on_action_hide)

        app.add_action(action_hide)

        # keep application running
        app.set_inactivity_timeout(180000)

        # hidden tray icon
        tray = tray_icon()

        source_id = GLib.timeout_add_seconds(60, query_update)

        # keep application running
        app.release()
        app.run(sys.argv)

        GLib.source_remove(source_id)
except GLib.Error as e:
    print(&#039;Failed to register service: {0} ({1})&#039;.format(e.message, e.code))

# vim:expandtab</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (geki)]]></author>
			<pubDate>Tue, 16 Apr 2019 09:50:34 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=15571#p15571</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=15067#p15067</link>
			<description><![CDATA[<p>Just for the curious, I ported update notifier to pygobject using glib and gio. There is no longer a status icon. Also posting my cron files for completeness to show how to delay after boot and get an update after some minutes. I have neither seen an update after boot with the pygtk2 version.</p><p>I set my update interval to one hour.</p><div class="codebox"><pre><code>$ cat /etc/cron.d/update_notifier 
@reboot root /etc/cron.hourly/update_notifier</code></pre></div><div class="codebox"><pre><code>$ cat /etc/cron.hourly/update_notifier 
#!/bin/sh

# wait up to 180 seconds to run apt-get

MAILTO=&quot;&quot;

test -x /usr/bin/apt-get || exit 0
/usr/bin/python3 -c &#039;import random; import time; time.sleep(random.random() * 180)&#039; \
	&amp;&amp; /usr/bin/apt-get update</code></pre></div><div class="codebox"><pre class="vscroll"><code>$ cat /usr/share/update-notifier/update-notifier.py
#!/usr/bin/env python3

################################################################################
# Configuration Section Begins Here                                            #
################################################################################

c = dict(
    # The title to be shown on the pop-up and the icon tooltip.
    title = &quot;Updates Available&quot;,

    # The message to be shown in the pop-up.
    message = &quot;There are updates available to install.&quot;,

    # Icon to use in the system tray and pop-up.
    icon = &quot;/usr/share/update-notifier/updates.svg&quot;,

    # Frequency to check for available updates.
    #interval = 900, # 15 minutes
    #interval = 14400, # 4 hours
    interval = 3600, # 1 hour

    # Command to run to check for available updates, and the expected status
    # code that indicates updates are available.
    check = &quot;/usr/bin/apt-get -s dist-upgrade | /bin/grep -c &#039;^Inst &#039;&quot;,
)

################################################################################
# Configuration Section Ends Here                                              #
################################################################################

import gi
gi.require_version(&#039;Gtk&#039;, &#039;3.0&#039;)
from gi.repository import Gio, GLib

import subprocess
from time import time
from random import random

def on_activate(data):
    &#039;&#039;&#039;do nothing&#039;&#039;&#039;

def main_loop():
    global next_check
    if (int(time()) &gt;= next_check):
        status = subprocess.getoutput(c[&#039;check&#039;])

        # Updates?
        if (status != &quot;0&quot;):
            global app
            icon = Gio.Icon.new_for_string(c[&#039;icon&#039;])
            notifier = Gio.Notification.new(c[&#039;title&#039;])
            notifier.set_body(c[&#039;message&#039;])
            notifier.set_icon(icon)

            app.send_notification(&#039;update.popup&#039;, notifier)

        next_check = next_check + c[&#039;interval&#039;] + int(random() * 300)

    return GLib.SOURCE_CONTINUE;

# + 200 for cron job to run after boot
next_check = int(time()) + 200 + int(random() * 300)

# service to run only one instance and allow to functioning as-is
app = Gio.Application.new(&#039;update.notifier&#039;, Gio.ApplicationFlags.IS_SERVICE)

# either notification action or app activate signal
app.connect(&#039;activate&#039;, on_activate)

try:
    if (app.register() == True):
        source_id = GLib.timeout_add_seconds(60, main_loop)

        GLib.MainLoop().run()

        GLib.source_remove(source_id)
except GLib.Error as e:
    print(&#039;Failed to register service: {0} ({1})&#039;.format(e.message, e.code))

# vim:expandtab</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (geki)]]></author>
			<pubDate>Mon, 25 Mar 2019 19:54:45 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=15067#p15067</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=15018#p15018</link>
			<description><![CDATA[<p>Hi all! This is my first post in the forum, glad to be here!</p><p> I have followed the instructions for <strong>Update Notifier</strong>, now I am waiting for some updates to see how it works.<br /> If I understood right, <strong>update-notifier.py</strong> starts at boot time, but does the first <em>apt-get update</em> after 4 hours; or I am wrong and it does the first <em>apt-get update</em> at boot time, and then every 4 hours? If the first is correct, could something be added, so there is an <em>apt-get update</em> 2-3 or 5 minutes after boot time?</p><p> I also have a problem after installing <strong>pk-update-icon</strong> and <strong>unattended-upgrades</strong>, before I found <strong> Update Notifier</strong> in this thread. Now I have uninstalled <strong>pk-update-icon</strong> and <strong>unattended-upgrades</strong>, but in <em>Synaptic</em>, when I click <em>Settings&gt;Repositories</em>, the repositories window does not pop-up, but a &quot;Repositories Changed&quot; window appears. Now I can only use <em>/etc/apt/sources.list</em> to manage repositories.<br /> Can someone help here, or I should better open another thread?</p>]]></description>
			<author><![CDATA[dummy@example.com (vasilis74)]]></author>
			<pubDate>Sat, 23 Mar 2019 16:23:28 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=15018#p15018</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=14393#p14393</link>
			<description><![CDATA[<p>Seeing the cron log reminded me that cron tries to email output from cron jobs to the user it runs as. So if you don&#039;t want the emails just redirect the output to /dev/null (much as the output from the debian-sa1 job is). Or redirect it to a file so you can see it if you want.</p><p>Chris</p>]]></description>
			<author><![CDATA[dummy@example.com (chris2be8)]]></author>
			<pubDate>Sat, 16 Feb 2019 17:47:39 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=14393#p14393</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=14392#p14392</link>
			<description><![CDATA[<div class="quotebox"><cite>franko wrote:</cite><blockquote><div><p>No, the mail is delivered every time a root cron job is done... </p><p>Sorry for raising confusion. XD But I learned something. :-)</p></div></blockquote></div><p>I also learned something. I have no mail. So, what you pointed out is good for me to know.</p><p>I didn&#039;t see it as confusion. <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (MiyoLinux)]]></author>
			<pubDate>Sat, 16 Feb 2019 17:29:23 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=14392#p14392</guid>
		</item>
		<item>
			<title><![CDATA[Re: Software update notifications in XFCE]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=14390#p14390</link>
			<description><![CDATA[<div class="quotebox"><cite>MiyoLinux wrote:</cite><blockquote><div><p>I don&#039;t know...perhaps the mail only goes out once a day?</p><p>Regarding the location of the log...I&#039;m on my phone, so I&#039;m doing this from memory... </p><p>I don&#039;t remember the actual name of the cron log file...but it&#039;s located in /var/log/ and it has &quot;cron&quot; in the name.</p><p>EDITED: Of all things, it&#039;s called <span class="bbc">cron.log</span>&#160; &#160;LOLOLOL! <img src="https://dev1galaxy.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p><p>If it&#039;s not already there, check to see if cron is commented out in the rsyslog.conf file...found in /etc/rsyslog.conf.</p><p>I think you may have to reboot after uncommenting cron in the rsyslog.conf file for it to show up in /var/log.</p></div></blockquote></div><p>No, the mail is delivered every time a root cron job is done... But you ARE right in the end. Last night I was sleepy and I deleted the mail before I checked it, and then commented basing myself on loose observation. Today I was brighter, and I checked the mail and when the various messages were sent: 15:00 and 18:00 h, for now.... and my laptop was on since about 13:00, So it&#039;s obvious I was in error. :-D Sorry for raising confusion. XD But I learned something. :-)</p>]]></description>
			<author><![CDATA[dummy@example.com (franko)]]></author>
			<pubDate>Sat, 16 Feb 2019 17:19:36 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=14390#p14390</guid>
		</item>
	</channel>
</rss>
