Change notification duration

This commit is contained in:
Loic Guegan 2020-05-16 11:08:47 +02:00
parent ba6a3ff28d
commit 81a1645bde

View file

@ -4,14 +4,13 @@ import berserk, subprocess
# Change ACCESS TOKEN according to your need # Change ACCESS TOKEN according to your need
ACCESS_TOKEN="" ACCESS_TOKEN=""
NOTIFY_DURATION=5*60 # Notification duration in seconds
# Notify using notify-send # Notify using notify-send
def notify_send(summary, message): def notify_send(summary, message):
subprocess.Popen(['notify-send', '-u', 'critical','-t', '99999999', summary, message]) subprocess.Popen(['notify-send', '-u', 'critical','-t', str(NOTIFY_DURATION*1000), summary, message])
return return
# Fetch data and notify # Fetch data and notify
session = berserk.TokenSession(ACCESS_TOKEN) session = berserk.TokenSession(ACCESS_TOKEN)
client = berserk.Client(session=session) client = berserk.Client(session=session)