Commit 2582ab4f authored by Tomasz Gąsior's avatar Tomasz Gąsior

User theme: compatibility with XDG Base Directory

See !55
parent 5a06de60
Pipeline #60933 passed with stages
in 4 minutes and 3 seconds
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
// Load shell theme from ~/.themes/name/gnome-shell
// Load shell theme from ~/.local/share/themes/name/gnome-shell
/* exported init */
const { Gio, GLib } = imports.gi;
......@@ -34,11 +34,17 @@ class ThemeManager {
let _themeName = this._settings.get_string(SETTINGS_KEY);
if (_themeName) {
let _userCssStylesheet = GLib.build_filenamev([
let _userCssStylesheetCompat = GLib.build_filenamev([
GLib.get_home_dir(), '.themes', _themeName, 'gnome-shell', 'gnome-shell.css'
]);
let fileCompat = Gio.file_new_for_path(_userCssStylesheetCompat);
let _userCssStylesheet = GLib.build_filenamev([
GLib.get_user_data_dir(), 'themes', _themeName, 'gnome-shell', 'gnome-shell.css'
]);
let file = Gio.file_new_for_path(_userCssStylesheet);
if (file.query_exists(null))
if (fileCompat.query_exists(null))
_stylesheet = _userCssStylesheetCompat;
else if (file.query_exists(null))
_stylesheet = _userCssStylesheet;
else {
let sysdirs = GLib.get_system_data_dirs();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment