View Single Post
Old 06-28-2017, 07:37 PM   #45
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
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
eschwartz is offline   Reply With Quote