Skip to content

Instantly share code, notes, and snippets.

View mathematicalcoffee's full-sized avatar

Amy Chan mathematicalcoffee

  • Australia
View GitHub Profile
@mathematicalcoffee
mathematicalcoffee / 3.2_3.4_icon_in_notification.js
Created December 12, 2012 00:14
Code snippets demonstrating how to send a notification to the user in GNOME-shell 3.2, 3.4 and 3.6
/** GNOME 3.2 and 3.4: sending a notification to the user.
* In this example we provide the Source's icon through the notification rather than the source
* (note the 'icon:' property in the object provided as the fourth parameter to the Notification.)
*/
// 1. Make a source
let source = new MessageTray.Source("source title");
// 2. Make a notification
let notification = new MessageTray.Notification(source,
"notification title",
"notification message",
@mathematicalcoffee
mathematicalcoffee / popupDoubleSliderMenuItem.js
Created December 12, 2012 00:01
Some javascript classes for gnome-shell extensions that create handy Popup Menu Items. PopupDoubleSliderMenuItem: a PopupSliderMenuItem with two sliders, for a lower and upper limit. PopupSliderMenuItemWithLabel: a PopupSliderMenuItem with a convenience label showing the current value. You can specify the lower/upper limits of the slider.
/* A SliderMenuItem with two slidable things, for
* selecting a range. Basically a modified PopupSliderMenuItem.
* It has no scroll or key-press event as it's hard to tell which
* blob the user meant to scroll.
*/
function PopupDoubleSliderMenuItem() {
this._init.apply(this, arguments);
}
PopupDoubleSliderMenuItem.prototype = {
__proto__: PopupMenu.PopupBaseMenuItem.prototype,