glazewm icon indicating copy to clipboard operation
glazewm copied to clipboard

[Feature Request] Add click events to non-text components

Open underscoregeb opened this issue 1 year ago • 2 comments

As far as i know, the only component that supports custom click commands is text :

    - type: "text"
      text: "hi"
      left_click_command: "exec cmd"
      right_click_command: "exec taskmgr"

Proposal:

It would be nice to bring this ability to other components. For example, i could click on my RAM indicator to launch Task Manager and kill a process that's hogging my memory.

underscoregeb avatar Dec 20 '23 05:12 underscoregeb

Before the developers implement this, there is currently actually the very scuffed but functional method of placing a text component containing only spaces on the right of component you want to add a click event for, and then giving it a negative x-margin.

# -- Your component --
- type: "text"
      text: "   " # Adjust number of spaces based on size of component
      margin: 0 -25 # Moves it left on top of the previous component
      left_click_command: "exec cmd"
      right_click_command: "exec taskmgr"

DaNubCoding avatar Dec 28 '23 16:12 DaNubCoding

oh, that’s a creative way of doing it! i’m going to give it a shot, thanks!

underscoregeb avatar Dec 31 '23 04:12 underscoregeb

I'm closing feature requests and bugs about the built-in bar since it's now been swapped out for Zebar. If Zebar doesn't fix what you need, a new issue for it can be opened over here

lars-berger avatar Aug 15 '24 08:08 lars-berger