From 9e8634d892c559c5b44565a68bf35b13cbcb5572 Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 16 Jan 2025 17:37:00 +0100 Subject: add: gtk3 ts popover example closes #224 closes #157 --- examples/js/simple-bar/widget/Bar.tsx | 161 ---------------------------------- 1 file changed, 161 deletions(-) delete mode 100644 examples/js/simple-bar/widget/Bar.tsx (limited to 'examples/js/simple-bar/widget') diff --git a/examples/js/simple-bar/widget/Bar.tsx b/examples/js/simple-bar/widget/Bar.tsx deleted file mode 100644 index 6592f6a..0000000 --- a/examples/js/simple-bar/widget/Bar.tsx +++ /dev/null @@ -1,161 +0,0 @@ -import { App } from "astal/gtk3" -import { Variable, GLib, bind } from "astal" -import { Astal, Gtk, Gdk } from "astal/gtk3" -import Hyprland from "gi://AstalHyprland" -import Mpris from "gi://AstalMpris" -import Battery from "gi://AstalBattery" -import Wp from "gi://AstalWp" -import Network from "gi://AstalNetwork" -import Tray from "gi://AstalTray" - -function SysTray() { - const tray = Tray.get_default() - - return - {bind(tray, "items").as(items => items.map(item => ( - ["dbusmenu", ag])} - menuModel={bind(item, "menuModel")}> - - - )))} - -} - -function Wifi() { - const network = Network.get_default() - const wifi = bind(network, "wifi") - - return - {wifi.as(wifi => wifi && ( - - ))} - - -} - -function AudioSlider() { - const speaker = Wp.get_default()?.audio.defaultSpeaker! - - return - - speaker.volume = value} - value={bind(speaker, "volume")} - /> - -} - -function BatteryLevel() { - const bat = Battery.get_default() - - return - - -} - -function Media() { - const mpris = Mpris.get_default() - - return - {bind(mpris, "players").as(ps => ps[0] ? ( - - - `background-image: url('${cover}');` - )} - /> - - ) : ( - "Nothing Playing" - ))} - -} - -function Workspaces() { - const hypr = Hyprland.get_default() - - return - {bind(hypr, "workspaces").as(wss => wss - .filter(ws => !(ws.id >= -99 && ws.id <= -2)) // filter out special workspaces - .sort((a, b) => a.id - b.id) - .map(ws => ( - - )) - )} - -} - -function FocusedClient() { - const hypr = Hyprland.get_default() - const focused = bind(hypr, "focusedClient") - - return - {focused.as(client => ( - client && -} - -function Time({ format = "%H:%M - %A %e." }) { - const time = Variable("").poll(1000, () => - GLib.DateTime.new_now_local().format(format)!) - - return