aboutsummaryrefslogtreecommitdiffstats
path: root/config/ags/modules/.miscutils/icons.js
blob: fb1e20da34bc69b628ccdd4a92acdcf5efb23165 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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;
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage