hyprcrux/.config/ags/modules/.miscutils/files.js
2024-04-11 00:21:35 -04:00

14 lines
No EOL
327 B
JavaScript

const { Gio, GLib, Gtk } = imports.gi;
export function fileExists(filePath) {
let file = Gio.File.new_for_path(filePath);
return file.query_exists(null);
}
export function expandTilde(path) {
if (path.startsWith('~')) {
return GLib.get_home_dir() + path.slice(1);
} else {
return path;
}
}