Skip to content

Commit

Permalink
Merge pull request linuxmint#307 from pdcurtis/bumblebee-3.1.1
Browse files Browse the repository at this point in the history
bumblebee@pdcurtis Update to v3.1.1
  • Loading branch information
brownsr committed Apr 13, 2017
2 parents 6149db1 + b01758e commit 95dc45f
Show file tree
Hide file tree
Showing 7 changed files with 239 additions and 20 deletions.
12 changes: 12 additions & 0 deletions bumblebee@pdcurtis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The Bumblebee And NVidia Display (Band) Applet is a relatively simple applet I w

It is useful to have continuous indication of whether the Discrete Graphics Processor Unit is in use and its temperature which is a concern on some laptops. The latest versions of Cinnamon provide more support so the option of running programs is now less important.

## Warning

I no longer run Bumbleebee on a regular basis so it is possible for errors to have crept in without my knowing during the recent changes to how applets are handled. Please report any errors by creating an Issue in the cinnamon-spices-applets Github repository at https://github.com/linuxmint/cinnamon-spices-applets and I will try to fix or revert to an earlier known working version within a few days. Also see requirements below.

## Features

The Right Click (Context menu) gives the ability to easily run the nVidia Settings program without use of the terminal and also the System Monitor and Power Statistics, all useful for monitoring Bumblebee and Power consumption which is paramount when using a laptop on batteries.
Expand All @@ -25,6 +29,14 @@ The Bumblebee and the nVidia graphics packages obviously need to be installed bu

glxsheres64 only needs to be installed if you want to use the applet to test the relative performances of the Intel and nVidia graphics processors. glxsheres64 is part of the VirtualGL package which needs to be installed from http:https://sourceforge.net/projects/virtualgl/files/VirtualGL/ - download the latest version and install using gdebi (should be the default for a right click on the downloaded file). It should run about five times faster when the nVidia GPU is active and is a very good test as to how good your cooling is for both the CPU and nVidia GPU when it is active.

## Translations and other Contributions

The internal changes required in the applet to allow translations have been implemented but no translations are available at this time. Translations are usually contributed by people fluent in the language and will be very much appreciated. Users please note I am unable to take responsibility for the accuracy of translations!

I no longer run Bumblebee on a regular basis and would greatly appreciate input from a regular user of Bumblebee and this applet.

Although comments and suggestions are always welcome any contributions which are contemplated should follow discussion.

## Manual Installation:

* Make sure Bumblebee is installed and working.
Expand Down
12 changes: 12 additions & 0 deletions bumblebee@pdcurtis/files/bumblebee@pdcurtis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The Bumblebee And NVidia Display (Band) Applet is a relatively simple applet I w

It is useful to have continuous indication of whether the Discrete Graphics Processor Unit is in use and its temperature which is a concern on some laptops. The latest versions of Cinnamon provide more support so the option of running programs is now less important.

## Warning

I no longer run Bumbleebee on a regular basis so it is possible for errors to have crept in without my knowing during the recent changes to how applets are handled. Please report any errors by creating an Issue in the cinnamon-spices-applets Github repository at https://github.com/linuxmint/cinnamon-spices-applets and I will try to fix or revert to an earlier known working version within a few days. Also see requirements below.

## Features

The Right Click (Context menu) gives the ability to easily run the nVidia Settings program without use of the terminal and also the System Monitor and Power Statistics, all useful for monitoring Bumblebee and Power consumption which is paramount when using a laptop on batteries.
Expand All @@ -25,6 +29,14 @@ The Bumblebee and the nVidia graphics packages obviously need to be installed bu

glxsheres64 only needs to be installed if you want to use the applet to test the relative performances of the Intel and nVidia graphics processors. glxsheres64 is part of the VirtualGL package which needs to be installed from http:https://sourceforge.net/projects/virtualgl/files/VirtualGL/ - download the latest version and install using gdebi (should be the default for a right click on the downloaded file). It should run about five times faster when the nVidia GPU is active and is a very good test as to how good your cooling is for both the CPU and nVidia GPU when it is active.

## Translations and other Contributions

The internal changes required in the applet to allow translations have been implemented but no translations are available at this time. Translations are usually contributed by people fluent in the language and will be very much appreciated. Users please note I am unable to take responsibility for the accuracy of translations!

I no longer run Bumblebee on a regular basis and would appreciate input from a regular user of Bumblebee and this applet.

