From 55f9e7fffcdabee1fa470839d27d75c00d6e3702 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Wed, 17 Jan 2024 20:39:54 +0100 Subject: [PATCH] add python example --- scripts/task_runner.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/task_runner.py diff --git a/scripts/task_runner.py b/scripts/task_runner.py new file mode 100755 index 00000000..c69dc630 --- /dev/null +++ b/scripts/task_runner.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import json +import sys + +# install plyer: pip install plyer +from plyer import notification + + +def send_notification(title, message): + notification.notify( + title=title, + message=message, + timeout=10 + ) + + +if __name__ == "__main__": + title = "ffplayout - current clip:" + input_data = json.loads(sys.argv[1]).get('current_media') + + if input_data is not None: + # print(input_data['source']) + + send_notification(title, f"Play: \"{input_data['source']}\"")