diff --git a/widgets/control-center/header.tsx b/widgets/control-center/header.tsx index 7bcdef4..401722d 100644 --- a/widgets/control-center/header.tsx +++ b/widgets/control-center/header.tsx @@ -2,6 +2,8 @@ import { Gdk, Gtk } from "ags/gtk4"; import { execAsync } from "ags/process"; import { createPoll } from "ags/time"; import GLib from "gi://GLib"; +import { WINDOW_NAME } from "."; +import app from "ags/gtk4/app"; export const Header = () => { const { VERTICAL } = Gtk.Orientation; @@ -13,6 +15,11 @@ export const Header = () => { () => GLib.DateTime.new_now_local().format("%a %b %d - %I:%M:%S %p")!, ); + const handleExec = (cmd: string) => { + app.toggle_window(WINDOW_NAME); + execAsync(cmd); + }; + return ( { diff --git a/widgets/control-center/index.tsx b/widgets/control-center/index.tsx index 824c49e..510ccde 100644 --- a/widgets/control-center/index.tsx +++ b/widgets/control-center/index.tsx @@ -15,7 +15,6 @@ export const ControlCenter = (gdkmonitor: Gdk.Monitor) => { return (