Although comments and suggestions are always welcome any contributions which are contemplated should follow discussion.

## Manual Installation:

* Make sure Bumblebee is installed and working.
Expand Down
49 changes: 34 additions & 15 deletions bumblebee@pdcurtis/files/bumblebee@pdcurtis/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ const Lang = imports.lang; // ++ Needed for menus
const GLib = imports.gi.GLib; // ++ Needed for starting programs
const Mainloop = imports.mainloop; // Needed for timer update loop


// l10n/translation support as per NikoKrause tutorial modified as UUID already used!
const Gettext = imports.gettext
const UUIDl10n = "bumblebee@pdcurtis"
Gettext.bindtextdomain(UUIDl10n, GLib.get_home_dir() + "/.local/share/locale")

function _(str) {
return Gettext.dgettext(UUIDl10n, str);
}


// ++ Always needed
function MyApplet(metadata, orientation, panelHeight, instance_id) {
this._init(metadata, orientation, panelHeight, instance_id);
Expand Down Expand Up @@ -127,7 +138,7 @@ MyApplet.prototype = {

// Finally setup to start the update loop for the applet display running
this.set_applet_label(" " ); // show nothing until system stable
this.set_applet_tooltip("Waiting for Bumblebee");
this.set_applet_tooltip(_("Waiting for Bumblebee"));
Mainloop.timeout_add_seconds(20, Lang.bind(this, this.updateLoop)); // Timer to allow bumbleebee to initiate

} catch (e) {
Expand Down Expand Up @@ -172,21 +183,21 @@ MyApplet.prototype = {
this._applet_context_menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());


let menuitem1 = new PopupMenu.PopupMenuItem("Open nVidia Settings Program");
let menuitem1 = new PopupMenu.PopupMenuItem(_("Open nVidia Settings Program"));
menuitem1.connect('activate', Lang.bind(this, function (event) {
GLib.spawn_command_line_async('optirun -b none nvidia-settings -c :8 ');
}));
this._applet_context_menu.addMenuItem(menuitem1);

let menuitem2 = new PopupMenu.PopupMenuItem("Open Power Statistics");
let menuitem2 = new PopupMenu.PopupMenuItem(_("Open Power Statistics"));
menuitem2.connect('activate', Lang.bind(this, function (event) {
GLib.spawn_command_line_async('gnome-power-statistics');
}));
this._applet_context_menu.addMenuItem(menuitem2);



this.menuitem3 = new PopupMenu.PopupMenuItem("Open System Monitor");
this.menuitem3 = new PopupMenu.PopupMenuItem(_("Open System Monitor"));
this.menuitem3.connect('activate', Lang.bind(this, function (event) {
GLib.spawn_command_line_async('gnome-system-monitor');
}));
Expand All @@ -195,16 +206,16 @@ MyApplet.prototype = {
this._applet_context_menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());

// ++ Set up sub menu for Housekeeping and System Items
this.subMenu1 = new PopupMenu.PopupSubMenuMenuItem("Housekeeping and System Sub Menu");
this.subMenu1 = new PopupMenu.PopupSubMenuMenuItem(_("Housekeeping and System Sub Menu"));
this._applet_context_menu.addMenuItem(this.subMenu1);

this.subMenuItem1 = new PopupMenu.PopupMenuItem("View the Changelog");
this.subMenuItem1 = new PopupMenu.PopupMenuItem(_("View the Changelog"));
this.subMenuItem1.connect('activate', Lang.bind(this, function (event) {
GLib.spawn_command_line_async(this.textEd + ' ' + this.changelog);
}));
this.subMenu1.menu.addMenuItem(this.subMenuItem1); // Note this has subMenu1.menu not subMenu1._applet_context_menu as one might expect

this.subMenuItem2 = new PopupMenu.PopupMenuItem("Open the Help file");
this.subMenuItem2 = new PopupMenu.PopupMenuItem(_("Open the Help file"));
this.subMenuItem2.connect('activate', Lang.bind(this, function (event) {
GLib.spawn_command_line_async(this.textEd + ' ' + this.helpfile);
}));
Expand All @@ -220,7 +231,7 @@ MyApplet.prototype = {
try {
this.menu.removeAll();

this.menuitemHead1 = new PopupMenu.PopupMenuItem("Launch programs using the nVidia Graphics Processor", {
this.menuitemHead1 = new PopupMenu.PopupMenuItem(_("Launch programs using the nVidia Graphics Processor"), {
reactive: false
});
this.menu.addMenuItem(this.menuitemHead1);
Expand Down Expand Up @@ -293,22 +304,22 @@ MyApplet.prototype = {
} catch (e) {
// global.logError(e); // Comment out to avoid filling error log
this.bbst = "ERROR"
this.set_applet_label("ERROR" );
this.set_applet_tooltip("Bumblebee is not installed so applet willl not work");
this.set_applet_label(_("ERROR" ));
this.set_applet_tooltip(_("Bumblebee is not installed so applet willl not work"));
}
try {
if(this.bbst == "OFF") {
this.set_applet_label("GPU OFF" );
this.set_applet_tooltip("NVidia based GPU is " + this.bbst);
this.set_applet_label(_("GPU OFF") );
this.set_applet_tooltip(_("NVidia based GPU is") + " " + this.bbst);
}
if(this.bbst == "ON") {

this.nvidiagputemp1 = GLib.file_get_contents("/tmp/.gpuTemperature").toString();
// Check we have a valid temperature returned before updating
// in case of slow response from nvidia-settings which gives null string
if(this.nvidiagputemp1.substr(5,2) > 0){ this.nvidiagputemp = this.nvidiagputemp1.substr(5,2)};
this.set_applet_label("GPU " + this.nvidiagputemp + "\u1d3cC" );
this.set_applet_tooltip("NVidia based GPU is " + this.bbst + " and Core Temperature is " + this.nvidiagputemp + "\u1d3cC" );
this.set_applet_label(_("GPU") + " " + this.nvidiagputemp + "\u1d3cC" );
this.set_applet_tooltip(_("NVidia based GPU is") + " " + this.bbst + " " + _("and Core Temperature is") + " " + this.nvidiagputemp + "\u1d3cC" );
// Get temperatures via asyncronous script ready for next cycle
GLib.spawn_command_line_async('sh ' + this.gputempScript );
}
Expand Down Expand Up @@ -339,7 +350,7 @@ function main(metadata, orientation, panelHeight, instance_id) {
return myApplet;
}
/*
Version v30_3.1.0
Version v30_3.1.1
v20_0.9.0 Beta 12-12-2013
v20_0.9.1 Added System Monitor and Power Statistics to right click menu
v20_0.9.2 Added Left Click Menu with 5 Program Launch Items with configuration in Settings - Release Candidate 14-12-2013
Expand All @@ -360,4 +371,12 @@ v30_3.0.2 NOTE 3.0.1 was not a separate version - it was a mechanism to overwri
v30_3.0.3 Corrected icon.png in applet folder which is used by Add Applets
v30_3.0.4 Corrected gputempscript to have correct option commented out
v30_3.1.0 Changed help file from help.txt to README.md
3.1.1 Version numbering harmonised with other Cinnamon applets and added to metadata.json so it can show in 'About...'
icon.png copied back into applet folder so it can show in 'About...'
Add translation support to applet.js
Identify strings for translation and remove leading and trailing spaces and replace with separate spaces where required.
Add po folder to applet
Create bumblebee.pot using cinnamon-json-makepot --js po/bumblebee.pot
Version and changes information update in applet.js and changelog.txt
NOTE: Only partially tested as I no longer run Bumblebee
*/
10 changes: 9 additions & 1 deletion bumblebee@pdcurtis/files/bumblebee@pdcurtis/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version v30_3.1.0
Version v30_3.1.1
v20_0.9.0 Beta 12-12-2013
v20_0.9.1 Added System Monitor and Power Statistics to right click menu
v20_0.9.2 Added Left Click Menu with 5 Program Launch Items with configuration in Settings - Release Candidate 14-12-2013
Expand All @@ -19,3 +19,11 @@ v30_3.0.2 NOTE 3.0.1 was not a separate version - it was a mechanism to overwri
v30_3.0.3 Corrected icon.png in applet folder which is used by Add Applets
v30_3.0.4 Corrected gputempscript to have correct option commented out
v30_3.1.0 Changed help file from help.txt to README.md
3.1.1 Version numbering harmonised with other Cinnamon applets and added to metadata.json so it can show in 'About...'
icon.png copied back into applet folder so it can show in 'About...'
Add translation support to applet.js
Identify strings for translation and remove leading and trailing spaces and replace with separate spaces where required.
Add po folder to applet
Create bumblebee.pot using cinnamon-json-makepot --js po/bumblebee.pot
Version and changes information update in applet.js and changelog.txt
NOTE: Only partially tested as I no longer run Bumblebee
Binary file added bumblebee@pdcurtis/files/bumblebee@pdcurtis/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions bumblebee@pdcurtis/files/bumblebee@pdcurtis/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"max-instances": "1",
"description": "Displays Status of Bumblebee and nVidia GPU Temperature",
"uuid": "bumblebee@pdcurtis",
"max-instances": "1",
"name": "Bumblebee and nVidia Display",
"uuid": "bumblebee@pdcurtis"
"version": "3.1.1",
"description": "Displays Status of Bumblebee and nVidia GPU Temperature"
}

168 changes: 168 additions & 0 deletions bumblebee@pdcurtis/files/bumblebee@pdcurtis/po/bumblebee.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-10 15:26+1200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: \n"

#: applet.js:141
msgid "Waiting for Bumblebee"
msgstr ""

#: applet.js:186
msgid "Open nVidia Settings Program"
msgstr ""

#: applet.js:192
msgid "Open Power Statistics"
msgstr ""

#: applet.js:200
msgid "Open System Monitor"
msgstr ""

#: applet.js:209
msgid "Housekeeping and System Sub Menu"
msgstr ""

#: applet.js:212
msgid "View the Changelog"
msgstr ""

#: applet.js:218
msgid "Open the Help file"
msgstr ""

#: applet.js:234
msgid "Launch programs using the nVidia Graphics Processor"
msgstr ""

#: applet.js:307
msgid "ERROR"
msgstr ""

#: applet.js:308
msgid "Bumblebee is not installed so applet willl not work"
msgstr ""

#: applet.js:312
msgid "GPU OFF"
msgstr ""

#: applet.js:313 applet.js:322
msgid "NVidia based GPU is"
msgstr ""

#: applet.js:321
msgid "GPU"
msgstr ""

#: applet.js:322
msgid "and Core Temperature is"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->head->description
msgid "General Settings for the nVidia Monitoring Applet"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->head2->description
msgid "Programs settings for Optimus"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->commandString2->description
msgid "Command String for Program 2"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->commandString2->tooltip
#. bumblebee@pdcurtis->settings-schema.json->commandString3->tooltip
#. bumblebee@pdcurtis->settings-schema.json->commandString1->tooltip
#. bumblebee@pdcurtis->settings-schema.json->commandString4->tooltip
#. bumblebee@pdcurtis->settings-schema.json->commandString5->tooltip
msgid ""
"Put the command string to run the program here starting with optirun or "
"primusrun"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->commandString3->description
msgid "Command String for Program 3"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->commandString1->description
msgid "Command String for Program 1"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->commandString4->description
msgid "Command String for Program 4"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->commandString5->description
msgid "Command String for Program 5"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->description4->description
msgid "Display Name of Program 4 to be run using Optimus technology"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->description4->tooltip
#. bumblebee@pdcurtis->settings-schema.json->description5->tooltip
#. bumblebee@pdcurtis->settings-schema.json->description2->tooltip
#. bumblebee@pdcurtis->settings-schema.json->description3->tooltip
msgid ""
"Put the name of the program here or none if you do not want it displayed"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->description5->description
msgid "Display Name of Program 5 to be run using Optimus technology"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->description2->description
msgid "Display Name of Program 2 to be run using Optimus technology"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->description3->description
msgid "Display Name of Program 3 to be run using Optimus technology"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->description1->description
msgid "Display Name of Program 1 to be run using Optimus technology"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->description1->tooltip
msgid ""
"Put the name of the program here or null if you do not want it displayed"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->refreshInterval-
#. spinner->description
msgid "Refresh Interval for Display:"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->refreshInterval-spinner->tooltip
msgid ""
"Increase or decrease this spinner value to change the refresh interval - use"
" a slow refresh if you have a slow machine"
msgstr ""

#. bumblebee@pdcurtis->settings-schema.json->refreshInterval-spinner->units
msgid "seconds"
msgstr ""

#. bumblebee@pdcurtis->metadata.json->description
msgid "Displays Status of Bumblebee and nVidia GPU Temperature"
msgstr ""

#. bumblebee@pdcurtis->metadata.json->name
msgid "Bumblebee and nVidia Display"
msgstr ""

0 comments on commit 95dc45f

Please sign in to comment.