commit b06dea222089b039d6173ce9b48e48a0a1f66eed Author: Guinn Peng Date: Tue Mar 25 13:39:36 2025 +0800 Initial commit diff --git a/extension.js b/extension.js new file mode 100644 index 0000000..229f762 --- /dev/null +++ b/extension.js @@ -0,0 +1,40 @@ +const St = imports.gi.St; +const Main = imports.ui.main; +const Gio = imports.gi.Gio; +const PanelMenu = imports.ui.panelMenu; +const PopupMenu = imports.ui.popupMenu; + +class MyPanelButton extends PanelMenu.Button { + constructor() { + super(0.0, 'MyExtension'); + + let icon = new St.Icon({ + icon_name: 'face-smile-symbolic', + style_class: 'system-status-icon' + }); + + this.add_child(icon); + + this.menu.addAction('Click Me', () => { + Main.notify('Hello from MyExtension!'); + }); + } +} + +let myPanelButton; + +function init() { + // 初始化代码 +} + +function enable() { + myPanelButton = new MyPanelButton(); + Main.panel.addToStatusArea('my-extension', myPanelButton); +} + +function disable() { + if (myPanelButton) { + myPanelButton.destroy(); + myPanelButton = null; + } +} \ No newline at end of file diff --git a/metadatat.json b/metadatat.json new file mode 100644 index 0000000..52a8e3d --- /dev/null +++ b/metadatat.json @@ -0,0 +1,7 @@ +{ + "shell-version": ["42", "43"], + "uuid": "my-extension@domain", + "name": "My Extension", + "description": "A simple GNOME Shell extension.", + "url": "https://github.com/yourusername/my-extension" + } \ No newline at end of file diff --git a/prefs.ui b/prefs.ui new file mode 100644 index 0000000..e69de29 diff --git a/stylesheet.css b/stylesheet.css new file mode 100644 index 0000000..e69de29