diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..234117d --- /dev/null +++ b/LICENCE @@ -0,0 +1,15 @@ +Copyright (C) 2012 Tim Cuthbertson + +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 . + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5d256bf --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +all: schemas zip + +0: phony + mkzero-gfxmonk -p impatience -p xdg gnome-shell-impatience.xml + +schemas: phony + cd impatience/schemas && glib-compile-schemas . + +zip: phony + rm impatience@gfxmonk.net.zip + cd impatience && zip -r ../impatience@gfxmonk.net.zip * + +.PHONY: phony diff --git a/README.md b/README.md new file mode 100644 index 0000000..2561f1e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ + + +Speed up builtin gnome-shell animations. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..c8a5397 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.4.5 \ No newline at end of file diff --git a/all.gup b/all.gup new file mode 100644 index 0000000..e0d448b --- /dev/null +++ b/all.gup @@ -0,0 +1,2 @@ +#!bash -eu +gup -u compile diff --git a/compile.gup b/compile.gup new file mode 100644 index 0000000..9287327 --- /dev/null +++ b/compile.gup @@ -0,0 +1,2 @@ +#!bash -eu +gup -u schemas diff --git a/debian/changelog b/debian/changelog index 29f5c1f..4297cf2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,19 @@ -gnome-shell-extension-impatience (0.4.5-5) UNRELEASED; urgency=medium +gnome-shell-extension-impatience (0.4.5+git20210412-e8e132f-1) unstable; urgency=medium + [ Debian Janitor ] * Trim trailing whitespace. * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, Repository-Browse. - -- Debian Janitor Tue, 03 Mar 2020 15:16:03 +0000 + [ Jonathan Carter ] + * New upstream snapshot (Closes: #993190) + * Update standards version to 4.6.1 + * Upgrade to debhelper-compat to level 13 + * Declare Rules-Requires-Root: no + * Update copyright years + * Remove patch for GNOME 3.34 that's no longer needed + + -- Jonathan Carter Thu, 02 Sep 2021 18:06:05 +0200 gnome-shell-extension-impatience (0.4.5-4) unstable; urgency=medium diff --git a/debian/control b/debian/control index 6b58777..199d3ea 100644 --- a/debian/control +++ b/debian/control @@ -2,11 +2,12 @@ Section: gnome Priority: optional Maintainer: Jonathan Carter -Build-Depends: debhelper-compat (=12), libglib2.0-bin -Standards-Version: 4.5.0 +Build-Depends: debhelper-compat (=13), libglib2.0-bin +Standards-Version: 4.6.1 Homepage: https://github.com/timbertson/gnome-shell-impatience Vcs-Git: https://salsa.debian.org/gnome-team/shell-extensions/gnome-shell-extension-impatience.git Vcs-Browser: https://salsa.debian.org/gnome-team/shell-extensions/gnome-shell-extension-impatience +Rules-Requires-Root: no Package: gnome-shell-extension-impatience Architecture: all diff --git a/debian/copyright b/debian/copyright index 2d35b1c..fc1fa3e 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,11 +3,11 @@ Source: https://github.com/timbertson/gnome-shell-impatience Files: * -Copyright: 2012-2017 Tim Cuthbertson +Copyright: 2012-2021 Tim Cuthbertson License: GPL-3+ Files: debian/* -Copyright: 2016-2020 Jonathan Carter +Copyright: 2016-2021 Jonathan Carter License: GPL-3+ License: GPL-3+ diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..64ad643 --- /dev/null +++ b/debian/files @@ -0,0 +1 @@ +gnome-shell-extension-impatience_0.4.5+git20210412-e8e132f-1_source.buildinfo gnome optional diff --git a/gnome-shell-impatience.dist b/gnome-shell-impatience.dist new file mode 100644 index 0000000..f96d04c --- /dev/null +++ b/gnome-shell-impatience.dist @@ -0,0 +1,2 @@ +impatience +xdg diff --git a/gnome-shell-impatience.xml b/gnome-shell-impatience.xml new file mode 100644 index 0000000..89c5702 --- /dev/null +++ b/gnome-shell-impatience.xml @@ -0,0 +1,56 @@ + + + + gnome-shell-impatience + speed up gnome-shell animations + + +Speed up builtin gnome-shell animations. + + + + + http://gfxmonk.net/dist/0install/gnome-shell.xml + --plugin-command + run + + + + + + + + + + + + + + + + + + + + + + + http://gfxmonk.net/dist/0install/gnome-shell.xml + --plugin-command + run + + + + + + + + + + + + + + + + diff --git a/gnome-shell-impatience.xml.template b/gnome-shell-impatience.xml.template new file mode 100644 index 0000000..540f6c7 --- /dev/null +++ b/gnome-shell-impatience.xml.template @@ -0,0 +1,28 @@ + + + + gnome-shell-impatience + speed up gnome-shell animations + + +Speed up builtin gnome-shell animations. + + + + + + http://gfxmonk.net/dist/0install/gnome-shell.xml + --plugin-command + run + + + + + + + + + + + + diff --git a/impatience/extension.js b/impatience/extension.js new file mode 100644 index 0000000..2dde979 --- /dev/null +++ b/impatience/extension.js @@ -0,0 +1,61 @@ +const St = imports.gi.St; +const Gio = imports.gi.Gio; +const Lang = imports.lang; +const DEFAULT_SPEED = 0.75; +const ExtensionUtils = imports.misc.extensionUtils; +const Extension = ExtensionUtils.getCurrentExtension(); +const Settings = Extension.imports.settings; + +function LOG(m){ + global.log("[impatience] " + m); + log("[impatience] " + m); +}; +function Ext() { + this._init.apply(this, arguments); +}; +var noop = function() {}; + +Ext.prototype = {}; +Ext.prototype._init = function() { + this.enabled = false; + this.original_speed = St.get_slow_down_factor(); + this.modified_speed = DEFAULT_SPEED; + this.unbind = noop; +}; + +Ext.prototype.enable = function() { + this.enabled = true; + var pref = (new Settings.Prefs()).SPEED; + LOG("enabled"); + var binding = pref.changed(Lang.bind(this, function() { + this.set_speed(pref.get()); + })); + this.unbind = function() { + pref.disconnect(binding); + this.unbind = noop; + }; + this.set_speed(pref.get()); +}; + +Ext.prototype.disable = function() { + this.enabled = false; + this.unbind(); + St.set_slow_down_factor(this.original_speed); +}; + +Ext.prototype.set_speed = function(new_speed) { + if(!this.enabled) { + LOG("NOT setting new speed, since the extension is disabled."); + return; + } + if(new_speed !== undefined) { + this.modified_speed = new_speed; + } + LOG("setting new speed: " + this.modified_speed); + St.set_slow_down_factor(this.modified_speed); +}; + +function init() { + return new Ext(); +}; + diff --git a/impatience/metadata.json b/impatience/metadata.json new file mode 100644 index 0000000..96dd8a0 --- /dev/null +++ b/impatience/metadata.json @@ -0,0 +1,7 @@ +{ + "uuid": "impatience@gfxmonk.net", + "name": "Impatience", + "description": "Speed up the gnome-shell animation speed", + "url": "http://gfxmonk.net/dist/0install/gnome-shell-impatience.xml", + "shell-version": [ "40" ] +} diff --git a/impatience/prefs.js b/impatience/prefs.js new file mode 100644 index 0000000..286599e --- /dev/null +++ b/impatience/prefs.js @@ -0,0 +1,62 @@ +const Gtk = imports.gi.Gtk; + +let Extension = imports.misc.extensionUtils.getCurrentExtension(); +let Settings = Extension.imports.settings; + +function init() { +} + +function buildPrefsWidget() { + let config = new Settings.Prefs(); + let frame = new Gtk.Box({ + orientation: Gtk.Orientation.VERTICAL, + 'margin-top': 20, + 'margin-bottom': 20, + 'margin-start': 20, + 'margin-end': 20 + }); + + (function() { + let hbox = new Gtk.Box({ + orientation: Gtk.Orientation.HORIZONTAL, + spacing: 20 + }); + + let label = new Gtk.Label({ + label: "Speed scaling\n(1 = normal, 0.5 = twice as fast)", + use_markup: true, + }); + let adjustment = new Gtk.Adjustment({ + lower: 0, + upper: 2, + step_increment: 0.05 + }); + let scale = new Gtk.Scale({ + orientation: Gtk.Orientation.HORIZONTAL, + digits:2, + adjustment: adjustment, + hexpand: true, + value_pos: Gtk.PositionType.RIGHT + }); + + hbox.append(label); + hbox.append(scale); + frame.append(hbox); + + var pref = config.SPEED; + scale.set_value(pref.get()); + [0.25, 0.5, 1.0, 2.0].forEach( + mark => scale.add_mark(mark, Gtk.PositionType.TOP, "" + mark + "") + ); + scale.connect('value-changed', function(sw) { + var oldval = pref.get(); + var newval = sw.get_value(); + if (newval != pref.get()) { + pref.set(newval); + } + }); + })(); + + frame.show(); + return frame; +} diff --git a/impatience/schemas/gschemas.compiled b/impatience/schemas/gschemas.compiled new file mode 100644 index 0000000..f909d13 Binary files /dev/null and b/impatience/schemas/gschemas.compiled differ diff --git a/impatience/schemas/org.gnome.shell.extensions.net.gfxmonk.impatience.gschema.xml b/impatience/schemas/org.gnome.shell.extensions.net.gfxmonk.impatience.gschema.xml new file mode 100644 index 0000000..ffd0c93 --- /dev/null +++ b/impatience/schemas/org.gnome.shell.extensions.net.gfxmonk.impatience.gschema.xml @@ -0,0 +1,10 @@ + + + + + 0.75 + speed factor + + + + diff --git a/impatience/settings.js b/impatience/settings.js new file mode 100644 index 0000000..c4f6815 --- /dev/null +++ b/impatience/settings.js @@ -0,0 +1,41 @@ +const Gio = imports.gi.Gio; +const ExtensionUtils = imports.misc.extensionUtils; +const Extension = ExtensionUtils.getCurrentExtension(); + +const SCHEMA_PATH = 'org.gnome.shell.extensions.net.gfxmonk.impatience'; + +function get_local_gsettings(schema_path) { + const GioSSS = Gio.SettingsSchemaSource; + + let schemaDir = Extension.dir.get_child('schemas'); + + let schemaSource = GioSSS.get_default(); + if (schemaDir.query_exists(null)) { + schemaSource = GioSSS.new_from_directory( + schemaDir.get_path(), + schemaSource, + false); + } + + let schemaObj = schemaSource.lookup(schema_path, true); + if (!schemaObj) { + throw new Error( + 'Schema ' + schema_path + + ' could not be found for extension ' + + Extension.metadata.uuid + ); + } + return new Gio.Settings({ settings_schema: schemaObj }); +}; + +function Prefs() { + var self = this; + var settings = this.settings = get_local_gsettings(SCHEMA_PATH); + this.SPEED = { + key: 'speed-factor', + get: function() { return settings.get_double(this.key); }, + set: function(v) { settings.set_double(this.key, v); }, + changed: function(cb) { return settings.connect('changed::' + this.key, cb); }, + disconnect: function() { return settings.disconnect.apply(settings, arguments); }, + }; +}; diff --git a/schemas.gup b/schemas.gup new file mode 100644 index 0000000..5cfd7a3 --- /dev/null +++ b/schemas.gup @@ -0,0 +1,4 @@ +#!bash -eu +gup --always +cd impatience/schemas +glib-compile-schemas . diff --git a/xdg/data/glib-2.0/schemas b/xdg/data/glib-2.0/schemas new file mode 120000 index 0000000..80200e5 --- /dev/null +++ b/xdg/data/glib-2.0/schemas @@ -0,0 +1 @@ +../../../impatience/schemas \ No newline at end of file diff --git a/xdg/data/gnome-shell/extensions/impatience@gfxmonk.net b/xdg/data/gnome-shell/extensions/impatience@gfxmonk.net new file mode 120000 index 0000000..e3fde42 --- /dev/null +++ b/xdg/data/gnome-shell/extensions/impatience@gfxmonk.net @@ -0,0 +1 @@ +../../../../impatience \ No newline at end of file