diff options
| author | nippy <you@example.com> | 2026-04-18 13:49:56 +0200 |
|---|---|---|
| committer | nippy <you@example.com> | 2026-04-18 13:49:56 +0200 |
| commit | 5d94c0a7d44a2255b81815a52a7056a94a39842d (patch) | |
| tree | 759bdea9645c6a62f9e1e4c001f7d81cccd120d2 /raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com | |
| parent | e79cdf210b267f21a186255ce1a4d50029439d54 (diff) | |
| download | RaveOS-PKGBUILD-5d94c0a7d44a2255b81815a52a7056a94a39842d.tar.gz RaveOS-PKGBUILD-5d94c0a7d44a2255b81815a52a7056a94a39842d.zip | |
update Raveos themes
Diffstat (limited to 'raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com')
9 files changed, 569 insertions, 0 deletions
diff --git a/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/CHANGELOG.md b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/CHANGELOG.md new file mode 100644 index 0000000..7ec9db3 --- /dev/null +++ b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/CHANGELOG.md @@ -0,0 +1,29 @@ +## Version 14 + * add Gnome 49 support +## Version 13 + * add Gnome 48 support +## Version 12 + * add Gnome 47 support +## Version 11 + * Gnome 46 support +## Version 10 + * null 'this._settings' in disable +## Version 9 + * porting to Gnome 45 + * add 'do not timeout' option +## Version 8 + * add possibility to change urgency to normal +## Version 7 + * Gnome 44 support +## Version 6 + * Gnome 43 support +## Version 5 + * remove non-debug logging +## Version 4 + * Gnome 41 support +## Version 3 + * Gnome 40 support +## Version 2 + * address e.g.o comment +## Version 1 + * initial versions diff --git a/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/LICENSE b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/LICENSE new file mode 100644 index 0000000..dfb190e --- /dev/null +++ b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2023 Václav Chlumský + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.
\ No newline at end of file diff --git a/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/README.md b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/README.md new file mode 100644 index 0000000..777b168 --- /dev/null +++ b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/README.md @@ -0,0 +1,24 @@ +# notification-timeout + +## Gnome Shell extension +notification-timeout is a Gnome Shell extension that allows configuring the same timeout for all notifications. It also allows ignoring the idle state, which means all the notification can timeout even if the system is idle. + +## Supported Gnome Shell version +This extension supports Gnome Shell verison 45 and above. + +## Installation from e.g.o +https://extensions.gnome.org/extension/3795/notification-timeout/ + +## Manual installation + + 1. `git clone https://github.com/vchlum/notification-timeout.git` + 1. `cd notification-timeout` + 1. `make build` + 1. `make install` + 1. Log out & Log in + 1. `gnome-extensions enable notification-timeout@chlumskyvaclav.gmail.com` + +## Install dependencies + - These are only required to install from source + - `make` + - `gnome-shell` (`gnome-extensions` command) diff --git a/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/extension.js b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/extension.js new file mode 100644 index 0000000..d441143 --- /dev/null +++ b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/extension.js @@ -0,0 +1,133 @@ +'use strict'; + +/** + * extension notification-timeout + * JavaScript Gnome extension for setting same timeout for all notifications. + * + * @author Václav Chlumský + * @copyright Copyright 2023, Václav Chlumský. + */ + + /** + * @license + * The MIT License (MIT) + * + * Copyright (c) 2023 Václav Chlumský + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js'; +import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js'; + +let newTimeout = 1000; +let alwaysNormal = true; +let ignoreIdle = true; + +export default class NotificationTimeoutExtension extends Extension { + + readSettings() { + ignoreIdle = this._settings.get_boolean("ignore-idle"); + alwaysNormal = this._settings.get_boolean("always-normal"); + newTimeout = this._settings.get_int("timeout"); + + } + + _modifiedUpdateNotificationTimeout(timeout) { + if (timeout > 0) { + timeout = newTimeout; + } + + /* call the original _updateNotificationTimeout with new timeout */ + this._updateNotificationTimeoutOrig(timeout); + } + + _modifiedUpdateStatus() { + if (ignoreIdle) { + this._userActiveWhileNotificationShown = true; + } + + /* call the original _updateState anyway */ + this._updateStateOrig(); + } + + _modifiedSetUrgency(urgency) { + /* call the original setUrgency */ + if (newTimeout === 0) { + this._setUrgencyOrig(MessageTray.Urgency.CRITICAL); + } else if (alwaysNormal) { + this._setUrgencyOrig(MessageTray.Urgency.NORMAL); + } else { + this._setUrgencyOrig(urgency); + } + } + + enable() { + this._settings = this.getSettings(); + + this.readSettings(); + this._settingsConnectId = this._settings.connect( + "changed", + () => { + this.readSettings(); + } + ); + + /** + * Change _updateNotificationTimeout() + */ + MessageTray.MessageTray.prototype._updateNotificationTimeoutOrig = MessageTray.MessageTray.prototype._updateNotificationTimeout; + MessageTray.MessageTray.prototype._updateNotificationTimeout = this._modifiedUpdateNotificationTimeout; + + /** + * Change _updateState() + */ + MessageTray.MessageTray.prototype._updateStateOrig = MessageTray.MessageTray.prototype._updateState; + MessageTray.MessageTray.prototype._updateState = this._modifiedUpdateStatus; + + /** + * Change setUrgency() + */ + MessageTray.Notification.prototype._setUrgencyOrig = MessageTray.Notification.prototype.setUrgency; + MessageTray.Notification.prototype.setUrgency = this._modifiedSetUrgency; + } + + disable() { + this._settings.disconnect(this._settingsConnectId); + this._settings = null; + + /** + * Reveret change _updateNotificationTimeout() + */ + MessageTray.MessageTray.prototype._updateNotificationTimeout = MessageTray.MessageTray.prototype._updateNotificationTimeoutOrig; + delete MessageTray.MessageTray.prototype._updateNotificationTimeoutOrig; + + /** + * Reveret change _updateState() + */ + MessageTray.MessageTray.prototype._updateState = MessageTray.MessageTray.prototype._updateStateOrig; + delete MessageTray.MessageTray.prototype._updateStateOrig; + + /** + * Reveret change setUrgency() + */ + MessageTray.Notification.prototype.setUrgency = MessageTray.Notification.prototype._setUrgencyOrig; + delete MessageTray.Notification.prototype._setUrgencyOrig; + } +} diff --git a/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/metadata.json b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/metadata.json new file mode 100644 index 0000000..22d4875 --- /dev/null +++ b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/metadata.json @@ -0,0 +1,19 @@ +{ + "_generated": "Generated by SweetTooth, do not edit", + "description": "This extension allows configuring the same timeout for all notifications. It also allows ignoring the idle state.", + "gettext-domain": "notification-timeout", + "name": "Notification Timeout", + "original-author": "chlumskyvaclav@gmail.com", + "settings-schema": "org.gnome.shell.extensions.notification-timeout", + "shell-version": [ + "45", + "46", + "47", + "48", + "49", + "50" + ], + "url": "https://github.com/vchlum/notification-timeout", + "uuid": "notification-timeout@chlumskyvaclav.gmail.com", + "version": 14 +} diff --git a/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/prefs.js b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/prefs.js new file mode 100644 index 0000000..435bd4e --- /dev/null +++ b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/prefs.js @@ -0,0 +1,47 @@ +'use strict'; + +/** + * extension notification-timeout + * JavaScript Gnome extension for setting same timeout for all notifications. + * + * @author Václav Chlumský + * @copyright Copyright 2023, Václav Chlumský. + */ + + /** + * @license + * The MIT License (MIT) + * + * Copyright (c) 2023 Václav Chlumský + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + import {ExtensionPreferences} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; + import * as PrefsPage from './prefspage.js'; + + export default class HueLightsPreferences extends ExtensionPreferences { + fillPreferencesWindow(window) { + + window.set_default_size(860, 580); + + const prefspage = new PrefsPage.PreferencesPage(this.metadata, this.getSettings()); + window.add(prefspage.buildPrefsWidget()); + } +} diff --git a/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/prefspage.js b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/prefspage.js new file mode 100644 index 0000000..ed2859a --- /dev/null +++ b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/prefspage.js @@ -0,0 +1,275 @@ +'use strict'; + +/** + * extension notification-timeout + * JavaScript Gnome extension for setting same timeout for all notifications. + * + * @author Václav Chlumský + * @copyright Copyright 2023, Václav Chlumský. + */ + + /** + * @license + * The MIT License (MIT) + * + * Copyright (c) 2023 Václav Chlumský + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +import Gtk from 'gi://Gtk'; +import Adw from 'gi://Adw'; +import GObject from 'gi://GObject'; +import {ExtensionPreferences, gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; + +export const PreferencesPage = GObject.registerClass({ + GTypeName: 'NotificationTimeoutPrefsWidget' +}, class PreferencesPage extends GObject.Object { + _init(metadata, settings) { + super._init(); + + this._metadata = metadata; + this._settings = settings; + this._ignoreIdle = settings.get_boolean("ignore-idle"); + this._alwaysNormal = settings.get_boolean("always-normal"); + this._newTimeout = settings.get_int("timeout"); + } + + /** + * Build Settings page with general settings + * + * @method buildGeneralPage + * @return {Object} widget for page in notebook + */ + _buildGeneralPage() { + + let top = 1; + let labelWidget = null; + + let generalPage = new Gtk.Grid( + { + hexpand: true, + vexpand: true, + halign:Gtk.Align.CENTER, + valign:Gtk.Align.CENTER + } + ); + + /** + * Ignore idle + */ + labelWidget = new Gtk.Label( + {label: _("Ignore idle (always use timeout):")} + ); + generalPage.attach(labelWidget, 1, top, 1, 1); + + + let ignoreIdleSwitch = new Gtk.Switch( + { + active: this._ignoreIdle, + hexpand: false, + vexpand: false, + halign:Gtk.Align.CENTER, + valign:Gtk.Align.CENTER + } + ); + + ignoreIdleSwitch.connect( + "notify::active", + () => { + this._ignoreIdle = ignoreIdleSwitch.get_active(); + this._settings.set_boolean("ignore-idle", this._ignoreIdle); + } + ) + generalPage.attach_next_to( + ignoreIdleSwitch, + labelWidget, + Gtk.PositionType.RIGHT, + 1, + 1 + ); + + top++; + + /** + * Notification' urgency is always normal + */ + labelWidget = new Gtk.Label( + {label: _("Timeouted notifications are always 'normal' ('critical' don't timeout):")} + ); + generalPage.attach(labelWidget, 1, top, 1, 1); + + + let alwaysNormalSwitch = new Gtk.Switch( + { + active: this._alwaysNormal, + hexpand: false, + vexpand: false, + halign:Gtk.Align.CENTER, + valign:Gtk.Align.CENTER + } + ); + + alwaysNormalSwitch.connect( + "notify::active", + () => { + this._alwaysNormal = alwaysNormalSwitch.get_active(); + this._settings.set_boolean("always-normal", this._alwaysNormal); + } + ) + generalPage.attach_next_to( + alwaysNormalSwitch, + labelWidget, + Gtk.PositionType.RIGHT, + 1, + 1 + ); + + top++; + + /** + * Notification timeout + */ + labelWidget = new Gtk.Label( + {label: _("Notification timeout:")} + ); + generalPage.attach(labelWidget, 1, top, 1, 1); + + let timeoutComboBox = new Gtk.ComboBoxText(); + + timeoutComboBox.append("0", _("Don't timeout")); + timeoutComboBox.append("500", _("500 ms")); + timeoutComboBox.append("1000", _("1 s")); + timeoutComboBox.append("2000", _("2 s")); + timeoutComboBox.append("3000", _("3 s")); + timeoutComboBox.append("4000", _("4 s")); + timeoutComboBox.append("5000", _("5 s")); + timeoutComboBox.append("6000", _("6 s")); + timeoutComboBox.append("7000", _("7 s")); + timeoutComboBox.append("8000", _("8 s")); + timeoutComboBox.append("9000", _("9 s")); + timeoutComboBox.append("10000", _("10 s")); + timeoutComboBox.append("15000", _("15 s")); + timeoutComboBox.append("20000", _("20 s")); + timeoutComboBox.append("30000", _("30 s")); + timeoutComboBox.append("45000", _("45 s")); + timeoutComboBox.append("60000", _("1 min")); + timeoutComboBox.append("120000", _("2 min")); + timeoutComboBox.append("180000", _("3 min")); + timeoutComboBox.append("240000", _("4 min")); + timeoutComboBox.append("300000", _("5 min")); + timeoutComboBox.append("600000", _("10 min")); + timeoutComboBox.append("900000", _("15 min")); + timeoutComboBox.append("1800000", _("30 min")); + + timeoutComboBox.set_active_id(this._newTimeout.toString()); + + timeoutComboBox.connect( + "changed", + () => { + this._newTimeout = parseInt(timeoutComboBox.get_active_id()); + this._settings.set_int("timeout", this._newTimeout); + } + ); + + generalPage.attach_next_to( + timeoutComboBox, + labelWidget, + Gtk.PositionType.RIGHT, + 1, + 1 + ); + + top++; + + return generalPage; + } + + /** + * Build About page + * + * @method buildGeneralPage + * @return {Object} widget for page in notebook + */ + _buildAboutPage() { + + let aboutWidget = new Gtk.Box( + { + hexpand: true, + vexpand: true, + halign:Gtk.Align.CENTER, + valign:Gtk.Align.CENTER + } + ); + + let labelWidget = new Gtk.Label( + {label: `${this._metadata.name}, version: ${this._metadata.version}, Copyright (c) 2023 Václav Chlumský`} + ); + + aboutWidget.append(labelWidget); + + return aboutWidget; + } + + /** + * This function is called when the preferences window is first created to build + * and return a Gtk widget. + * + * @method buildPrefsWidget + * @return {Object} returns the prefsWidget + */ + buildPrefsWidget() { + + let prefsPage = new Adw.PreferencesPage(); + let prefsGroup = new Adw.PreferencesGroup(); + + let prefsMainBox = new Gtk.Box( + { + hexpand: true, + vexpand: true, + vexpand_set:true, + hexpand_set: true, + halign:Gtk.Align.FILL, + valign:Gtk.Align.FILL + } + ); + + let notebook = new Gtk.Notebook(); + + let pageGeneral = this._buildGeneralPage(); + pageGeneral.border_width = 10; + notebook.append_page( + pageGeneral, + new Gtk.Label({label: _("General settings")}) + ); + + let pageAbout = this._buildAboutPage() + pageAbout.border_width = 10; + notebook.append_page( + pageAbout, + Gtk.Image.new_from_icon_name("help-about", Gtk.IconSize.MENU) + ); + + prefsMainBox.append(notebook); + prefsGroup.add(prefsMainBox); + prefsPage.add(prefsGroup); + + return prefsPage; + } +}); diff --git a/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/schemas/gschemas.compiled b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/schemas/gschemas.compiled Binary files differnew file mode 100644 index 0000000..285234b --- /dev/null +++ b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/schemas/gschemas.compiled diff --git a/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/schemas/org.gnome.shell.extensions.notification-timeout.gschema.xml b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/schemas/org.gnome.shell.extensions.notification-timeout.gschema.xml new file mode 100644 index 0000000..1d23477 --- /dev/null +++ b/raveos-theme/gnome/theme-data/extensions/installed/notification-timeout@chlumskyvaclav.gmail.com/schemas/org.gnome.shell.extensions.notification-timeout.gschema.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<schemalist> + + <schema id="org.gnome.shell.extensions.notification-timeout" path="/org/gnome/shell/extensions/notification-timeout/"> + + <!-- See also: https://developer.gnome.org/glib/stable/gvariant-format-strings.html --> + + <key name="ignore-idle" type="b"> + <default>true</default> + <summary>Ignores idle user - always timeout</summary> + </key> + <key name="always-normal" type="b"> + <default>true</default> + <summary>Always as normal.</summary> + </key> + <key name="timeout" type="i"> + <default>3000</default> + <summary>Notification timeout</summary> + </key> + </schema> +</schemalist>
\ No newline at end of file |