user config round 1 (#271)

This commit is contained in:
end-4
2024-03-01 23:18:56 +07:00
parent 99b8b92889
commit 29fdbd376f
20 changed files with 170 additions and 224 deletions
+13
View File
@@ -0,0 +1,13 @@
const { Gtk } = imports.gi;
export function iconExists(iconName) {
let iconTheme = Gtk.IconTheme.get_default();
return iconTheme.has_icon(iconName);
}
export function substitute(str) {
if(userOptions.icons.substitutions[str]) return userOptions.icons.substitutions[str];
if (!iconExists(str)) str = str.toLowerCase().replace(/\s+/g, '-'); // Turn into kebab-case
return str;
}