add proto_command option and use it for termine
This commit is contained in:
@@ -134,6 +134,9 @@ def conf2top(top):
|
||||
if "command" in top:
|
||||
body = subprocess.run(top["command"], shell=True, text=True, capture_output=True, check=True).stdout
|
||||
|
||||
if "proto_command" in top:
|
||||
protostub = subprocess.run(top["proto_command"], shell=True, text=True, capture_output=True, check=True).stdout
|
||||
|
||||
return Top(top["title"], sender, body, protostub)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -45,6 +45,7 @@ post_tops:
|
||||
- title: Termine
|
||||
file: "data/termine.txt"
|
||||
#command: "./list_termine.sh" # if khal is setup correctly, uncomment this to read events from there
|
||||
#proto_command: "./list_termine_proto.sh"
|
||||
protostub: '{|
|
||||
|
||||
{{"{{"}}Termin|was=AAAAAAAAAA|wann=XX.YY.{{"}}"}}
|
||||
|
||||
4
list_termine_proto.sh
Executable file
4
list_termine_proto.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh -e
|
||||
echo "{{'{{'}}"
|
||||
khal list --day-format "" --format "{{{{'{{{{'}}}}Termin|was={title}|wann={start}{{{{'}}}}'}}}}" -a calendars_fsmi today 30d | grep -v Fachschaftsrat
|
||||
echo "{{'}}'}}"
|
||||
Reference in New Issue
Block a user