ironbar icon indicating copy to clipboard operation
ironbar copied to clipboard

on_scroll_[up/down] dont work in Hyprland

Open ralencode opened this issue 1 year ago • 2 comments

Describe the bug

on_scroll module properties dont work in latest Hyprland

To Reproduce

  1. Archlinux, aur/hyprland-git
  2. Use my config.json
  3. Have amixer and pipewire installed
  4. Scroll down or up on the volume widgets
  5. See nothing changes

Expected behavior

Volume changes on scroll up and down

System information:

  • Distro: Archlinux
  • Compositor: Hyprland git v0.41.2-13-g4d6f96f7
  • Ironbar version: 0.16.0-pre

Configuration

Config
{
  "$schema": "https://f.jstanger.dev/github/ironbar/schema.json",
  "anchor_to_edges": true,
  "position": "top",
  "height": 16,
  "icon_theme": "Fluent-teal-dark",
  "start": [
    {
      "type": "workspaces",
      "all_monitors": false,
      "name_map": {
        "special:magic": "S"
      }
    },
    {
      "type": "launcher",
      "favorites": [
        "thunar",
        "firefox",
        "mgba",
        "PPSSPPSDL",
        "lutris"
      ],
      "show_names": false,
      "show_icons": true
    }
  ],
  "center": [
    {
      "type": "clock"
    }
  ],
  "end": [
    {
      "type": "volume",
      "format": "{icon} {percentage}%",
      "max_volume": 100,
      "on_click_right": "amixer -D pipewire sset Master toggle",
      "on_scroll_up": "amixer -D pipewire sset Master playback 5%-",
      "on_scroll_down": "amixer -D pipewire sset Master playback 5%+",
      "icons": {
        "volume_high": "󰕾",
        "volume_medium": "󰖀",
        "volume_low": "󰕿",
        "muted": "󰝟"
      }
    },
    {
      "type": "clipboard",
      "max_items": 3,
      "truncate": {
        "mode": "end",
        "length": 50
      }
    },
    {
      "type": "custom",
      "class": "power-menu",
      "bar": [
        {
          "type": "button",
          "name": "power-btn",
          "label": "",
          "on_click": "popup:toggle"
        }
      ],
      "popup": [
        {
          "type": "box",
          "orientation": "vertical",
          "widgets": [
            {
              "type": "label",
              "name": "header",
              "label": "Power menu"
            },
            {
              "type": "box",
              "widgets": [
                {
                  "type": "button",
                  "class": "power-btn",
                  "label": "<span font-size='40pt'>  </span>",
                  "on_click": "!shutdown now"
                },
                {
                  "type": "button",
                  "class": "power-btn",
                  "label": "<span font-size='40pt'>  </span>",
                  "on_click": "!reboot"
                }
              ]
            },
            {
              "type": "label",
              "name": "uptime",
              "label": "Uptime: {{30000:uptime -p | cut -d ' ' -f2-}}"
            }
          ]
        }
      ],
      "tooltip": "Up: {{30000:uptime -p | cut -d ' ' -f2-}}"
    },
    {
      "type": "upower",
      "format": "{percentage}% {state}"
    },
    {
      "type": "notifications",
      "show_count": true,
      "icons": {
        "closed_none": "󰍥",
        "closed_some": "󱥂",
        "closed_dnd": "󱅯",
        "open_none": "󰍡",
        "open_some": "󱥁",
        "open_dnd": "󱅮"
      }
    }
  ]
}
Styles
{
  "$schema": "https://f.jstanger.dev/github/ironbar/schema.json",
  "anchor_to_edges": true,
  "position": "top",
  "height": 16,
  "icon_theme": "Fluent-teal-dark",
  "start": [
    {
      "type": "workspaces",
      "all_monitors": false,
      "name_map": {
        "special:magic": "S"
      }
    },
    {
      "type": "launcher",
      "favorites": [
        "thunar",
        "firefox",
        "mgba",
        "PPSSPPSDL",
        "lutris"
      ],
      "show_names": false,
      "show_icons": true
    }
  ],
  "center": [
    {
      "type": "clock"
    }
  ],
  "end": [
    {
      "type": "volume",
      "format": "{icon} {percentage}%",
      "max_volume": 100,
      "on_click_right": "amixer -D pipewire sset Master toggle",
      "on_scroll_up": "amixer -D pipewire sset Master playback 5%-",
      "on_scroll_down": "amixer -D pipewire sset Master playback 5%+",
      "icons": {
        "volume_high": "󰕾",
        "volume_medium": "󰖀",
        "volume_low": "󰕿",
        "muted": "󰝟"
      }
    },
    {
      "type": "clipboard",
      "max_items": 3,
      "truncate": {
        "mode": "end",
        "length": 50
      }
    },
    {
      "type": "custom",
      "class": "power-menu",
      "bar": [
        {
          "type": "button",
          "name": "power-btn",
          "label": "",
          "on_click": "popup:toggle"
        }
      ],
      "popup": [
        {
          "type": "box",
          "orientation": "vertical",
          "widgets": [
            {
              "type": "label",
              "name": "header",
              "label": "Power menu"
            },
            {
              "type": "box",
              "widgets": [
                {
                  "type": "button",
                  "class": "power-btn",
                  "label": "<span font-size='40pt'>  </span>",
                  "on_click": "!shutdown now"
                },
                {
                  "type": "button",
                  "class": "power-btn",
                  "label": "<span font-size='40pt'>  </span>",
                  "on_click": "!reboot"
                }
              ]
            },
            {
              "type": "label",
              "name": "uptime",
              "label": "Uptime: {{30000:uptime -p | cut -d ' ' -f2-}}"
            }
          ]
        }
      ],
      "tooltip": "Up: {{30000:uptime -p | cut -d ' ' -f2-}}"
    },
    {
      "type": "upower",
      "format": "{percentage}% {state}"
    },
    {
      "type": "notifications",
      "show_count": true,
      "icons": {
        "closed_none": "󰍥",
        "closed_some": "󱥂",
        "closed_dnd": "󱅯",
        "open_none": "󰍡",
        "open_some": "󱥁",
        "open_dnd": "󱅮"
      }
    }
  ]
}

