Skip to content

Multiple windows

cr3eperall edited this page Sep 6, 2024 · 1 revision

How it works

Windows are defined in the layout manager config and every module can send its widgets to a named window or "" to send it to the default one


Layout managers

By default a window with no name is created from the default config, if no other window is defined, every widget will be sent here.
Multiple windows can be defined in the windows map:

Example

// ...
layout_configs: {
    "DynamicLayout": (
        window_position: (           // every option before the windows map is a default value
            layer: (
                Layer: "Top",
            ),
            h_anchor: (
                Alignment: "Center",
            ),
            v_anchor: (
                Alignment: "Start",
            ),
            margin_x: 0,
            margin_y: 0,
            exclusive_zone: -1,
            monitor: "",
            layer_shell: true,
        ),
        auto_minimize_timeout: 5000,
        max_activities: 3,
        max_active: 1,
        reorder_on_add: true,
        reorder_on_reload: true,
        windows: { // multiple windows can be defined here with different names
                   // default window, this will always be present 
            "": (  // every widget defined with a window with a name different than "window2" will be put here
                activity_order: [], // this option is not in the default options, so it's auto-generated by default-config
                // other options can be put here and they will override the default configs
            ),
            "window2": (
                window_position: (
                    monitor: "HDMI-A-1",
                    h_anchor: ("start"),
                ),
                activity_order: [],
            ),
        },
    ),
},
// ...

Modules

A module can define multiple widgets in different windows, by default a widget will be sent to the "" window, even if no widget is defined, if you don't want any widget from a module, remove it from the loaded_modules array.
Widgets are defined in the windows map inside a module, this maps a window name to an array of widgets

Example

// ...
module_config: {
    "MusicModule": (
        preferred_player: "",
        default_album_art_url: "",
        scrolling_label_speed: 30.0,
        cava_visualizer_script: "cava -p ~/.config/dynisland/scripts/cava-config | awk '{print substr($0, 1, length($0)-1); fflush()}'",
        use_fallback_player: true,
        windows: {
            "": [ // every widget defined here will be put in the default window
                ( // these options override the default ones defined above
                    preferred_player: "firefox",
                    use_fallback_player: false,
                ),
                (
                    preferred_player: ""
                ),
            ],
            "inexistent_window": [
                ( // this widget will be sent to the default window because there is no defined window with that name
                    preferred_player: "firefox",
                ),
            ],
            "window2": [
                ( // this widget will be put on the window named "window2"
                    preferred_player: "",
                ),
            ],
        },
    ),
},
// ...
Clone this wiki locally