Support globally installed themes

If a theme cannot be found in the user directory, try in system
data dirs (XDG_DATA_DIRS, usually /usr/share and /usr/local/share)

Signed-off-by: Giovanni Campagna <gcampagna@src.gnome.org>
This commit is contained in:
Elad Alfassa
2011-05-20 15:47:54 +02:00
committed by Giovanni Campagna
parent f7e32aabc5
commit 7576883744
+11 -2
View File
@@ -29,8 +29,17 @@ ThemeManager.prototype = {
file = Gio.file_new_for_path(_userCssStylesheet);
if (file.query_exists(null))
_stylesheet = _userCssStylesheet;
else
_stylesheet = null;
else {
let sysdirs = GLib.get_system_data_dirs();
for (let i = 0; i < sysdirs.length; i++) {
_userCssStylesheet = sysdirs[i] + '/themes/' + _themeName + '/gnome-shell/gnome-shell.css';
file = Gio.file_new_for_path(_userCssStylesheet);
if (file.query_exists(null)) {
_stylesheet = _userCssStylesheet;
break;
}
}
}
}
if (_stylesheet)