pop-os / desktop-icons-ng

Packaging of https://gitlab.com/rastersoft/desktop-icons-ng
GNU General Public License v3.0
6 stars 7 forks source link

DING Desktop Icons New Generation

What is it

Desktop Icons NG for GNOME Shell. It is a fork/rewrite of the official 'Desktop Icons' extension, with these advantages:

But it is still an alpha development, so it probably still have a lot of bugs. Use with care.

Requirements

TO-DO

Internal architecture

The code is divided in two parts: a classic Gtk program that manages the whole desktop (comprised by the files ding.js, askNamePopup.js, createThumbnail.js, dbusUtils.js, desktopGrid.js, desktopIconsUtil.js, desktopManager.js, enums.js, fileItem.js and preferences.js), and a little extension (extension.js) that have these roles:

This last part is paramount in Wayland systems, because there an application can't set its role as freely as in X11.

Of course, to avoid breaking the security model of Wayland, it is paramount to ensure that no other program can pose as DING. In old versions, the process for identifying the window was quite convoluted, passing an UUID through STDIN and putting it in the window title. But since Gnome Shell 3.38 there is a new API that allows to check whether a window belongs to an specific process launched from an extension, which makes the code much cleaner and straightforward.

The extension monitors all 'map' signals, and when a window from the DING process previously launched is mapped, it knows that it is the desktop window. It stores that window object, sends it to the bottom of the stack, and connects to three signals:

It also monitors other signals to ensure that the desktop receives the focus only when there are no other windows in the current desktop, and to keep the icons in the right screen, no matter if the user changes to another virtual desktop.

The extension also intercepts three Gnome Shell system calls, in order to hide the desktop windows from the tab switcher and the Activities mode. These are 'Meta.Display.get_tab_list()', 'Shell.Global.get_window_actors()', and 'Meta.Workspace.list_windows()'.

Launching the Desktop Icons application stand-alone

It is possible to launch the desktop icons application in stand-alone mode to do debugging and testing, but, of course, it will behave as a classic Gtk program: there will be a window with its titlebar, and the background won't be transparent (it could be, but since the idea is to do debug, it is better this way). To do so, just launch './ding.js' from the repository directory. If it can't find the schemas file, just enter the 'schemas' folder and type 'glib-compile-schemas .', and retry.

It accepts the following command line parameters:

Manual installation

The easiest way of installing DING is to run the local_install.sh script. It performs the build steps specified in the next section.

Build with Meson

The project uses a build system called Meson. You can install in most Linux distributions as "meson". You also need "ninja" and xgettext.

It's possible to read more information in the Meson docs to tweak the configuration if needed.

For a regular use and local development these are the steps to build the project and install it:

meson --prefix=$HOME/.local/ --localedir=share/gnome-shell/extensions/ding@rastersoft.com/locale .build
ninja -C .build install

It is strongly recommended to delete the destination folder ($HOME/.local/share/gnome-shell/extensions/ding@rastersoft.com) before doing this, to ensure that no old data is kept.

Export extension ZIP file for extensions.gnome.org

To create a ZIP file with the extension, just run:

./export-zip.sh

This will create the file ding@rastersoft.com.zip with the extension, following the rules for publishing at extensions.gnome.org.

Source code and contacting the author

Sergio Costas
https://gitlab.com/rastersoft/desktop-icons-ng
rastersoft@gmail.com