Cursor theme switching
This commit is contained in:
@@ -28,6 +28,7 @@ const { SettingsManager } = Me.imports.modules.SettingsManager;
|
||||
const { Timer } = Me.imports.modules.Timer;
|
||||
const { GtkThemer } = Me.imports.modules.GtkThemer;
|
||||
const { ShellThemer } = Me.imports.modules.ShellThemer;
|
||||
const { CursorThemer } = Me.imports.modules.CursorThemer;
|
||||
const { Backgrounder } = Me.imports.modules.Backgrounder;
|
||||
const { Commander } = Me.imports.modules.Commander;
|
||||
|
||||
@@ -43,6 +44,7 @@ var settingsManager = null;
|
||||
var timer = null;
|
||||
var gtkThemer = null;
|
||||
var shellThemer = null;
|
||||
var cursorThemer = null;
|
||||
var backgrounder = null;
|
||||
var commander = null;
|
||||
|
||||
@@ -60,6 +62,7 @@ function enable() {
|
||||
timer = new Timer();
|
||||
gtkThemer = new GtkThemer();
|
||||
shellThemer = new ShellThemer();
|
||||
cursorThemer = new CursorThemer();
|
||||
backgrounder = new Backgrounder();
|
||||
commander = new Commander();
|
||||
|
||||
@@ -67,6 +70,7 @@ function enable() {
|
||||
timer.enable();
|
||||
gtkThemer.enable();
|
||||
shellThemer.enable();
|
||||
cursorThemer.enable();
|
||||
backgrounder.enable();
|
||||
commander.enable();
|
||||
|
||||
@@ -81,6 +85,7 @@ function disable() {
|
||||
|
||||
gtkThemer.disable();
|
||||
shellThemer.disable();
|
||||
cursorThemer.disable();
|
||||
backgrounder.disable();
|
||||
commander.disable();
|
||||
timer.disable();
|
||||
@@ -90,6 +95,7 @@ function disable() {
|
||||
timer = null;
|
||||
gtkThemer = null;
|
||||
shellThemer = null;
|
||||
cursorThemer = null;
|
||||
backgrounder = null;
|
||||
commander = null;
|
||||
log_debug('Extension disabled.');
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
Night Theme Switcher Gnome Shell extension
|
||||
|
||||
Copyright (C) 2020 Romain Vigier
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation, either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http s ://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
const { extensionUtils } = imports.misc;
|
||||
const { main } = imports.ui;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const e = Me.imports.extension;
|
||||
const { log_debug } = Me.imports.utils;
|
||||
|
||||
|
||||
/**
|
||||
* The Cursor Themer is responsible for changing the cursor theme according to
|
||||
* the time.
|
||||
*/
|
||||
var CursorThemer = class {
|
||||
|
||||
enable() {
|
||||
log_debug('Enabling Cursor Themer...');
|
||||
this._watch_status();
|
||||
this._save_original_theme();
|
||||
if ( e.settingsManager.cursor_variants_enabled ) {
|
||||
this._connect_settings();
|
||||
this._connect_timer();
|
||||
}
|
||||
log_debug('Cursor Themer enabled.');
|
||||
}
|
||||
|
||||
disable() {
|
||||
log_debug('Disabling Cursor Themer...');
|
||||
this._disconnect_timer();
|
||||
this._disconnect_settings();
|
||||
this._reset_original_theme();
|
||||
this._unwatch_status();
|
||||
log_debug('Cursor Themer disabled.');
|
||||
}
|
||||
|
||||
|
||||
_watch_status() {
|
||||
log_debug('Watching cursor variants status...');
|
||||
this._cursor_variants_status_changed_connect = e.settingsManager.connect('cursor-variants-status-changed', this._on_cursor_variants_status_changed.bind(this));
|
||||
}
|
||||
|
||||
_unwatch_status() {
|
||||
if ( this._cursor_variants_status_changed_connect ) {
|
||||
e.settingsManager.disconnect(this._cursor_variants_status_changed_connect);
|
||||
this._cursor_variants_status_changed_connect = null;
|
||||
}
|
||||
log_debug('Stopped watching cursor variants status.');
|
||||
}
|
||||
|
||||
_connect_settings() {
|
||||
log_debug('Connecting Cursor Themer to settings...');
|
||||
this._cursor_variant_changed_connect = e.settingsManager.connect('cursor-variant-changed', this._on_cursor_variant_changed.bind(this));
|
||||
this._cursor_theme_changed_connect = e.settingsManager.connect('cursor-theme-changed', this._on_cursor_theme_changed.bind(this));
|
||||
}
|
||||
|
||||
_disconnect_settings() {
|
||||
if ( this._cursor_variant_changed_connect ) {
|
||||
e.settingsManager.disconnect(this._cursor_variant_changed_connect);
|
||||
this._cursor_variant_changed_connect = null;
|
||||
}
|
||||
if ( this._cursor_theme_changed_connect ) {
|
||||
e.settingsManager.disconnect(this._cursor_theme_changed_connect);
|
||||
this._cursor_theme_changed_connect = null;
|
||||
}
|
||||
log_debug('Disconnected Cursor Themer from settings.');
|
||||
}
|
||||
|
||||
_connect_timer() {
|
||||
log_debug('Connecting Cursor Themer to Timer...');
|
||||
this._time_changed_connect = e.timer.connect('time-changed', this._on_time_changed.bind(this));
|
||||
}
|
||||
|
||||
_disconnect_timer() {
|
||||
if ( this._time_changed_connect ) {
|
||||
e.timer.disconnect(this._time_changed_connect);
|
||||
this._time_changed_connect = null;
|
||||
}
|
||||
log_debug('Disconnected Cursor Themer from Timer.');
|
||||
}
|
||||
|
||||
|
||||
_on_cursor_variants_status_changed(settings, enabled) {
|
||||
this.disable();
|
||||
this.enable();
|
||||
}
|
||||
|
||||
_on_cursor_variant_changed(settings, changed_variant_time) {
|
||||
if ( changed_variant_time === e.timer.time ) {
|
||||
this._set_variant(changed_variant_time);
|
||||
}
|
||||
}
|
||||
|
||||
_on_cursor_theme_changed(settings, new_theme) {
|
||||
this._save_original_theme();
|
||||
switch (e.timer.time) {
|
||||
case 'day':
|
||||
e.settingsManager.cursor_variant_day = new_theme;
|
||||
break;
|
||||
case 'night':
|
||||
e.settingsManager.cursor_variant_night = new_theme;
|
||||
}
|
||||
this._set_variant(e.timer.time);
|
||||
}
|
||||
|
||||
_on_time_changed(timer, new_time) {
|
||||
this._set_variant(new_time);
|
||||
}
|
||||
|
||||
|
||||
_are_variants_up_to_date() {
|
||||
return ( e.settingsManager.cursor_theme === e.settingsManager.cursor_variant_day || e.settingsManager.cursor_theme === e.settingsManager.cursor_variant_night );
|
||||
}
|
||||
|
||||
_set_variant(time) {
|
||||
log_debug(`Setting the cursor ${time} variant...`);
|
||||
switch (time) {
|
||||
case 'day':
|
||||
e.settingsManager.cursor_theme = e.settingsManager.cursor_variant_day;
|
||||
break;
|
||||
case 'night':
|
||||
e.settingsManager.cursor_theme = e.settingsManager.cursor_variant_night;
|
||||
break;
|
||||
case 'original':
|
||||
e.settingsManager.cursor_theme = e.settingsManager.cursor_variant_original;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_save_original_theme() {
|
||||
if ( this._are_variants_up_to_date() ) {
|
||||
return;
|
||||
}
|
||||
e.settingsManager.cursor_variant_original = e.settingsManager.cursor_theme;
|
||||
}
|
||||
|
||||
_reset_original_theme() {
|
||||
// We don't reset the theme when locking the session to prevent
|
||||
// flicker on unlocking
|
||||
if ( !main.screenShield.locked ) {
|
||||
log_debug('Resetting to the user\'s original cursor theme...');
|
||||
this._set_variant('original');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,6 +57,10 @@ var SettingsManager = class {
|
||||
this._shell_variant_day_changed_connect = this._extensionsSettings.connect('changed::shell-variant-day', this._on_shell_variant_day_changed.bind(this));
|
||||
this._shell_variant_night_changed_connect = this._extensionsSettings.connect('changed::shell-variant-night', this._on_shell_variant_night_changed.bind(this));
|
||||
this._shell_variant_original_changed_connect = this._extensionsSettings.connect('changed::shell-variant-original', this._on_shell_variant_original_changed.bind(this));
|
||||
this._cursor_variants_status_connect = this._extensionsSettings.connect('changed::cursor-variants-enabled', this._on_cursor_variants_status_changed.bind(this));
|
||||
this._cursor_variant_day_changed_connect = this._extensionsSettings.connect('changed::cursor-variant-day', this._on_cursor_variant_day_changed.bind(this));
|
||||
this._cursor_variant_night_changed_connect = this._extensionsSettings.connect('changed::cursor-variant-night', this._on_cursor_variant_night_changed.bind(this));
|
||||
this._cursor_variant_original_changed_connect = this._extensionsSettings.connect('changed::cursor-variant-original', this._on_cursor_variant_original_changed.bind(this));
|
||||
this._time_source_changed_connect = this._extensionsSettings.connect('changed::time-source', this._on_time_source_changed.bind(this));
|
||||
this._manual_time_source_changed_connect = this._extensionsSettings.connect('changed::manual-time-source', this._on_manual_time_source_changed.bind(this));
|
||||
this._commands_status_connect = this._extensionsSettings.connect('changed::commands-enabled', this._on_commands_status_changed.bind(this));
|
||||
@@ -66,6 +70,7 @@ var SettingsManager = class {
|
||||
this._nightlight_status_connect = this._colorSettings.connect('changed::night-light-enabled', this._on_nightlight_status_changed.bind(this));
|
||||
this._location_status_connect = this._locationSettings.connect('changed::enabled', this._on_location_status_changed.bind(this));
|
||||
this._gtk_theme_changed_connect = this._interfaceSettings.connect('changed::gtk-theme', this._on_gtk_theme_changed.bind(this));
|
||||
this._cursor_theme_changed_connect = this._interfaceSettings.connect('changed::cursor-theme', this._on_cursor_theme_changed.bind(this));
|
||||
this._background_changed_connect = this._backgroundSettings.connect('changed::picture-uri', this._on_background_changed.bind(this));
|
||||
if ( this._userthemesSettings ) {
|
||||
this._shell_theme_changed_connect = this._userthemesSettings.connect('changed::name', this._on_shell_theme_changed.bind(this));
|
||||
@@ -81,6 +86,10 @@ var SettingsManager = class {
|
||||
this._extensionsSettings.disconnect(this._shell_variant_day_changed_connect);
|
||||
this._extensionsSettings.disconnect(this._shell_variant_night_changed_connect);
|
||||
this._extensionsSettings.disconnect(this._shell_variant_original_changed_connect);
|
||||
this._extensionsSettings.disconnect(this._cursor_variants_status_connect);
|
||||
this._extensionsSettings.disconnect(this._cursor_variant_day_changed_connect);
|
||||
this._extensionsSettings.disconnect(this._cursor_variant_night_changed_connect);
|
||||
this._extensionsSettings.disconnect(this._cursor_variant_original_changed_connect);
|
||||
this._extensionsSettings.disconnect(this._time_source_changed_connect);
|
||||
this._extensionsSettings.disconnect(this._manual_time_source_changed_connect);
|
||||
this._extensionsSettings.disconnect(this._commands_status_connect);
|
||||
@@ -180,6 +189,45 @@ var SettingsManager = class {
|
||||
return this._extensionsSettings.get_boolean('manual-shell-variants');
|
||||
}
|
||||
|
||||
/* Cursor variants settings */
|
||||
|
||||
get cursor_variants_enabled() {
|
||||
return this._extensionsSettings.get_boolean('cursor-variants-enabled');
|
||||
}
|
||||
|
||||
get cursor_variant_day() {
|
||||
return this._extensionsSettings.get_string('cursor-variant-day') || this.cursor_theme;
|
||||
}
|
||||
|
||||
set cursor_variant_day(value) {
|
||||
if ( value !== this.cursor_variant_day ) {
|
||||
this._extensionsSettings.set_string('cursor-variant-day', value);
|
||||
log_debug(`The cursor day variant has been set to '${value}'.`);
|
||||
}
|
||||
}
|
||||
|
||||
get cursor_variant_night() {
|
||||
return this._extensionsSettings.get_string('cursor-variant-night') || this.cursor_theme;
|
||||
}
|
||||
|
||||
set cursor_variant_night(value) {
|
||||
if ( value !== this.cursor_variant_night ) {
|
||||
this._extensionsSettings.set_string('cursor-variant-night', value);
|
||||
log_debug(`The cursor night variant has been set to '${value}'.`);
|
||||
}
|
||||
}
|
||||
|
||||
get cursor_variant_original() {
|
||||
return this._extensionsSettings.get_string('cursor-variant-original');
|
||||
}
|
||||
|
||||
set cursor_variant_original(value) {
|
||||
if ( value !== this.cursor_variant_original ) {
|
||||
this._extensionsSettings.set_string('cursor-variant-original', value);
|
||||
log_debug(`The cursor original variant has been set to '${value}'.`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Time source settings */
|
||||
|
||||
@@ -292,6 +340,20 @@ var SettingsManager = class {
|
||||
}
|
||||
|
||||
|
||||
/* Cursor theme settings */
|
||||
|
||||
get cursor_theme() {
|
||||
return this._interfaceSettings.get_string('cursor-theme');
|
||||
}
|
||||
|
||||
set cursor_theme(value) {
|
||||
if ( value !== this.cursor_theme ) {
|
||||
this._interfaceSettings.set_string('cursor-theme', value);
|
||||
log_debug(`Cursor theme has been set to '${value}.'`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Background settings */
|
||||
|
||||
get background() {
|
||||
@@ -345,6 +407,29 @@ var SettingsManager = class {
|
||||
}
|
||||
|
||||
|
||||
/* Cursor variants */
|
||||
|
||||
_on_cursor_variants_status_changed(settings, changed_key) {
|
||||
log_debug('Cursor variants have been ' + (this.cursor_variants_enabled ? 'ena' : 'disa') + 'bled.');
|
||||
this.emit('cursor-variants-status-changed', this.curso_variants_enabled);
|
||||
}
|
||||
|
||||
_on_cursor_variant_day_changed(settings, changed_key) {
|
||||
log_debug(`Cursor day variant has changed to '${this.cursor_variant_day}'.`);
|
||||
this.emit('cursor-variant-changed', 'day');
|
||||
}
|
||||
|
||||
_on_cursor_variant_night_changed(settings, changed_key) {
|
||||
log_debug(`Cursor night variant has changed to '${this.cursor_variant_night}'.`);
|
||||
this.emit('cursor-variant-changed', 'night');
|
||||
}
|
||||
|
||||
_on_cursor_variant_original_changed(settings, changed_key) {
|
||||
log_debug(`Cursor original variant has changed to '${this.cursor_variant_original}'.`);
|
||||
this.emit('cursor-variant-changed', 'original');
|
||||
}
|
||||
|
||||
|
||||
/* Time source */
|
||||
|
||||
_on_time_source_changed(settings, changed_key) {
|
||||
@@ -408,6 +493,14 @@ var SettingsManager = class {
|
||||
}
|
||||
|
||||
|
||||
/* Cursor theme */
|
||||
|
||||
_on_cursor_theme_changed(settings, changed_key) {
|
||||
log_debug(`Cursor theme has changed to '${this.cursor_theme}'.`);
|
||||
this.emit('cursor-theme-changed', this.cursor_theme);
|
||||
}
|
||||
|
||||
|
||||
/* Background */
|
||||
|
||||
_on_background_changed(settings, changed_key) {
|
||||
|
||||
@@ -23,7 +23,7 @@ const { main } = imports.ui;
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const e = Me.imports.extension;
|
||||
const { log_debug, log_error, get_theme_dirs_paths, get_installed_shell_themes, get_shell_theme_stylesheet, apply_shell_stylesheet } = Me.imports.utils;
|
||||
const { log_debug, log_error, get_installed_shell_themes, get_shell_theme_stylesheet, apply_shell_stylesheet } = Me.imports.utils;
|
||||
const { ShellVariants } = Me.imports.modules.ShellVariants;
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata.uuid);
|
||||
|
||||
+73
-29
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Night Theme Switcher 7\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-05-25 10:09+0200\n"
|
||||
"PO-Revision-Date: 2020-05-29 11:24+0200\n"
|
||||
"POT-Creation-Date: 2020-05-29 11:18+0200\n"
|
||||
"PO-Revision-Date: 2020-05-29 11:21+0200\n"
|
||||
"Last-Translator: Romain Vigier <romain@romainvigier.fr>\n"
|
||||
"Language-Team: French - France <romain@romainvigier.fr>\n"
|
||||
"Language: fr_FR\n"
|
||||
@@ -52,12 +52,12 @@ msgid "Switch backgrounds"
|
||||
msgstr "Changer les arrière-plans"
|
||||
|
||||
#: src/preferences/Backgrounds.js:44
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:91
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:111
|
||||
msgid "Day background"
|
||||
msgstr "Arrière-plan diurne"
|
||||
|
||||
#: src/preferences/Backgrounds.js:45
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:96
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:116
|
||||
msgid "Night background"
|
||||
msgstr "Arrière-plan nocturne"
|
||||
|
||||
@@ -97,6 +97,30 @@ msgstr "Bonjour!"
|
||||
msgid "Hello moonshine!"
|
||||
msgstr "Bonsoir!"
|
||||
|
||||
#: src/preferences/CursorTheme.js:40
|
||||
msgid "Cursor theme"
|
||||
msgstr "Thème de curseur"
|
||||
|
||||
#: src/preferences/CursorTheme.js:41
|
||||
msgid "You can set different cursor themes for day and night."
|
||||
msgstr ""
|
||||
"Vous pouvez définir des thèmes de curseurs diurnes et nocturnes différents."
|
||||
|
||||
#: src/preferences/CursorTheme.js:44
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:46
|
||||
msgid "Switch cursor variants"
|
||||
msgstr "Changer les variantes de curseur"
|
||||
|
||||
#: src/preferences/CursorTheme.js:45 src/preferences/GtkTheme.js:45
|
||||
#: src/preferences/ShellTheme.js:45
|
||||
msgid "Day variant"
|
||||
msgstr "Variante diurne"
|
||||
|
||||
#: src/preferences/CursorTheme.js:46 src/preferences/GtkTheme.js:46
|
||||
#: src/preferences/ShellTheme.js:46
|
||||
msgid "Night variant"
|
||||
msgstr "Variante nocturne"
|
||||
|
||||
#: src/preferences/GtkTheme.js:40
|
||||
msgid "GTK theme"
|
||||
msgstr "Thème GTK"
|
||||
@@ -122,14 +146,6 @@ msgstr ""
|
||||
msgid "Manual variants"
|
||||
msgstr "Variantes manuelles"
|
||||
|
||||
#: src/preferences/GtkTheme.js:45 src/preferences/ShellTheme.js:45
|
||||
msgid "Day variant"
|
||||
msgstr "Variante diurne"
|
||||
|
||||
#: src/preferences/GtkTheme.js:46 src/preferences/ShellTheme.js:46
|
||||
msgid "Night variant"
|
||||
msgstr "Variante nocturne"
|
||||
|
||||
#: src/preferences/Schedule.js:39
|
||||
msgid "Schedule"
|
||||
msgstr "Horaires"
|
||||
@@ -154,7 +170,7 @@ msgid "Manual time source"
|
||||
msgstr "Source d’horaires manuelle"
|
||||
|
||||
#: src/preferences/Schedule.js:44
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:51
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:71
|
||||
msgid "Time source"
|
||||
msgstr "Source d’horaires"
|
||||
|
||||
@@ -259,71 +275,99 @@ msgstr "Utiliser des variantes shell manuelles"
|
||||
msgid "Disable automatic shell theme variants detection"
|
||||
msgstr "Désactiver la détection automatique des variantes du thème shell"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:47
|
||||
msgid "Enable cursor variants switching"
|
||||
msgstr "Activer le changement de variantes de curseur"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:51
|
||||
msgid "Day cursor theme"
|
||||
msgstr "Thème de curseur diurne"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:52
|
||||
msgid "The cursor theme to use during daytime"
|
||||
msgstr "Le thème de curseur à utiliser le jour"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:56
|
||||
msgid "Night cursor theme"
|
||||
msgstr "Thème de curseur nocturne"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:57
|
||||
msgid "The cursor theme to use during nighttime"
|
||||
msgstr "Le thème shell à utiliser la nuit"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:61
|
||||
msgid "Original cursor theme"
|
||||
msgstr "Thème de curseur original"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:62
|
||||
msgid "The cursor theme to restore when the extension is disabled"
|
||||
msgstr "Le thème de curseur à restaurer quand l’extension est désactivée"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:72
|
||||
msgid "The source used to check current time"
|
||||
msgstr "Source utilisée pour vérifier les horaires"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:56
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:76
|
||||
msgid "Use manual time source"
|
||||
msgstr "Utiliser une source d’horaires manuelle"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:57
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:77
|
||||
msgid "Disable automatic time source detection"
|
||||
msgstr "Désactive la détection automatique de la source d’horaires"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:61
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:81
|
||||
msgid "Sunrise time"
|
||||
msgstr "Heure du lever"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:62
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:82
|
||||
msgid "When the day starts"
|
||||
msgstr "Quand le jour se lève"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:66
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:86
|
||||
msgid "Sunset time"
|
||||
msgstr "Heure du coucher"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:67
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:87
|
||||
msgid "When the day ends"
|
||||
msgstr "Quand le jour se couche"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:71
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:91
|
||||
msgid "Enable commands"
|
||||
msgstr "Activer les commandes"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:72
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:92
|
||||
msgid "Commands will be spawned on time change"
|
||||
msgstr "Les commandes seront lancées au changement d’horaire"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:76
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:96
|
||||
msgid "Sunrise command"
|
||||
msgstr "Commande du lever de soleil"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:77
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:97
|
||||
msgid "The command to spawn at sunrise"
|
||||
msgstr "La commande à lancer quand le soleil se lève"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:81
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:101
|
||||
msgid "Sunset command"
|
||||
msgstr "Commande du coucher de soleil"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:82
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:102
|
||||
msgid "The command to spawn at sunset"
|
||||
msgstr "La commande à lancer quand le soleil se couche"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:86
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:106
|
||||
msgid "Enable backgrounds"
|
||||
msgstr "Activer les arrière-plans"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:87
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:107
|
||||
msgid "Background will be changed on time change"
|
||||
msgstr "L’arrière-plan changera au changement d’horaire"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:92
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:112
|
||||
msgid "Path to the day background"
|
||||
msgstr "Chemin vers l’arrière-plan diurne"
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:97
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:117
|
||||
msgid "Path to the night background"
|
||||
msgstr "Chemin vers l’arrière-plan nocturne"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Night Theme Switcher 30\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-05-25 10:09+0200\n"
|
||||
"POT-Creation-Date: 2020-05-29 11:18+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -45,12 +45,12 @@ msgid "Switch backgrounds"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/Backgrounds.js:44
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:91
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:111
|
||||
msgid "Day background"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/Backgrounds.js:45
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:96
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:116
|
||||
msgid "Night background"
|
||||
msgstr ""
|
||||
|
||||
@@ -88,6 +88,29 @@ msgstr ""
|
||||
msgid "Hello moonshine!"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/CursorTheme.js:40
|
||||
msgid "Cursor theme"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/CursorTheme.js:41
|
||||
msgid "You can set different cursor themes for day and night."
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/CursorTheme.js:44
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:46
|
||||
msgid "Switch cursor variants"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/CursorTheme.js:45 src/preferences/GtkTheme.js:45
|
||||
#: src/preferences/ShellTheme.js:45
|
||||
msgid "Day variant"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/CursorTheme.js:46 src/preferences/GtkTheme.js:46
|
||||
#: src/preferences/ShellTheme.js:46
|
||||
msgid "Night variant"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/GtkTheme.js:40
|
||||
msgid "GTK theme"
|
||||
msgstr ""
|
||||
@@ -106,14 +129,6 @@ msgstr ""
|
||||
msgid "Manual variants"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/GtkTheme.js:45 src/preferences/ShellTheme.js:45
|
||||
msgid "Day variant"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/GtkTheme.js:46 src/preferences/ShellTheme.js:46
|
||||
msgid "Night variant"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/Schedule.js:39
|
||||
msgid "Schedule"
|
||||
msgstr ""
|
||||
@@ -132,7 +147,7 @@ msgid "Manual time source"
|
||||
msgstr ""
|
||||
|
||||
#: src/preferences/Schedule.js:44
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:51
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:71
|
||||
msgid "Time source"
|
||||
msgstr ""
|
||||
|
||||
@@ -230,70 +245,98 @@ msgstr ""
|
||||
msgid "Disable automatic shell theme variants detection"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:47
|
||||
msgid "Enable cursor variants switching"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:51
|
||||
msgid "Day cursor theme"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:52
|
||||
msgid "The source used to check current time"
|
||||
msgid "The cursor theme to use during daytime"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:56
|
||||
msgid "Use manual time source"
|
||||
msgid "Night cursor theme"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:57
|
||||
msgid "Disable automatic time source detection"
|
||||
msgid "The cursor theme to use during nighttime"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:61
|
||||
msgid "Sunrise time"
|
||||
msgid "Original cursor theme"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:62
|
||||
msgid "When the day starts"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:66
|
||||
msgid "Sunset time"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:67
|
||||
msgid "When the day ends"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:71
|
||||
msgid "Enable commands"
|
||||
msgid "The cursor theme to restore when the extension is disabled"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:72
|
||||
msgid "Commands will be spawned on time change"
|
||||
msgid "The source used to check current time"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:76
|
||||
msgid "Sunrise command"
|
||||
msgid "Use manual time source"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:77
|
||||
msgid "The command to spawn at sunrise"
|
||||
msgid "Disable automatic time source detection"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:81
|
||||
msgid "Sunset command"
|
||||
msgid "Sunrise time"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:82
|
||||
msgid "The command to spawn at sunset"
|
||||
msgid "When the day starts"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:86
|
||||
msgid "Enable backgrounds"
|
||||
msgid "Sunset time"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:87
|
||||
msgid "Background will be changed on time change"
|
||||
msgid "When the day ends"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:91
|
||||
msgid "Enable commands"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:92
|
||||
msgid "Path to the day background"
|
||||
msgid "Commands will be spawned on time change"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:96
|
||||
msgid "Sunrise command"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:97
|
||||
msgid "The command to spawn at sunrise"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:101
|
||||
msgid "Sunset command"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:102
|
||||
msgid "The command to spawn at sunset"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:106
|
||||
msgid "Enable backgrounds"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:107
|
||||
msgid "Background will be changed on time change"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:112
|
||||
msgid "Path to the day background"
|
||||
msgstr ""
|
||||
|
||||
#: src/schemas/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml:117
|
||||
msgid "Path to the night background"
|
||||
msgstr ""
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
Night Theme Switcher Gnome Shell extension
|
||||
|
||||
Copyright (C) 2020 Romain Vigier
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation, either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http s ://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
const { GdkPixbuf, Gio, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const { SettingsPage, SettingsList, SettingsListRow } = Me.imports.preferences.bases;
|
||||
const { get_installed_cursor_themes } = Me.imports.utils;
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata.uuid);
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
|
||||
const shell_minor_version = parseInt(imports.misc.config.PACKAGE_VERSION.split('.')[1]);
|
||||
if ( shell_minor_version <= 30 ) {
|
||||
extensionUtils.getSettings = Me.imports.convenience.getSettings;
|
||||
}
|
||||
|
||||
|
||||
var CursorThemePreferences = class {
|
||||
|
||||
constructor() {
|
||||
const label = _('Cursor theme');
|
||||
const description = _('You can set different cursor themes for day and night.');
|
||||
const content = new SettingsList();
|
||||
|
||||
content.add_row(new SettingsListRow(_('Switch cursor variants'), new CursorVariantsEnabledControl()));
|
||||
content.add_row(new SettingsListRow(_('Day variant'), new TimeCursorVariantControl('day')));
|
||||
content.add_row(new SettingsListRow(_('Night variant'), new TimeCursorVariantControl('night')));
|
||||
|
||||
return new SettingsPage(label, description, content);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class CursorVariantsEnabledControl {
|
||||
|
||||
constructor() {
|
||||
const settings = extensionUtils.getSettings();
|
||||
const toggle = new Gtk.Switch({
|
||||
active: settings.get_boolean('cursor-variants-enabled')
|
||||
});
|
||||
settings.bind(
|
||||
'cursor-variants-enabled',
|
||||
toggle,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
return toggle;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class TimeCursorVariantControl {
|
||||
|
||||
constructor(time) {
|
||||
const settings = extensionUtils.getSettings();
|
||||
const combo = new Gtk.ComboBoxText();
|
||||
const themes = Array.from(get_installed_cursor_themes()).sort();
|
||||
themes.forEach(theme => combo.append(theme, theme));
|
||||
settings.bind(
|
||||
`cursor-variant-${time}`,
|
||||
combo,
|
||||
'active-id',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
settings.bind(
|
||||
'cursor-variants-enabled',
|
||||
combo,
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
return combo;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,6 +25,7 @@ const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const { BackgroundsPreferences } = Me.imports.preferences.Backgrounds;
|
||||
const { CommandsPreferences } = Me.imports.preferences.Commands;
|
||||
const { CursorThemePreferences } = Me.imports.preferences.CursorTheme;
|
||||
const { GtkThemePreferences } = Me.imports.preferences.GtkTheme;
|
||||
const { SchedulePreferences } = Me.imports.preferences.Schedule;
|
||||
const { ShellThemePreferences } = Me.imports.preferences.ShellTheme;
|
||||
@@ -54,6 +55,9 @@ function buildPrefsWidget() {
|
||||
const shellThemePreferences = new ShellThemePreferences();
|
||||
prefs_widget.append_page(shellThemePreferences.page, shellThemePreferences.label);
|
||||
|
||||
const cursorThemePreferences = new CursorThemePreferences();
|
||||
prefs_widget.append_page(cursorThemePreferences.page, cursorThemePreferences.label);
|
||||
|
||||
const backgroundsPreferences = new BackgroundsPreferences();
|
||||
prefs_widget.append_page(backgroundsPreferences.page, backgroundsPreferences.label);
|
||||
|
||||
|
||||
@@ -41,6 +41,26 @@
|
||||
<summary>Use manual shell variants</summary>
|
||||
<description>Disable automatic shell theme variants detection</description>
|
||||
</key>
|
||||
<key name="cursor-variants-enabled" type="b">
|
||||
<default>false</default>
|
||||
<summary>Switch cursor variants</summary>
|
||||
<description>Enable cursor variants switching</description>
|
||||
</key>
|
||||
<key name="cursor-variant-day" type="s">
|
||||
<default>""</default>
|
||||
<summary>Day cursor theme</summary>
|
||||
<description>The cursor theme to use during daytime</description>
|
||||
</key>
|
||||
<key name="cursor-variant-night" type="s">
|
||||
<default>""</default>
|
||||
<summary>Night cursor theme</summary>
|
||||
<description>The cursor theme to use during nighttime</description>
|
||||
</key>
|
||||
<key name="cursor-variant-original" type="s">
|
||||
<default>""</default>
|
||||
<summary>Original cursor theme</summary>
|
||||
<description>The cursor theme to restore when the extension is disabled</description>
|
||||
</key>
|
||||
<key name="time-source" type="s">
|
||||
<choices>
|
||||
<choice value="nightlight"/>
|
||||
|
||||
+44
-8
@@ -53,14 +53,15 @@ function log_error(error) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the theme directories of the system.
|
||||
* Get all the directories of the system for a resource.
|
||||
* @param {string} resource The resource to get the directories.
|
||||
* @returns {string[]} An array of paths.
|
||||
*/
|
||||
function get_theme_dirs_paths() {
|
||||
function get_resources_dirs_paths(resource) {
|
||||
return [
|
||||
GLib.build_filenamev([GLib.get_home_dir(), '.themes']),
|
||||
GLib.build_filenamev([GLib.get_user_data_dir(), 'themes']),
|
||||
...GLib.get_system_data_dirs().map(path => GLib.build_filenamev([path, 'themes']))
|
||||
GLib.build_filenamev([GLib.get_home_dir(), `.${resource}`]),
|
||||
GLib.build_filenamev([GLib.get_user_data_dir(), resource]),
|
||||
...GLib.get_system_data_dirs().map(path => GLib.build_filenamev([path, resource]))
|
||||
];
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ function get_theme_dirs_paths() {
|
||||
function get_installed_gtk_themes() {
|
||||
const themes = new Set(['Adwaita', 'HighContrast', 'HighContrastInverse']);
|
||||
|
||||
get_theme_dirs_paths().forEach(themes_dir_path => {
|
||||
get_resources_dirs_paths('themes').forEach(themes_dir_path => {
|
||||
const themes_dir = Gio.File.new_for_path(themes_dir_path);
|
||||
|
||||
if (themes_dir.query_file_type(Gio.FileQueryInfoFlags.NONE, null) !== Gio.FileType.DIRECTORY) {
|
||||
@@ -112,7 +113,7 @@ function get_installed_gtk_themes() {
|
||||
function get_installed_shell_themes() {
|
||||
const themes = new Set(['']);
|
||||
|
||||
get_theme_dirs_paths().forEach(themes_dir_path => {
|
||||
get_resources_dirs_paths('themes').forEach(themes_dir_path => {
|
||||
const themes_dir = Gio.File.new_for_path(themes_dir_path);
|
||||
|
||||
if (themes_dir.query_file_type(Gio.FileQueryInfoFlags.NONE, null) !== Gio.FileType.DIRECTORY) {
|
||||
@@ -140,6 +141,41 @@ function get_installed_shell_themes() {
|
||||
return themes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the installed cursor themes on the system.
|
||||
* @returns {Set} A set containing all the installed cursor themes names.
|
||||
*/
|
||||
function get_installed_cursor_themes() {
|
||||
const themes = new Set();
|
||||
|
||||
get_resources_dirs_paths('icons').forEach(themes_dir_path => {
|
||||
const themes_dir = Gio.File.new_for_path(themes_dir_path);
|
||||
|
||||
if (themes_dir.query_file_type(Gio.FileQueryInfoFlags.NONE, null) !== Gio.FileType.DIRECTORY) {
|
||||
return;
|
||||
}
|
||||
|
||||
const theme_dirs_enumerator = themes_dir.enumerate_children('', Gio.FileQueryInfoFlags.NONE, null);
|
||||
|
||||
while (true) {
|
||||
let theme_dir_info = theme_dirs_enumerator.next_file(null);
|
||||
|
||||
if (theme_dir_info === null) {
|
||||
break;
|
||||
}
|
||||
|
||||
const theme_dir = theme_dirs_enumerator.get_child(theme_dir_info);
|
||||
const css_file = Gio.File.new_for_path(GLib.build_filenamev([theme_dir.get_path(), 'cursors']));
|
||||
if (css_file.query_exists(null)) {
|
||||
themes.add(theme_dir.get_basename());
|
||||
}
|
||||
}
|
||||
theme_dirs_enumerator.close(null);
|
||||
});
|
||||
|
||||
return themes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the User Themes extension.
|
||||
* @returns {Object|undefined} The User Themes extension object or undefined if
|
||||
@@ -188,7 +224,7 @@ function get_shell_theme_stylesheet(theme) {
|
||||
log_debug('Getting the ' + (theme ? `'${theme}'` : 'default') + ' theme shell stylesheet...');
|
||||
let stylesheet = null;
|
||||
if ( theme ) {
|
||||
const stylesheet_paths = get_theme_dirs_paths().map(path => `${path}/${theme}/gnome-shell/gnome-shell.css`);
|
||||
const stylesheet_paths = get_resources_dirs_paths('themes').map(path => `${path}/${theme}/gnome-shell/gnome-shell.css`);
|
||||
stylesheet = stylesheet_paths.find(path => {
|
||||
let file = Gio.file_new_for_path(path);
|
||||
return file.query_exists(null);
|
||||
|
||||
Reference in New Issue
Block a user