mirror of
https://github.com/9001/copyparty.git
synced 2025-10-03 09:49:29 +02:00
add event hooks
This commit is contained in:
parent
70f1642d0d
commit
f8e3e87a52
13 changed files with 591 additions and 22 deletions
30
bin/hooks/notify.py
Normal file
30
bin/hooks/notify.py
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue