add event hooks

This commit is contained in:
ed 2023-01-22 23:35:31 +00:00
parent 70f1642d0d
commit f8e3e87a52
13 changed files with 591 additions and 22 deletions

30
bin/hooks/notify.py Normal file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env python3
import sys
from plyer import notification
_ = r"""
show os notification on upload; works on windows, linux, macos
depdencies:
python3 -m pip install --user -U plyer
example usage as global config:
--xau f,bin/hooks/notify.py
example usage as a volflag (per-volume config):
-v srv/inc:inc:c,xau=f,bin/hooks/notify.py
parameters explained,
xau = execute after upload
f = fork so it doesn't block uploads
"""
def main():
notification.notify(title="new file uploaded", message=sys.argv[1], timeout=10)
if __name__ == "__main__":
main()