[Librem-5-dev] A few questions about development

Guido Günther agx at sigxcpu.org
Wed Jan 23 08:55:32 PST 2019


Hi,
On Wed, Jan 23, 2019 at 09:34:10AM -0700, Chris Hessing via Librem-5-dev wrote:
> Hello all,
[..snip..]
> 1. Is there any good way to detect that the device the app is running on is
> a Librem 5? --  I may be off about the intent here, but I suspect that apps
> running on the Librem are expected to run full screen.  So, being able to
> detect the device would allow me to put some special Librem 5 code in to run
> the app fullscreen.

The compositor will handle making the window large (maximized, not
fullscreen) for you to use all available space. You can already see that
in the qemu image.

> 2. How are apps expected to terminate when running? --  I ran in to a couple
> of problems that prompted this question.   First, when I built the Qt app on
> the emulator and ran it, the title bar was tiny, and there was no "X" button
> visible, so no obvious way to close the app.   Second, when I added code to
> show the app full screen, Qt removes the title bar completely, so again,
> there was no way to close the app.   If apps are expected to be closed using
> the "X" button, I can change the way it goes full screen to keep the title
> bar, but that just runs me in to the first issue in this list.

Users will be able to close apps from the home screen.

> 2a. Is it expected that Qt developers will use the KDE Kirigami framework
> (or some other framework) to make apps look/work properly on the
> device?

I can't comment on Qt development.

> 
> 2b. If a specific framework is expected, can you provide any useful links to
> examples of how to install it in a dev environment?   (Or, even tell me if a
> certain Linux distro is a good one to use as it is easy to set up the
> development environment.   When it comes to development resources, I have a
> ton of hardware (and the power bill to prove it!), but not a ton of
> time. ;)

We're using GTK+ for the apps. There's documentation on
developer.puri.sm on how to set that up. Debian and PureOS are good
choices but every Debian based distro should work. Make sure it's recent
if you want to build natively (e.g. Debian buster).

> 3. According to the developer documentation, apps can be distributed either
> as flatpak or .deb packages.  The app I am working on will require more
> components of Qt than what are installed on the emulator by default.   If I
> package the app as a .deb, will the phone properly handle asking for root
> permissions to install the extra packages?   Or do I need to use a
> flatpak?   (I have no experience with either packaging method, so I'd like
> to avoid learning one and finding out that it won't work.   Right now, I am
> leaning towards creating a .deb as I suspect there is more information
> available on how to do it.)

(Note: I don't know details about the possible app store formats this is
just how flatpak/debs work):

When using flatpak you can use what the provided runtimes ship. We will
have a runtime that is similar to the GNOME ones. You can also bundle
additional dependencies in your flatpak. See how chatty does this for
libhandy:

    https://source.puri.sm/Librem5/chatty/blob/master/sm.puri.Chatty.json#L58

When using debs declare the necessary dependencies on the package and
things will be pulled in when the package is installed. Look e.g. how
phosh pulls in an additional font package here:

    https://source.puri.sm/Librem5/phosh/blob/master/debian/control#L26

> 4. After sliding up the key guard and entering the PIN, you are presented
> with (on the emulator) a screen with a title bar, and some buttons in the
> footer, but is otherwise blank.   Is the idea that apps will show up on that
> screen?

Yes.

> 5. When installing an app, what should the app be doing to have its icon
> show up in the appropriate place?

Nothing. The shell will handle this in the future when your app provides
a desktop file. For the moment you can use gsettings to add it to the
favorites list:

    https://source.puri.sm/Librem5/phosh/issues/3#note_15208

Hope that helps,
 -- Guido


More information about the Librem-5-dev mailing list