Skip to content

Add Resource Monitor applet#8284

Closed
kpr-dev590 wants to merge 9 commits intolinuxmint:masterfrom
kpr-dev590:add-resource-monitor-kprakesh
Closed

Add Resource Monitor applet#8284
kpr-dev590 wants to merge 9 commits intolinuxmint:masterfrom
kpr-dev590:add-resource-monitor-kprakesh

Conversation

@kpr-dev590
Copy link
Copy Markdown

@kpr-dev590 kpr-dev590 commented Feb 6, 2026

This PR adds a new applet: Resource Monitor.

Features:

  • Real-time monitoring of CPU, RAM, and Swap usage.
  • Dependency-free: Reads directly from /proc for high performance and zero extra library requirements.
  • Customizable: Users can toggle individual metrics on/off.
  • Empty State: Displays a symbolic icon when all toggles are disabled.

I've tested this on Cinnamon 6.6.6 (Linux Mint 22.3 x86_64) and ensured it follows the standard desktop UI guidelines.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new Resource Monitor applet for the Cinnamon desktop environment that displays real-time CPU, RAM, and Swap usage directly in the panel. The applet reads system metrics from /proc filesystem files for lightweight, dependency-free monitoring with customizable display options.

Changes:

  • Added a new system resource monitoring applet with CPU, RAM, and Swap tracking
  • Implemented customizable settings to toggle individual metrics on/off
  • Provided comprehensive documentation including README and LICENSE files

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
resource-monitor@kprakesh/applet.js Main applet implementation with /proc parsing logic and update loop
resource-monitor@kprakesh/metadata.json Applet metadata including name, description, version, and Cinnamon compatibility
resource-monitor@kprakesh/settings-schema.json Configuration schema for toggling CPU, RAM, and Swap display
resource-monitor@kprakesh/README.md Comprehensive documentation covering features, installation, and technical details
resource-monitor@kprakesh/LICENSE GPL-3.0 license text
resource-monitor@kprakesh/utilities-system-monitor.png Icon file (should be renamed to icon.png)

Comment thread resource-monitor@kprakesh/applet.js Outdated
Comment thread resource-monitor@kprakesh/applet.js Outdated
Comment thread resource-monitor@kprakesh/applet.js Outdated
Comment thread resource-monitor@kprakesh/files/resource-monitor@kprakesh/applet.js
Comment thread resource-monitor@kprakesh/README.md Outdated
Comment thread resource-monitor@kprakesh/metadata.json Outdated
Comment thread resource-monitor@kprakesh/metadata.json Outdated
Comment thread resource-monitor@kprakesh/files/resource-monitor@kprakesh/applet.js
Comment thread resource-monitor@kprakesh/applet.js Outdated
Comment thread resource-monitor@kprakesh/metadata.json Outdated
@github-actions
Copy link
Copy Markdown
Contributor

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 5 potential issue(s):

⚠️ sync_file_get_contents

resource-monitor@kprakesh/files/resource-monitor@kprakesh/applet.js:65

let [ok_cpu, statContent] = GLib.file_get_contents("/proc/stat");

Synchronous file_get_contents() blocks the main loop.
Use Gio.File.load_contents_async() instead.

resource-monitor@kprakesh/files/resource-monitor@kprakesh/applet.js:93

let [ok_mem, memContent] = GLib.file_get_contents("/proc/meminfo");

Synchronous file_get_contents() blocks the main loop.
Use Gio.File.load_contents_async() instead.

⚠️ lang_bind

resource-monitor@kprakesh/files/resource-monitor@kprakesh/applet.js:55

this._timeoutId = Mainloop.timeout_add_seconds(UPDATE_INTERVAL_SECONDS, Lang.bind(this, this._update_loop));

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.

ℹ️ shell_string_spawn

screen-snipper@kprakesh/applet.js:63

Util.spawnCommandLine("gnome-screenshot -a -c");

