-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from CleoMenezesJr/gnome-47
release: v47.0
- Loading branch information
Showing
7 changed files
with
151 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ INSTALLNAME = [email protected] | |
default: build | ||
|
||
.PHONY: build | ||
build: | ||
glib-compile-schemas ./[email protected]/schemas | ||
|
||
.PHONY: install | ||
install: build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,16 @@ | |
"uuid": "[email protected]", | ||
"name": "Weather O'Clock", | ||
"description": "Display the current weather inside the pill next to the clock. GNOME Weather is required for this extension to work.", | ||
"shell-version": ["46"], | ||
"shell-version": [ | ||
"47" | ||
], | ||
"url": "https://github.com/CleoMenezesJr/weather-oclock", | ||
"original-author": "[email protected]", | ||
"donations": { | ||
"github": "CleoMenezesJr", | ||
"kofi": "cleomenezesjr", | ||
"paypal": "CleoMenezesJr" | ||
}, | ||
"version-name": "46.2" | ||
"settings-schema": "org.gnome.shell.extensions.weather-oclock", | ||
"version-name": "47.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/**************************************************************************** | ||
** Weather O'Clock extension for GNOME Shell 45+ | ||
** Copyright (C) 2024 Cleo Menezes Jr. | ||
** | ||
** 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 <https://www.gnu.org/licenses/>. | ||
****************************************************************************/ | ||
"use strict"; | ||
|
||
import Gtk from "gi://Gtk"; | ||
import Gio from "gi://Gio"; | ||
import { ExtensionPreferences } from "resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js"; | ||
|
||
export default class WeatherOClockPreferences extends ExtensionPreferences { | ||
fillPreferencesWindow(window) { | ||
window._settings = this.getSettings(); | ||
window.set_default_size(360, 200); | ||
|
||
const builder = new Gtk.Builder(); | ||
builder.add_from_file(`${this.path}/prefs.ui`); | ||
|
||
const weatherAfterClock = builder.get_object("WeatherAfterClock"); | ||
weatherAfterClock.set_active(window._settings.get_boolean("weather-after-clock")); | ||
|
||
window._settings.bind( | ||
"weather-after-clock", | ||
weatherAfterClock, | ||
"active", | ||
Gio.SettingsBindFlags.DEFAULT, | ||
); | ||
|
||
const page = builder.get_object("MainWidget"); | ||
window.add(page); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<interface domain="auto-activities"> | ||
<object class="AdwPreferencesPage" id="MainWidget"> | ||
<property name="title" translatable="yes">Preferences</property> | ||
<child> | ||
<object class="AdwPreferencesGroup"> | ||
<property name="title" translatable="yes">General</property> | ||
<child> | ||
<object class="AdwActionRow"> | ||
<property name="title" translatable="yes">Weather After Clock</property> | ||
<property name="subtitle" translatable="yes">Widget to the right of the clock</property> | ||
<property name="activatable-widget">WeatherAfterClock</property> | ||
<child> | ||
<object class="GtkSwitch" id="WeatherAfterClock"> | ||
<property name="valign">center</property> | ||
<property name="active">False</property> | ||
</object> | ||
</child> | ||
</object> | ||
</child> | ||
</object> | ||
</child> | ||
</object> | ||
</interface> |
9 changes: 9 additions & 0 deletions
9
[email protected]/schemas/org.gnome.shell.weather-oclock.gschema.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<schemalist> | ||
<schema id="org.gnome.shell.extensions.weather-oclock" | ||
path="/org/gnome/shell/extensions/weather-oclock/"> | ||
<key name="weather-after-clock" type="b"> | ||
<default>false</default> | ||
</key> | ||
</schema> | ||
</schemalist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters