From 0e259e49357d5389db897414fc52b50b1ce1d14c Mon Sep 17 00:00:00 2001 From: Aylur Date: Wed, 11 Sep 2024 20:52:44 +0000 Subject: example: add lua simple-bar --- examples/js/simple-bar/README.md | 2 +- examples/js/simple-bar/widget/Bar.tsx | 34 +++--- examples/lua/simple-bar/README.md | 12 +++ examples/lua/simple-bar/app.lua | 20 ++++ examples/lua/simple-bar/lib.lua | 25 +++++ examples/lua/simple-bar/style.scss | 88 +++++++++++++++ examples/lua/simple-bar/widget/Bar.lua | 192 +++++++++++++++++++++++++++++++++ 7 files changed, 358 insertions(+), 15 deletions(-) create mode 100644 examples/lua/simple-bar/README.md create mode 100644 examples/lua/simple-bar/app.lua create mode 100644 examples/lua/simple-bar/lib.lua create mode 100644 examples/lua/simple-bar/style.scss create mode 100644 examples/lua/simple-bar/widget/Bar.lua (limited to 'examples') diff --git a/examples/js/simple-bar/README.md b/examples/js/simple-bar/README.md index 3a4316e..8f733da 100644 --- a/examples/js/simple-bar/README.md +++ b/examples/js/simple-bar/README.md @@ -1,6 +1,6 @@ # Simple Bar Example -![sime-bar](https://github.com/user-attachments/assets/a306c864-56b7-44c4-8820-81f424f32b9b) +![simple-bar](https://github.com/user-attachments/assets/a306c864-56b7-44c4-8820-81f424f32b9b) A simple bar for Hyprland using diff --git a/examples/js/simple-bar/widget/Bar.tsx b/examples/js/simple-bar/widget/Bar.tsx index d669fd5..492ab1d 100644 --- a/examples/js/simple-bar/widget/Bar.tsx +++ b/examples/js/simple-bar/widget/Bar.tsx @@ -22,7 +22,7 @@ function SysTray() { onClickRelease={self => { menu?.popup_at_widget(self, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null) }}> - + }))} @@ -64,21 +64,27 @@ function BatteryLevel() { } function Media() { - const player = Mpris.Player.new("spotify") + const mpris = Mpris.get_default() return - - `background-image: url('${cover}');` - )} - /> -