How to use libsushi in elementary?

What’s the suggested approach to communicate with the Gnome Sushi dbus service on elementary via Vala? Which packages need to be installed for this?

More detail

I’d love to integrate libsushi into elementary using vapigen. Although I never did this before, I guess the approach should be similar to what was done for libgnomekbd in switchboard-plug-keyboard.

However, there it needs a libgnomekbd-dev package installed as dev dependency - but I was not able to find any package alike for sushi (I’m on elementary 5.1 Hera, which is based on Ubuntu 18.04 LTS).

That said, I’m a bit lost how to get started to eventually build a plugin for elementary Files which adds file preview using sushi on elementary OS as described here.

FWIW: I already asked this question in the sushi repo and was sent here for help.

It’s possible that libgnomekbd provides a C library that wraps its DBus API, while Sushi does not and expects you to call into the D-Bus API directly.

What does libsushi do?

1 Like

As you already mentioned sushi is a dbus service, so you use it via dbus and not via libsushi (which is private).

See here for examples on how to use dbus from vala. The interface definition xml for sushi is here. You can write the vala interface yourself or generate it using vala-dbus-binding-tool

Thank you for this insightful answer! This should be enough information to get me going :tada:

I was able to hack together a quick proof of concept and as you can see in the Screen below it’s working. Two follow up questions:

  1. Is it possible to somehow mitigate the window repositioning right after Sushi is started (see Screen below)?
  2. How can I customize the appearance of Sushi? Right now it looks quite dark.

1 Like

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