### Configure Game Launch Options with Wrapper Script Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/tips.md This example shows how to configure launch options in Steam to use the previously created wrapper script. It specifies the path to the script and the desired effect name as the first argument, followed by '%command%' which Steam replaces with the game's actual launch command. This allows for automatic effect application when a game is started. ```bash /path/to/script.sh "Effect Name Here" %command% ``` -------------------------------- ### OpenRazer Integration Commands and Python Example Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt Provides essential bash commands for managing the OpenRazer daemon and troubleshooting driver issues. Includes a Python script demonstrating how to interact with OpenRazer devices using the `openrazer.client` library. ```bash # Check OpenRazer daemon status systemctl --user status openrazer-daemon # Start OpenRazer daemon openrazer-daemon # Stop OpenRazer daemon openrazer-daemon -s # Run daemon in foreground with verbose output openrazer-daemon -Fv # Check kernel messages for driver issues dmesg | grep -i razer # Test fake devices (for development) # Download OpenRazer repository first git clone https://github.com/openrazer/openrazer.git cd openrazer ./scripts/setup_fake_devices.sh # Using D-Bus to communicate directly with OpenRazer dbus-send --session --dest=org.razer --print-reply \ /org/razer org.razer.devices.getDevices # Python library example for direct OpenRazer access python3 << 'EOF' from openrazer.client import DeviceManager device_manager = DeviceManager() for device in device_manager.devices: print(f"Device: {device.name}") print(f"Serial: {device.serial}") print(f"Type: {device.type}") if device.has("lighting"): device.fx.static(0, 255, 0) # Green EOF ``` -------------------------------- ### Run Polychromatic Application with Locale Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/translations.md These commands demonstrate how to run different Polychromatic applications (controller, tray applet, CLI) from the repository with a specified locale code. This allows for testing of translated user interfaces. Ensure build dependencies are installed. ```shell ./polychromatic-controller-dev --locale ``` ```shell ./polychromatic-tray-applet --locale ``` ```shell ./polychromatic-cli --locale ``` -------------------------------- ### Clone Polychromatic Repository Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/devicemaps.md This command clones the Polychromatic repository from GitHub to your local machine. Ensure you have Git installed and replace 'YOUR_GITHUB_USERNAME' with your actual GitHub username. ```bash git clone https://github.com/YOUR_GITHUB_USERNAME/polychromatic.git ``` -------------------------------- ### Polychromatic Preferences Configuration File Structure Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt Polychromatic stores configuration in JSON files at `~/.config/polychromatic/`. This example shows the structure of `preferences.json` with settings for the controller, custom DPI stages, editor, and tray applet. ```json // ~/.config/polychromatic/preferences.json { "config_version": 8, "controller": { "landing_tab": 0, "show_menu_bar": true, "system_qt_theme": false, "window_behaviour": 1, "toolbar_style": 0 }, "custom": { "use_dpi_stages": true, "dpi_stage_1": 800, "dpi_stage_2": 1600, "dpi_stage_3": 3200, "dpi_stage_4": 6400, "dpi_stage_5": 16000 }, "editor": { "hide_key_labels": false, "live_preview": true, "show_saved_colour_shades": true, "suppress_confirm_dialog": false, "system_cursors": false }, "tray": { "autostart": true, "autostart_delay": 0, "mode": 0, "icon": "custom_icons/my-icon.svg" } } ``` -------------------------------- ### Making Script Executable and Steam Launch Options Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt Instructions on how to make the RGB launcher script executable and how to configure Steam launch options to use it. ```bash # Make script executable chmod +x ~/scripts/rgb-launcher.sh # Steam launch options (Right-click game → Properties → Launch Options) # Format: /path/to/script.sh "Effect Name" %command% /home/user/scripts/rgb-launcher.sh "FPS Game Keys" %command% ``` -------------------------------- ### Cloud Sync Configuration for Polychromatic Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt Demonstrates how to synchronize the Polychromatic configuration directory across multiple machines using Syncthing or cloud storage providers like Dropbox. ```bash # Using Syncthing (local network sync) # Add ~/.config/polychromatic folder to Syncthing on both machines # Using cloud providers (Dropbox, Nextcloud) # Move config to cloud folder and create symlink mv ~/.config/polychromatic ~/Dropbox/polychromatic ln -s ~/Dropbox/polychromatic ~/.config/polychromatic # Verify symlink ls -la ~/.config/ | grep polychromatic # Output: polychromatic -> /home/user/Dropbox/polychromatic ``` -------------------------------- ### Create Game/Application Lighting Wrapper Script Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/tips.md This bash script acts as a wrapper to apply a specified Polychromatic effect before launching a game or application. It takes the effect name as the first argument and then executes the rest of the provided command. This script needs to be marked as executable and then used in the game's launch options. ```bash #!/bin/bash polychromatic-cli -e "$1" shift 1 exec "$@" ``` -------------------------------- ### Launch Polychromatic Tray Applet Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt System tray applet for quick access to device controls without opening the full application. Supports verbose output for debugging and autostart delay configuration. ```bash # Launch tray applet polychromatic-tray-applet # Launch with verbose output for debugging polychromatic-tray-applet -v # Autostart delay configuration (in preferences.json) # Useful for desktop environments with race conditions { "tray": { "autostart": true, "autostart_delay": 5, "mode": 0, "icon": "ui/img/tray/light/polychromatic.svg" } } ``` -------------------------------- ### Launch Polychromatic Controller Application Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt The main GUI application for managing devices and creating effects. Launch with `polychromatic-controller`. Supports verbose output and locale forcing for debugging. ```bash # Launch the Controller application polychromatic-controller # Run with verbose output for debugging polychromatic-controller -v # Force specific locale polychromatic-controller --locale de_DE # Keyboard shortcuts in Controller: # F5 - Refresh current tab # CTRL+F5 - Force reload (reinitialize backends) # Alt - Reveal menu bar if hidden ``` -------------------------------- ### Apply Static Green Effect and Set Brightness via CLI Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/tips.md These commands demonstrate how to use the Polychromatic CLI to set specific lighting effects and brightness levels. They are intended to be used with a desktop's start-up applications list to apply desired lighting configurations upon login. The first command sets brightness to 25%, and the second sets a static green effect. ```bash /usr/bin/polychromatic-cli -o brightness -p 25 /usr/bin/polychromatic-cli -o static -c 00FF00 ``` -------------------------------- ### Create Symbolic Link for Cloud Sync Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/tips.md This command creates a symbolic link to synchronize the Polychromatic configuration folder with a cloud storage directory. It's useful for users employing services like Dropbox or Nextcloud to maintain consistent settings across devices. Ensure the cloud path is correct before executing. ```bash ln -s /path/to/cloud/polychromatic ~/.config/polychromatic ``` -------------------------------- ### Desktop Entry Configuration Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt Defines application metadata for Linux desktop environments, including generic names and comments in multiple languages. ```ini [Desktop Entry] GenericName=Device Manager for RGB Lighting GenericName[es]=Administrador de dispositivos para iluminación RGB GenericName[de]=Gerätemanager für RGB-Beleuchtung Comment=Configure connected lighting peripherals Comment[es]=Configurar conectado iluminación periféricos Comment[de]=Angeschlossene Beleuchtungsperipherie konfigurieren [Desktop Action devices] Name=Configure Devices Name[es]=Configurar dispositivos Name[de]=Geräte konfigurieren ``` -------------------------------- ### Translation Workflow using gettext and Poedit Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt Outlines the steps for contributing translations to the Polychromatic project. This involves cloning the repository, updating translation templates, building locales, testing, and committing changes. ```bash # Clone repository git clone https://github.com/YOUR_USERNAME/polychromatic.git cd polychromatic # Generate/update translation templates ./scripts/create-locales.sh # Build locales for testing ./scripts/build-locales.sh # Test translation ./polychromatic-controller-dev --locale es_ES ./polychromatic-tray-applet --locale es_ES ./polychromatic-cli --locale es_ES # Commit translation git add locale/es_ES.po git add locale/LINGUAS git commit -m "Add translation for es_ES" git push origin master ``` -------------------------------- ### Control Lighting Peripherals with Polychromatic CLI Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt The CLI allows controlling lighting peripherals from scripts or the terminal. It supports listing devices, setting effects, colors, brightness, DPI, and playing custom effects. Note: This feature is deprecated. ```bash # List all connected devices and their zones polychromatic-cli -l, --list-devices # List supported options and current settings for a device polychromatic-cli -k, --list-options # Select device by form factor (keyboard, mouse, mousemat, headset, etc.) polychromatic-cli -d keyboard -o static -c "#00FF00" # Select device by name polychromatic-cli -n "Razer BlackWidow Chroma" -o wave -p right # Select device by serial number polychromatic-cli -s XX1234567890 -o spectrum # Set static color effect with hex color polychromatic-cli -o static -c 00FF00 # Set wave effect with direction parameter (1=right, 2=left) polychromatic-cli -o wave -p 1 # Set breath effect with multiple colors polychromatic-cli -o breath -c "#FF0000,#00FF00,#0000FF" # Set brightness level (0-100) polychromatic-cli -o brightness -p 50 # Apply effect to specific zone polychromatic-cli -z logo -o static -c "#FF0000" # Set mouse DPI (X and Y axis) polychromatic-cli --dpi 1600,800 # Play a custom software effect by name polychromatic-cli -e "My Custom Effect" # Play effect from file path polychromatic-cli -e "/path/to/effect.json" # Enable verbose output polychromatic-cli -v --list-devices # Force specific locale polychromatic-cli --locale fr_FR -l ``` -------------------------------- ### Build Locales Script Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/translations.md This script is used to build the locale files for the Polychromatic application. It is a prerequisite for testing translations. ```shell ./scripts/build-locales.sh ``` -------------------------------- ### Steam Game Integration Script Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt A bash script to apply RGB effects when launching Steam games. It takes an effect name as an argument and then executes the game command. ```bash #!/bin/bash # ~/scripts/rgb-launcher.sh # Wrapper script for Steam games with RGB effect support polychromatic-cli -e "$1" shift 1 exec "$@" ``` -------------------------------- ### Add and Commit Translation Files Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/translations.md These Git commands are used to stage and commit translation-related files after making changes. It includes adding the specific locale's .po file and the LINGUAS file, followed by a commit message indicating the locale. ```git git add locale/.po git add locale/LINGUAS git commit -m "Add translation for " ``` -------------------------------- ### Sequence Effect Configuration (JSON) Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/effects-sequence.md Defines the configuration for a sequence effect, including frames per second, looping behavior, and the frame data itself. Each frame maps LED coordinates (x, y) to hex color strings. ```json { "fps": 10, "loop": true, "frames": [ { "": { "": "" }, "0": { "0": "#00FF00", "1": "#008000", "2": "#004000" } } ] } ``` -------------------------------- ### Determining Scan Codes using evtest (Shell) Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/devicemaps.md This demonstrates how to use the 'evtest' command-line utility to identify the scan code of a physical key press. Running 'evtest' as root and then pressing a key will output event details, including the 'MSC_SCAN' code, which is the value needed for the scan code JSON mapping. ```bash sudo evtest # ... (select input device) # Press a key, e.g., 'Q' # Look for output similar to: # Event: time 1612876038.328661, type 1 (EV_KEY), code 16 (KEY_Q), value 0 # The scan code is often found in related MSC_SCAN events or inferred from the KEY code. ``` -------------------------------- ### Add Device Mapping to maps.json Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/devicemaps.md This JSON snippet demonstrates how to add a new device mapping to the 'data/devicemaps/maps.json' file. It includes essential details like the device name, associated SVG filename, dimensions, locale, and scancode file. ```json "Razer BlackWidow Chroma (British)": { "filename": "blackwidow_m_keys_en_GB.svg", "cols": 22, "rows": 6, "locale": "en_GB", "scancode": "blackwidow_m_keys.json" } ``` -------------------------------- ### Push Translation Changes Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/translations.md This command pushes the committed translation changes to the 'origin' remote, typically to your fork on GitHub. This is a necessary step before creating a pull request. ```git git push origin master ``` -------------------------------- ### Mapping Scan Codes to LED Matrix Positions (JSON) Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/devicemaps.md This JSON structure defines the mapping between physical key scan codes and their corresponding positions on an LED matrix. This is crucial for devices with physical inputs that are recognized as keystrokes, allowing Polychromatic to associate LED behavior with specific keys. The keys are scan codes (as strings), and the values are arrays representing [row, column] coordinates. ```json { "1": [1, 0], "59": [3, 0], "113": [3, 0], "60": [4, 0], "114": [4, 0], "61": [5, 0], "115": [5, 0], "62": [6, 0] } ``` -------------------------------- ### Common Effect Metadata Structure (JSON) Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/config-effects.md This JSON structure represents the common metadata fields required for all Polychromatic software effects. It includes details like the effect's name, author, icon, summary, and device mapping information. Localized names and summaries are also supported. ```json { "name": "Example Effect", "name[fr_FR]": "Exemple d'effet", "type": 1, "author": "ghost", "author_url": "https://github.com/ghost", "icon": "ui/img/emblems/lamp.svg", "summary": "This is an example effect", "summary[fr_FR]": "Ceci est un exemple d'effet", "map_device": "Razer BlackWidow Chroma", "map_device_icon": "keyboard", "map_graphic": "blackwidow_m_keys_en_GB.svg", "map_cols": 22, "map_rows": 6, "save_format": 8, "revision": 1 } ``` -------------------------------- ### Device Map Configuration for Polychromatic Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt Defines device layouts for visual effect editing using SVG graphics. These maps are stored in `data/devicemaps/maps.json` and reference specific SVG files and scan code mappings. ```json // data/devicemaps/maps.json entry { "Razer BlackWidow Chroma (British)": { "filename": "blackwidow_m_keys_en_GB.svg", "cols": 22, "rows": 6, "locale": "en_GB", "scancode": "blackwidow_m_keys.json" }, "Razer DeathAdder Elite": { "filename": "deathadder_elite.svg", "cols": 2, "rows": 1, "locale": null, "scancode": null } } ``` ```json // data/devicemaps/blackwidow_m_keys.json (scan code mapping) { "1": [1, 0], "16": [4, 2], "17": [5, 2], "18": [6, 2], "59": [3, 0], "60": [4, 0], "61": [5, 0], "62": [6, 0] } ``` -------------------------------- ### SVG Device Map Requirements for Polychromatic Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt Specifies the required attributes and structure for SVG files used as device maps in Polychromatic. Elements with the class 'LED' and an 'id' in the format 'x-y' are used for LED mapping. ```xml P ESC ``` -------------------------------- ### Effect JSON Format for Polychromatic Source: https://context7.com/polychromatic/polychromatic-docs/llms.txt Defines the structure for software effects, including animation details, device mapping, and color frames. This JSON file is stored in `~/.config/polychromatic/effects/`. ```json // ~/.config/polychromatic/effects/my-effect.json { "name": "Green Wave Animation", "name[de_DE]": "Grüne Wellenanimation", "type": 3, "author": "username", "author_url": "https://github.com/username", "icon": "ui/img/emblems/lamp.svg", "summary": "A scrolling green wave effect", "summary[de_DE]": "Ein scrollender grüner Welleneffekt", "map_device": "Razer BlackWidow Chroma", "map_device_icon": "keyboard", "map_graphic": "blackwidow_m_keys_en_GB.svg", "map_cols": 22, "map_rows": 6, "save_format": 8, "revision": 1, "fps": 10, "loop": true, "frames": [ { "0": { "0": "#00FF00", "1": "#00DD00", "2": "#00BB00" }, "1": { "0": "#00DD00", "1": "#00BB00", "2": "#009900" } }, { "0": { "0": "#00DD00", "1": "#00FF00", "2": "#00DD00" }, "1": { "0": "#00BB00", "1": "#00DD00", "2": "#00BB00" } } ] } ``` -------------------------------- ### Assigning LED Attributes in Inkscape SVG Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/devicemaps.md This describes how to assign 'class' and 'id' attributes to SVG elements representing LEDs in Inkscape. The 'class' should be 'LED', and the 'id' should follow the format 'x0-y0' corresponding to the LED's coordinates. For grouped elements representing a single LED, attributes are applied to the parent '' tag. ```xml ``` -------------------------------- ### Exempting SVG Elements from Color Changes in Inkscape Source: https://github.com/polychromatic/polychromatic-docs/blob/master/pages/devicemaps.md This explains how to use 'nostroke' and 'nochange' attributes to control how SVG elements are affected by color changes in Polychromatic. 'nostroke' sets the fill to black or white and clears the stroke, useful for key labels. 'nochange' prevents any modification to the element's fill or stroke. ```xml P ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.