import { Gtk, Gdk } from "astal/gtk4";
import { GLib } from "astal";

export const isIcon = (icon: string) => {
  const display = Gdk.Display.get_default();
  if (!display) return false;
  const iconTheme = Gtk.IconTheme.get_for_display(display);
  return iconTheme.has_icon(icon);
};

export const fileExists = (path: string) =>
  GLib.file_test(path, GLib.FileTest.EXISTS);
