some random stuff. caelestia incoming

This commit is contained in:
voidarclabs
2025-08-21 17:40:48 +01:00
parent 12df9a0b6e
commit 1cc414a96a
1308 changed files with 217219 additions and 8 deletions

31
.config/scripts/notify.py Normal file
View File

@@ -0,0 +1,31 @@
import asyncio
import subprocess
import os
from aiohttp import ClientSession
from aiontfy import Ntfy, Event, Notification
TOPICS = ["android-notifications"]
NTFY_URL = "https://ntfy.voidarc.co.uk"
def send_notification(ntfy_notif: Notification):
title = ntfy_notif.title or "ntfy"
message = ntfy_notif.message or ""
subprocess.Popen(["notify-send", "-i", "phone", title, message])
os.system("pw-cat -p ~/.local/share/sounds/notif.mp3")
async def main():
async with ClientSession() as session:
ntfy = Ntfy(NTFY_URL, session)
def callback(ntfy_notif: Notification):
if ntfy_notif.event is Event.MESSAGE:
send_notification(ntfy_notif)
await ntfy.subscribe(
TOPICS,
callback, # this is now a regular function
)
if __name__ == "__main__":
asyncio.run(main())