workspace-indicator@benzor.hu: added#8321
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Cinnamon applet spice (workspace-indicator@benzor.hu) that provides a minimal panel workspace indicator with optional Expo-on-click and scroll-to-switch behavior.
Changes:
- Introduces the new applet implementation (
applet.js) with click (Expo) and scroll (workspace switch) interactions. - Adds Cinnamon metadata and settings schema (
metadata.json,settings-schema.json) plus supporting documentation (README.md,ATTRIBUTION.md,COPYING). - Adds applet assets (icon and screenshot) and spice metadata (
info.json).
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| workspace-indicator@benzor.hu/files/workspace-indicator@benzor.hu/applet.js | Implements the indicator button, tooltip, click-to-Expo, and scroll-to-switch logic. |
| workspace-indicator@benzor.hu/files/workspace-indicator@benzor.hu/metadata.json | Declares Cinnamon applet metadata (uuid/name/version/instance limit, etc.). |
| workspace-indicator@benzor.hu/files/workspace-indicator@benzor.hu/settings-schema.json | Adds settings toggles for Expo click and scroll switching. |
| workspace-indicator@benzor.hu/info.json | Adds spice-level metadata (author/license). |
| workspace-indicator@benzor.hu/README.md | Documents behavior and settings. |
| workspace-indicator@benzor.hu/ATTRIBUTION.md | Notes upstream inspiration and icon source. |
| workspace-indicator@benzor.hu/COPYING | Adds GPLv3 license text. |
| workspace-indicator@benzor.hu/files/workspace-indicator@benzor.hu/icon.png | Adds the applet icon asset. |
| workspace-indicator@benzor.hu/screenshot.png | Adds a screenshot asset for the spice. |
| "name": "Workspace Indicator", | ||
| "description": "Single-button workspace indicator and switcher", | ||
| "version": "1.0.0", | ||
| "max_instances": 10, |
There was a problem hiding this comment.
metadata.json uses max_instances, but Cinnamon applet metadata expects max-instances (hyphenated). With the underscore key, the instance limit will be ignored by Cinnamon/spices tooling. Rename the key to max-instances (and keep the numeric value).
| "max_instances": 10, | |
| "max-instances": 10, |
| let direction = event.get_scroll_direction(); | ||
|
|
||
| if (direction !== 0 && direction !== 1) return; | ||
|
|
||
| const now = (new Date()).getTime(); | ||
|
|
||
| if ((now - this.last_switch) >= MIN_SWITCH_INTERVAL_MS || direction !== this.last_switch_direction) { | ||
| direction === 0 ? Main.wm.actionMoveWorkspaceLeft() : Main.wm.actionMoveWorkspaceRight(); | ||
| } |
There was a problem hiding this comment.
get_scroll_direction() is compared against magic numbers 0 and 1. For readability and future compatibility, prefer Clutter.ScrollDirection.UP/DOWN (and ignore SMOOTH) like other applets in this repo; this also makes the intent clearer than relying on numeric enum values.
Added a minimal workspace indicator applet.