From d06784958d73159b5e4abafe5114804662114ed7 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Thu, 9 Jul 2026 22:15:53 -0400 Subject: move ubersicht modules in tree --- .../lib/components/aerospace/process.jsx | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 users/ryan/modules/simple-bar/simple-bar-source/lib/components/aerospace/process.jsx (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/components/aerospace/process.jsx') diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/components/aerospace/process.jsx b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/aerospace/process.jsx new file mode 100755 index 0000000..0c461cc --- /dev/null +++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/aerospace/process.jsx @@ -0,0 +1,72 @@ +import * as Uebersicht from "uebersicht"; +import Window from "./window.jsx"; +import * as Utils from "../../utils"; +import { useAerospaceContext } from "../aerospace-context.jsx"; +import { useSimpleBarContext } from "../simple-bar-context.jsx"; + +export { processStyles as styles } from "../../styles/components/process"; + +const { React } = Uebersicht; + +/** + * Process component to display windows in the current space. + * @returns {JSX.Element|null} The rendered component or null if not visible. + */ +const Component = React.memo(() => { + // Get spaces from aerospace context + const { spaces } = useAerospaceContext(); + // Get settings and display index from simple bar context + const { settings, displayIndex } = useSimpleBarContext(); + const { spacesDisplay, process, widgets } = settings; + const { exclusionsAsRegex } = spacesDisplay; + const { processWidget } = widgets; + const { centered, showOnDisplay } = process; + + // Determine if the component should be visible + const visible = + spaces?.length && + processWidget && + Utils.isVisibleOnDisplay(displayIndex, showOnDisplay); + + if (!visible) return null; + + // Find the focused space on the current display + const { windows = [] } = + spaces.find((space) => space.focused && space.monitor === displayIndex) || + {}; + + if (!windows.length) return null; + + // Get exclusions for filtering windows + const exclusions = exclusionsAsRegex + ? spacesDisplay.exclusions + : spacesDisplay.exclusions.split(", "); + + const titleExclusions = exclusionsAsRegex + ? spacesDisplay.titleExclusions + : spacesDisplay.titleExclusions.split(", "); + + // Generate class names for the component + const classes = Utils.classNames("process", { + "process--centered": centered, + }); + + // Filter windows based on exclusions + const filteredWindows = windows.filter((window) => + Utils.filterApps(window, exclusions, titleExclusions, exclusionsAsRegex), + ); + + return ( +
+
+ {filteredWindows.map((window, i) => ( + + ))} +
+
+ ); +}); + +Component.displayName = "Process"; + +export default Component; -- cgit v1.3