| 1 |
// SPDX-FileCopyrightText: 2023 Florian Müllner <[email protected]> |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: GPL-2.0-or-later |
| 4 |
|
| 5 |
import St from 'gi://St'; |
| 6 |
|
| 7 |
import * as Main from 'resource:///org/gnome/shell/ui/main.js'; |
| 8 |
|
| 9 |
export default class Extension { |
| 10 |
_updateColorScheme(scheme) { |
| 11 |
Main.sessionMode.colorScheme = scheme; |
| 12 |
St.Settings.get().notify('color-scheme'); |
| 13 |
} |
| 14 |
|
| 15 |
enable() { |
| 16 |
this._savedColorScheme = Main.sessionMode.colorScheme; |
| 17 |
this._updateColorScheme('prefer-light'); |
| 18 |
} |
| 19 |
|
| 20 |
disable() { |
| 21 |
this._updateColorScheme(this._savedColorScheme); |
| 22 |
} |
| 23 |
} |