Help for a newbie: creating an alphabetizing extension

Hello everyone,

I’m a relative newcomer to Linux, but I’d say I have knowledge somewhere in between a newbie and an intermediate user. I’ve been using a GNOME-based distro, namely Pop!_OS, in its last few incarnations almost exclusively over the past few months, and I’m currently on 20.10.

I’m a writer, entrepreneur, and gamer, in no particular order. I don’t have much experience programming, although I have a logical mind and have programmed before–just not since around 1999 when I was a high school student. I also had some knowledge of JavaScript, but that dates back to university a few years later and it’s all but left my memory.

Having said that, though, I’d like to try my hand at my first contribution to the open-source community in the form of a simple GNOME extension. For the past couple of versions, as we all know, GNOME has allowed users to re-order their app icons. My extension would create an “Alphabetize apps” button on the Settings panel that, when clicked, would execute the two following terminal commands:

gsettings reset org.gnome.shell app-picker-layout

busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart(“Restarting…”)'

I know there has previously been discussion of implementing such functionality back into GNOME, but from what I can tell, it’s not been well-received. I’d like some guidance in creating an extension as I’ve described above, as I’m sure it’d be popular with many even if the GNOM team itself isn’t too keen on implementing the functionality.

The guides I’ve been able to find so far seem too broad and technical for someone like me who is just starting out, so I’d appreciate some honest direction as to where to start and how I can accomplish this.

Thanks,
Luke

My extension would create an “Alphabetize apps” button on the Settings panel

That’s not possible: GNOME extensions change gnome-shell, not the Settings application. The latter doesn’t have an extension API.

busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s ‘Meta.restart(“Restarting…”)’

In the default (read: wayland) session, this command will terminate the user’s existing session and crash all running applications. Not a good idea.

I’d like to try my hand at my first contribution to the open-source community in the form of a simple GNOME extension.

If your goal is to have the app grid organized in alphabetic order, look at PageManager:
https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/master/js/ui/appDisplay.js#L897

It shouldn’t be overly hard to replace that in an extension with a version that ignores the app-picker-layout setting and instead sorts apps alphabetically.

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