diff --git a/README.md b/README.md index 970ef05..c2ab935 100644 --- a/README.md +++ b/README.md @@ -66,16 +66,6 @@ Unfortunately, Ubuntu ships heavily modified GNOME components to implement some As the issue is in Ubuntu, and because I don't have the energy nor the will to work around the consequences of their decisions, unfortunately Ubuntu is not supported until it provides a standard GNOME environment. -### Switching happens too early/too late - -There's a hidden setting to configure the offset (in hours) applied to the calculated sunrise and sunset times, you can change it with the `gsettings` command: - -``` -gsettings --schemadir ~/.local/share/gnome-shell/extensions/nightthemeswitcher@romainvigier.fr/schemas/ set org.gnome.shell.extensions.nightthemeswitcher.time offset $DESIRED_OFFSET -``` - -The default offset is `0.4`, set it to `0` do disable it. - ### I have disabled Location services but want to use sunrise and sunset times from my location If you know your coordinates, you can enter them in a hidden setting, and the extension will use them to calculate the sunrise and sunset times. You can set it with the `gsettings` command: diff --git a/src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml b/src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml index f73dc83..9d47a2a 100644 --- a/src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml +++ b/src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml @@ -47,7 +47,7 @@ SPDX-License-Identifier: GPL-3.0-or-later (91,181) - + 0.4 diff --git a/src/data/ui/SchedulePage.ui b/src/data/ui/SchedulePage.ui index 9fe3da4..31976d3 100644 --- a/src/data/ui/SchedulePage.ui +++ b/src/data/ui/SchedulePage.ui @@ -44,6 +44,39 @@ SPDX-License-Identifier: GPL-3.0-or-later + + + + + Automatic schedule offset + A positive value makes the night longer, a negative value makes the day longer. + + + 8 + + + 2 + center + + + -6 + 6 + 0.01 + + + + + + + hours + + + + + + + + diff --git a/src/po/nightthemeswitcher@romainvigier.fr.pot b/src/po/nightthemeswitcher@romainvigier.fr.pot index b2e24f3..82b940d 100644 --- a/src/po/nightthemeswitcher@romainvigier.fr.pot +++ b/src/po/nightthemeswitcher@romainvigier.fr.pot @@ -8,7 +8,11 @@ msgid "" msgstr "" "Project-Id-Version: nightthemeswitcher@romainvigier.fr\n" "Report-Msgid-Bugs-To: \n" +<<<<<<< HEAD "POT-Creation-Date: 2024-03-24 11:18+0100\n" +======= +"POT-Creation-Date: 2025-08-17 17:45+0200\n" +>>>>>>> 8f766cc (FIX) "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -84,10 +88,24 @@ msgid "Use a manual schedule instead of the one computed from your location." msgstr "" #: src/data/ui/SchedulePage.ui:51 +msgid "Automatic schedule offset" +msgstr "" + +#: src/data/ui/SchedulePage.ui:52 +msgid "" +"A positive value makes the night longer, a negative value makes the day " +"longer." +msgstr "" + +#: src/data/ui/SchedulePage.ui:71 +msgid "hours" +msgstr "" + +#: src/data/ui/SchedulePage.ui:84 msgid "Run the transition when an app is fullscreen" msgstr "" -#: src/data/ui/SchedulePage.ui:60 +#: src/data/ui/SchedulePage.ui:93 msgid "Keyboard shortcut" msgstr "" diff --git a/src/preferences/SchedulePage.js b/src/preferences/SchedulePage.js index 8b3cd7c..16cb29b 100644 --- a/src/preferences/SchedulePage.js +++ b/src/preferences/SchedulePage.js @@ -16,6 +16,7 @@ export class SchedulePage extends Adw.PreferencesPage { 'keyboard_shortcut_button', 'schedule_sunrise_time_chooser', 'schedule_sunset_time_chooser', + 'schedule_offset_spin_button', 'fullscreen_transition_switch', ], }, this); @@ -29,6 +30,8 @@ export class SchedulePage extends Adw.PreferencesPage { settings.bind('sunrise', this._schedule_sunrise_time_chooser, 'time', Gio.SettingsBindFlags.DEFAULT); settings.bind('sunset', this._schedule_sunset_time_chooser, 'time', Gio.SettingsBindFlags.DEFAULT); + settings.bind('offset', this._schedule_offset_spin_button, 'value', Gio.SettingsBindFlags.DEFAULT); + settings.bind('fullscreen-transition', this._fullscreen_transition_switch, 'active', Gio.SettingsBindFlags.DEFAULT); settings.connect('changed::nightthemeswitcher-ondemand-keybinding', () => {