Can I create my dashboard as a "Taskbar" or "Status Area"?

63 Views Asked by At

Can I create my custom panel like a "Taskbar" or "Status Area"?

When you launch ubuntu for the first time, two "panels" are immediately visible, on the left with applications and on top

I have a piece of code that adds ... in the status area (which is located at the top of the screen):

Main.panel.addToStatusArea("myPanelButton", ...);

Is it possible to create your own panel at the bottom of the screen? That is, on the left with the applications, on top with the time display and my own on the bottom?

If it is possible (and I think it is 100% possible), then please give the code to implement it

P.S. For those who did not understand, I call the "panel" a strip on the screen that applications cannot go beyond

Gnome Shell Version: 44.3

1

There are 1 best solutions below

0
ladno On

The answer is this code:

/* Imports */
const { St, Clutter, Gio, Shell } = imports.gi;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Main = imports.ui.main;

/* Bottom panel */
let panel;

function enable() {
    panel = new St.BoxLayout({
        style_class: "my-panel",
        vertical: false,
        width: Main.layoutManager.primaryMonitor.width, // Width of the display
        height: 42
    });

    panel.add_child(...); // Add anything element to panel

    Main.uiGroup.add_actor(panel); // Add panel to uiGroup
    panel.set_position(0, Main.layoutManager.primaryMonitor.height - panel.height); // By default, position of the uiGroup is on the top, so we need to change its position to bottom of the screen
}

This code adds panel to uiGroup and sets position to bottom of the display.