From 10290bc427acc3f7fc1331cc3cb3ea8c2118180c Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 8 Apr 2025 16:52:38 +1000 Subject: navbar: add special workspace toggles --- src/modules/navbar.tsx | 52 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/modules/navbar.tsx b/src/modules/navbar.tsx index b844ff4..e230c19 100644 --- a/src/modules/navbar.tsx +++ b/src/modules/navbar.tsx @@ -1,11 +1,16 @@ import type { Monitor } from "@/services/monitors"; +import { capitalize } from "@/utils/strings"; import type { AstalWidget } from "@/utils/types"; -import { Variable } from "astal"; +import { bind, execAsync, Variable } from "astal"; import { Astal, Gtk } from "astal/gtk3"; import { navbar as config } from "config"; import AstalHyprland from "gi://AstalHyprland"; +import Pango from "gi://Pango"; import SideBar, { awaitSidebar, paneNames, switchPane, type PaneName } from "./sidebar"; +const specialWsNames = ["sysmon", "communication", "music", "todo"] as const; +type SpecialWsName = (typeof specialWsNames)[number]; + const getPaneIcon = (name: PaneName) => { if (name === "dashboard") return "dashboard"; if (name === "audio") return "tune"; @@ -15,13 +20,11 @@ const getPaneIcon = (name: PaneName) => { return "date_range"; }; -const getPaneName = (name: PaneName) => { - if (name === "dashboard") return "Dash"; - if (name === "audio") return "Audio"; - if (name === "connectivity") return "Conn"; - if (name === "packages") return "Pkgs"; - if (name === "notifpane") return "Alrts"; - return "Time"; +const getSpecialWsIcon = (name: SpecialWsName) => { + if (name === "sysmon") return "speed"; + if (name === "communication") return "communication"; + if (name === "music") return "music_note"; + return "checklist"; }; const hookIsCurrent = ( @@ -50,17 +53,40 @@ const PaneButton = ({ }) => ( +); + +const SpecialWsButton = ({ name }: { name: SpecialWsName }) => ( + @@ -113,6 +139,10 @@ export default ({ monitor }: { monitor: Monitor }) => { {paneNames.map(n => ( ))} + + {specialWsNames.map(n => ( + + ))} -- cgit v1.2.3-freya