diff --git a/utils/mpris.ts b/utils/mpris.ts index 8f6923a4..e0cc1110 100644 --- a/utils/mpris.ts +++ b/utils/mpris.ts @@ -1,7 +1,7 @@ +import { GLib } from "astal"; import AstalMpris from "gi://AstalMpris"; -import { inPath } from "./system"; -const hasPlasmaIntegration = inPath("plasma-browser-integration-host"); +const hasPlasmaIntegration = GLib.find_program_in_path("plasma-browser-integration-host") !== null; export const isRealPlayer = (player?: AstalMpris.Player) => player !== undefined && diff --git a/utils/system.ts b/utils/system.ts index 99e9d7c8..5d779085 100644 --- a/utils/system.ts +++ b/utils/system.ts @@ -1,16 +1,7 @@ -import { exec, execAsync, GLib } from "astal"; +import { execAsync, GLib } from "astal"; import type AstalApps from "gi://AstalApps"; import { osIcons } from "./icons"; -export const inPath = (bin: string) => { - try { - exec(`which ${bin}`); - } catch { - return false; - } - return true; -}; - export const launch = (app: AstalApps.Application) => { execAsync(["uwsm", "app", "--", app.entry]).catch(() => { app.frequency--; // Decrement frequency cause launch also increments it