From c7513c6319ba6ab1024fce54c5d0e0eeb7f1eb38 Mon Sep 17 00:00:00 2001 From: FieldofClay <7278759+FieldofClay@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:45:07 +1100 Subject: [PATCH] Simplify examples --- README.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3078f9d..f31fd0d 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) + ) +) ``` \ No newline at end of file