### Start GDB for Binary Program Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Launch GDB to debug a binary executable like Nemo. ```bash gdb nemo ``` -------------------------------- ### Install Debug Symbols Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Install debug symbols for core Cinnamon components using apt-get. This is a prerequisite for effective debugging. ```bash sudo apt-get install gnome-dbg nemo-dbg cinnamon-dbg muffin-dbg ``` -------------------------------- ### Get Cinnamon Version Source: https://github.com/linuxmint/cinnamon/wiki/Issues-and-Troubleshooting Use this command to retrieve the currently installed version of Cinnamon. This information is often required when reporting bugs. ```bash cinnamon --version ``` -------------------------------- ### Start GDB for Python Program Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Launch GDB to debug a Python script. Replace with the actual path to your script. ```bash gdb python ``` -------------------------------- ### Kill Existing Program Instances Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Before debugging, ensure no instances of the program are running. This example shows how to kill the Nemo process. ```bash sudo killall nemo ``` -------------------------------- ### Get Setting Value Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Retrieves the current value of a specified configuration key. The value can be a boolean, string, or number. ```javascript getValue(key_name) ``` -------------------------------- ### Get Backtrace in GDB Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program After a crash, obtain a backtrace of all threads to diagnose the issue. This command is used within GDB. ```bash thread apply all bt ``` -------------------------------- ### Generate GDB Trace for Cinnamon Crash Source: https://github.com/linuxmint/cinnamon/wiki/Issues-and-Troubleshooting This script helps generate a GDB trace when Cinnamon crashes, which is crucial for developers to diagnose and fix bugs. Ensure you have a fallback DE installed and follow the steps carefully. ```bash kill -9 $(pidof cinnamon) ``` ```bash cin-debug-run cinnamon --replace ``` ```bash DISPLAY=:0 cinnamon-launcher ``` -------------------------------- ### Applet/Desklet/Extension Settings Constructors Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Instantiate settings objects for applets, desklets, or extensions. Ensure the correct constructor is used based on the component type. ```javascript new Settings.AppletSettings(this, "settings-example@cinnamon.org", instanceId); ``` ```javascript new Settings.DeskletSettings(this, "settings-example@cinnamon.org", instanceId); ``` ```javascript new Settings.ExtensionSettings(this, "settings-example@cinnamon.org"); ``` -------------------------------- ### Settings Constructors Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Constructors for creating settings objects for Applets, Desklets, and Extensions. ```APIDOC ## Settings Constructors ### `new Settings.AppletSettings(this, "settings-example@cinnamon.org", instanceId);` ### `new Settings.DeskletSettings(this, "settings-example@cinnamon.org", instanceId);` ### `new Settings.ExtensionSettings(this, "settings-example@cinnamon.org");` ``` -------------------------------- ### Command line access to configuration page Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Command line arguments to access the configuration page for applets, desklets, and extensions. ```APIDOC ## Command line access to configuration page in Cinnamon Settings ### `cinnamon-settings applets *uuid*` ### `cinnamon-settings desklets *uuid*` ### `cinnamon-settings extensions *uuid*` ``` -------------------------------- ### Add Nvidia Modules for Kernel Mode Setting Source: https://github.com/linuxmint/cinnamon/wiki/Performance-Tips Add the specified Nvidia modules to /etc/initramfs-tools/modules to ensure they are loaded during system initialization when using kernel mode setting. ```bash nvidia nvidia_modeset nvidia_uvm nvidia_drm ``` -------------------------------- ### Update GRUB and Initramfs Source: https://github.com/linuxmint/cinnamon/wiki/Performance-Tips Run these commands after modifying GRUB configuration and initramfs modules to apply the changes and reboot the system. ```bash sudo update-grub && sudo update-initramfs -u ``` -------------------------------- ### Keybinding Management Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Methods for adding and removing hotkeys for applets and desklets. ```APIDOC ## Keybinding Management ### Setting up a keybinding: `Main.keybindingManager.addHotKey(id, this.keybinding, Lang.bind(this, this.on_hotkey_triggered));` * `id` (string): Can be any string. If your applet or desklet supports multiple instances, add the instance ID to this string to keep it unique from other instances. * `this.keybinding`: Contains the parseable keybinding string. * `this.on_hotkey_triggered`: The callback method to be triggered when the hotkey is pressed. ### Removing a keybinding: `Main.keybindingManager.removeHotKey(id)` * `id` (string): The string used when the keybinding was originally defined. ``` -------------------------------- ### Backup Cinnamon Settings Source: https://github.com/linuxmint/cinnamon/wiki/Backing-up-and-restoring-your-cinnamon-settings-(dconf) Use this command to dump all Cinnamon settings to a file. Save the output file to a secure location for future restoration. ```bash dconf dump /org/cinnamon/ > backup_of_my_cinnamon_settings ``` -------------------------------- ### Extension Initialization Function Source: https://github.com/linuxmint/cinnamon/wiki/[Development]-extensions The init function is called when the extension is loaded. It receives extension metadata, allowing access to properties like the UUID. ```javascript /** * called when extension is loaded */ function init(extensionMeta) { //extensionMeta holds your metadata.json info const UUID = extensionMeta['uuid']; } ``` -------------------------------- ### Configure GDB Logging Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Enable logging to save GDB output to a file and disable pagination for easier capture. Use these commands within GDB. ```bash set logging on set pagination off ``` -------------------------------- ### Extension Enable Function Source: https://github.com/linuxmint/cinnamon/wiki/[Development]-extensions The enable function is called when the extension is loaded, typically used for setting up the extension's functionality. ```javascript /** * called when extension is loaded */ function enable() { } ``` -------------------------------- ### Command Line Access to Settings Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Opens the Cinnamon Settings application for a specific applet, desklet, or extension using its UUID. ```bash cinnamon-settings applets *uuid* ``` ```bash cinnamon-settings desklets *uuid* ``` ```bash cinnamon-settings extensions *uuid* ``` -------------------------------- ### Restore Cinnamon Settings Source: https://github.com/linuxmint/cinnamon/wiki/Backing-up-and-restoring-your-cinnamon-settings-(dconf) Load your previously backed-up Cinnamon settings from a file. Cinnamon might become unstable after this operation, and logging out and back in is recommended. ```bash dconf load /org/cinnamon/ < backup_of_my_cinnamon_settings ``` -------------------------------- ### Enable Nvidia DRM Kernel Mode Setting for Optimus Laptops Source: https://github.com/linuxmint/cinnamon/wiki/Performance-Tips Append 'nvidia-drm.modeset=1' to GRUB_CMDLINE_LINUX_DEFAULT to enable DRM kernel mode setting for Nvidia GPUs on Optimus laptops. This helps prevent screen tearing. ```bash GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1" ``` -------------------------------- ### Additional Options in metadata.json Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Configuration options that can be added to the metadata.json file. ```APIDOC ## Additional Options in metadata.json ### `hide-configuration` (boolean) Hides the configure button in Cinnamon Settings. Set to `true` if you are using only generic-type settings that should be hidden from the user. ### `external-configuration-app` (string) Allows you to define an external settings app to use instead of the built-in settings GUI. This should be a string with the name of your executable settings app (path relative to the applet's install directory). ### `max-instances` (number) Allow multiple instances in the panel. Remember to pass the `instanceId` in function calls. ``` -------------------------------- ### Run Program in GDB (Binary) Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Execute the program within the GDB debugger. This command is for binary executables. ```bash run ``` -------------------------------- ### Importing Meta Module via Gjs Source: https://github.com/linuxmint/cinnamon/wiki/[Development]-General-structure This import statement provides access to the 'meta' module of muffin, which is written in C and accessed via Gjs. ```javascript const Meta = imports.gi.Meta; ``` -------------------------------- ### Bind Setting to Applet Property Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Binds a configuration setting to an applet's property, allowing automatic updates. The `sync_type` determines the direction of synchronization. ```javascript bindProperty(sync_type, key_name, applet_var, applet_callback, user_data) ``` -------------------------------- ### bindProperty Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Binds a setting to an applet property, allowing synchronization and callbacks. ```APIDOC ## `bindProperty` ### Description Binds a setting to the applet_var property. ### Method `boolean bindProperty(sync_type, key_name, applet_var, applet_callback, user_data)` ### Parameters * `sync_type`: BindingDirection * `key_name` (string): The JSON key name of the setting. * `applet_var` (string): The applet property name to bind to. * `applet_callback`: The applet callback method (e.g., `this.on_settings_changed`). * `user_data` (optional): Extra data to send to the callback method. ### Returns * `boolean`: Whether the binding was successful. ``` -------------------------------- ### Add Keybinding Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Registers a hotkey with a unique ID and a callback function to be executed when the keybinding is triggered. Ensure the ID is unique, especially for multi-instance applets. ```javascript Main.keybindingManager.addHotKey(id, this.keybinding, Lang.bind(this, this.on_hotkey_triggered)); ``` -------------------------------- ### Importing Layout Module via Gjs Source: https://github.com/linuxmint/cinnamon/wiki/[Development]-General-structure This import statement provides access to the 'layout.js' module of Cinnamon, which is written in Javascript. ```javascript const Layout = imports.ui.layout; ``` -------------------------------- ### Variable Scoping with `let` vs `var` Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips Explains the difference between block-scoped `let` and function-scoped `var` in JavaScript. Highlights that `var`'s behavior might be intentionally used in Cinnamon code. ```javascript function foo() { let bar0 = 0; var bar1 = 1; if (bar0 == 0) { print(bar0); // Prints 0 print(bar1); // Prints 1 let bar2 = 2; var bar3 = 3; } print(bar2); // Undefined print(bar3); // Prints 3 } ``` -------------------------------- ### Add Snap/Tile OSD Popup Styles Source: https://github.com/linuxmint/cinnamon/blob/master/data/theme/theme-changelog.txt Introduces CSS for the On-Screen Display (OSD) popup used for snap and tile actions. This styles the popup with specific font size, border-radius, background, border, color, padding, and text alignment. ```css /* Snap/tile OSD popup */ .snap-osd { font-size: 18pt; border-radius: 24px; background-color: rgba(85, 85, 85, 0.9); border: 2px solid #868686; color: #babdb6; padding-right: 20px; padding-left: 20px; padding-bottom: 20px; padding-top: 20px; text-align: center; } ``` -------------------------------- ### Debug GLib Warnings with GDB Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Run GDB with the G_DEBUG=fatal_warnings environment variable to halt execution at every GLib warning. This helps in identifying warning sources. ```bash G_DEBUG=fatal_warnings gdb nemo ``` -------------------------------- ### Set Setting Value Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Sets the value for a specified configuration key. The value can be a boolean, string, or number. ```javascript setValue(key_name, value) ``` -------------------------------- ### Run Program in GDB (Python) Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Execute a Python script within the GDB debugger. Provide the path to the script. ```bash run *path to .py or python-shebanged file* ``` -------------------------------- ### getValue Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Retrieves the currently stored value for a given setting key. ```APIDOC ## `getValue` ### Description Returns the currently stored value of the key `key_name`. ### Method `getValue(key_name)` ### Parameters * `key_name` (string): The key name to fetch the value for. ### Returns * `boolean`, `string`, or `number`: The currently stored value of the key. ``` -------------------------------- ### Debug Cinnamon with Fatal Warnings Flag Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Run GDB as root with the G_DEBUG=fatal_warnings environment variable to catch GLib warnings in Cinnamon. This ensures the environment variable is respected. ```bash sudo su G_DEBUG=fatal_warnings gdb ``` -------------------------------- ### Attach GDB to Cinnamon Process Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Debug the Cinnamon desktop environment by attaching GDB to its running process. This requires SSH access and the process ID. ```bash sudo gdb set logging on attach c ``` -------------------------------- ### Normal Function Scoping in JavaScript Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips Demonstrates how functions can access variables from their outer scope in standard JavaScript. No special binding is required for this behavior. ```javascript let x = 42; let func = function() { print(x); } func(); // Prints 42 ``` -------------------------------- ### Binding Directions Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Enumeration for specifying the direction of property binding. ```APIDOC ## Binding Directions ### `Settings.BindingDirection.IN` Set the property at binding time, and automatically update the property and execute the callback when the setting file changes. ### `Settings.BindingDirection.OUT` Set the property at binding time, and automatically update the setting file when the property changes. The callback can be omitted when using this mode, as it will not be used. ### `Settings.BindingDirection.BIDIRECTIONAL` Combines the effects of .IN and .OUT. ``` -------------------------------- ### metadata.json Structure Source: https://github.com/linuxmint/cinnamon/wiki/[Development]-extensions Defines the essential properties for a Cinnamon extension's metadata file, including UUID, name, description, and compatibility with Cinnamon versions. ```json { "cinnamon-version": [ "1.8", "1.9", "2.0" ], "uuid": "EXTENSION_NAME@cinnamon.org", "name": "EXTENSION_NAME", "description": "Aweseome Extension", "url" : "https://this-is-where-you-put-your-HP-or-github-or-whatever.url" } ``` -------------------------------- ### Settings Signals Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Signals emitted by the settings object to indicate changes. ```APIDOC ## Settings Signals ### `settings-changed` Signals when the underlying config file has changed and the in-memory values have been updated. ### `changed::` Signals when `key` has changed in the configuration file. Use this in conjunction with `getValue` if you want to handle your own updating in a more traditional way (like gsettings). #### Callback Function `on_setting_changed: function(setting_provider, oldval, newval)` * `setting_provider`: The settings object (discard). * `oldval`: The original value. * `newval`: The updated value. ``` -------------------------------- ### Using map for Array Transformation Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips Employ map to transform each element of an array into a new value. This method is more performant and clearer in intent than manual for loops for transformations. ```javascript for (let i = 0, len = array.length; i < len; i ++) { array[i] = doSomething(array[i]); } ``` ```javascript array.map(function(item) { return doSomething(item); }) ``` -------------------------------- ### Using forEach for Array Iteration Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips Use forEach for iterating over array elements when a simple action needs to be performed on each item. It is generally faster than a manual for loop for this purpose. ```javascript for (let i = 0, len = array.length; i < len; i++) { doSomething(array[i]); } ``` ```javascript array.forEach(function(item) { doSomething(item); }) ``` -------------------------------- ### setValue Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Sets the value for a given setting key. ```APIDOC ## `setValue` ### Description Sets the value of `key_name` to `value`. ### Method `setValue(key_name, value)` ### Parameters * `key_name` (string): The key name to set the value for. * `value` (boolean, string, or number): The new value for the setting. ### Returns * None. ``` -------------------------------- ### Exit GDB Source: https://github.com/linuxmint/cinnamon/wiki/How-to-use-GDB-to-gather-debug-information-on-a-program Quit the GDB debugger session. ```bash quit ``` -------------------------------- ### Standard For Loop with Array Length Caching Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips Presents an optimized version of a standard for loop that caches the array's length before the loop begins. This can significantly improve performance for large arrays. ```javascript for (let i = 0; i < array.length; i ++) { doSomething(); } ``` ```javascript for (let i = 0, len = array.length; i < len; i ++) { doSomething(); } ``` -------------------------------- ### Reset Cinnamon Settings to Defaults Source: https://github.com/linuxmint/cinnamon/wiki/Backing-up-and-restoring-your-cinnamon-settings-(dconf) This command resets all Cinnamon settings to their default values. Be aware that Cinnamon may freeze or crash during this process. ```bash dconf reset -f /org/cinnamon/ ``` -------------------------------- ### Convert CLDR Keyboard Layouts to JSON Source: https://github.com/linuxmint/cinnamon/blob/master/data/cldr2json/README.md Use this command to convert CLDR keyboard layout files or directories into JSON format for GNOME Shell. Specify the input path for CLDR layouts and the output directory for the generated JSON files. ```bash ./cldr2json ``` ```bash ./cldr2json cldr/keyboards/android/ json_layouts/ ``` -------------------------------- ### Cinnamon Popup Menu HTML Structure Source: https://github.com/linuxmint/cinnamon/wiki/Theme-Dev-::-Popup-Menu This HTML structure outlines the elements and classes used for a Cinnamon popup menu. It includes standard menu items, separators, and the structure for submenus. ```html Add applets to the panel Panel Settings Themes All Settings Troubleshoot Restart Cinnamon Looking Glass Restore all settings to default ... ... ... ... Panel edit mode ``` -------------------------------- ### Searching Array Elements with map and indexOf Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips For searching elements based on a property, mapping the property first and then using indexOf can be efficient for smaller arrays, though potentially slower for large ones due to full array traversal. ```javascript let array2 = array.map(function(foo) { return foo.bar; }); array2.indexOf(0) ``` -------------------------------- ### Correct Array Modification Using Reverse Iteration Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips Shows the correct way to remove elements from an array by iterating backward. This avoids issues caused by index shifting after removal. ```javascript for (let i = array.length - 1; i != 0; i --) { if (array[i] == 3) array.splice(i, 1) } ``` ```javascript let i = array.length; while (i--) { if (array[i] == 3) array.splice(i, 1) } ``` -------------------------------- ### Direct Array Search with indexOf Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips Use indexOf for direct searching of primitive values within an array. It is generally the fastest method for simple lookups. ```javascript array.indexOf(0) ``` -------------------------------- ### Panel Drag and Drop Pseudoclass Source: https://github.com/linuxmint/cinnamon/wiki/Theming,-CSS-reference The ':dnd' pseudoclass is applied when the panel editing mode (drag and drop) is active. It's used to modify the background appearance during this mode. ```css :dnd ``` -------------------------------- ### Magic 'while' loop for Reverse Array Iteration Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips This 'magic while' loop iterates through an array in reverse order and can be slightly faster than a standard for loop. It relies on the falsiness of 0. ```javascript let i = array.length; while (i--) { doSomething(array[i]); } ``` -------------------------------- ### Function Scoping with `this` in JavaScript Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips Illustrates the challenge of accessing object properties within a function when `this` is not explicitly bound. `Lang.bind` is used to correctly scope `this`. ```javascript this.x = 42; let func = function() { print(this.x); } func(); // Prints undefined ``` ```javascript this.x = 42; let func = Lang.bind(this, function() { print(this.x); }) func(); // Prints 42 ``` ```javascript this.x = {'a': 42}; let func = Lang.bind(this.x, function() { print(this.a); } func(); // Prints 42 ``` -------------------------------- ### Update Notification Button Styles Source: https://github.com/linuxmint/cinnamon/blob/master/data/theme/theme-changelog.txt Modifies the border-radius, font-size, and padding for notification buttons. Use this to adjust the appearance of notification buttons. ```css .notification-button { border-radius: 18px; font-size: 11pt; padding: 4px 42px 5px; } .notification-button:focus { padding: 3px 41px 4px; } ``` ```css .notification-button { border-radius: 5px; padding: 4px 8px 5px; } .notification-button:focus { padding: 3px 8px 4px; } ``` -------------------------------- ### Popup Menu Selectors Source: https://github.com/linuxmint/cinnamon/wiki/Theming,-CSS-reference These selectors target the popup menu elements. '.popup-menu-content' styles the container for menu items, while '.popup-menu-item' styles individual items within the menu. ```css .popup-menu-boxpointer {} ``` ```css .popup-menu-content ``` ```css .popup-menu-item ``` -------------------------------- ### Panel Selectors Source: https://github.com/linuxmint/cinnamon/wiki/Theming,-CSS-reference These selectors correspond to the different panels (top, bottom, left, right) and their zones (left, center, right). They are used to style panel elements and their children. ```css .panel-top .panel-bottom .panel-left .panel-right ``` ```css #panel {} ``` ```css #panelLeft {} #panelCenter {} #panelRight {} ``` -------------------------------- ### Searching Array Elements with a Magic 'while' loop Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips A terse 'magic while' loop can be used for searching array elements, offering similar performance to a for loop but with a more compact syntax. It returns -1 if the element is not found. ```javascript let i = array.length; while (i-- && array[i].bar != 0); ``` -------------------------------- ### Optimized 'for' loop for Array Iteration Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips A standard cached for loop is efficient for iterating through arrays. Ensure the length is cached for optimal performance. ```javascript for (let i = 0, len = array.length; i < len; i++) { doSomething(array[i]); } ``` -------------------------------- ### Searching Array Elements with a 'for' loop Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips A standard for loop with a break condition is a clear way to search for an element within an array, offering good performance, especially when the element is found early. ```javascript let pos = -1; for (let i = 0, len = array.length; i < len; i++) if (array[i].bar == 0) { pos = i; break; } } ``` -------------------------------- ### Base Stage Selector Source: https://github.com/linuxmint/cinnamon/wiki/Theming,-CSS-reference The 'stage' selector is used for setting base attributes for theme elements when no specific overrides are present in the cascade. It defines default colors, fonts, and font sizes. ```css stage {} ``` -------------------------------- ### Remove Keybinding Source: https://github.com/linuxmint/cinnamon/wiki/Applet,-Desklet-and-Extension-Settings-Reference Removes a previously added hotkey using its unique ID. This is typically called during cleanup, such as when an applet is removed from the panel. ```javascript Main.keybindingManager.removeHotKey(id); ``` -------------------------------- ### Extension Disable Function Source: https://github.com/linuxmint/cinnamon/wiki/[Development]-extensions The disable function is called when the extension is disabled, used for cleaning up resources and reverting any changes made by the extension. ```javascript /** * called when extension gets disabled */ function disable() { } ``` -------------------------------- ### Incorrect Array Modification During Iteration Source: https://github.com/linuxmint/cinnamon/wiki/General-coding-tips Demonstrates a common error when removing elements from an array using `splice` within a forward loop, leading to skipped elements. This approach is incorrect. ```javascript for (let i = 0; i < array.length; i ++){ if (array[i] == 3) array.splice(i, 1) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.