FWIW I quite want calibre to be able to connect to a running server instance, and I hope Kovid eventually gets that working.
In the meantime, I have updated my calibre wrapper script to accommodate the server:
Code:
#!/bin/bash
eval $(systemctl --user show calibre-server -q -p ActiveState)
toggle-server() {
local action=$1
if [[ $ActiveState = active ]]; then
systemctl --user $action calibre-server
fi
}
toggle-server stop
if [ $# -eq 0 ] || [[ "$1" = "--detach" ]]; then
echo -e "\n\n\nStarting calibre at $(date).\n\n\n" >> "/tmp/calibre-debug-$USER.log" 2>&1
# FIXME: Once calibre supports running the GUI with a server database, we can stop doing this.
if [[ $ActiveState = active ]]; then
echo -e "Pausing the systemd-managed server due to calibre v3 restraints.\n" >> "/tmp/calibre-debug-$USER.log" 2>&1
echo -e "FIXME: Once calibre supports running the GUI with a server database, we can stop doing this.\n\n\n" >> "/tmp/calibre-debug-$USER.log" 2>&1
fi
calibre-debug -g 2>&1 | tee -a "/tmp/calibre-debug-$USER.log"
else
/usr/bin/calibre "$@"
fi
toggle-server start