Skip to content

Commit

Permalink
Merge pull request linuxmint#321 from Odyseus/0dyseus@SysmonitorByOrcus
Browse files Browse the repository at this point in the history
System Monitor (Fork By Odyseus) (0dyseus@SysmonitorByOrcus) update
  • Loading branch information
brownsr committed Apr 17, 2017
2 parents d008c51 + ed03c43 commit 18ba1cb
Show file tree
Hide file tree
Showing 10 changed files with 424 additions and 52 deletions.
8 changes: 7 additions & 1 deletion 0dyseus@SysmonitorByOrcus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Change Log

##### 1.11
- Fixed the display of **Load average** and **Swap** graphics.
- Added localized help.
- Changed contributors key on metadata.json file from a string to an array for better readability.
- Some minor code clean up.

##### 1.10
- Better handling of dependencies.

Expand All @@ -17,7 +23,7 @@
- Added support for localizations. If someone wants to contribute with translations, inside the Help section of this applet (found in the applet context menu or the Help.md file inside this applet folder) you will find some pointers on how to do it.

##### 1.05
- Re-writed to use Cinnamon's native settings system instead of an external library. This allowed me to remove **gjs** as a dependency for this applet.
- Rewritten to use Cinnamon's native settings system instead of an external library. This allowed me to remove **gjs** as a dependency for this applet.
- Added an option to use a custom command on applet click.
- Added an option to set a custom width for each graph individually.
- Added an option to align this applet tooltip text to the left. ¬¬
Expand Down
67 changes: 66 additions & 1 deletion 0dyseus@SysmonitorByOrcus/HELP.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,76 @@ html
title System Monitor (Fork By Odyseus) applet help
link(rel='shortcut icon', type='image/x-icon', href='./icon.png')
meta(name='viewport', content='width=device-width, initial-scale=1')

script(type='text/javascript')
include ../../docs/lib/js/localizations-handler.js

style(type='text/css')
include ../../docs/lib/css/bootstrap-for-standalone.min.css
include ../../docs/lib/css/tweaks.css

style(type='text/css').
.localization-chooser {
padding: 1em !important;
width: 100% !important;
}

.localization-chooser input.btn {
font-weight: bold !important;
margin: 5px !important;
height: 100% !important;
display: inline-block !important;
}

body
noscript
style(type='text/css').
#autohide_navbar {
display: none !important;
}
#noscript-navbar {
display: inline-block !important;
}
#noscript-navbar > li {
float: left !important;
margin: 2px !important;
padding: 2px !important;
top: 0 !important;
display: inline-block !important;
}
#noscript-navbar li > ul {
margin: 1px !important;
padding: 1px !important;
}
#noscript-navbar li {
list-style: none !important;
list-style-type: none !important;
}

.alert.alert-warning
p: strong Oh snap! This page needs JavaScript enabled to display correctly.
p: strong This page uses JavaScript only to switch between the available languages.
p: strong There are no tracking services of any kind and never will be (at least, not from my side).

div#mainarea
.localization-chooser(align="middle")
input(type='button', class='btn btn-success btn-sm localization-switch' value='English' data-id='english' data-title='System Monitor (Fork By Odyseus) applet help' onclick='self.toggleLocalizationVisibility(this);')
input(type='button', class='btn btn-default btn-sm localization-switch' value='Español' data-id='spanish' data-title='Ayuda para el applet Monitor de Sistema (Modificado por Odyseus)' onclick='self.toggleLocalizationVisibility(this);')
//- Example:
//- input(type='button', class='btn btn-default btn-sm localization-switch' value='language-endonym' data-id='language-name' data-title='page-title' onclick='self.toggleLocalizationVisibility(this);')
//- language-endonym = Language name in the language tongue in capital case (if apply).
//- language-name = Language name in English and in lower case.
//- page-title = The translated page title.
.container.boxed
include:markdown-it(html) HELP.md
#english.localization-content
include:markdown-it(html) docs/HELP.md
#spanish.localization-content.hidden
include:markdown-it(html) docs/HELP-es.md
//- Example:
//- #language-name.localization-content.hidden
//- include:markdown-it(html) docs/HELP-language-code.md
//- language-name = Language name in English and in lower case. The same used on the input.
//- language-code = The code of the language used on the translated file.
script(type='text/javascript').
toggleLocalizationVisibility(null);
44 changes: 44 additions & 0 deletions 0dyseus@SysmonitorByOrcus/docs/HELP-es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

# Ayuda para el applet Monitor de Sistema (Modificado por Odyseus)

### ¡IMPORTANTE!
Jamás borrar ninguno de los archivos encontrados dentro de la carpeta de este xlet. Podría romper la funcionalidad del xlet.

***

