agsdotfilesdotshyprlandhyprland-configricerofirofi-configshell-scriptsswwwwallustwaybarwaybar-modulewaybar-themes
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
399 B
13 lines
399 B
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; |
|
} |