From 7e8472e1e2a0b39746ef86c041d56b92bab5a6b7 Mon Sep 17 00:00:00 2001 From: "Christopher R. Nelson" Date: Tue, 21 Jul 2026 11:18:56 -0400 Subject: Wire up cache, file watcher, and Unix socket daemon Adds a gen_server cache holding the rendered menu, an fs/inotify-based watcher that debounces changes and invalidates it, a Unix domain socket serving the cached binary, and the escript client Openbox invokes (with an inline render fallback if the daemon isn't running). Also documents local deployment (systemd user unit, Openbox menu.xml wiring) in the README. Co-Authored-By: Claude Sonnet 5 --- bin/er_xdg_pipe_menu_menu | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/er_xdg_pipe_menu_menu (limited to 'bin') diff --git a/bin/er_xdg_pipe_menu_menu b/bin/er_xdg_pipe_menu_menu new file mode 100755 index 0000000..32a9bd9 --- /dev/null +++ b/bin/er_xdg_pipe_menu_menu @@ -0,0 +1,17 @@ +#!/usr/bin/env escript +%%! -noshell + +%% Openbox pipe menu entry point. Tries the running daemon's Unix +%% socket first; falls back to an inline scan+parse+render if it +%% isn't reachable. See src/er_xdg_pipe_menu_cli.erl for the logic -- +%% this script only wires up the code path to the compiled app. + +main(Args) -> + add_code_paths(), + er_xdg_pipe_menu_cli:main(Args). + +add_code_paths() -> + ScriptDir = filename:dirname(filename:absname(escript:script_name())), + RepoRoot = filename:dirname(ScriptDir), + Pattern = filename:join([RepoRoot, "_build", "default", "lib", "*", "ebin"]), + code:add_pathsz(filelib:wildcard(Pattern)). -- cgit v1.2.3