<h2 style="color:red;">Reportes de fallos, peticiones de características y contribuciones</h2>
<span style="color:red;">
Si cualquiera tiene fallos que reportar, peticiones de características y contribuciones, deben realizarlas <a href="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/Odyseus/CinnamonTools">en la página de GitHub de este xlet</a>.
</span>

***

### Dependencias

- **gir1.2-gtop-2.0**: La biblioteca gtop lee información acerca de procesos y el estado del
sistema.
- Distribuciones basadas en Debian: El packate es llamado **gir1.2-gtop-2.0**.
- Distribuciones basadas en Archlinux: El packate es llamado **libgtop**.
- Distribuciones basadas en Fedora: El packate es llamado **libgtop2-devel**.
- **NetworkManager**: NetworkManager es un servicio de red del sistema que administra los dispositivos y conexiones de red, intentando mantener una conectividad de red activa cuando está disponible.
- Distribuciones basadas en Debian: El packate es llamado **gir1.2-networkmanager-1.0**.
- Distribuciones basadas en Archlinux: El packate es llamado **networkmanager**.
- Distribuciones basadas en Fedora: El packate es llamado **NetworkManager**.

**Nota importante:** NetworkManager is usado sólo si la versión de la librería **GTop** instalada en el sistema es < 2.32 y no soporta ciertas llamadas a la librería. Básicamente, si el gráfico de red de este applet funciona sin tener instalado NetworkManager, entonces no es necesario que sea instalado.

**Reiniciar Cinnamon luego de haber instalado los paquetes para que el applet los reconozca.**

***

### Localización de applets/desklets/extensiones (también conocidos como xlets)