Prefer argument vector spawn functions over shell command strings.
This is especially important when arguments include untrusted input (user data,
filenames, settings values, etc.) as shell strings are vulnerable to injection.
Static command strings are generally fine, but argv is always safer.
Use Util.spawn(["cmd", "arg1", "arg2"]) or Util.trySpawn() instead.

screen-snipper@kprakesh/applet.js:68

Util.spawnCommandLine(`gnome-screenshot -c -d ${this.delaySeconds}`);

Prefer argument vector spawn functions over shell command strings.
This is especially important when arguments include untrusted input (user data,
filenames, settings values, etc.) as shell strings are vulnerable to injection.
Static command strings are generally fine, but argv is always safer.
Use Util.spawn(["cmd", "arg1", "arg2"]) or Util.trySpawn() instead.


Automated pattern check.

@github-actions
Copy link
Copy Markdown
Contributor

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 2 potential issue(s):

ℹ️ shell_string_spawn

screen-snipper@kprakesh/applet.js:63

Util.spawnCommandLine("gnome-screenshot -a -c");

Prefer argument vector spawn functions over shell command strings.
This is especially important when arguments include untrusted input (user data,
filenames, settings values, etc.) as shell strings are vulnerable to injection.
Static command strings are generally fine, but argv is always safer.
Use Util.spawn(["cmd", "arg1", "arg2"]) or Util.trySpawn() instead.

screen-snipper@kprakesh/applet.js:68

Util.spawnCommandLine(`gnome-screenshot -c -d ${this.delaySeconds}`);

Prefer argument vector spawn functions over shell command strings.
This is especially important when arguments include untrusted input (user data,
filenames, settings values, etc.) as shell strings are vulnerable to injection.
Static command strings are generally fine, but argv is always safer.
Use Util.spawn(["cmd", "arg1", "arg2"]) or Util.trySpawn() instead.


Automated pattern check.

@github-actions
Copy link
Copy Markdown
Contributor

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 2 potential issue(s):

ℹ️ shell_string_spawn

screen-snipper@kprakesh/applet.js:63

Util.spawnCommandLine("gnome-screenshot -a -c");

Prefer argument vector spawn functions over shell command strings.
This is especially important when arguments include untrusted input (user data,
filenames, settings values, etc.) as shell strings are vulnerable to injection.
Static command strings are generally fine, but argv is always safer.
Use Util.spawn(["cmd", "arg1", "arg2"]) or Util.trySpawn() instead.

screen-snipper@kprakesh/applet.js:68

Util.spawnCommandLine(`gnome-screenshot -c -d ${this.delaySeconds}`);

Prefer argument vector spawn functions over shell command strings.
This is especially important when arguments include untrusted input (user data,
filenames, settings values, etc.) as shell strings are vulnerable to injection.
Static command strings are generally fine, but argv is always safer.
Use Util.spawn(["cmd", "arg1", "arg2"]) or Util.trySpawn() instead.


Automated pattern check.

@github-actions
Copy link
Copy Markdown
Contributor

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 2 potential issue(s):

ℹ️ shell_string_spawn

screen-snipper@kprakesh/applet.js:63

Util.spawnCommandLine("gnome-screenshot -a -c");

Prefer argument vector spawn functions over shell command strings.
This is especially important when arguments include untrusted input (user data,
filenames, settings values, etc.) as shell strings are vulnerable to injection.
Static command strings are generally fine, but argv is always safer.
Use Util.spawn(["cmd", "arg1", "arg2"]) or Util.trySpawn() instead.

screen-snipper@kprakesh/applet.js:68

Util.spawnCommandLine(`gnome-screenshot -c -d ${this.delaySeconds}`);

Prefer argument vector spawn functions over shell command strings.
This is especially important when arguments include untrusted input (user data,
filenames, settings values, etc.) as shell strings are vulnerable to injection.
Static command strings are generally fine, but argv is always safer.
Use Util.spawn(["cmd", "arg1", "arg2"]) or Util.trySpawn() instead.


Automated pattern check.

@kpr-dev590 kpr-dev590 closed this Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants