diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-14 00:22:59 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-14 00:22:59 +1100 |
| commit | e923d39cdeed4b42e747afc01b3420d6d89af6e6 (patch) | |
| tree | a6e1c4fd3af32d2c8bcaf9d4f49226ced4c9c8c0 /utils/system.ts | |
| parent | less border (diff) | |
| download | caelestia-shell-e923d39cdeed4b42e747afc01b3420d6d89af6e6.tar.gz caelestia-shell-e923d39cdeed4b42e747afc01b3420d6d89af6e6.tar.bz2 caelestia-shell-e923d39cdeed4b42e747afc01b3420d6d89af6e6.zip | |
app launcher
Diffstat (limited to 'utils/system.ts')
| -rw-r--r-- | utils/system.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/utils/system.ts b/utils/system.ts index 9a328d5..99e9d7c 100644 --- a/utils/system.ts +++ b/utils/system.ts @@ -1,4 +1,5 @@ -import { exec, GLib } from "astal"; +import { exec, execAsync, GLib } from "astal"; +import type AstalApps from "gi://AstalApps"; import { osIcons } from "./icons"; export const inPath = (bin: string) => { @@ -10,6 +11,14 @@ export const inPath = (bin: string) => { return true; }; +export const launch = (app: AstalApps.Application) => { + execAsync(["uwsm", "app", "--", app.entry]).catch(() => { + app.frequency--; // Decrement frequency cause launch also increments it + app.launch(); + }); + app.frequency++; +}; + export const osId = GLib.get_os_info("ID") ?? "unknown"; export const osIdLike = GLib.get_os_info("ID_LIKE"); export const osIcon = String.fromCodePoint( |