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 --- .../modules/simple-bar/simple-bar-source/lib/skhd.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 users/ryan/modules/simple-bar/simple-bar-source/lib/skhd.js (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/skhd.js') diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/skhd.js b/users/ryan/modules/simple-bar/simple-bar-source/lib/skhd.js new file mode 100755 index 0000000..e2923d1 --- /dev/null +++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/skhd.js @@ -0,0 +1,17 @@ +import * as Uebersicht from "uebersicht"; +import * as Settings from "./settings"; +import * as Utils from "./utils"; + +/** + * Retrieves the current mode by executing a shell script and parsing its output. + * + * @returns {Promise | undefined} A promise that resolves to the parsed JSON object representing the mode. + */ +export async function getMode() { + const settings = Settings.get(); + const { shell } = settings.global; + const mode = await Uebersicht.run( + `cat $(${shell} ./simple-bar/lib/scripts/yabai-set-mode-server.sh --query 2>&1)`, + ); + return Utils.parseJson(mode); +} -- cgit v1.3