diff options
| author | Ryan Schanzenbacher <ryan@rschanz.org> | 2026-07-09 22:15:53 -0400 |
|---|---|---|
| committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2026-07-09 22:15:53 -0400 |
| commit | d06784958d73159b5e4abafe5114804662114ed7 (patch) | |
| tree | d8464262c1aa1f10553a5b11a9fda3e505e71f7f /users/ryan/modules/simple-bar/simple-bar-source/lib/skhd.js | |
| parent | 1a71e94eb8ca1585201263cf654611ef6849d359 (diff) | |
move ubersicht modules in tree
Diffstat (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/skhd.js')
| -rwxr-xr-x | users/ryan/modules/simple-bar/simple-bar-source/lib/skhd.js | 17 |
1 files changed, 17 insertions, 0 deletions
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 @@ | |||
| 1 | import * as Uebersicht from "uebersicht"; | ||
| 2 | import * as Settings from "./settings"; | ||
| 3 | import * as Utils from "./utils"; | ||
| 4 | |||
| 5 | /** | ||
| 6 | * Retrieves the current mode by executing a shell script and parsing its output. | ||
| 7 | * | ||
| 8 | * @returns {Promise<Object> | undefined} A promise that resolves to the parsed JSON object representing the mode. | ||
| 9 | */ | ||
| 10 | export async function getMode() { | ||
| 11 | const settings = Settings.get(); | ||
| 12 | const { shell } = settings.global; | ||
| 13 | const mode = await Uebersicht.run( | ||
| 14 | `cat $(${shell} ./simple-bar/lib/scripts/yabai-set-mode-server.sh --query 2>&1)`, | ||
| 15 | ); | ||
| 16 | return Utils.parseJson(mode); | ||
| 17 | } | ||
