Skip to content

Commit f07c784

Browse files
committed
resolves a merge conflict
2 parents 4c4e2ae + f2f30f4 commit f07c784

23 files changed

Lines changed: 3789 additions & 2052 deletions

README

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ Touchpad Indicator is a minimalistic Touchpad management extension for the Gnome
55

66
2. What does it?
77

8-
Touchpad Indicator allows you to switch your Touchpad On or Off, if a Trackpoint exists it is also possible to switch it On or Off through the extension (Needs 'xinput' to detect and switch the trackpoint).
9-
There's further the possibility to automatically switch On or Off the touchpad and/or trackpoint if a mouse is detected at startup or if a mouse is plugged or the automatc switch off is disabled by default.
10-
If your touchpad use synclient the extension also use synclient to switch the touchpad On or Off and not the standard gsettings values of gnome-shell.
8+
Touchpad Indicator allows you to switch your Touchpad On or Off, if a Trackpoint, a Fingertouch, a Touchscreen or a Pen exists it is also possible to switch it On or Off through the extension (Needs 'xinput' to detect and switch the trackpoint and the one of the other devices).
9+
There's further the possibility to automatically switch On or Off the touchpad and/or trackpoint if a mouse is detected at startup or if a mouse is plugged or the automatic switch off is disabled by default.
10+
If your touchpad use synclient the extension could also use synclient to switch the touchpad On or Off, you could change this in the preferences. The standard settings is to use gsettings values of gnome-shell.
1111

1212

1313
3. Where can I change settings?
1414

15-
To choose your preferred option you could change the values below "Indicatorsettings".
15+
To choose your preferred option you could change the values below "Indicatorpreferences".
1616

1717

1818
4. How can I install the extension
@@ -22,10 +22,16 @@ You can use this link: https://extensions.gnome.org/extension/131/touchpad-indic
2222
If you want the newest code you should pull the code from github. Pull the code from repository and move it to ~/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt
2323
Finally restart the shell with Alt+F2 and 'r' or logout and in.
2424

25+
5. Where can I report a bug?
2526

26-
5. How can I translate the extension?
27+
Please report all issues on github, on extensions.gnome.org or send an email to me.
28+
Github: https://github.com/orangeshirt/gnome-shell-extension-touchpad-indicator
29+
Gnome Extensions Page: https://extensions.gnome.org/extension/131/touchpad-indicator/
30+
Please do not only make a Comment or a Rating!!
2731

28-
5.1 Start a new translation
32+
6. How can I translate the extension?
33+
34+
6.1 Start a new translation
2935

3036
You have to open a terminal and change your directory:
3137
cd ~/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/
@@ -38,7 +44,7 @@ where 'de' is the language abbreviation of your translation. It is the same as f
3844
Now you could restart gnome-shell with Alt+F2 and 'r' or logout and in. Touchpad-indicator now should be shown in your language.
3945

4046

41-
5.2 Update an existing translation
47+
6.2 Update an existing translation
4248

4349
You have to open a terminal and change to the directory where your *.po file still exists:
4450
cd ~/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/
@@ -50,6 +56,6 @@ where 'de' is the language abbreviation of your translation. It is the same as f
5056
Now you could restart gnome-shell with Alt+F2 and 'r' or logout and in. Touchpad-indicator now should be shown in your language.
5157

5258

53-
6 FAQ
59+
7 FAQ
5460

5561
Currently there is no FAQ

convenience.js

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */
2+
/*
3+
Copyright (c) 2011-2012, Giovanni Campagna <scampa.giovanni@gmail.com>
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above copyright
10+
notice, this list of conditions and the following disclaimer in the
11+
documentation and/or other materials provided with the distribution.
12+
* Neither the name of the GNOME nor the
13+
names of its contributors may be used to endorse or promote products
14+
derived from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
20+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
*/
27+
28+
const Gettext = imports.gettext;
29+
const Gio = imports.gi.Gio;
30+
31+
const Config = imports.misc.config;
32+
const ExtensionUtils = imports.misc.extensionUtils;
33+
34+
/**
35+
* initTranslations:
36+
* @domain: (optional): the gettext domain to use
37+
*
38+
* Initialize Gettext to load translations from extensionsdir/locale.
39+
* If @domain is not provided, it will be taken from metadata['gettext-domain']
40+
*/
41+
function initTranslations(domain) {
42+
let extension = ExtensionUtils.getCurrentExtension();
43+
44+
domain = domain || extension.metadata['gettext-domain'];
45+
46+
// check if this extension was built with "make zip-file", and thus
47+
// has the locale files in a subfolder
48+
// otherwise assume that extension has been installed in the
49+
// same prefix as gnome-shell
50+
let localeDir = extension.dir.get_child('locale');
51+
if (localeDir.query_exists(null))
52+
Gettext.bindtextdomain(domain, localeDir.get_path());
53+
else
54+
Gettext.bindtextdomain(domain, Config.LOCALEDIR);
55+
}
56+
57+
/**
58+
* getSettings:
59+
* @schema: (optional): the GSettings schema id
60+
*
61+
* Builds and return a GSettings schema for @schema, using schema files
62+
* in extensionsdir/schemas. If @schema is not provided, it is taken from
63+
* metadata['settings-schema'].
64+
*/
65+
function getSettings(schema) {
66+
let extension = ExtensionUtils.getCurrentExtension();
67+
68+
schema = schema || extension.metadata['settings-schema'];
69+
70+
const GioSSS = Gio.SettingsSchemaSource;
71+
72+
// check if this extension was built with "make zip-file", and thus
73+
// has the schema files in a subfolder
74+
// otherwise assume that extension has been installed in the
75+
// same prefix as gnome-shell (and therefore schemas are available
76+
// in the standard folders)
77+
let schemaDir = extension.dir.get_child('schemas');
78+
let schemaSource;
79+
if (schemaDir.query_exists(null))
80+
schemaSource = GioSSS.new_from_directory(schemaDir.get_path(),
81+
GioSSS.get_default(),
82+
false);
83+
else
84+
schemaSource = GioSSS.get_default();
85+
86+
let schemaObj = schemaSource.lookup(schema, true);
87+
if (!schemaObj)
88+
throw new Error('Schema ' + schema + ' could not be found for extension '
89+
+ extension.metadata.uuid + '. Please check your installation.');
90+
91+
return new Gio.Settings({ settings_schema: schemaObj });
92+
}
93+

0 commit comments

Comments
 (0)