Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 07-13-2024, 11:01 AM   #1
axlrod
Junior Member
axlrod began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Oct 2011
Location: The Shire
Device: iPad
Library Location Configs Mac

I am developing a bash script for Mac that will allow me to wrap and run a portable version of Calibre on a Mac.

One of the recurring issues I encounter is when the script is used on a new machine. In such cases, it fails to recognize/Volumes/CaliberPortable/Library as the library location, as it has been mounted as "/Volumes/Calibre 1." This necessitates a manual search for the library.

I don't think there is any way to use relative paths; or is there? That would be the ideal solution!

If not, assuming I tracked down all the JSON files and tweaked those usng my wrapper script before Calibre launches, would that be a safe way to change it with the script? Is there a better way?

Also, to update the quick switch menu to additional Libraries, can I just adjust the history.plist file?
axlrod is offline   Reply With Quote
Old 07-14-2024, 12:30 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,542
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look at the calibre-portable.sh script in the resources folder of a calibre install to see how to do it. You just need toset a few env vars
kovidgoyal is offline   Reply With Quote
Advert
Old 07-14-2024, 07:08 PM   #3
axlrod
Junior Member
axlrod began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Oct 2011
Location: The Shire
Device: iPad
I did not realize that might work for a Mac. Are there any detailed instructions for setting that up? I dropped the caliber.app and created the two default directories, I got this far and pressed Ctrl-C:

Code:
$ calibre.app/Contents/Resources/resources/calibre-portable.sh 
Generating default configuration file at /Volumes/PortableCalibre/Books/calibre-portable.conf
Set any non-default options here.
CONFIG FILES:       /Volumes/PortableCalibre/Books/CalibreConfig
--------------------------------------------------
LIBRARY FILES:      /Volumes/PortableCalibre/Books/CalibreLibrary
--------------------------------------------------
SOURCE FILES:       *** Not being Used ***
--------------------------------------------------
PROGRAM FILES:      No portable copy found.
To install a portable copy, run './calibre-portable.sh --upgrade-install'
*** Using system search path instead***
--------------------------------------------------
tr: Illegal byte sequence
TEMPORARY FILES:    /tmp/CALIBRE_TEMP_
--------------------------------------------------

Press CTRL-C if you do not want to continue
Press ENTER to continue and start calibre
The built-in script in resources looks a lot cleaner than my method. If I had a definitive guide on the steps different from Linux on a Mac, I could likely take it from there and stop asking too many questions.

Maybe I need to create a Calibre folder and drop the app in there for the first issue? I imagine not, as I believe it looks for a ${BIN_DIR}/calibre and not a calibre.app, or the system search path for "calibre", or spits out that error.

For the temp directory I am pretty sure I can just tweak the calibre-portable.conf to use CALIBRE_TEMP_DIR="$\(pwd)/CalibreTemp"

Or am I on the wrong path to even try and use that script on a Mac? I might have the skills to work through adding Mac support to the script to work on a Mac once I get this figured out.
axlrod is offline   Reply With Quote
Old 07-15-2024, 12:02 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,542
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No clue, this was a user contributed script. All the env vars it uses are documented in the manual at https://manual.calibre-ebook.com/cus...ment-variables
you can create your own script using them to run calibre with specified config, cache and temp directories, You can specify the path to the library to start with using --with-library.
kovidgoyal is offline   Reply With Quote
Reply

Tags
configuration, mac, portable calibre, scripting


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Library Database location vs Library location (nas) sshaikh Calibre 1 02-01-2023 08:02 PM
My configs and locations? devtech8 Library Management 11 12-24-2018 05:39 AM
Kindle for Mac book folder location Mkoenig Amazon Kindle 12 01-04-2018 10:21 PM
Export configs..? JTAL604622 Calibre 1 07-26-2011 07:48 PM
Windows XP Service Configs Colin Dunstan Lounge 1 08-04-2004 06:50 AM


All times are GMT -4. The time now is 06:54 PM.


MobileRead.com is a privately owned, operated and funded community.