Browse Source

initial commit

Sebastian Vendt 1 năm trước cách đây
commit
8b2a744d5d

+ 28 - 0
scripts/joplinRemoveCheckedItems.py

@@ -0,0 +1,28 @@
+#!/usr/bin/python2.7
+
+import sys
+import os
+
+def remove_checked_items(file_path):
+    try:
+        with open(file_path, 'r') as file:
+            lines = file.readlines()
+        with open(file_path, 'w') as file:
+            for line in lines:
+                if not line.startswith("- [x]"):
+                    file.write(line)
+    except FileNotFoundError:
+        sys.stderr.write("File not found: {}".format(file_path))
+    except Exception as e:
+        sys.stderr.write("An error occurred: {}".format(str(e)))
+
+
+if __name__ == "__main__":
+    if len(sys.argv) != 2:
+        print("Usage: python remove_checked_items.py <file_path>")
+    else:
+        #if os.environ.get('REMOVE_CHECKED') is not None:
+        file_path = sys.argv[1]
+        remove_checked_items(file_path)
+        #else:
+        #    print("No environment variable set to define behavior")

+ 9 - 0
scripts/joplinRemoveCheckedItemsWrapper.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+
+joplin sync > /dev/null
+joplin config editor /root/scripts/JoplinAutomate/scripts/joplinRemoveCheckedItems.py > /dev/null
+#Shared Notes/Einkaufen Essen
+joplin edit 1321a101e1954c29be381a9d3dd2c30c 2>&1 > /dev/null
+joplin config editor /bin/nano > /dev/null
+joplin sync > /dev/null

+ 4 - 0
scripts/liste1.md

@@ -0,0 +1,4 @@
+Einkaufen Essen
+
+- [ ] Zahnstocher
+- [ ] Sekt

+ 11 - 0
scripts/liste2.md

@@ -0,0 +1,11 @@
+Einkaufen Essen
+
+- [x] Pfefferkörner
+- [ ] Zahnstocher
+- [x] Zwiebeln
+- [x] Knoblauch
+- [x] rosato
+- [x] Kölln knusperkeks
+- [x] Graukäse
+- [ ] Sekt
+- [x] Filterkaffee