Skip to content
This repository was archived by the owner on Jan 4, 2026. It is now read-only.

Commit b7c7fc3

Browse files
committed
first commit
0 parents  commit b7c7fc3

9 files changed

Lines changed: 801 additions & 0 deletions

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Panel Note
2+
![screenshot](./images/screen1.png)
3+
4+
Add a small note to your GNOME panel.
5+
6+
> [!NOTE]
7+
> This extension is inspired by the macOS app "One Thing."
8+
9+
## Usage
10+
![screenshot](./images/screen2.png)
11+
12+
When you enable the extension, the default note will appear on your panel. To edit the note, simply click on the note and type in your new note.

extension.js

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/* extension.js
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU General Public License as published by
5+
* the Free Software Foundation, either version 2 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU General Public License
14+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
*
16+
* SPDX-License-Identifier: GPL-2.0-or-later
17+
*/
18+
19+
// Inspired by the macOS app 'One Thing'
20+
// Extension uses elements from 'Just Another Search Bar' (https://extensions.gnome.org/extension/5522/just-another-search-bar/)
21+
22+
import GObject from 'gi://GObject';
23+
import St from 'gi://St';
24+
import Clutter from 'gi://Clutter';
25+
26+
import { Extension, gettext as _ } from 'resource:///org/gnome/shell/extensions/extension.js';
27+
import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
28+
import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
29+
30+
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
31+
32+
const Indicator = GObject.registerClass(
33+
class Indicator extends PanelMenu.Button {
34+
_init(settings) {
35+
super._init(0.0, _('Panel Note'));
36+
37+
/* ------------------------------- Panel Note ------------------------------- */
38+
let noteInPanel = new St.Label({
39+
text: settings.get_string('note'),
40+
y_expand: true,
41+
y_align: Clutter.ActorAlign.CENTER,
42+
});
43+
this.add_child(noteInPanel);
44+
45+
46+
/* ----------------------------- Note Entry Box ----------------------------- */
47+
this.entry = new St.Entry({
48+
text: settings.get_string('note'),
49+
can_focus: true,
50+
track_hover: true
51+
});
52+
53+
this.entry.set_primary_icon(new St.Icon({
54+
icon_name: 'document-edit-symbolic',
55+
style_class: 'popup-menu-icon',
56+
}));
57+
58+
this.entry.clutter_text.connect('text-changed', () => {
59+
let text = this.entry.get_text();
60+
if (text == "")
61+
text = "No Note";
62+
settings.set_string('note', text);
63+
noteInPanel.text = text;
64+
});
65+
66+
let popupEdit = new PopupMenu.PopupMenuSection();
67+
popupEdit.actor.add_actor(this.entry);
68+
69+
this.menu.addMenuItem(popupEdit);
70+
this.menu.actor.add_style_class_name('note-entry');
71+
}
72+
});
73+
74+
export default class IndicatorExampleExtension extends Extension {
75+
enable() {
76+
this._settings = this.getSettings();
77+
this._indicator = new Indicator(this._settings);
78+
Main.panel.addToStatusArea(this.uuid, this._indicator);
79+
}
80+
81+
disable() {
82+
this._indicator.entry.disconnect();
83+
this._indicator.destroy();
84+
this._indicator = null;
85+
this._settings = null;
86+
}
87+
}

images/screen1.png

31 KB
Loading

images/screen2.png

31.7 KB
Loading

metadata.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "Panel Note",
3+
"description": "Add a small note to your GNOME panel",
4+
"uuid": "panelnote@gittymac.github.io",
5+
"settings-schema": "org.gnome.shell.extensions.panelnote",
6+
"url": "https://github.com/GittyMac/PanelNote",
7+
"version": 1,
8+
"shell-version": [
9+
"45"
10+
]
11+
}

schemas/gschemas.compiled

312 Bytes
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<schemalist>
3+
4+
<schema id="org.gnome.shell.extensions.panelnote" path="/org/gnome/shell/extensions/panelnote/">
5+
6+
<!-- See also: https://developer.gnome.org/glib/stable/gvariant-format-strings.html -->
7+
8+
<key type="s" name="note">
9+
<default>"Change my Panel Note!"</default>
10+
<summary>The note that is showing on the panel.</summary>
11+
</key>
12+
</schema>
13+
</schemalist>

stylesheet.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Add your custom extension styling here */
2+
.note-entry {
3+
min-width: 20em;
4+
}

0 commit comments

Comments
 (0)