Skip to content

Add workspace-icons@yoy675 extension - #1135

Open
yoy675 wants to merge 5 commits into
linuxmint:masterfrom
yoy675:master
Open

Add workspace-icons@yoy675 extension#1135
yoy675 wants to merge 5 commits into
linuxmint:masterfrom
yoy675:master

Conversation

@yoy675

@yoy675 yoy675 commented Aug 13, 2026

Copy link
Copy Markdown

Add new extension: workspace-icons@yoy675

Description

This extension lets users present a different Desktop folder (and therefore different desktop icons) per workspace in Cinnamon.

Features

  • Per-workspace Desktop folder handling (creates ~/Desktop/workspace0, workspace1, ...)
  • Automatically creates all workspace directories on extension enable
  • Copies existing Desktop contents into workspace folders on first use
  • Restores/merges workspace contents back into ~/Desktop when disabled
  • Secure command execution to prevent injection attacks

Security

  • Uses GLib.spawn_async with argument arrays (no shell command strings)
  • Thoroughly tested for command injection vulnerabilities
  • Cinnamon-specific operations only

Testing

Tested on Cinnamon 5.x and 6.x

yoy675 and others added 4 commits August 12, 2026 19:48
- Fix command injection vulnerability by using GLib.spawn_async with argument array
- Add user confirmation prompt before overwriting files during disable
- Improve error handling and add warnings
- Scope extension to Cinnamon-specific operations
Add workspace-icons@yoy675 extension with security fixes
… Per-workspace Desktop folder handling\n- Pre-creates all workspace directories on enable\n- Reads workspace count from gsettings\n- Secure command execution (GLib.spawn_async with argument arrays)\n- Copies Desktop contents to workspace folders on first creation\n- Merges workspace contents back on disable\n\nSecurity:\n- Fixed command injection vulnerability\n- Uses array-based spawning instead of shell commands\n- Scoped to Cinnamon-specific operations"
@github-actions

Copy link
Copy Markdown

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

⚠️ sync_spawn

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:248

GLib.spawn_sync(

Synchronous process spawning blocks the main loop.
Use GLib.spawn_async() or Gio.Subprocess instead.

⚠️ sync_file_enumerate_children

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:122

const enumerator = wsDir.enumerate_children(

Synchronous enumerate_children() blocks the main loop.
Use enumerate_children_async() instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:140

const enumerator = desktopDir.enumerate_children(

Synchronous enumerate_children() blocks the main loop.
Use enumerate_children_async() instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:178

const enumerator = desktopDir.enumerate_children(

Synchronous enumerate_children() blocks the main loop.
Use enumerate_children_async() instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:218

const enumerator = srcDir.enumerate_children(

Synchronous enumerate_children() blocks the main loop.
Use enumerate_children_async() instead.

⚠️ sync_file_query_exists

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:104

if (!file.query_exists(null)) {

query_exists() is a synchronous call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:118

if (!desktopDir.query_exists(null)) return;

query_exists() is a synchronous call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:157

if (!destFile.query_exists(null)) {

query_exists() is a synchronous call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:176

if (desktopDir.query_exists(null)) {

query_exists() is a synchronous call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:215

if (!srcDir.query_exists(null)) return;

query_exists() is a synchronous call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

⚠️ global_screen

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:8

this._workspaceManager = global.screen;

(Cinnamon 5.4) global.screen is a deprecated compatibility shim for the removed MetaScreen.
Use the appropriate replacement instead:

  • Workspace operations: global.workspace_manager (get_n_workspaces(),
    get_workspace_by_index(), append_new_workspace(), remove_workspace(),
    override_workspace_layout(), toggle_desktop(), show_desktop(),
    get_active_workspace(), get_active_workspace_index(), get_workspaces())
  • Monitor info: Main.layoutManager (monitors, primaryMonitor, primaryIndex,
    focusMonitor, currentMonitor — each with geometry, index, name, and
    inFullscreen properties)
  • Monitor by rect: global.display.get_monitor_index_for_rect()
  • Display size: global.display.get_size()
  • Mouse window: Main.layoutManager.getWindowAtPointer()
  • Window xid: metaWindow.get_xwindow()
  • Display: global.display

Automated pattern check.

@github-actions

Copy link
Copy Markdown

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

⚠️ sync_spawn

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:248

GLib.spawn_sync(

Synchronous process spawning blocks the main loop.
Use GLib.spawn_async() or Gio.Subprocess instead.

⚠️ sync_file_enumerate_children

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:122

const enumerator = wsDir.enumerate_children(

Synchronous enumerate_children() blocks the main loop.
Use enumerate_children_async() instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:140

const enumerator = desktopDir.enumerate_children(

Synchronous enumerate_children() blocks the main loop.
Use enumerate_children_async() instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:178

const enumerator = desktopDir.enumerate_children(

Synchronous enumerate_children() blocks the main loop.
Use enumerate_children_async() instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:218

const enumerator = srcDir.enumerate_children(

Synchronous enumerate_children() blocks the main loop.
Use enumerate_children_async() instead.

⚠️ sync_file_query_exists

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:104

if (!file.query_exists(null)) {

query_exists() is a synchronous call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:118

if (!desktopDir.query_exists(null)) return;

query_exists() is a synchronous call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:157

if (!destFile.query_exists(null)) {

query_exists() is a synchronous call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:176

if (desktopDir.query_exists(null)) {

query_exists() is a synchronous call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:215

if (!srcDir.query_exists(null)) return;

query_exists() is a synchronous call that can block on slow/network filesystems.
Prefer attempting the operation and handling a Gio.IOErrorEnum.NOT_FOUND error instead.

⚠️ global_screen

workspace-icons@yoy675/files/workspace-icons@yoy675/extension.js:8

this._workspaceManager = global.screen;

(Cinnamon 5.4) global.screen is a deprecated compatibility shim for the removed MetaScreen.
Use the appropriate replacement instead:

  • Workspace operations: global.workspace_manager (get_n_workspaces(),
    get_workspace_by_index(), append_new_workspace(), remove_workspace(),
    override_workspace_layout(), toggle_desktop(), show_desktop(),
    get_active_workspace(), get_active_workspace_index(), get_workspaces())
  • Monitor info: Main.layoutManager (monitors, primaryMonitor, primaryIndex,
    focusMonitor, currentMonitor — each with geometry, index, name, and
    inFullscreen properties)
  • Monitor by rect: global.display.get_monitor_index_for_rect()
  • Display size: global.display.get_size()
  • Mouse window: Main.layoutManager.getWindowAtPointer()
  • Window xid: metaWindow.get_xwindow()
  • Display: global.display

Automated pattern check.

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.

1 participant