From 928a71365a809373f187651c21eb883959f09b09 Mon Sep 17 00:00:00 2001 From: kbrenner-dev Date: Thu, 19 Mar 2026 12:05:43 +0100 Subject: [PATCH 1/6] fix: correct typo BAISC_MAGENTA -> BASIC_MAGENTA --- cinelog.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinelog.plugin.zsh b/cinelog.plugin.zsh index 7ef69ca..729b2e3 100644 --- a/cinelog.plugin.zsh +++ b/cinelog.plugin.zsh @@ -13,7 +13,7 @@ BOLD='\e[1m' BASIC_RED='\e[31m' BASIC_GREEN='\e[32m' BASIC_BLUE='\e[34m' -BAISC_MAGENTA='\e[35m' +BASIC_MAGENTA='\e[35m' BASIC_CYAN='\e[36m' # Pastel Colors PASTEL_RED='\e[38;2;255;105;97m' From 6783d05c50893a2f4f2213c616763f011660468f Mon Sep 17 00:00:00 2001 From: kbrenner-dev Date: Thu, 19 Mar 2026 12:05:44 +0100 Subject: [PATCH 2/6] fix: add fallback IP detection for non-Linux systems (macOS/BSD) --- http_server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/http_server.py b/http_server.py index fc5da3a..7c0f8d5 100644 --- a/http_server.py +++ b/http_server.py @@ -35,7 +35,14 @@ def do_GET(self): def run_server(port, directory, auth_token): handler = partial(AuthHandler, auth_token=auth_token, directory=directory) - ip = subprocess.check_output("ip route get 1 | awk '{print $7}'", shell=True).decode().strip() + try: + ip = subprocess.check_output("ip route get 1 | awk '{print $7}'", shell=True).decode().strip() + except Exception: + import socket + # Fallback for non-Linux systems (macOS, BSD) + with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s: + s.connect(("8.8.8.8", 80)) + ip = s.getsockname()[0] with socketserver.TCPServer((ip, port), handler) as httpd: print(f"Serving at port {port} with authentication") httpd.serve_forever() From 1476106ec87b71229f6b370d84574fba403323d3 Mon Sep 17 00:00:00 2001 From: kbrenner-dev Date: Thu, 19 Mar 2026 12:07:12 +0100 Subject: [PATCH 3/6] fix: add requirements.txt for hist script (docopt + prompt_toolkit) --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2001fe8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +docopt==0.6.2 +prompt_toolkit>=3.0.0 From 5352b4d98b2a95dff43e44262e0a7cea47d4bf3c Mon Sep 17 00:00:00 2001 From: kbrenner-dev Date: Thu, 19 Mar 2026 12:07:13 +0100 Subject: [PATCH 4/6] docs: clarify Python dependencies installation (prompt_toolkit was missing) --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 960a5e8..af6dc38 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,11 @@ I applied some magic to summon the ingestion of `chapter markers` to the video t 1. Download and install zsh zim framework: `curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh` 2. Remove `compinit` from your .zshrc if needed -3. Install asciinema `apt install asciinema python3-docopt` +3. Install asciinema and Python dependencies: + ```bash + apt install asciinema + pip install -r requirements.txt # installs docopt + prompt_toolkit + ``` 4. Edit .zimrc and add `zmodule cmprmsd/cinelog` 5. Run `zimfw install` to download the plugin from GitHub 6. Start a new terminal From b41fdfd1037699e3f4674b03dc32c2deb6185a33 Mon Sep 17 00:00:00 2001 From: kbrenner-dev Date: Thu, 19 Mar 2026 12:09:19 +0100 Subject: [PATCH 5/6] fix: replace hardcoded ~/.zim/modules/cinelog path with dynamic ${0:A:h} This makes the plugin work with any ZSH plugin manager (oh-my-zsh, antigen, zplug, manual installs) instead of being locked to zim. --- cinelog.plugin.zsh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cinelog.plugin.zsh b/cinelog.plugin.zsh index 729b2e3..e5169fc 100644 --- a/cinelog.plugin.zsh +++ b/cinelog.plugin.zsh @@ -5,6 +5,9 @@ # Author: Sebastian Haas - https://h8.to #################################################### +# Resolve plugin directory dynamically — works with zim, oh-my-zsh, antigen, manual installs, etc. +CINELOG_DIR="${${0:A:h}}" + # Color definitions using 24-bit true color (RGB) RESET='\e[0m' # Resets all attributes BOLD='\e[1m' @@ -69,8 +72,8 @@ here() { alias cs="clear; load_motd" # Interactive history search with graphical Asciinema UI -alias hist="$HOME/.zim/modules/cinelog/hist" -alias histo="$HOME/.zim/modules/cinelog/histo" +alias hist="$CINELOG_DIR/hist" +alias histo="$CINELOG_DIR/histo" # MOTD functionality load_motd() { @@ -151,7 +154,7 @@ else # Check for webserver and spawn if not running if ! ss -tln | grep -q ":${CINELOG_VIEWER_PORT}"; then { - nohup python3 "$HOME/.zim/modules/cinelog/http_server.py" & #>/dev/null 2>&1 & + nohup python3 "$CINELOG_DIR/http_server.py" & #>/dev/null 2>&1 & } &>/dev/null fi export LOGFILE="$LOGDIR/terminal_$(date +%F_%T:%3N).cast" From 4002a48917929d23e03aa0c8ac3c3f7cdc906163 Mon Sep 17 00:00:00 2001 From: kbrenner-dev Date: Thu, 19 Mar 2026 12:09:20 +0100 Subject: [PATCH 6/6] fix: replace hardcoded ~/.zim path in http_server.py with dynamic script-relative path --- http_server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/http_server.py b/http_server.py index 7c0f8d5..ea284c1 100644 --- a/http_server.py +++ b/http_server.py @@ -50,7 +50,11 @@ def run_server(port, directory, auth_token): if __name__ == "__main__": port = int(os.environ.get('CINELOG_VIEWER_PORT', 10000)) auth_token = os.environ.get('CINELOG_AUTH_UUID') - directory = os.path.expanduser("~/.zim/modules/cinelog/asciinema-player") + # Use CINELOG_DIR env var if set (exported by the zsh plugin), otherwise fall back to + # a path relative to this script's location — works regardless of plugin manager. + script_dir = os.path.dirname(os.path.realpath(__file__)) + directory = os.environ.get('CINELOG_DIR', script_dir) + directory = os.path.join(directory, 'asciinema-player') if not auth_token: print("Error: CINELOG_AUTH_UUID environment variable not set")