elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.15k stars 379 forks source link

Is it possible to add context menus to each widget? #1173

Open hypernova7 opened 2 weeks ago

hypernova7 commented 2 weeks ago

20240826_155731.png

I currently edited the eww code to convert a json array to render the photo's context menu.

MartyMcFlyInTheSky commented 2 weeks ago

Pretty cool. Care to publish the dotfiles or the relevant parts at least? :)

hypernova7 commented 2 weeks ago

@MartyMcFlyInTheSky I do this 2024-08-29_01-31-02_area_maim

Edit the eww code to add the menu attribute, it converts a json to a gtk menu. The idea is that elkowar can make any widget able to carry this attribute to add context menus anywhere, but in a more beautiful way. Like this

(box
  :menu (menu
    (option
      :label "Show weather"
      :actionn "${EWW_CMD} update show_weather=true"
    )
    (option
      :label "Submenu"
      :submenu (menu
        (option
          :label "Item 1"
        )
      )
    )
  )
)