[GH-ISSUE #74] Support module-level options in custom modules' Widget #1447

Closed
opened 2026-05-22 22:52:19 +01:00 by JakeStanger · 4 comments
Owner

Originally created by @JustSimplyKyle on GitHub (Feb 11, 2023).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/74

Is your feature request related to a problem? Please describe.
Kinda? I want on_scroll_up and on_scroll_down in custom but that doesn't seem to work according to my testing

Describe the solution you'd like
Support for https://github.com/JakeStanger/ironbar/wiki/configuration-guide#32-module-level-options ! Should be quite simple I think.

Additional context
Why is it on_click instead of on_click_left in custom, very confusing

Originally created by @JustSimplyKyle on GitHub (Feb 11, 2023). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/74 **Is your feature request related to a problem? Please describe.** Kinda? I want on_scroll_up and on_scroll_down in custom but that doesn't seem to work according to my testing **Describe the solution you'd like** Support for https://github.com/JakeStanger/ironbar/wiki/configuration-guide#32-module-level-options ! Should be quite simple I think. **Additional context** Why is it `on_click` instead of `on_click_left` in custom, very confusing
Author
Owner

@JakeStanger commented on GitHub (Feb 11, 2023):

This would be good for consistency, happy to add this in.

Should be quite simple I think.

Probably not - the two are independent systems that work differently, hence why they have a different set of options from each other currently. The ideal way to implement this would be to make them share the same options/responsible code but that will require some refactoring.

Why is it on_click instead of on_click_left in custom, very confusing

This got missed when I changed the module-level option's name for consistency. I'll get that fixed, thanks for spotting.

<!-- gh-comment-id:1426757020 --> @JakeStanger commented on GitHub (Feb 11, 2023): This would be good for consistency, happy to add this in. > Should be quite simple I think. Probably not - the two are independent systems that work differently, hence why they have a different set of options from each other currently. The ideal way to implement this would be to make them share the same options/responsible code but that will require some refactoring. > Why is it on_click instead of on_click_left in custom, very confusing This got missed when I changed the module-level option's name for consistency. I'll get that fixed, thanks for spotting.
Author
Owner

@JustSimplyKyle commented on GitHub (Apr 22, 2023):

Thanks! Although it seems like on_scroll_up and on_scroll_down in the slider widget doesn't work

    $volume = {
        type = "custom"
        bar = [ 
            {
                type = "slider"
                class = "volbar"
                length = 100
                max = 100
                on_change = "!wpctl set-volume @DEFAULT_SINK@ $0%"
                on_scroll_down = "wpctl set-volume @DEFAULT_SINK@ 2%-"
                on_scroll_up = "wpctl set-volume @DEFAULT_SINK@ 2%+"
                on_click_right = "pavucontrol"
                value = "0:/home/kyle/.config/ironbar/scripts/volume"
                show_if = $check_sound_state
            }
        ]
    }
<!-- gh-comment-id:1518664250 --> @JustSimplyKyle commented on GitHub (Apr 22, 2023): Thanks! Although it seems like on_scroll_up and on_scroll_down in the slider widget doesn't work ```corn $volume = { type = "custom" bar = [ { type = "slider" class = "volbar" length = 100 max = 100 on_change = "!wpctl set-volume @DEFAULT_SINK@ $0%" on_scroll_down = "wpctl set-volume @DEFAULT_SINK@ 2%-" on_scroll_up = "wpctl set-volume @DEFAULT_SINK@ 2%+" on_click_right = "pavucontrol" value = "0:/home/kyle/.config/ironbar/scripts/volume" show_if = $check_sound_state } ] } ```
Author
Owner

@JakeStanger commented on GitHub (Apr 22, 2023):

For some reason the scale automatically binds to the scroll event, then does nothing with it, so the parent EventBox never receives the event.

I'm going to implement proper scrolling logic into the scale component, so it will just work to change the value on scroll without any config. There'll be a step config option to go with it to configure how much it steps by.

<!-- gh-comment-id:1518693802 --> @JakeStanger commented on GitHub (Apr 22, 2023): For some reason the scale automatically binds to the scroll event, then does nothing with it, so the parent EventBox never receives the event. I'm going to implement proper scrolling logic into the scale component, so it will just work to change the value on scroll without any config. There'll be a `step` config option to go with it to configure how much it steps by.
Author
Owner

@JakeStanger commented on GitHub (Apr 23, 2023):

This is what was resolved by #119, not #115 as it was linked.

<!-- gh-comment-id:1519022903 --> @JakeStanger commented on GitHub (Apr 23, 2023): *This* is what was resolved by #119, not #115 as it was linked.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#1447
No description provided.