- Si este xlet se instaló desde Configuración de Cinnamon, todas las localizaciones de este xlet se instalaron automáticamente.
- Si este xlet se instaló manualmente y no a través de Configuración de Cinnamon, las localizaciones se pueden instalar ejecutando el archivo llamado **localizations.sh** desde una terminal abierta dentro de la carpeta del xlet.
- Si este xlet no está disponible en su idioma, la localización puede ser creada siguiendo [estas instrucciones](https://github.com/Odyseus/CinnamonTools/wiki/Xlet-localization) y luego enviarme el archivo .po.
- Si se posee una cuenta de GitHub:
- Puede enviar una "pull request" con el nuevo archivo de localización.
- Si no se desea clonar el repositorio, simplemente crear un [Gist](https://gist.github.com/) y enviarme el enlace.
- Si no se posee o no se quiere una cuenta de GitHub:
- Se puede enviar un [Pastebin](http:https://pastebin.com/) (o servicio similar) a mi [cuenta en el for de Linux Mint](https://forums.linuxmint.com/memberlist.php?mode=viewprofile&u=164858).
- Si el texto fuente (en Inglés) y/o mi traducción al Español contiene errores o inconsistencias, no dude en informarlos.
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@

<!--
Notes to translators:
- Do not modify this file directly. Create a copy of it with a different name that contains the language code and always use the .md extension for the file. Example: HELP-es.md file will contain the content of the HELP.md file translated into Spanish.
- This file is written in [markdown](https://guides.github.com/features/mastering-markdown/) and some "touches" of HTML.
- Familiarize yourself with markdown and HTML languages before attempting to translate the content of this file.
- These notes doesn't need to be translated and can be deleted from the translated file.
-->

# Help for System Monitor (Fork By Odyseus) applet

### IMPORTANT!!!
Never delete any of the files found inside this applet folder. It might break this applet functionality.
Never delete any of the files found inside this xlet folder. It might break this xlet functionality.

***

Expand Down Expand Up @@ -31,14 +39,14 @@ system.

***

### Applet localization
### Applets/Desklets/Extensions (a.k.a. xlets) localization

- If this applet was installed from Cinnamon Settings, all of this applet's localizations were automatically installed.
- If this applet was installed manually and not trough Cinnamon Settings, localizations can be installed by executing the script called **localizations.sh** from a terminal opened inside the applet's folder.
- If this applet has no locale available for your language, you could create it by following [these instructions](https://github.com/Odyseus/CinnamonTools/wiki/Xlet-localization) and send the .po file to me.
- If this xlet was installed from Cinnamon Settings, all of this xlet's localizations were automatically installed.
- If this xlet was installed manually and not trough Cinnamon Settings, localizations can be installed by executing the script called **localizations.sh** from a terminal opened inside the xlet's folder.
- If this xlet has no locale available for your language, you could create it by following [these instructions](https://github.com/Odyseus/CinnamonTools/wiki/Xlet-localization) and send the .po file to me.
- If you have a GitHub account:
- You could send a pull request with the new locale file.
- If you don't want to clone the repository, just create a Gist and send me the link.
- If you don't want to clone the repository, just create a [Gist](https://gist.github.com/) and send me the link.
- If you don't have/want a GitHub account:
- You can send me a [Pastebin](http:https://pastebin.com/) (or similar service) to my [Mint Forums account](https://forums.linuxmint.com/memberlist.php?mode=viewprofile&u=164858).
- If the source text (in English) and/or my translation to Spanish has errors/inconsistencies, feel free to report them.
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ MyApplet.prototype = {
}

if (this.pref_show_swap_graph) {
this.addGraph(new SwapDataProvider(),
this._parseColor(this.pref_swap_graph_color_used),
this.addGraph(new SwapDataProvider(), [
this._parseColor(this.pref_swap_graph_color_used)
],
this.pref_swap_graph_width);
}

Expand All @@ -160,8 +161,9 @@ MyApplet.prototype = {
}

if (this.pref_show_load_graph) {
this.addGraph(new LoadAvgDataProvider(),
this._parseColor(this.pref_load_graph_color_load),
this.addGraph(new LoadAvgDataProvider(), [
this._parseColor(this.pref_load_graph_color_load)
],
this.pref_load_graph_width).setAutoScale(2 * ncpu);
}

Expand Down Expand Up @@ -403,7 +405,8 @@ Graph.prototype = {
let [width, height] = this.area.get_size();
//background
if (this.background !== null) {
cr.setSourceRGBA(this.background[0], this.background[1], this.background[2], this.background[3]);
cr.setSourceRGBA(this.background[0], this.background[1], this.background[2],
this.background[3]);
cr.setLineWidth(1);
cr.rectangle(0.5, 0.5, width - 1, height - 1);
cr.fill();
Expand All @@ -417,7 +420,8 @@ Graph.prototype = {
let i = 0,
iLen = this.data.length;
for (; i < iLen; ++i)
cr.lineTo(i + 1.5, height - Math.round((height - 1) * this.scale * this.dataSum(i, j)));
cr.lineTo(i + 1.5, height - Math.round((height - 1) *
this.scale * this.dataSum(i, j)));
cr.lineTo(width - 1.5, height);
cr.lineTo(1.5, height);
cr.fillPreserve();
Expand Down Expand Up @@ -523,7 +527,8 @@ MemDataProvider.prototype = {
GTop.glibtop_get_mem(this.gtop);
let used = this.gtop.used / this.gtop.total;
let cached = (this.gtop.buffer + this.gtop.cached) / this.gtop.total;
this.text = [_("Memory: "), Math.round((this.gtop.used - this.gtop.cached - this.gtop.buffer) / (1024 * 1024)) + " / " + Math.round(this.gtop.total / (1024 * 1024)) + _(" MB")];
this.text = [_("Memory: "), Math.round((this.gtop.used - this.gtop.cached - this.gtop.buffer) /
(1024 * 1024)) + " / " + Math.round(this.gtop.total / (1024 * 1024)) + _(" MB")];
return [used - cached, cached];
},

Expand All @@ -548,7 +553,9 @@ SwapDataProvider.prototype = {
getData: function() {
GTop.glibtop_get_swap(this.gtop);
let used = this.gtop.used / this.gtop.total;
this.text = [_("Swap: "), Math.round(this.gtop.used / (1024 * 1024)) + " / " + Math.round(this.gtop.total / (1024 * 1024)) + _(" MB")];
this.text = [_("Swap: "), Math.round(this.gtop.used / (1024 * 1024)) + " / " +
Math.round(this.gtop.total / (1024 * 1024)) + _(" MB")
];
return [used];
},

Expand Down Expand Up @@ -590,7 +597,9 @@ NetDataProvider.prototype = {
let up_delta = (up - this.up_last) * 1000 / this.refreshRate;
this.down_last = down;
this.up_last = up;
this.text = [_("Network D/U: "), Math.round(down_delta / 1024) + " / " + Math.round(up_delta / 1024) + _(" KB/s")];
this.text = [_("Network D/U: "), Math.round(down_delta / 1024) + " / " +
Math.round(up_delta / 1024) + _(" KB/s")
];
return [down_delta, up_delta];
},

Expand Down Expand Up @@ -628,7 +637,9 @@ LoadAvgDataProvider.prototype = {
getData: function() {
GTop.glibtop_get_loadavg(this.gtop);
let load = this.gtop.loadavg[0];
this.text = [_("Load average: "), this.gtop.loadavg[0] + ", " + this.gtop.loadavg[1] + ", " + this.gtop.loadavg[2]];
this.text = [_("Load average: "), this.gtop.loadavg[0] + ", " + this.gtop.loadavg[1] +
", " + this.gtop.loadavg[2]
];
return [load];
},

Expand Down
Loading

0 comments on commit 18ba1cb

Please sign in to comment.