Skip to content

auto-dark-light@gihaume: v2.0.0 - #9381

Open
guillaume-mueller wants to merge 9 commits into
linuxmint:masterfrom
guillaume-mueller:auto-dark-light
Open

guillaume-mueller wants to merge 9 commits into
linuxmint:masterfrom
guillaume-mueller:auto-dark-light

Conversation

@guillaume-mueller

@guillaume-mueller guillaume-mueller commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Rewrite of the applet for maintainability and features, following #7939.

The changes are listed in CHANGELOG.md.

CONTRIBUTING.md introduces the development context.

Developed on Mint 22.3 with Cinnamon 6.6.9, and also tested in a Mint 27 beta live session.

Closes #6758, closes #7247, closes #7923, closes #8153, closes #7258.

@mtwebster Following your comments in #7939:

  • The time change listener binary is gone. Time jumps (set by the user, the network or a wake-up) are detected with Cinnamon's WallClock.
  • The screen lock state comes from imports.misc.screenSaver.
  • Sleep is no longer listened to, a wake-up being a time jump.
  • The crash I asked about came from WallClock itself, fixed in Cinnamon 6.8 by gnome-wall-clock.c: Fix use-after-free in 'changed' signal handlers. cinnamon-desktop#276. Before that version, the themes are applied after the unlocking.
  • The compiled output is no longer bundled: each source file has its own output. (see below)

@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. Most findings
are advisory and do not automatically disqualify a pull request.

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


Found 11 potential issue(s):

⚠️ WARNING

⚠️ screensaver_imports

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_platform/session_lock.js:16

const { ScreenSaverProxy } = imports.misc.screenSaver;

Screensaver modules are internal to Cinnamon and must not be imported
by third-party code. This includes the lock screen, unlock dialog, PAM
authentication, and all screensaver widgets.

auto-dark-light@gihaume/src/_platform/session_lock.js:16

const { ScreenSaverProxy } = imports.misc.screenSaver;

Screensaver modules are internal to Cinnamon and must not be imported
by third-party code. This includes the lock screen, unlock dialog, PAM
authentication, and all screensaver widgets.

ℹ️ INFO

ℹ️ shell_string_spawn

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:42

void GLib.spawn_command_line_async("cinnamon-looking-glass");

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:128

void GLib.spawn_command_line_async(

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:171

void GLib.spawn_command_line_async(

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:713

void GLib.spawn_command_line_async("cinnamon-settings calendar"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:823

() => void GLib.spawn_command_line_async("cinnamon-settings calendar"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:827

() => void GLib.spawn_command_line_async("cinnamon-settings themes"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:832

void GLib.spawn_command_line_async("cinnamon-settings backgrounds"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_platform/logger.js:125

void GLib.spawn_command_line_async(

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/applet.js:23

void GLib.spawn_command_line_async("cinnamon-looking-glass");

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.

@guillaume-mueller

guillaume-mueller commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

⚠️ screensaver_imports

Before Cinnamon 6.8, applying the themes right at a wake-up crashes the lock screen (linuxmint/cinnamon-screensaver#503), so session_lock.js provides ScreenSaverProxy to wait for the unlocking.

ℹ️ shell_string_spawn

The command strings are all static. (finally worked out in 34a5766)

@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. Most findings
are advisory and do not automatically disqualify a pull request.

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


Found 11 potential issue(s):

⚠️ WARNING

⚠️ screensaver_imports

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_platform/session_lock.js:16

const { ScreenSaverProxy } = imports.misc.screenSaver;

Screensaver modules are internal to Cinnamon and must not be imported
by third-party code. This includes the lock screen, unlock dialog, PAM
authentication, and all screensaver widgets.

auto-dark-light@gihaume/src/_platform/session_lock.js:16

const { ScreenSaverProxy } = imports.misc.screenSaver;

Screensaver modules are internal to Cinnamon and must not be imported
by third-party code. This includes the lock screen, unlock dialog, PAM
authentication, and all screensaver widgets.

ℹ️ INFO

ℹ️ shell_string_spawn

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:42

void GLib.spawn_command_line_async("cinnamon-looking-glass");

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:128

void GLib.spawn_command_line_async(

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:171

void GLib.spawn_command_line_async(

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:713

void GLib.spawn_command_line_async("cinnamon-settings calendar"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:823

() => void GLib.spawn_command_line_async("cinnamon-settings calendar"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:827

() => void GLib.spawn_command_line_async("cinnamon-settings themes"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:832

void GLib.spawn_command_line_async("cinnamon-settings backgrounds"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_platform/logger.js:125

void GLib.spawn_command_line_async(

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/applet.js:23

void GLib.spawn_command_line_async("cinnamon-looking-glass");

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. Most findings
are advisory and do not automatically disqualify a pull request.

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


Found 11 potential issue(s):

⚠️ WARNING

⚠️ screensaver_imports

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_platform/session_lock.js:16

const { ScreenSaverProxy } = imports.misc.screenSaver;

Screensaver modules are internal to Cinnamon and must not be imported
by third-party code. This includes the lock screen, unlock dialog, PAM
authentication, and all screensaver widgets.

auto-dark-light@gihaume/src/_platform/session_lock.js:16

const { ScreenSaverProxy } = imports.misc.screenSaver;

Screensaver modules are internal to Cinnamon and must not be imported
by third-party code. This includes the lock screen, unlock dialog, PAM
authentication, and all screensaver widgets.

ℹ️ INFO

ℹ️ shell_string_spawn

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:42

void GLib.spawn_command_line_async("cinnamon-looking-glass");

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:128

void GLib.spawn_command_line_async(

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:171

void GLib.spawn_command_line_async(

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:713

void GLib.spawn_command_line_async("cinnamon-settings calendar"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:823

() => void GLib.spawn_command_line_async("cinnamon-settings calendar"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:827

() => void GLib.spawn_command_line_async("cinnamon-settings themes"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_applet/applet_launching.js:832

void GLib.spawn_command_line_async("cinnamon-settings backgrounds"),

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/_platform/logger.js:125

void GLib.spawn_command_line_async(

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.

auto-dark-light@gihaume/files/auto-dark-light@gihaume/5.8/applet.js:23

void GLib.spawn_command_line_async("cinnamon-looking-glass");

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.

@guillaume-mueller

Copy link
Copy Markdown
Contributor Author

Just tested on Cinnamon 5.8.4 (Mint 21.2 live session), hence the fix.

  - import it with a `last-edited` query, so that reloads (w/o cinnamon restart) run the new version
  - shorten the repetitive applet paths in reported stacks
- replace the version folders with `cinnamon-version` in `metadata.json`
@guillaume-mueller

guillaume-mueller commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

CJS caches ES modules by URL until Cinnamon restarts, so an update reloaded with ReloadXlet kept running the old modules.

The runtime is now bundled into a single ES module, imported with ?last-edited=<timestamp> from metadata.json so each update gets a new URL.

  - only create it before Cinnamon 6.8, where it is needed
@guillaume-mueller

Copy link
Copy Markdown
Contributor Author

Not sure why da.po, el_GR.po and ru_RU.po got deleted… never intended to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant