Where is sushi typelib?

As we know nautilus and sushi cant support preview .epub file, so I want to write a extension for quick look .epub book(focus on epub file convert service)

To reduce workload, I try to apply sushi window for preview file, located at /src/ui.

src/ui
├── application.js
├── fallbackRenderer.js
├── main.js
├── mainWindow.js
├── mimeHandler.js
├── renderer.js
└── utils.js
const {Gdk, Gio, GLib, GObject, Gtk, Sushi} = imports.gi;
const Constants = imports.util.constants;
const MimeHandler = imports.ui.mimeHandler;
const Renderer = imports.ui.renderer;
const Utils = imports.ui.utils;

I searched online and found that GJS can run .js file directly. Considering import module search path like above, so I try to run command

cd src
pwd
./src
gjs ui/mainWindow.js ./

then I get message below, it indicates that missing Sushi typelib.

(gjs:47777): Gjs-WARNING **: 16:30:19.251: JS ERROR: Error: Requiring Sushi, version none: Typelib file for namespace 'Sushi' (any version) not found
@ui/mainWindow.js:26:47
(gjs:47777): Gjs-CRITICAL **: 16:30:19.251: Script ui/mainWindow.js threw an exception

I know gjs search typelib path is /lib/x86_64-linux-gnu/girepository-1.0, so I want to get a Sushi.typelib to put it in this lib directory. but i cant find Sushi.typelib anywhere.

my device is ubuntu 20.04, I install sushi through the package manager sudo apt install gnome-sushi. Where is my sushi typelib. Do I need to generate it from a .so shared library myself? but where is sushi .so libray?

I am a newbie to gnome, I am sorry that my question might be low level.

The Sushi typelib and .so are internal to Sushi, so I’m not sure it was ever intended to be used a public library. You may have some difficulties trying to use it as a library in another application.

In any case, it should be in ${LIBDIR}/sushi/girepository-1.0/.

Thank you for your help, followed your answer, I have found the Sushi.typelib and Sushi.so. and copy them to assigned directory.

That’s a terrible idea: Sushi’s typelib and shared library are not for general consumption. They are an internal, implementation detail of Sushi itself, and are not meant to be used by other applications.

1 Like

Hi, ebassi, Nice to meet you, I just asked your for help in Matrix(I know you from YouTube), Can I ask you specific questions in details? now sushi typelib file is enough for me to import manual in GJS and custom js code , I have basically achieved my goal to preview .epub file. But now I have trouble to generate gir file with class and function myself. I’m trying to simplify File Roller as a base class, then generate gir/typelib file, Finally, sushi can import it and preview compress files.

You’re doing something wrong, unless you’re literally writing Sushi itself.

FileRoller is another application: you can’t use it as a library.

If you want to add compressed file formats, you can look at libarchive.

Can you explain what are you trying to achieve? What are you writing?

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.