Flatseal 1.6.0 and beyond

It’s been five months since the original release of Flatseal. Seventeen releases later, this project has evolved incredibly fast thanks to the Flatpak community.

Flatseal is a graphical utility to review and modify basic permissions from your Flatpak applications.

When I started this project as a weekend-long challenge, I considered the possibility of creating something useful but, I clearly did not expect such overwhelming reception.

From the first Flathub discourse members testing it, to having a humble chunk of the Flatpak community using and recommending it, this has been a really fun experience that I’d love to share in more detail at some point.

For now, I would simply like to thank everyone who contributed so far and share the new things coming with the 1.6.0 release.

So, what’s new?

The biggest change in this release is the complete rewrite of how Flatseal manages and mixes permissions and overrides. This is one of those things that no one should ever notice, when it goes well of course. In this case though, these changes makes it easier to expand Flatseal with new override options and, more importantly, to maintain it.

To put these changes to test, I added support for two new overrides options: persistent  homedir-relative paths and environment variables.

You can add new persistent homedir-relative paths. Even though this override is not the most commonly used one, it has proven to be quite useful. Thanks to @ManIVIctorious for the suggestion.
You can add, remove or modify the environment variables that are exported to the application. Thanks to @trashcan55 for the suggestion. I have been using this quite a lot myself to debug Flatseal.

Another key feature, made possible with the rewrite, is that Flatseal is now fully aware of overrides that it doesn’t support. If you have been using Flatseal and flatpak-override CLI together you know exactly what I am talking about.

Before this release, Flatseal would only load the overrides that it did support, and later drop the ones that didn’t. Of course this caused confusion and headaches to people using both tools. Well, these will be kept intact from now on, making Flatseal future proof at the same time.  Thanks @WhyNotHugo for highlighting this issue.

Before moving on to other changes, I would really like to give special thanks to Tobias Bernard @bertob for all the design ideas, mockups and feedback from the very beginning of this project.

Talking about Tobias and his ideas, now Flatseal displays basic information for applications. Aside for the obvious usefulness of this information, e.g. for troubleshooting, I like to see this as a small tribute to applications developers.

The title, author, version, last-updated date and Flatpak runtime are now displayed.

Moving on, another quite popular family of requests from the community has been to include application-management features, e.g. options to uninstall or launch an application. Even though I understand why it would make sense to have those, I decided to draw a line and keep Flatseal focused on managing permissions. Well, that was until @Johnn3y suggested to add a show details button, which is a good compromise.

This button will redirect you to the software manager page for the application, where you can launch, update or uninstall the application. For the time being, only GNOME Software is supported since it provides API for doing this, but I am looking forward to add support for others if possible.

As part of this change, I had to reconsider how to display these buttons, so that there would be enough space left in the top header bar in mobile mode. To solve this, Tobias suggested to move these buttons to a separate action bar at the bottom.

Having these buttons down there solves the space problem, and also improves Flatseal ergonomics when used on a phone.

Another small change I managed to land last minute was to rename permissions references. Instead of showing something like features=bluetooth, it will now show allow=bluetooth which is what you would use from flatpak-override or flatpak-run CLI. Thanks to @digitalethics for the suggestion.

Last but not least, special thanks to @eson57, @MiloCasagrande, @AsciiWolf, @ovari, @cho2 and others for keeping an eye on Flatseal and helping me with translations!

So, What’s next?

Well, for the short term I will keep adding support for more overrides requested by the community.

For the longer term though, considering that I now have a better idea of how to model this problem and, that other projects have found Flatseal source code useful to kickstart their permissions managers, I think it would be interesting to consider moving Flatseal backend to an introspectable library, to make things easier for other projects. But, let’s see if there’s interest for that.

Sugar Learning Tools – Part II

It’s been many months since my visit to Barcelona and the Linux App Summit. Since then, I got unexpectedly distracted by another project , started a new job and, well, COVID-19 happened.

But, even before all that, a lot of progress was made to bring Sugar applications to the desktop with Flatpak and Flathub. I thought it would be worth sharing the progress.

Here’s a quick summary:

  • Twenty applications were ported, with the help of Google Code-In students, and are now available on Flathub.
  • Identified the most common issues of running these applications outside of Sugar. Many of those issues are handled nicely by Sugarapp now.
  • Made several upstream contributions, which also benefits other Sugar Labs community efforts.
  • The process of porting applications is decently documented.
  • Started making these Flatpak bundles easier to maintain.
  • Nowhere near to support collaboration yet.