Additional context on_click_[right/middle] properties work as expected, left doesn't seem to work too

ralencode avatar Jun 30 '24 20:06 ralencode

the weird thing for me is, scroll works on using a physical mouse, but not when using laptop's touchpad scrolling. which is a real issue as i'm a laptop user.

LoneWolf4713 avatar Aug 11 '24 02:08 LoneWolf4713

i didnt test with a mouse, but touchpad doesnt work. i should have specified it maybe

ralencode avatar Aug 19 '24 14:08 ralencode

Apologies this took so long! Finally grabbed my laptop so I could test.

JakeStanger avatar Nov 04 '24 13:11 JakeStanger

it definitely doesn't work with touchpad. it worked with mouse wheel (ps4 gamepad mapping with antimicrox) at first, but now that doesnt work either (after some restarts). both aur ironbar-git package and binary built from git sources. image image

ralencode avatar Nov 04 '24 16:11 ralencode

libinput debug tells me that touchpad is POINTER_SCROLL_FINGER event and gamepad stick is POINTER_SCROLL_WHEEL, if its helpful

ralencode avatar Nov 04 '24 17:11 ralencode

Looks like my fix also ended up breaking it in unintended ways. I've just pushed another fix that may help your issue, but should at least get it working on mouse/trackpad.

JakeStanger avatar Nov 10 '24 17:11 JakeStanger

finally, it works!

ralencode avatar Nov 10 '24 22:11 ralencode

Cool thanks for confirming, in that case I'll re-close.

JakeStanger avatar Nov 10 '24 23:11 JakeStanger