From 0c8fa3a2a270747f3dbb54fe8792f3f0aec997e3 Mon Sep 17 00:00:00 2001
From: Ryan Schanzenbacher <ryan@rschanz.org>
Date: Mon, 3 Aug 2026 01:22:44 -0400
Subject: Initial commit: combined darwin + guix-linux home-manager flake

Supersedes nix-dotfiles (darwin) and guix-dotfiles' ad-hoc
nix-home-manager flake (linux). See README.md/MIGRATION.md.
---
 .../lib/components/yabai/stickies.jsx              | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100755 users/ryan/modules/simple-bar/simple-bar-source/lib/components/yabai/stickies.jsx

(limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/components/yabai/stickies.jsx')

diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/components/yabai/stickies.jsx b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/yabai/stickies.jsx
new file mode 100755
index 0000000..703bf68
--- /dev/null
+++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/yabai/stickies.jsx
@@ -0,0 +1,56 @@
+import OpenedApps from "./opened-apps.jsx";
+import { useYabaiContext } from "../yabai-context.jsx";
+import { useSimpleBarContext } from "../simple-bar-context.jsx";
+import * as Utils from "../../utils";
+
+/**
+ * Stickies component to display sticky windows.
+ * @param {Object} props - Component properties.
+ * @param {Object} props.display - The current display information.
+ * @returns {JSX.Element|null} The rendered component or null if no sticky windows are present.
+ */
+export default function Stickies({ display }) {
+  // Get windows from yabai context
+  const { windows } = useYabaiContext();
+  // Get settings from simple-bar context
+  const { settings } = useSimpleBarContext();
+  const { spacesDisplay } = settings;
+  const { exclusionsAsRegex, hideDuplicateAppsInSpaces } = spacesDisplay;
+
+  // Determine exclusions based on settings
+  const exclusions = exclusionsAsRegex
+    ? spacesDisplay.exclusions
+    : spacesDisplay.exclusions.split(", ");
+  const titleExclusions = exclusionsAsRegex
+    ? spacesDisplay.titleExclusions
+    : spacesDisplay.titleExclusions.split(", ");
+
+  // Get sticky windows using a utility function
+  const { stickyWindows: apps } = Utils.stickyWindowWorkaround({
+    windows,
+    uniqueApps: hideDuplicateAppsInSpaces,
+    currentDisplay: display,
+    currentSpace: undefined,
+    exclusions,
+    titleExclusions,
+    exclusionsAsRegex,
+  });
+
+  // Filter out minimized sticky windows
+  const notMinimizedStikies = apps.filter((app) => {
+    const { "is-minimized": isMinimized, minimized: __legacyIsMinimized } = app;
+    return !(isMinimized || __legacyIsMinimized);
+  });
+
+  // Return null if no non-minimized sticky windows are present
+  if (!notMinimizedStikies?.length) return null;
+
+  // Render the sticky windows
+  return (
+    <div className="stickies">
+      <div className="stickies__inner">
+        <OpenedApps apps={apps} />
+      </div>
+    </div>
+  );
+}
-- 
cgit v1.3.1

