Skip to content

Instantly share code, notes, and snippets.

@Trucido
Created May 22, 2015 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Trucido/27060659b8f6cd3227cc to your computer and use it in GitHub Desktop.
Save Trucido/27060659b8f6cd3227cc to your computer and use it in GitHub Desktop.
removes net entirely from Multi-Core-System-Monitor applet in cinnamon, preventing dbus/polkit spamming errors.
diff -Nurp a/applet.js b/applet.js
--- a/applet.js 2015-05-21 23:09:45.419126109 -0400
+++ b/applet.js 2015-05-21 23:09:08.868126289 -0400
@@ -31,8 +31,8 @@ try {
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const GLib = imports.gi.GLib;
- const NMClient = imports.gi.NMClient;
- const NetworkManager = imports.gi.NetworkManager;
+ // const NMClient = imports.gi.NMClient;
+ // const NetworkManager = imports.gi.NetworkManager;
const Cinnamon = imports.gi.Cinnamon;
const GTop = imports.gi.GTop; //psst this is really only to see if we can
@@ -87,23 +87,23 @@ MyApplet.prototype = {
this.memProvider = new DataProviders.MemDataProvider();
this.swapProvider = new DataProviders.SwapDataProvider();
- this.netProvider = new DataProviders.NetDataProvider();
+ // this.netProvider = new DataProviders.NetDataProvider();
this.diskProvider = new DataProviders.DiskDataProvider();
this.configSettings.adjustDiskDevices(this.diskProvider.getDiskDevices());
this.diskProvider.setDisabledDevices(this.configSettings.getDiskDisabledDevices());
- this.configSettings.adjustNetInterfaces(Object.keys(this.netProvider.getNetDevices()));
- this.netProvider.setDisabledInterfaces(this.configSettings.getNETDisabledDevices());
+ // this.configSettings.adjustNetInterfaces(Object.keys(this.netProvider.getNetDevices()));
+ // this.netProvider.setDisabledInterfaces(this.configSettings.getNETDisabledDevices());
this.multiCpuGraph = new Graphs.GraphVBars(this.graphArea, this.multiCpuProvider);
this.memGraph = new Graphs.GraphPieChart(this.graphArea, this.memProvider);
this.swapGraph = new Graphs.GraphVBars(this.graphArea, this.swapProvider);
- this.netGraph = new Graphs.GraphLineChart(this.graphArea, this.netProvider, this.configSettings.getNETWidth());
- this.netGraph.setMinScaleYvalue(1.0); //For us this means the heighest point wont represent a valuelower than 1Kb/s
- this.netGraph.setAutoScale(this.configSettings.isNETAutoScaled());
- this.netGraph.setLogScale(this.configSettings.isNETLogScaled());
+ // this.netGraph = new Graphs.GraphLineChart(this.graphArea, this.netProvider, this.configSettings.getNETWidth());
+ // this.netGraph.setMinScaleYvalue(1.0); //For us this means the heighest point wont represent a valuelower than 1Kb/s
+ // this.netGraph.setAutoScale(this.configSettings.isNETAutoScaled());
+ // this.netGraph.setLogScale(this.configSettings.isNETLogScaled());
this.diskGraph = new Graphs.GraphLineChart(this.graphArea, this.diskProvider, this.configSettings.getDiskWidth());
this.diskGraph.setMinScaleYvalue(1.0); //For us this means the heighest point wont represent a valuelower than 1Kb/s
@@ -114,8 +114,8 @@ MyApplet.prototype = {
this.graphs[0] = this.multiCpuGraph;
this.graphs[1] = this.memGraph;
this.graphs[2] = this.swapGraph;
- this.graphs[3] = this.netGraph;
- this.graphs[4] = this.diskGraph;
+ // this.graphs[3] = this.netGraph;
+ this.graphs[3] = this.diskGraph;
this.actor.add_actor(this.graphArea);
this._update();
@@ -177,9 +177,9 @@ MyApplet.prototype = {
}
}
//Do any required processing when configuration changes
- this.netProvider.setDisabledInterfaces(this.configSettings.getNETDisabledDevices());
- this.netGraph.setAutoScale(this.configSettings.isNETAutoScaled());
- this.netGraph.setLogScale(this.configSettings.isNETLogScaled());
+ // this.netProvider.setDisabledInterfaces(this.configSettings.getNETDisabledDevices());
+ // this.netGraph.setAutoScale(this.configSettings.isNETAutoScaled());
+ // this.netGraph.setLogScale(this.configSettings.isNETLogScaled());
//check for new drives that are mounted
this.configSettings.adjustDiskDevices( Object.keys(this.diskProvider.getDiskDevices()) );
this.diskGraph.setAutoScale(this.configSettings.isDiskAutoScaled());
@@ -189,7 +189,7 @@ MyApplet.prototype = {
this.multiCpuProvider.isEnabled = this.configSettings.isCPUEnabled()
this.memProvider.isEnabled = this.configSettings.isMEMEnabled();
- this.netProvider.isEnabled = this.configSettings.isNETEnabled();
+ // this.netProvider.isEnabled = this.configSettings.isNETEnabled();
this.diskProvider.isEnabled = this.configSettings.isDiskEnabled();
for (var i = 0; i < this.graphs.length; i++)
@@ -206,7 +206,7 @@ MyApplet.prototype = {
appletTooltipstr += this.multiCpuProvider.getTooltipString();
appletTooltipstr += this.memProvider.getTooltipString();
appletTooltipstr += this.swapProvider.getTooltipString();
- appletTooltipstr += this.netProvider.getTooltipString();
+ // appletTooltipstr += this.netProvider.getTooltipString();
appletTooltipstr += this.diskProvider.getTooltipString();
this.set_applet_tooltip(appletTooltipstr.trim());
} catch(err) {
@@ -223,8 +223,8 @@ MyApplet.prototype = {
appwidth += this.configSettings.getCPUWidth()+1;
if(this.configSettings.isMEMEnabled())
appwidth += this.configSettings.getMEMWidth()+1;
- if(this.configSettings.isNETEnabled())
- appwidth += this.configSettings.getNETWidth()+1;
+ // if(this.configSettings.isNETEnabled())
+ // appwidth += this.configSettings.getNETWidth()+1;
if(this.configSettings.isDiskEnabled())
appwidth += this.configSettings.getDiskWidth()+1;
@@ -278,22 +278,22 @@ MyApplet.prototype = {
xoffset += this.configSettings.getMEMWidth()+1; //update xoffset for next translation
}
- if(this.configSettings.isNETEnabled())
- {
+ // if(this.configSettings.isNETEnabled())
+ // {
- area.get_context().translate(xoffset, 0); //translate origin to the new location for the graph
+ // area.get_context().translate(xoffset, 0); //translate origin to the new location for the graph
//paint the memory piechart over it
- this.netGraph.paint( area,
- this.configSettings.getLabelsOn(),
- this.configSettings.getNETWidth(),
- this.configSettings.getHeight(),
- this.configSettings.getBackgroundColor(),
- this.configSettings.getNETColorList());
+ // this.netGraph.paint( area,
+ // this.configSettings.getLabelsOn(),
+ // this.configSettings.getNETWidth(),
+ // this.configSettings.getHeight(),
+ // this.configSettings.getBackgroundColor(),
+ // this.configSettings.getNETColorList());
- area.get_context().translate(-1*xoffset, 0); //return translation to origin
- xoffset += this.configSettings.getNETWidth()+1; //update xoffset for next translation
- }
+ // area.get_context().translate(-1*xoffset, 0); //return translation to origin
+ // xoffset += this.configSettings.getNETWidth()+1; //update xoffset for next translation
+ // }
if(this.configSettings.isDiskEnabled())
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment