From 15e87e332f2fc971ce4f8af35adf9f10af4460b1 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Mon, 13 May 2024 14:09:30 -0400 Subject: [PATCH] Experiment with re-org-ing scripts --- install-linux.sh | 3 --- mini_apps/README.md | 5 +++++ .../daily-digest}/ewp-generate-article-digest | 3 +++ {scripts => mini_apps/memegen/bin}/memegen | 6 ++++-- .../memegen/data}/fonts/impact.ttf | Bin .../data}/templates/bernie-asking/config.json | 0 .../data}/templates/bernie-asking/template.png | Bin .../data}/templates/hotline-bling/config.json | 0 .../data}/templates/hotline-bling/template.png | Bin .../memegen/data}/templates/megamind/config.json | 0 .../memegen/data}/templates/megamind/template.png | Bin 11 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 mini_apps/README.md rename {scripts => mini_apps/daily-digest}/ewp-generate-article-digest (98%) rename {scripts => mini_apps/memegen/bin}/memegen (97%) rename {configs/memegen => mini_apps/memegen/data}/fonts/impact.ttf (100%) rename {configs/memegen => mini_apps/memegen/data}/templates/bernie-asking/config.json (100%) rename {configs/memegen => mini_apps/memegen/data}/templates/bernie-asking/template.png (100%) rename {configs/memegen => mini_apps/memegen/data}/templates/hotline-bling/config.json (100%) rename {configs/memegen => mini_apps/memegen/data}/templates/hotline-bling/template.png (100%) rename {configs/memegen => mini_apps/memegen/data}/templates/megamind/config.json (100%) rename {configs/memegen => mini_apps/memegen/data}/templates/megamind/template.png (100%) diff --git a/install-linux.sh b/install-linux.sh index 20cb3e5..52efe20 100644 --- a/install-linux.sh +++ b/install-linux.sh @@ -129,9 +129,6 @@ if [ -d ~/.var/app/org.prismlauncher.PrismLauncher ]; then flatpak override --user --filesystem=~/.config/minecraft org.prismlauncher.PrismLauncher fi -# Memegen -ln -nsf $EWCONFIG_ROOT/configs/memegen ~/.config/memegen - # Tmux ln -sf $EWCONFIG_ROOT/configs/tmux/.tmux.conf ~/.tmux.conf diff --git a/mini_apps/README.md b/mini_apps/README.md new file mode 100644 index 0000000..47c14c8 --- /dev/null +++ b/mini_apps/README.md @@ -0,0 +1,5 @@ +# Mini Apps + +This directory contains things that are too complex to be considered a "script", yet too personalized to be useful to anyone else. + +I may occasionally promote things from here to actual public repos someday. \ No newline at end of file diff --git a/scripts/ewp-generate-article-digest b/mini_apps/daily-digest/ewp-generate-article-digest similarity index 98% rename from scripts/ewp-generate-article-digest rename to mini_apps/daily-digest/ewp-generate-article-digest index a2a0b62..8507098 100755 --- a/scripts/ewp-generate-article-digest +++ b/mini_apps/daily-digest/ewp-generate-article-digest @@ -6,6 +6,9 @@ import requests import feedparser import json import sqlite3 +import subprocess +import smtplib +from datetime import datetime from pathlib import Path logger = logging.getLogger(__name__) diff --git a/scripts/memegen b/mini_apps/memegen/bin/memegen similarity index 97% rename from scripts/memegen rename to mini_apps/memegen/bin/memegen index ae77f67..470d3d5 100755 --- a/scripts/memegen +++ b/mini_apps/memegen/bin/memegen @@ -12,7 +12,7 @@ from enum import Enum from datetime import datetime logger = logging.getLogger(__name__) -CONFIG_DIR = Path("~/.config/memegen").expanduser() +CONFIG_DIR = Path(__file__).parent.parent / "data" DEFAULT_OUTPUT_DIR = Path("~/Pictures/memes").expanduser() @@ -151,7 +151,9 @@ def main() -> int: "--keep-case", help="Keep the case of the text", action="store_true" ) ap.add_argument("--output", "-o", help="Output file path") - ap.add_argument("--no-show", help="Don't show the image after creation", action="store_true") + ap.add_argument( + "--no-show", help="Don't show the image after creation", action="store_true" + ) ap.add_argument( "-v", "--verbose", help="Enable verbose logging", action="store_true" ) diff --git a/configs/memegen/fonts/impact.ttf b/mini_apps/memegen/data/fonts/impact.ttf similarity index 100% rename from configs/memegen/fonts/impact.ttf rename to mini_apps/memegen/data/fonts/impact.ttf diff --git a/configs/memegen/templates/bernie-asking/config.json b/mini_apps/memegen/data/templates/bernie-asking/config.json similarity index 100% rename from configs/memegen/templates/bernie-asking/config.json rename to mini_apps/memegen/data/templates/bernie-asking/config.json diff --git a/configs/memegen/templates/bernie-asking/template.png b/mini_apps/memegen/data/templates/bernie-asking/template.png similarity index 100% rename from configs/memegen/templates/bernie-asking/template.png rename to mini_apps/memegen/data/templates/bernie-asking/template.png diff --git a/configs/memegen/templates/hotline-bling/config.json b/mini_apps/memegen/data/templates/hotline-bling/config.json similarity index 100% rename from configs/memegen/templates/hotline-bling/config.json rename to mini_apps/memegen/data/templates/hotline-bling/config.json diff --git a/configs/memegen/templates/hotline-bling/template.png b/mini_apps/memegen/data/templates/hotline-bling/template.png similarity index 100% rename from configs/memegen/templates/hotline-bling/template.png rename to mini_apps/memegen/data/templates/hotline-bling/template.png diff --git a/configs/memegen/templates/megamind/config.json b/mini_apps/memegen/data/templates/megamind/config.json similarity index 100% rename from configs/memegen/templates/megamind/config.json rename to mini_apps/memegen/data/templates/megamind/config.json diff --git a/configs/memegen/templates/megamind/template.png b/mini_apps/memegen/data/templates/megamind/template.png similarity index 100% rename from configs/memegen/templates/megamind/template.png rename to mini_apps/memegen/data/templates/megamind/template.png