Here’s an overview of these applications:

Abacus it quite self explanatory. What’s remarkable about this application, is that it includes a tool to build a custom abacus. Fun fact, many years ago, it was used by teachers from Caacupé – Paraguay, to build their own abacus to handle fractions. The Caacupé abacus has been part of this application since then.

Chart is a simple tool to visualize data. What’s nice about this application is that the learner can take data from other Sugar applications and visualize it. Works with the most classic visual representations.

ColorDeducto is not the typical learning tool. It’s a challenging game about recognizing patterns and developing inductive logic.  Something cool about this application is that the learner can create custom patterns using Python. The application was ported by our all-star Google Code-In winner Srevin Saju.Dimensions is a fun pattern-matching game. The learner can compete against an AI, and it can be quite challenging as categories, difficulty levels and timers start mixing .

Finance is an interesting take on learning by doing. This application can help the learners to manage a real budget, and use basic home-finance concepts while they’re at it. Another awesome port by Srevin, by the way.

FotoToon lets the learner create their own comics. It’s simple and fun.  These comics can be saved to many formats, including video. A popular choice nowadays, with everyone spamming memes at each other, haha.

What to say about FractionBounce, learn the concepts of fractions and percentages while kicking a football? It can never go wrong. Yet another port from Srevin.

Implode is a tetris-like game. Dear learner, watch out for this application, it’s quite entertaining. Don’t let anyone try it on your computer, they might not give it back for a while, hah.

Maze is a simple game but, activate these mines, turn off back tracking and go crazy with that difficulty button. It will blow anyone’s mind. This application was ported by Marcus Chong, another brilliant student and one of our runner up winners.

We are half way through the list, so let’s take a little breath and remind you that if you don’t have high school students contributing to your project, you’re really missing out.

Alright, let’s continue.

Measure is one of my personal favorites. This application bridges the real world and the digital world. The learner can visualize their own voice, tune instruments, and record and export that data to visualize it with the Chart application.

Memorize is more than just a pair-finding game, it’s a tool to create these games. Learners can mix sounds, images, text, text to speech and send these games to their friends.

Another personal favorite, Music Keyboard. Simply put, converts the learners computers into more than thirty instruments. They can record and share their masterpieces. Fun fact, my 4 year old nephews approved it, very loudly.

Physics is the perfect example of playful learning. It’s simply a physics sandbox. Learners can create structures, machines and simulations. Of course, they can also watch it all crumble, hah.

I suppose is no surprise that Pippy is my personal absolute favorite. Lets the learners write and run Python scripts in a surprisingly simple way. It comes packed with tutorials for writing Python games, physics simulations, and even GTK applications.

ReadETexts does many things. Helps the learner find books from a freely-available catalog of thousands of books. It downloads the books and it can even read them with a delightful robotic voice, hah. Works with dozens of languages. Another application ported with the help of Srevin.

It can’t never hurt to have a slipstick calculator available right? hah. I think it’s a great example of many other Sugar applications, tiny curiosity-driven tools. Sliderule is another port from Marcus.

Speak is another personal favorite. It engages the learner to write and read, while conversing with Alice, a bot with a particular sense of humor. It works in many different languages.

Story is probably one of most lovely applications I ported.  The premise is quite simple, it randomly generates a sequence of images and asks the learner to create a story that connect these images. They can record their voices or use text.

Turtle in a Pond is a gem in disguise. At first sight is simply a game about trying to catch a turtle before it runs away. The real fun though, is when the learner realizes that is possible to write Python code to make the turtle smarter.

Words is a simple, yet powerful, dictionary. Doesn’t require internet access. It can read the words and their definitions with its robotic voice. Works in many different languages.

That’s it!

The focus of this project will move onto making these Flatpak bundles more easily maintainable, for now. I am working on a BaseApp for that purpose, and will soon start updating each of these applications.

If someone is interested in any of the topics I discussed here, or just wants to contribute to this project, contact me via the GNOME Rocket chat. I can help you get started. There’s a lot of work to do!

