Files
gnome-shell-extensions/extensions/user-theme/util.js
Florian Müllner 563d7770d3 lint: Sync with gnome-shell
gnome-shell started transitioning to gjs' object spacing rule,
i.e. `{foo: 42}` instead of `{ foo: 42 }`.

We have a much smaller code base than the shell and aren't using
a secondary "allowed-but-deprecated" configuration that allows a
gradual transition, so just pull the switch and update to the new
style.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/240>
2022-08-20 19:00:32 +02:00

24 lines
607 B
JavaScript

/* exported getThemeDirs getModeThemeDirs */
const {GLib} = imports.gi;
const fn = (...args) => GLib.build_filenamev(args);
/**
* @returns {string[]} - an ordered list of theme directories
*/
function getThemeDirs() {
return [
fn(GLib.get_home_dir(), '.themes'),
fn(GLib.get_user_data_dir(), 'themes'),
...GLib.get_system_data_dirs().map(dir => fn(dir, 'themes')),
];
}
/**
* @returns {string[]} - an ordered list of mode theme directories
*/
function getModeThemeDirs() {
return GLib.get_system_data_dirs()
.map(dir => fn(dir, 'gnome-shell', 'theme'));
}