From f95ee4d35c595c955213bf2bd54e7ce0bad57234 Mon Sep 17 00:00:00 2001 From: Joshua Yuen Date: Sat, 12 Sep 2026 18:06:12 -0400 Subject: [PATCH] Add popup header with avatar and system actions --- modules/home/ags/app/style.scss | 18 +++++--- modules/home/ags/app/widget/QuickSettings.tsx | 41 +++++++++++++------ 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/modules/home/ags/app/style.scss b/modules/home/ags/app/style.scss index 5480c16..e3ab040 100644 --- a/modules/home/ags/app/style.scss +++ b/modules/home/ags/app/style.scss @@ -220,8 +220,18 @@ $module-bg: transparentize($base02, 0.4); color: $base05; } -.power-header { - margin-bottom: 10px; +.header { + margin-bottom: 6px; + + .avatar { + padding: 7px; + border-radius: 10px; + background: transparentize($base02, 0.4); + } + + .username { + font-weight: bold; + } } .power-action { @@ -372,9 +382,7 @@ $module-bg: transparentize($base02, 0.4); } .battery-section { - margin-top: 10px; - border-top: 1px solid $base02; - padding-top: 8px; + margin-bottom: 8px; icon { font-size: 16px; diff --git a/modules/home/ags/app/widget/QuickSettings.tsx b/modules/home/ags/app/widget/QuickSettings.tsx index 77477bb..19192f6 100644 --- a/modules/home/ags/app/widget/QuickSettings.tsx +++ b/modules/home/ags/app/widget/QuickSettings.tsx @@ -1,4 +1,5 @@ import Gtk from "gi://Gtk?version=3.0" +import GLib from "gi://GLib" import AstalWp from "gi://AstalWp" import Notifd from "gi://AstalNotifd" import { execAsync, Variable, bind } from "astal" @@ -33,14 +34,37 @@ const micIcon = mic ) : null -const actions = [ +const user = GLib.get_user_name() + +const actions: { icon: string; cmd?: string[] }[] = [ + { icon: "emblem-system-symbolic" }, { icon: "system-lock-screen-symbolic", cmd: ["hyprlock"] }, { icon: "weather-clear-night-symbolic", cmd: ["systemctl", "suspend"] }, - { icon: "system-log-out-symbolic", cmd: ["hyprctl", "dispatch", "exit"] }, { icon: "system-reboot-symbolic", cmd: ["systemctl", "reboot"] }, + { icon: "system-log-out-symbolic", cmd: ["hyprctl", "dispatch", "exit"] }, { icon: "system-shutdown-symbolic", cmd: ["systemctl", "poweroff"] }, ] +function Header() { + return ( + + + + +