Hello,
I have put together an extension to hide the top panel and show overview after unlocking the system. I just want to know whether the way I did these things are okay or is there a proper way to do it. Thanks!
extension.js
import { panel, overview } from "resource:///org/gnome/shell/ui/main.js";
// panel visiblity logic is based on: https://github.com/fthx/panel-free
export default class MyExtension {
#showPanel = () => {
panel.visible = true;
};
#hidePanel = () => {
panel.visible = false;
};
enable() {
// refer (this._shownState): https://github.com/GNOME/gnome-shell/blob/main/js/ui/overview.js#L159
if (["HIDDEN", "HIDING"].includes(overview._shownState)) {
overview.show();
}
overview.connectObject(
"showing",
this.#showPanel,
"hiding",
this.#hidePanel,
this,
);
}
disable() {
overview.disconnectObject(this);
this.#showPanel();
}
}
[!NOTE]
This extension is meant for my personal use and I have no plan to publish it to Gnome Extensions