-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
William Brendaw
committed
Sep 4, 2016
0 parents
commit 834ddbc
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |