Add GNOME Shell extension showing sing-box status via the Clash API
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
|
||||
import { SingBoxIndicator } from './lib/indicator.js';
|
||||
|
||||
export default class SingBoxStatusExtension extends Extension {
|
||||
enable() {
|
||||
this._indicator = new SingBoxIndicator(this);
|
||||
Main.panel.addToStatusArea(this.uuid, this._indicator);
|
||||
}
|
||||
|
||||
disable() {
|
||||
this._indicator?.destroy();
|
||||
this._indicator = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user