Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.8k stars 713 forks source link

add tooltip-format field to custom modules (quick launch buttons) #2825

Open je-vv opened 10 months ago

je-vv commented 10 months ago

Hello !

As waybar doesn't offer out of the box quick launch buttons, I'm emulating them with custom modules, like:

    "custom/librewolf": {
        "format": "",
        "interval": "once",
        "on-click": "librewolf",
    },

And then:

modules-left": [..., "custom/librewolf", ...]

This works, but for those not used to the utf-8 awesome font icons, it might be hard to guess what the modules trigger. Currently AFAIK custom modules do not support the "tooltip-format" which other modules do. If supported, that filed could make it really easy to provide a text hint of what's getting triggered by the module. For example:

    "custom/librewolf": {
        "format": "",
        "tooltip-format" "Librewolf Browser"
        "interval": "once",
        "on-click": "librewolf",
    },

Can this hint field be added to custom modules, so by positioning the mouse on the module (quick launch button emulated) a hint of what gets triggered is shown?

I guess there might be other ways to achieve that, but I bet nothing as simple as specifying the hint inline...

Thanks !

piyoki commented 9 months ago

Any updates on this one?

joesri commented 7 months ago

Hi. You could get exactly that with:

    "custom/librewolf": {
        "return-type": "json",
        "format": " {} ",
        "exec": "printf '{\"text\": \"\", \"tooltip\": \"Librewolf Browser\"}'",
        "interval": "once",
        "on-click": "librewolf",
    },

Salut!

je-vv commented 5 months ago

@joesri you were right, that works just as you mentioned... Many thanks !

That said, it's sort of not intuitive to get there, hehe. Re-reading the custom module doc, now I can get sense of it, but without your example no way... Actually it'd be cleaner not needing exec at all, so I'm not closing this, since I believe if not needing exec it should not be forced at all, and still be consistent with other modules...