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.