add python example
This commit is contained in:
parent
415d79ecbc
commit
55f9e7fffc
25
scripts/task_runner.py
Executable file
25
scripts/task_runner.py
Executable file
@ -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']}\"")
|
Loading…
Reference in New Issue
Block a user