use GLib instead of external which
This commit is contained in:
parent
9d6b26e49b
commit
b5648cf986
2 changed files with 3 additions and 12 deletions
|
|
@ -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 &&
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue