forked from Shinonome/dots-hyprland
user config round 1 (#271)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user