aboutsummaryrefslogtreecommitdiff
path: root/sorter
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukasz.kasprzak@pm.me>2026-04-13 17:37:26 +0200
committerLukasz Kasprzak <lukasz.kasprzak@pm.me>2026-04-13 17:37:26 +0200
commit51d43498b07dc97d795947964534f0903cd05db5 (patch)
tree735712bd50b5c244ef922a3b873c709ecce604cd /sorter
parent39711cf6c2ec5a3b4480dcb4800cc3802bda5bf2 (diff)
downloadbin-51d43498b07dc97d795947964534f0903cd05db5.tar.gz
bin-51d43498b07dc97d795947964534f0903cd05db5.zip
routine backup
Diffstat (limited to 'sorter')
-rw-r--r--sorter/rules.toml13
-rw-r--r--sorter/sort_downloads.py5
2 files changed, 16 insertions, 2 deletions
diff --git a/sorter/rules.toml b/sorter/rules.toml
index 0c0a7ac..ae1cbfd 100644
--- a/sorter/rules.toml
+++ b/sorter/rules.toml
@@ -29,6 +29,15 @@ supported_extensions = [
".xls",
".md",
".odt",
+ ".sh",
+ ".py",
+ ".js",
+ ".ts",
+ ".html",
+ ".css",
+ ".json",
+ ".yaml",
+ ".toml",
]
# ── Categories ────────────────────────────────────────────────────────────────
@@ -79,6 +88,10 @@ filename_keywords = [
"akw",
]
+[[categories]]
+name = "Code"
+description = "Scripts and source code files"
+filename_keywords = [".sh", ".py", ".js", ".ts", ".html", ".css", ".json", ".yaml", ".toml"]
# ── Add more categories below ─────────────────────────────────────────────────
# [[categories]]
diff --git a/sorter/sort_downloads.py b/sorter/sort_downloads.py
index 10cc696..1ced5e3 100644
--- a/sorter/sort_downloads.py
+++ b/sorter/sort_downloads.py
@@ -215,11 +215,11 @@ def main():
sys.exit(1)
parser = argparse.ArgumentParser(
- description="Sort ~/Downloads using rules defined in rules.toml"
+ description="Sort ~/downloads using rules defined in rules.toml"
)
parser.add_argument(
"--dir",
- default=str(Path.home() / "Downloads"),
+ default=str(Path.home() / "downloads"),
help="Path to Downloads folder (default: ~/Downloads)",
)
parser.add_argument(
@@ -246,6 +246,7 @@ def main():
extensions = set(config.get("supported_extensions", [
".pdf", ".docx", ".doc", ".txt", ".xlsx", ".xls", ".md", ".odt"
+ ".sh", ".py", ".js", ".ts", ".html", ".css", ".json", ".yaml", ".toml"
]))
if args.list_rules: