From d3742d78f3ad428337ddc5271f0fc8d329540a55 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Tue, 17 Jun 2025 01:48:59 +0200 Subject: [PATCH] Modules/AGS: Add WIP config --- home/modules/ags/config/style.scss | 42 +++++++--- home/modules/ags/config/widget/Bar.tsx | 90 ++++++++++++++++------ home/modules/ags/config/widget/SysTray.tsx | 40 ++++++++++ 3 files changed, 137 insertions(+), 35 deletions(-) create mode 100644 home/modules/ags/config/widget/SysTray.tsx diff --git a/home/modules/ags/config/style.scss b/home/modules/ags/config/style.scss index b7effa7f..45345505 100644 --- a/home/modules/ags/config/style.scss +++ b/home/modules/ags/config/style.scss @@ -6,19 +6,41 @@ $fg-color: #{"@theme_fg_color"}; $bg-color: #{"@theme_bg_color"}; -window.Bar { +// Order is Top-Right-Bottom-Left for combined properties + +* { + // Remove the default theme's background-image, otherwise background-color doesn't work + background-image: none; + + // Clear implicit paddings and margins, otherwise size management is terrible + padding: 0; + margin: 0; +} + +.Window { background: transparent; - color: $fg-color; font-weight: bold; + font-size: x-large; - >centerbox { - background: $bg-color; - border-radius: 10px; - margin: 8px; - } + .Bar { + background-color: rgba($light-base, 0.3); + border-radius: 6px; + border-width: 2px; + border-color: $dark-lavender; + border-style: solid; + margin: 10px 10px 0 10px; - button { - border-radius: 8px; - margin: 2px; + .LauncherButton { + background-color: $dark-lavender; + border-radius: 6px; + border-width: 0; + margin: -1px 10px -1px -1px; // Negative margins to remove gaps from border radii + min-width: 36px; + min-height: 36px; + + >label { + margin-left: -4px; // Tux not centered otherwise + } + } } } diff --git a/home/modules/ags/config/widget/Bar.tsx b/home/modules/ags/config/widget/Bar.tsx index c2db8c52..3f0ced13 100644 --- a/home/modules/ags/config/widget/Bar.tsx +++ b/home/modules/ags/config/widget/Bar.tsx @@ -1,36 +1,76 @@ import { App, Astal, Gtk, Gdk } from "astal/gtk4" -import { Variable } from "astal" +import { GLib, Variable } from "astal" +import { SysTray } from "./SysTray"; -const time = Variable("").poll(1000, "date") +const user = Variable("") + .poll(60000, ["bash", "-c", "whoami"]); + +const time = Variable("") + .poll(1000, ["bash", "-c", "date +'%H:%M:%S'"]); + +const date = Variable("") + .poll(60000, ["bash", "-c", "date +'%y-%m-%d'"]) + +const uptime = Variable("") + .poll(60000, ["bash", "-c", "uptime | awk -F'( |,)+' '{print $4}'"]); export default function Bar(gdkmonitor: Gdk.Monitor) { const { TOP, LEFT, RIGHT } = Astal.WindowAnchor return - - - - - - - + visible + + child={ + , + +