I’m getting started with my first gnome shell extension. I want to add and display titles to workspaces. My instinct is to extend the workspace class in ui/workspace.js. However, this class isn’t based on GObject. When I look at other gnome-shell extensions, any class that they extend is based on GObject. Without an example or documentation to follow, I’m unsure how to properly extend this class.
Again, my goal is to create a simple extension that adds and displays titles to workspaces. Am I going about this the right way?Is it possible to extend this class?
class MySubclass extends BaseClass {
constructor() {
// important: the "this" pointer is initialized by chaining up to the base Object class
super();
// your custom code goes here
}
}
The tricky bit here isn’t about extending the workspaces class, but about making sure that the shell uses your subclass instead of the original one.
This extension does add labels to workspaces, feel free to copy the relevant bits.