Finally, I want thank everyone who contributed to this project during these months. Special thanks to Srevin Saju, Marcus Chong (and all our Google Code-In students), Bilal Elmoussaoui, Bartłomiej Piotrowski, Nick Richards (and all other Flathub admins who helped me with the reviews), and Jorge García Oncins for all the early testing and feedback.

Linux App Summit 2019 and Sugar Learning Tools

Last week I traveled to Barcelona, Spain to attend the Linux App Summit. For the first time, GNOME and KDE co-hosted this event to bring together everyone involved in the Linux application ecosystem. The summit was packed with a diverse audience from all over the desktop community and the world. Being there and being part of what is coming for the future of this ecosystem was truly an enriching and motivating experience.

The always-wonderful group photo

Equally important, I was able to meet with former colleagues and friends from Endless, and from the GNOME community. I made many new friends as well. All of this is certainly priceless for someone living far, far away. If you want to know more details about what happened during the summit, I highly recommend reading blog posts like the ones from Julita Inca, Daniel Garcia Moreno, Nick Richards and others. The social media coverage was superb, so check their twitter and youtube channels as well.

During the summit, I had the opportunity to present a lightning-talk titled Flooding the desktop with great learning tools. In this blog post, I will try to expand just a bit more on the details of this project. TL;DR I am making Sugar applications available to all desktops and Linux distributions using Flatpak and Flathub. But first a bit of context.

That is me making the most out of my precious five minutes. Thanks to Matthias Clasen for the encouragement and this picture.

Sugar is a unique desktop and a set of applications for Linux. It was designed for children to learn while having fun. It is Free and Open Source Software. Sugar Labs is a community of volunteers who maintains the project until this day. Since its original release, as part of the One Laptop Per Child project, dozens of educators and developers have created hundreds of great learning tools, most of which are only available for this platform.

Flatpak is a next-generation technology for building, distributing and safely running applications on Linux. It allows developers to build their applications once, and ensures that it will run properly on any Linux distribution. Beyond its technical marvels, it is a game-changing technology that will bring developers and users closer than ever before. Flathub is a community-driven hub for distributing and downloading applications powered by Flatpak. Both Flatpak and Flathub are Free and Open Source Software, as well.

I have spent many years working on desktop technologies in education and access to information, including the Sugar desktop and Endless OS. So the idea of putting Sugar and Flatpak together started a few years ago, while I was working at Endless, one of the early-adopters of Flatpak.

Sugar homepage screenshot
The Sugar desktop with a custom background image

It was easy to see that this is a clear win-win situation. Sugar has many unique learning tools that do not exist on the desktop, and Flatpak has the potential to reach new desktop users.

But, how does this project differ from the Sugar applications already available through package managers? Depending on your Linux distribution, you could technically install a small selection of these applications today. But there are two big caveats. First, you will need to install the Sugar desktop or at least some of its system services just so they can run. Second, and most important, you won’t be able to do much with these applications unless you are doing it within Sugar. These applications depend heavily on the Sugar paradigms and APIs, which are quite different from desktops like GNOME or KDE.

As an example, Sugar users don’t need to deal with file system directly, instead they use something called the Journal, which is not available outside Sugar. But they certainly need to deal with the file system in the desktop.

So, to combine both worlds, I created a small library that makes it easier to port these applications to the desktop. It provides the basic building blocks needed for the job, like:

  • A base desktop application that acts as a middle man between the desktop and the Sugar application.
  • A set of compatibility UI components that can be used as a replacement for Sugar-specific components.
  • A set of utilities to generate the metadata needed for a desktop application, basically, the appdata.xml, .desktop and mimetypes.xml files.

With the help of this library, porting applications is surprisingly easy. In most cases, the changes result in small patches that are easily maintainable downstream. Of course, this simple approach has its downsides. As an example, collaboration is disabled since there is no Sugar collaboration service, nor is mimicked by the library.

Once the application is ported, it can be packaged as any other desktop application with Flatpak and published on Flathub. I already ported a few of my favorite applications, two of which are already published on Flathub. My plan is to port as many applications as possible with the help of Google Code-in students this winter.

Abacus now available on Flathub
Music Keyboard now available on Flathub

If you find this project interesting and want to contribute, feel free to contact me!

Last but not least, special thanks to Nick Richards, a former colleague at Endless and Flathub admin, for his early review of this work during the summit, and to Javier Martinez Canillas and his family for hosting me during that week in Barcelona.