Skip to content

Commit

Permalink
Simplify examples
Browse files Browse the repository at this point in the history
  • Loading branch information
FieldofClay committed Jan 26, 2024
1 parent 6f3d54e commit c7513c6
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,29 @@ hyprctl monitors -j

It can be used as a title widget in Eww with config similar to below.
```yuck
(deflisten window0 "hyprland-activewindow `hyprctl monitors -j | jq -r \".[0].name\"`")
(deflisten window0 "hyprland-activewindow eDP-1")
(defwidget title0 []
(label :text "${window0}"))
(deflisten window1 "hyprland-activewindow `hyprctl monitors -j | jq -r \".[1].name\"`")
(deflisten window1 "hyprland-activewindow DP-1")
(defwidget title1 []
(label :text "${window1}"))
(defwidget bar0 []
(box
...other config...
(window0)
...other config...
)
)
(defwidget bar1 []
(box
...other config...
(window1)
...other config...
)
)
```

### Advanced Mode
Expand All @@ -56,4 +72,16 @@ This allows simplified Eww config similar to this:
(label :text "${windows['${monitor}'].title}")
)
)
(defwidget bar0 []
(box
(window :monitor 0)
)
)
(defwidget bar1 []
(box
(window :monitor 1)
)
)
```

0 comments on commit c7513c6

Please sign in to comment.