From 7380c75818ed8d4b863d3f6063571194f9d68854 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Mon, 21 Apr 2025 17:26:52 +0200 Subject: [PATCH] [AGS] Save for migration to GTK4 --- config/astal/components/bar/ui/Bar.tsx | 2 ++ .../components/bar/ui/modules/Calendar.tsx | 4 ++++ .../components/bar/ui/modules/Hyprland.tsx | 19 +++++++++++++++---- .../components/bar/ui/modules/SystemInfo.tsx | 10 +++++++++- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/config/astal/components/bar/ui/Bar.tsx b/config/astal/components/bar/ui/Bar.tsx index aa55679..7c9c7da 100644 --- a/config/astal/components/bar/ui/Bar.tsx +++ b/config/astal/components/bar/ui/Bar.tsx @@ -2,6 +2,7 @@ import { Astal, Gdk, Gtk } from "astal/gtk3"; import Hyprland from "./modules/Hyprland"; import Calendar from "./modules/Calendar"; import QuickView from "./modules/QuickView"; +import SystemInfo from "./modules/SystemInfo"; const Bar = (gdkmonitor: Gdk.Monitor) => { const { TOP, LEFT, RIGHT } = Astal.WindowAnchor; @@ -14,6 +15,7 @@ const Bar = (gdkmonitor: Gdk.Monitor) => { + diff --git a/config/astal/components/bar/ui/modules/Calendar.tsx b/config/astal/components/bar/ui/modules/Calendar.tsx index aa4fc7d..9784b95 100644 --- a/config/astal/components/bar/ui/modules/Calendar.tsx +++ b/config/astal/components/bar/ui/modules/Calendar.tsx @@ -11,6 +11,10 @@ const Time = ({ format = "%a, %e.%m %H:%M:%S" }) => { /> } +const Calendar = () => { + +} + export default { Time diff --git a/config/astal/components/bar/ui/modules/Hyprland.tsx b/config/astal/components/bar/ui/modules/Hyprland.tsx index 5d547cf..9e42d90 100644 --- a/config/astal/components/bar/ui/modules/Hyprland.tsx +++ b/config/astal/components/bar/ui/modules/Hyprland.tsx @@ -1,5 +1,5 @@ import AstalTray from "gi://AstalTray"; -import { bind } from "astal"; +import { bind, Variable } from "astal"; import AstalHyprland from "gi://AstalHyprland"; const SysTray = () => { @@ -42,14 +42,25 @@ const Workspace = () => { const ActiveWindow = () => { const hypr = AstalHyprland.get_default(); const focused = bind( hypr, "focusedClient" ); + let visible = Variable( false ); + + const toggleOverlay = () => { + visible.set( !visible.get() ); + } return - {focused.as( client => ( - client && } + export default { Workspace, ActiveWindow, diff --git a/config/astal/components/bar/ui/modules/SystemInfo.tsx b/config/astal/components/bar/ui/modules/SystemInfo.tsx index 2d91d04..404c010 100644 --- a/config/astal/components/bar/ui/modules/SystemInfo.tsx +++ b/config/astal/components/bar/ui/modules/SystemInfo.tsx @@ -17,6 +17,9 @@ const featureTest = () => { availableFeatures.cpu = false; printerr( '[ SysInfo ] Feature Test for CPU info failed. mpstat from the sysstat package missing!' ); } + + // Screen brightness... CTL might be available, but no screen controllable + // Battery... acpi might be present, but potentially no bat } let enabled = false; @@ -52,5 +55,10 @@ const sysInfoFetcher = () => { const SystemInfo = () => { - + return +} + + +export default { + SystemInfo }