Skip to content

Commit

Permalink
Initial version of the extension
Browse files Browse the repository at this point in the history
  • Loading branch information
William Brendaw committed Sep 4, 2016
0 parents commit 834ddbc
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
30 changes: 30 additions & 0 deletions extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Add Username to Top Panel GNOME extension
Created by William Brendaw ([email protected])
Inspired from Add Username to Top Panel (https://extensions.gnome.org/extension/813/add-user-and-host-name-to-panel/)
Hack it!
*/
const Clutter = imports.gi.Clutter;
const St = imports.gi.St;
const Main = imports.ui.main;
const GLib = imports.gi.GLib;

let label;
let aggregateMenu;
let children;

function init() {
label = new St.Label({ text: GLib.get_real_name(), y_align: Clutter.ActorAlign.CENTER, style_class: "username-label" });
aggregateMenu = Main.panel.statusArea["aggregateMenu"];
powerIndicator = aggregateMenu._power.indicators;
}

function enable() {
powerIndicator.add_child(label);
}

function disable() {
powerIndicator.remove_child(label);
}
16 changes: 16 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"description": "Simply add your username to topbar panel aggregate menu",
"uuid": "[email protected]",
"name": "Add Username to Top Panel",
"original-authors": [
"[email protected]"
],
"shell-version": [
"3.12",
"3.14",
"3.16",
"3.18"
],
"url": "https://github.com/brendaw/add-username-toppanel",
"version": 1
}
6 changes: 6 additions & 0 deletions stylesheet.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

.username-label {
margin-left: 7px;
margin-right: 5px;
vertical-align: middle;
}

0 comments on commit 834ddbc

Please sign in to comment.