use GLib instead of external which

This commit is contained in:
2 * r + 2 * t 2025-01-14 18:15:09 +11:00
parent 9d6b26e49b
commit b5648cf986
2 changed files with 3 additions and 12 deletions

View file

@ -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 &&

View file

@ -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