Files
WorkNote/.obsidian/plugins/obsidian-webpage-export-master/docker/run.sh
2025-04-10 14:07:13 +08:00

15 lines
859 B
Bash

# Copy the plugin and config to the vault, inject script and start Obsidian on startup
mkdir -p /vault/.obsidian/plugins/webpage-html-export
if [ -f /config.json ]; then cp /config.json /vault/.obsidian/plugins/webpage-html-export/data.json; fi
if [ ! -f /vault/.obsidian/plugins/webpage-html-export/main.js ]; then
cp /plugin/* /vault/.obsidian/plugins/webpage-html-export/
else
sed -i 's|callback: () => {|callback: async () => {|1' /vault/.obsidian/plugins/webpage-html-export/main.js
sed -i 's|HTMLExporter.export(true)|await HTMLExporter.export(true)|1' /vault/.obsidian/plugins/webpage-html-export/main.js
fi
python3 -m electron_inject -r /inject-enable.js - obsidian --remote-allow-origins=* --no-sandbox --no-xshm --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer --remote-debugging-port=37941
x11vnc -forever -nopw -create