Compare commits

...

85 Commits

Author SHA1 Message Date
Benjamin Berg
ff1b411f74 data: Add desktop autostart file for extension warning
Adding this file allows gnome-session to trigger the warning after it
disabled extensions in the non-systemd case.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/695
2019-08-30 18:58:50 +02:00
Benjamin Berg
098114f4c8 data: Add systemd service file for extension disabled warning
Show the extension preferences UI right after login if the last session
failed and extensions have been disabled because of this.

This adds the files for the systemd session case.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/695
2019-08-30 18:58:50 +02:00
Benjamin Berg
9a49b20fac extensionPrefs: Delete disabled warning marker
It isn't possible to easily delete the marker from an XDG autostart
file, so make it on startup to simplify that. This is in preparation
for the next commit which adds the appropriate autostart file.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/695
2019-08-30 18:58:50 +02:00
Benjamin Berg
d9775e41b2 extensionSystem: Allow disabling extensions when globally disabled
The canChange property was not actually reflecting whether
the enableExtension or disableExtension can change the underlying
setting. Instead the property was showing whether such a change will
have an effect.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/695
2019-08-30 18:58:30 +02:00
Benjamin Berg
5796a5d193 extensionPrefs: Reflect whether extension is requested in active state
To do this, simply use the new isRequested property to properly reflect
the underlying settings key rather than the actual loaded state of the
extension.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/695
2019-08-30 18:56:24 +02:00
Benjamin Berg
afefc88e02 extensionSystem: Add isRequested property for extensions
The property reflects whether the extension is enabled in the setting.
This does not mean that the extension is actually loaded, the API user
must check the state property for this information.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/695
2019-08-30 17:19:23 +02:00
Benjamin Berg
44cd1ae25b extensionPrefs: Add ability to warn about extensions being disabled
If we disable extensions after a gnome-shell failure, then we should
warn the user about this happening. The old concept was to do so in the
fail-whale, but we can't even show the fail-whale when running on
wayland.

Adding this option allows starting up the preference dialog on the next
log in and telling the user what happened then. This means we can both
tell the user what is going on and enable them to solve the issue at the
same time.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/695
2019-08-30 16:09:26 +02:00
Ryuta Fujii
f226398c7c Update Japanese translation 2019-08-29 11:49:39 +00:00
Ryuta Fujii
890ac9ff38 Update Japanese translation 2019-08-29 11:36:39 +00:00
Pawan Chitrakar
6a027cd566 Update Nepali translation 2019-08-29 08:32:16 +00:00
Fabio Tomat
1dc971d760 Update Friulian translation 2019-08-28 09:19:25 +00:00
Tim Sabsch
dcf0bf0bb1 Update German translation 2019-08-27 21:24:29 +00:00
Benjamin Berg
cf156b469c Notify service startup to systemd
Using the bus name to notify service startup to systemd has some
disadvantages. The main one being that systemd will consider a
gnome-shell restart (Alt+F2 r) a service failure and restart the shell,
cleaning up all its children (i.e. user launched applications). In the
future the shell should launch applications in their own transient unit
so that a service restart does not affect applications.

Another potential issue is that we must never load
gnome-shell-wayland.service and gnome-shell-x11.service at the same
time, as systemd does not like two services providing the same bus
name.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1496

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/690
2019-08-27 17:42:32 +00:00
Florian Müllner
da6c154ceb ci: Set XDG_RUNTIME_DIR for tests
Mutter's backend code depends on it being set.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/691
2019-08-27 15:30:51 +03:00
Florian Müllner
957fa910b3 st: Adjust theme test
Mutter's Clutter fork can no longer be initialized separatedly, as
its backend now draws from MetaBackend. Adjust the code to use the
newly added test initialization function instead to get the test
back up.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/691
2019-08-27 15:30:51 +03:00
Florian Müllner
8ac5be95d3 tests: Don't initialize Clutter
Clutter's backend code depends on MetaBackend now, which makes it
impossible to initialize without resorting to private mutter API.

Luckily we only need Clutter for interactive tests which are broken
anyway, as Clutter.main() and friends were removed a while ago.

So for now, get at least unit tests working again by simply the
unnecessary Clutter initialization.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/691
2019-08-27 15:30:51 +03:00
Ryuta Fujii
c27bd62106 Update Japanese translation 2019-08-27 11:26:32 +00:00
Ryuta Fujii
480e8b8842 Update Japanese translation 2019-08-27 10:45:55 +00:00
Florian Müllner
c6580421b3 shell-extension-tool: Fix typo
Spotted by Amr Ibrahim.
2019-08-27 12:16:27 +03:00
Jonas Dreßler
c2f5331187 pointerA11yTimeout: Create new PieTimer object for each timeout
Since we now put a short timeout in before the start of the actual pie
timer we don't start the timer as often as we used to. This allows us to
create a new PieTimer object each time a timeout is started and
therefore play a finish animation independently of other (new) timeouts.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/688
2019-08-27 08:03:49 +00:00
Jonas Dreßler
5d0c403f1d pointerA11yTimeout: Add a zoom out+fade animation on success
We currently don't indicate success of the pie timer at all, let's do
this by animating the circle's scale and fading it out at the same time.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/688
2019-08-27 08:03:49 +00:00
Jonas Dreßler
20fc4b4490 pointerA11yTimeout: Draw a clean circle if the pie is finished
If the circle is complete and the pie timeout finished, we don't need
the lines to the center point indicating the ends of the pie anymore.
We just draw a clean circle instead, which allows for a zoom-out and
fade animation of the circle when we're done.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/688
2019-08-27 08:03:49 +00:00
Jonas Dreßler
ea3f906f38 pointerA11yTimeout: Don't stop the pie timer if it finished successfully
If the pie timeout has finished successfully there's no need to cancel
the pie animation, instead we can just wait for that animation to finish
and show some visual feedback like a zoom-out animation to indicate the
click afterwards.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/688
2019-08-27 08:03:49 +00:00
Jonas Dreßler
2c4df6abcf pointerA11yTimeout: Fade the pie timer in
Fade the pie timer in using a duration of 1/4 of the timeout and a
EASE_IN_QUAD animation. This significantly reduces flickering of the pie
timer while moving the cursor and makes the timer less distracting.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/688
2019-08-27 08:03:49 +00:00
Jonas Dreßler
67a0b3b98e pointerA11yTimeout: Remove unused properties
Those properties were overlooked in 5cb02c1c, remove them now.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/688
2019-08-27 08:03:49 +00:00
Zander Brown
c366e9f3ca Update British English translation 2019-08-26 21:21:58 +00:00
Matej Urbančič
812a8552e5 Updated Slovenian translation 2019-08-26 22:20:53 +02:00
Fran Dieguez
069d7d6cac Update Galician translation 2019-08-26 15:22:53 +00:00
Daniel Mustieles
785a8b78b1 Updated Spanish translation 2019-08-26 12:26:03 +02:00
Jordi Mas
2d927639fe Update Catalan translation 2019-08-25 21:54:37 +02:00
Fran Dieguez
d5cad10181 Update Galician translation 2019-08-25 16:47:04 +00:00
Anders Jonsson
441a56b916 Update Swedish translation 2019-08-24 20:05:19 +00:00
Rūdolfs Mazurs
c2a6a6c939 Update Latvian translation 2019-08-24 16:21:58 +00:00
Piotr Drąg
15d1aee21a Update Polish translation 2019-08-23 18:41:05 +02:00
Asier Sarasua Garmendia
f1bc2d56f4 Update Basque translation 2019-08-23 07:18:19 +00:00
Asier Sarasua Garmendia
6f62965305 Update Basque translation 2019-08-22 21:45:29 +00:00
Jiri Grönroos
a6aa0ac74a Update Finnish translation 2019-08-22 16:36:37 +00:00
Daniel Mustieles
32ed4ee12e Updated Spanish translation 2019-08-22 15:06:34 +02:00
Danial Behzadi
33a48aecb7 Update Persian translation 2019-08-22 12:10:52 +00:00
Daniel Șerbănescu
3b63062a30 Update Romanian translation 2019-08-22 08:05:48 +00:00
Piotr Drąg
b680952197 Update POTFILES.in 2019-08-22 01:17:50 +02:00
Florian Müllner
a4ec460f96 Bump version to 3.33.91
Update NEWS.
2019-08-21 19:47:37 +00:00
Florian Müllner
5bd295842b extensionPrefs: Request correct GDK/GTK versions
gjs no longer has an implicit dependency on GTK 3.0, so without
requesting an explicit version, we will get the highest available.

Our code isn't GTK-4 ready, so request 3.0 explicitly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/686
2019-08-21 19:43:33 +02:00
Carlos Garnacho
db9a7ea7a9 shell: Ignore non-toplevels for ShellWindowTracker::tracked-windows-changed
Popups and other override-redirect windows are meaningless to everything
that depends on the ShellWindowTracker. Ignoring those windows will result
in less ShellApp::windows-changed signal emissions, and less activity in
the AppMenuButton and everything else that depends on them.

Reduces gnome-shell CPU activity while typing on the Epiphany addressbar,
as the pop up animation there results in a number of xdg_popup being
created and destroyed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/642
https://gitlab.gnome.org/GNOME/mutter/issues/556
2019-08-21 16:53:36 +00:00
Florian Müllner
490a62e781 shell-extension-tool: Turn into a small wrapper
Now that we have a replacement, deprecate the existing tool and make
it call out to the new one instead of implementing any functionality
on its own.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
d4b8912c0e extensions-tool: Add 'reset' command
Now that we allow to disable session mode extensions, it can be useful
to reset an extension to its original state, that is disabled in the
regular session, but possibly enabled via the session mode.

Add a corresponding command.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
532acf4c4a extensions-tool: Adjust enable/disable commands to shell changes
Change both 'enabled-extensions' and 'disabled-extensions' keys as in
commit ce1bee727. While those actions are now also exposed by the
shell's D-Bus API, there is some value in allowing the tool to be used
outside a running GNOME session (for example in setup scripts), so
keep changing the GSettings keys directly.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
7141c5be6d extensions-tool: Split out settings_list_add/remove helpers
With the addition of the 'disabled-extensions' key in commit ce1bee727,
the way extensions are enabled/disabled changed: Now a UUID is always
added to one list and removed from another.

Prepare for that by generalizing the relevant bits of the existing
enable/disable commands as helper functions.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
2df7757905 extensions-tool: Add 'uninstall' command
Uninstall is another action that can be useful from the command line,
so expose that as well.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
9d5c743a98 extensions-tool: Handle existing extension folder
g_file_make_directory_with_parents() returns an error if the directory
already exists (unlike g_mkdir_with_parents()), so it is currently
impossible to install more than a single extension, whoops.

Handle the error properly by just carrying on.

https://gitlab.gnome.org/fmuellner/gnome-extensions-tool/merge_requests/3
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
653e6c85bb extensions-tool: Add 'prefs' command
Easily launching an extension's preference dialog from the command
line can be quicker than using a UI like Tweaks or the extension
website, so add that functionality.

https://gitlab.gnome.org/fmuellner/gnome-extensions-tool/merge_requests/2
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
d9fa389079 extensions-tool: Add '--prefs' list option
We are about to add a 'prefs' command for launching an extension's
preference dialog. As that command only makes sense for extensions
that actually have preferences, shell completion should filter the
list of extensions accordingly. To allow that, add an appropriate
list option.

https://gitlab.gnome.org/fmuellner/gnome-extensions-tool/merge_requests/2
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
a429fdbd08 extensions-tool: Add 'install' command
The ability to install unaudited extensions directly from a zip file
can be useful for testing and code review, so implement a corresponding
command that complements the previously added 'pack' command.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
f9357457bf extensions-tool: Add new 'pack' command
Extensions are uploaded to extensions.gnome.org as zip files that
not only contain the extension sources, but also compiled GSettings
schemas and message catalogues. To make this more convenient, add
a corresponding command for creating an archive suitable for up-
loading.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
369e400e32 extensions-tool: Show Philip some info
Add a 'show' alias for the previously added 'info' command
because it makes sense:

https://twitter.com/pwithnall/status/1036895943004762112

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
07ad4d8911 extensions-tool: Add info command
We already support displaying extension details for the list command,
so it's a logical extension to also support showing extension info
for a particular extension (not least because the shell has a
corresponding D-Bus method).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
803a096b7e ci: Turn off man pages
There is little to test there, and excluding them slightly reduces the
dependencies in the CI image.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
1b40abe37a extensions-tool: Add a man page
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
0de5209cf1 extensions-tool: Add bash completion
Completions are clearly helpful, in particular for extension UUIDs
that are often lengthy strings containing random usernames.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
07fad38a50 extensions-tool: Add list options
In addition to a plain list of all extensions, add options to display
additional details of each extensions and to filter the list by
enabled state or install location.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
ac4b88f25d extensions-tool: Implement list command
Seeing at a glance which extensions are installed is surely useful,
so add a corresponding command.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
23a7aa5740 extensions-tool: Add create options
As we are using git-style command syntax, we can allow for data to be
provided on the command line rather than asking for it interactively.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
0b1e29e5e3 extensions-tool: Implement create command
This implements more functionality of the existing tool and, as
'reload' is an unreliable feature that doesn't work more often
than not, the last bit that we will replicate.

The command follows the original for the most part, with the most
important difference being the installed template, which doesn't
provide any sample functionality and uses modern JS syntax.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
c8c93b2a70 extensions-tool: Implement enable/disable commands
This replicates the most basic functionality of the existing
gnome-shell-extension-tool, albeit using a git/gio/gsettings
style command interface rather than plain options; this will
allow us to implement more complex commands that have options
on their own in the future.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Florian Müllner
d8c7cac536 extensions-tool: Start import
The gnome-extensions tool[0] was started as an external project, and
provides a replacement for the existing gnome-shell-extension-tool.
It was decided to ship the tool as part of the gnome-shell repository,
so start importing it with its history into a subdir.

[0] https://gitlab.gnome.org/fmuellner/gnome-extensions-tool

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234
2019-08-21 18:28:02 +02:00
Jonas Dreßler
5cb02c1cb5 pieTimer: Use custom GObject property for animating pie
Before the move to Clutters implicit animations with 0846238f6 and
bf497ed64, we used Tweener to do a fake-animation of the opacity and
Tweeners `onUpdate` signal to queue a repaint of the PieTimer everytime
Tweener tries to update the animation.

Now, with Clutters implicit animations, there is no `onUpdate` signal
anymore and also `notify::opacity` no longer gets emitted since the
value doesn't actually change. This lead to the PieTimer no longer being
repainted, which broke the animation.

Fix this by implementing the current angle of the pie using a custom
GObject property `angle` and animating this property using the new
`actor.ease_property` method.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1533
2019-08-21 17:14:40 +02:00
Danial Behzadi
10c1df61cd Update Persian translation 2019-08-21 11:31:51 +00:00
Piotr Drąg
387e5ef0f1 Update Polish translation
Closes https://gitlab.gnome.org/Teams/Translation/pl/issues/4
2019-08-20 19:19:52 +02:00
Daniel Mustieles
f8f40f247f Updated Spanish translation 2019-08-20 12:43:51 +02:00
Jonas Ådahl
16cb918e0d shell-global: Set stage input region via MetaX11Display
The API in mutter changed to set it via MetaX11Display; lets jump on the
train.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/682
2019-08-19 09:20:44 +00:00
Jonas Ådahl
638b315e40 shell-global: Only sync input region if X11 session
We'd do an early out in the called functions eventually anyway.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/682
2019-08-19 09:20:44 +00:00
Aurimas Černius
a20b8dc1ad Updated Lithuanian translation 2019-08-18 22:05:31 +03:00
Jiri Grönroos
4370aee81e Update Finnish translation 2019-08-18 14:38:55 +00:00
Florentina Mușat
779e37fbd9 Update Romanian translation 2019-08-18 12:26:25 +00:00
Jonas Dreßler
6f4c5022eb iconGrid: Only add one onComplete callback for the animations
We only need a callback on the last animated actor, so no need to
register the callback for all actors.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/678
2019-08-16 14:55:25 +00:00
Jonas Dreßler
b499ca47a3 iconGrid: Restore grid actors when cancelling animations
When cancelling the animations of the icon grid, right now we simply
destroy all the clones without resetting the opacity and making the
actor reactive again. So if the spring animation to show the grid is
cancelled by pressing a key to start a search, the icon clones would be
destroyed, but the icon-opacity would still be set to 0. Now if the
Escape key is pressed, viewSelector will show the last active page (ie.
the iconGrid) without a custom animation and only fade in the page, and
because the icons still have an opacity of 0, they will be invisible.

Fix this by always restoring the opacity and reactive property of the
original actors if the animation is cancelled instead of only destroying
the clones.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/678
2019-08-16 14:55:25 +00:00
Kukuh Syafaat
dc38e48202 Update Indonesian translation 2019-08-16 08:38:32 +00:00
Jordi Mas
7efdb97641 Update Catalan translation 2019-08-15 09:24:26 +02:00
Asier Sarasua Garmendia
14fd7c7532 Update Basque translation 2019-08-14 14:31:21 +00:00
Florian Müllner
21e14bd46f brightness: Ignore slider changes we initiated ourselves
Since we set the proxy value when the slider changes and set the slider
value on proxy property changes, we run into a cycle.

Before commit 3d3dca4aa this was addressed by not notifying on all slider
changes, but only in reaction to direct user action. Given that since the
splitting out of the BarLevel class those events are handled in a subclass,
that approach is at least unconvential and fairly fragile.

Instead, make the brightness indicator ignore any changes to the slider it
initiated itself.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1500
2019-08-13 16:35:17 +02:00
Florian Müllner
f0e1dc5715 slider: Do not notify on parent's behalf
Instead just use the regular property setter which since commit 3d3dca4aa
already emits the signal and queues a redraw.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1500
2019-08-13 16:35:17 +02:00
Florian Müllner
6b7af407e1 barLevel: Remove duplicated assignment
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1500
2019-08-13 16:35:17 +02:00
Anders Jonsson
d67c64af83 Update Swedish translation 2019-08-12 19:40:31 +00:00
Sveinn í Felli
5d2e5fe85a Update Icelandic translation
(cherry picked from commit 40db793230)
2019-08-12 07:47:40 +00:00
Asier Sarasua Garmendia
308da6ae53 Update Basque translation 2019-08-11 14:29:45 +00:00
70 changed files with 17596 additions and 8730 deletions

View File

@@ -54,7 +54,7 @@ build:
- meson mutter mutter/build --prefix=/usr -Dtests=false
- ninja -C mutter/build install
script:
- meson . build -Dbuiltype=debugoptimized
- meson . build -Dbuiltype=debugoptimized -Dman=false
- ninja -C build
- ninja -C build install
<<: *only_default
@@ -67,6 +67,8 @@ build:
test:
image: registry.gitlab.gnome.org/gnome/mutter/master:v2
stage: test
variables:
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
before_script:
- ninja -C mutter/build install
script:

18
NEWS
View File

@@ -1,3 +1,21 @@
3.33.91
=======
* Fix regression when adjusting brightness [Florian; #1500]
* Fix pointer a11y timeout animation [Jonas D.; #1533]
* Add new extensions CLI tool [Florian; #1234]
* Only track top-level windows [Carlos; #556]
* Misc. bug fixes and cleanups [Jonas D., Jonas Å., Piotr, Florian;
!678, !682, !686]
Contributors:
Jonas Ådahl, Jonas Dreßler, Carlos Garnacho, Florian Müllner
Translators:
Asier Sarasua Garmendia [eu], Sveinn í Felli [is], Anders Jonsson [sv],
Jordi Mas [ca], Kukuh Syafaat [id], Florentina Mușat [ro], Jiri Grönroos [fi],
Aurimas Černius [lt], Daniel Mustieles [es], Piotr Drąg [pl],
Danial Behzadi [fa]
3.33.90
=======
* Implement DND app picker folder management [Georges; !643, !645, !664, !671]

View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Name=GNOME Shell Extensions Disabled Warning
Comment=Warning shown if extensions were disabled due to a failure
Exec=@bindir@/gnome-shell-extension-prefs --disabled-warning
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-shell
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=@VERSION@
OnlyShowIn=GNOME;
AutostartCondition=if-exists gnome-shell-extensions-disabled-warning
X-GNOME-HiddenUnderSystemd=@systemd_hidden@

View File

@@ -0,0 +1,13 @@
[Unit]
Description=Warn about GNOME Shell extensions being disabled
ConditionPathExists=%E/gnome-shell-extensions-disabled-warning
Requisite=gnome-session.target
After=gnome-session.target
[Service]
Type=simple
ExecStartPre=-/bin/rm %E/gnome-shell-extensions-disabled-warning
ExecStart=@bindir@/gnome-shell-extension-prefs --disabled-warning
Restart=no

View File

@@ -17,10 +17,9 @@ Before=gnome-session-initialized.target
#Conflicts=gnome-shell-x11.service
[Service]
Type=dbus
Type=notify
ExecStart=@bindir@/gnome-shell
# Exit code 1 means we are probably *not* dealing with an extension failure
SuccessExitStatus=1
# On wayland we cannot restart
Restart=no
BusName=org.gnome.Shell

View File

@@ -8,3 +8,5 @@ Before=gnome-session-initialized.target
Requires=gnome-shell-wayland.service
After=gnome-shell-wayland.service
Wants=gnome-shell-extensions-disabled-warning.service

View File

@@ -21,7 +21,7 @@ StartLimitIntervalSec=15s
StartLimitBurst=3
[Service]
Type=dbus
Type=notify
ExecStart=@bindir@/gnome-shell
# Exit code 1 means we are probably *not* dealing with an extension failure
SuccessExitStatus=1
@@ -29,4 +29,3 @@ SuccessExitStatus=1
Restart=always
# Do not wait before restarting the shell
RestartSec=0ms
BusName=org.gnome.Shell

View File

@@ -8,3 +8,5 @@ Before=gnome-session-initialized.target
Requires=gnome-shell-x11.service
After=gnome-shell-x11.service
Wants=gnome-shell-extensions-disabled-warning.service

View File

@@ -31,6 +31,19 @@ foreach desktop_file : desktop_files
)
endforeach
i18n.merge_file('desktop',
input: configure_file(
input: 'gnome-shell-extensions-disabled-warning.desktop.in.in',
output: 'gnome-shell-extensions-disabled-warning.desktop.in',
configuration: desktopconf
),
output: 'gnome-shell-extension-disabled-warning.desktop',
po_dir: po_dir,
install: true,
install_dir: autostartdir,
type: 'desktop'
)
serviceconf = configuration_data()
serviceconf.set('libexecdir', libexecdir)
foreach service_file : service_files

View File

@@ -1,4 +1,7 @@
/* exported main */
imports.gi.versions.Gdk = '3.0';
imports.gi.versions.Gtk = '3.0';
const Gettext = imports.gettext;
const { Gdk, GLib, Gio, GObject, Gtk, Pango } = imports.gi;
const Format = imports.format;
@@ -7,7 +10,7 @@ const _ = Gettext.gettext;
const Config = imports.misc.config;
const ExtensionUtils = imports.misc.extensionUtils;
const { loadInterfaceXML } = imports.misc.fileUtils;
const { loadInterfaceXML, deleteGFile } = imports.misc.fileUtils;
const { ExtensionState } = ExtensionUtils;
@@ -216,10 +219,33 @@ var Application = GObject.registerClass({
Gio.SettingsBindFlags.DEFAULT |
Gio.SettingsBindFlags.INVERT_BOOLEAN);
let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
this._window.add(vbox);
this.disabledInfobar = new Gtk.InfoBar({
message_type: Gtk.MessageType.ERROR,
revealed: false,
show_close_button: true
});
this.disabledInfobar.connect('response', () => {
this.disabledInfobar.revealed = false;
});
let contentArea = this.disabledInfobar.get_content_area();
let label = new Gtk.Label({
label: _('A problem was detected and extensions were automatically disabled. It is recommended to disable or reconfigure any extensions that may have caused the issue before re-enabling them at the top.'),
ellipsize: Pango.EllipsizeMode.END,
wrap: true,
lines: 2,
xalign: 0,
margin: 6
});
contentArea.add(label);
vbox.add(this.disabledInfobar);
this._mainStack = new Gtk.Stack({
transition_type: Gtk.StackTransitionType.CROSSFADE
});
this._window.add(this._mainStack);
vbox.add(this._mainStack);
let scroll = new Gtk.ScrolledWindow({ hscrollbar_policy: Gtk.PolicyType.NEVER });
@@ -335,6 +361,20 @@ var Application = GObject.registerClass({
let args = commandLine.get_arguments();
if (args.length) {
if (args[0] == '--disabled-warning') {
if (!this._settings.is_writable('disable-user-extensions'))
this.quit();
this.disabledInfobar.set_revealed(true);
let file = GLib.build_filenamev ([GLib.get_user_config_dir(), 'gnome-shell-extensions-disabled-warning']);
let gfile = Gio.File.new_for_path(file);
if (gfile.query_exists(null))
deleteGFile(gfile);
return 0;
}
let uuid = args[0];
this._skipMainWindow = true;
@@ -571,8 +611,11 @@ class ExtensionRow extends Gtk.ListBoxRow {
this._extension = ExtensionUtils.deserializeExtension(newState);
let state = (this._extension.state == ExtensionState.ENABLED);
this._switch.freeze_notify();
this._switch.state = state;
this._switch.active = this._extension.isRequested;
this._switch.sensitive = this._canToggle();
this._switch.thaw_notify();
});
this.connect('destroy', this._onDestroy.bind(this));
@@ -641,7 +684,6 @@ class ExtensionRow extends Gtk.ListBoxRow {
this._switch = new Gtk.Switch({
valign: Gtk.Align.CENTER,
sensitive: this._canToggle(),
state: this._extension.state === ExtensionState.ENABLED
});
this._switch.connect('notify::active', () => {
if (this._switch.active)
@@ -650,6 +692,11 @@ class ExtensionRow extends Gtk.ListBoxRow {
this._app.shellProxy.DisableExtensionRemote(this.uuid);
});
this._switch.connect('state-set', () => true);
this._switch.freeze_notify();
this._switch.state = this._extension.state === ExtensionState.ENABLED;
this._switch.active = this._extension.isRequested;
this._switch.thaw_notify();
hbox.add(this._switch);
}

View File

@@ -31,7 +31,7 @@ var ExtensionState = {
UNINSTALLED: 99
};
const SERIALIZED_PROPERTIES = ['type', 'state', 'path', 'error', 'hasPrefs', 'canChange'];
const SERIALIZED_PROPERTIES = ['type', 'state', 'path', 'error', 'hasPrefs', 'canChange', 'isRequested'];
/**
* getCurrentExtension:

View File

@@ -55,7 +55,6 @@ var BarLevel = GObject.registerClass({
if (this._value == value)
return;
this._value = value;
this._value = value;
this.notify('value');
this.queue_repaint();

View File

@@ -22,6 +22,7 @@ var ExtensionManager = class {
this._extensions = new Map();
this._enabledExtensions = [];
this._requestedExtensions = [];
this._extensionOrder = [];
Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
@@ -250,6 +251,9 @@ var ExtensionManager = class {
// Default to error, we set success as the last step
extension.state = ExtensionState.ERROR;
let requested = this._requestedExtensions.includes(extension.uuid);
extension.isRequested = requested;
let checkVersion = !global.settings.get_boolean(EXTENSION_DISABLE_VERSION_CHECK_KEY);
if (checkVersion && ExtensionUtils.isOutOfDate(extension)) {
@@ -363,10 +367,7 @@ var ExtensionManager = class {
? DISABLE_USER_EXTENSIONS_KEY
: ENABLED_EXTENSIONS_KEY;
extension.canChange =
!hasError &&
global.settings.is_writable(changeKey) &&
(isMode || !modeOnly);
extension.canChange = global.settings.is_writable(ENABLED_EXTENSIONS_KEY);
}
_getEnabledExtensions() {
@@ -380,6 +381,14 @@ var ExtensionManager = class {
return extensions.filter(item => !disabledExtensions.includes(item));
}
_getRequestedExtensions() {
let extensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
// filter out 'disabled-extensions' which takes precedence
let disabledExtensions = global.settings.get_strv(DISABLED_EXTENSIONS_KEY);
return extensions.filter(item => !disabledExtensions.includes(item));
}
_onUserExtensionsEnabledChanged() {
this._onEnabledExtensionsChanged();
this._onSettingsWritableChanged();
@@ -391,6 +400,16 @@ var ExtensionManager = class {
if (!this._enabled)
return;
// Updated requested state and emit change notifications
this._requestedExtensions = this._getRequestedExtensions();
for (let extension of this._extensions.values()) {
let requested = this._requestedExtensions.includes(extension.uuid);
if (extension.isRequested == requested)
continue;
extension.isRequested = requested;
this.emit('extension-state-changed', extension);
}
// Find and enable all the newly enabled extensions: UUIDs found in the
// new setting, but not in the old one.
newEnabledExtensions.filter(
@@ -451,6 +470,7 @@ var ExtensionManager = class {
this._onSettingsWritableChanged.bind(this));
this._enabledExtensions = this._getEnabledExtensions();
this._requestedExtensions = this._getRequestedExtensions();
let perUserDir = Gio.File.new_for_path(global.userdatadir);
FileUtils.collectFromDatadirs('extensions', true, (dir, info) => {
@@ -512,8 +532,9 @@ var ExtensionManager = class {
// property; it might make sense to make enabledExtensions independent
// from allowExtensions in the future
if (Main.sessionMode.allowExtensions) {
if (this._initted)
if (this._initted) {
this._enabledExtensions = this._getEnabledExtensions();
}
this._enableAllExtensions();
} else {
this._disableAllExtensions();

View File

@@ -226,7 +226,7 @@ var IconGrid = GObject.registerClass({
// swarming into the void ...
this.connect('notify::mapped', () => {
if (!this.mapped)
this._cancelAnimation();
this._resetAnimationActors();
});
this.connect('actor-added', this._childAdded.bind(this));
@@ -417,18 +417,17 @@ var IconGrid = GObject.registerClass({
return this._getVisibleChildren();
}
_cancelAnimation() {
this._clonesAnimating.forEach(clone => clone.destroy());
this._clonesAnimating = [];
}
_animationDone() {
_resetAnimationActors() {
this._clonesAnimating.forEach(clone => {
clone.source.reactive = true;
clone.source.opacity = 255;
clone.destroy();
});
this._clonesAnimating = [];
}
_animationDone() {
this._resetAnimationActors();
this.emit('animation-done');
}
@@ -437,7 +436,7 @@ var IconGrid = GObject.registerClass({
throw new GObject.NotImplementedError("Pulse animation only implements " +
"'in' animation direction");
this._cancelAnimation();
this._resetAnimationActors();
let actors = this._getChildrenToAnimate();
if (actors.length == 0) {
@@ -485,7 +484,7 @@ var IconGrid = GObject.registerClass({
}
animateSpring(animationDirection, sourceActor) {
this._cancelAnimation();
this._resetAnimationActors();
let actors = this._getChildrenToAnimate();
if (actors.length == 0) {
@@ -546,12 +545,12 @@ var IconGrid = GObject.registerClass({
scale_y: 1,
duration: ANIMATION_TIME_IN,
mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
delay,
onComplete: () => {
if (isLastItem)
this._animationDone();
}
delay
};
if (isLastItem)
movementParams.onComplete = this._animationDone.bind(this);
fadeParams = {
opacity: 255,
duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,
@@ -572,13 +571,12 @@ var IconGrid = GObject.registerClass({
scale_y: scaleY,
duration: ANIMATION_TIME_OUT,
mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
delay,
onComplete: () => {
if (isLastItem) {
this._animationDone();
}
}
delay
};
if (isLastItem)
movementParams.onComplete = this._animationDone.bind(this);
fadeParams = {
opacity: 0,
duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,

View File

@@ -3,21 +3,40 @@ const { Clutter, GLib, GObject, Meta, St } = imports.gi;
const Main = imports.ui.main;
const Cairo = imports.cairo;
var PieTimer = GObject.registerClass(
class PieTimer extends St.DrawingArea {
const SUCCESS_ZOOM_OUT_DURATION = 150;
var PieTimer = GObject.registerClass({
Properties: {
'angle': GObject.ParamSpec.double(
'angle', 'angle', 'angle',
GObject.ParamFlags.READWRITE,
0, 2 * Math.PI, 0)
}
}, class PieTimer extends St.DrawingArea {
_init() {
this._x = 0;
this._y = 0;
this._startTime = 0;
this._duration = 0;
this._angle = 0;
super._init({
style_class: 'pie-timer',
opacity: 0,
visible: false,
can_focus: false,
reactive: false
});
this.connect('notify::opacity', this.queue_repaint.bind(this));
this.set_pivot_point(0.5, 0.5);
}
get angle() {
return this._angle;
}
set angle(angle) {
if (this._angle == angle)
return;
this._angle = angle;
this.notify('angle');
this.queue_repaint();
}
vfunc_repaint() {
@@ -28,20 +47,22 @@ class PieTimer extends St.DrawingArea {
let [width, height] = this.get_surface_size();
let radius = Math.min(width / 2, height / 2);
let currentTime = GLib.get_monotonic_time() / 1000.0;
let ellapsed = currentTime - this._startTime;
let angle = (ellapsed / this._duration) * 2 * Math.PI;
let startAngle = 3 * Math.PI / 2;
let endAngle = startAngle + angle;
let endAngle = startAngle + this._angle;
let cr = this.get_context();
cr.setLineCap(Cairo.LineCap.ROUND);
cr.setLineJoin(Cairo.LineJoin.ROUND);
cr.translate(width / 2, height / 2);
cr.moveTo(0, 0);
if (this._angle < 2 * Math.PI)
cr.moveTo(0, 0);
cr.arc(0, 0, radius - borderWidth, startAngle, endAngle);
cr.lineTo(0, 0);
if (this._angle < 2 * Math.PI)
cr.lineTo(0, 0);
cr.closePath();
cr.setLineWidth(0);
@@ -56,46 +77,56 @@ class PieTimer extends St.DrawingArea {
}
start(x, y, duration) {
this.remove_all_transitions();
this.x = x - this.width / 2;
this.y = y - this.height / 2;
this.show();
Main.uiGroup.set_child_above_sibling(this, null);
this._startTime = GLib.get_monotonic_time() / 1000.0;
this._duration = duration;
this.ease({
opacity: 255,
duration: duration / 4,
mode: Clutter.AnimationMode.EASE_IN_QUAD
});
this.ease_property('angle', 2 * Math.PI, {
duration,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => this.stop()
mode: Clutter.AnimationMode.LINEAR,
onComplete: this._onTransitionComplete.bind(this)
});
}
stop() {
this.remove_all_transitions();
this.hide();
_onTransitionComplete() {
this.ease({
scale_x: 2,
scale_y: 2,
opacity: 0,
duration: SUCCESS_ZOOM_OUT_DURATION,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onStopped: () => this.destroy()
});
}
});
var PointerA11yTimeout = class PointerA11yTimeout {
constructor() {
let manager = Clutter.DeviceManager.get_default();
let pieTimer = new PieTimer();
Main.uiGroup.add_actor(pieTimer);
manager.connect('ptr-a11y-timeout-started', (manager, device, type, timeout) => {
let [x, y] = global.get_pointer();
pieTimer.start(x, y, timeout);
this._pieTimer = new PieTimer();
Main.uiGroup.add_actor(this._pieTimer);
Main.uiGroup.set_child_above_sibling(this._pieTimer, null);
this._pieTimer.start(x, y, timeout);
if (type == Clutter.PointerA11yTimeoutType.GESTURE)
global.display.set_cursor(Meta.Cursor.CROSSHAIR);
});
manager.connect('ptr-a11y-timeout-stopped', (manager, device, type) => {
pieTimer.stop();
manager.connect('ptr-a11y-timeout-stopped', (manager, device, type, clicked) => {
if (!clicked)
this._pieTimer.destroy();
if (type == Clutter.PointerA11yTimeoutType.GESTURE)
global.display.set_cursor(Meta.Cursor.DEFAULT);
});

View File

@@ -155,10 +155,8 @@ var Slider = GObject.registerClass({
delta = -dy * SLIDER_SCROLL_STEP;
}
this._value = Math.min(Math.max(0, this._value + delta), this._maxValue);
this.value = Math.min(Math.max(0, this._value + delta), this._maxValue);
this.queue_repaint();
this.notify('value');
return Clutter.EVENT_STOP;
}
@@ -177,10 +175,8 @@ var Slider = GObject.registerClass({
let key = event.get_key_symbol();
if (key == Clutter.KEY_Right || key == Clutter.KEY_Left) {
let delta = key == Clutter.KEY_Right ? 0.1 : -0.1;
this._value = Math.max(0, Math.min(this._value + delta, this._maxValue));
this.queue_repaint();
this.emit('drag-begin');
this.notify('value');
this.value = Math.max(0, Math.min(this._value + delta, this._maxValue));
this.emit('drag-end');
return Clutter.EVENT_STOP;
}
@@ -202,9 +198,7 @@ var Slider = GObject.registerClass({
newvalue = 1;
else
newvalue = (relX - handleRadius) / (width - 2 * handleRadius);
this._value = newvalue * this._maxValue;
this.queue_repaint();
this.notify('value');
this.value = newvalue * this._maxValue;
}
_getMinimumIncrement() {

View File

@@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported Indicator */
const { Gio, St } = imports.gi;
const { Gio, GObject, St } = imports.gi;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
@@ -33,7 +33,8 @@ var Indicator = class extends PanelMenu.SystemIndicator {
this.menu.addMenuItem(this._item);
this._slider = new Slider.Slider(0);
this._slider.connect('notify::value', this._sliderChanged.bind(this));
this._sliderChangedId = this._slider.connect('notify::value',
this._sliderChanged.bind(this));
this._slider.accessible_name = _("Brightness");
let icon = new St.Icon({ icon_name: 'display-brightness-symbolic',
@@ -54,10 +55,16 @@ var Indicator = class extends PanelMenu.SystemIndicator {
this._proxy.Brightness = percent;
}
_changeSlider(value) {
GObject.signal_handler_block(this._slider, this._sliderChangedId);
this._slider.value = value;
GObject.signal_handler_unblock(this._slider, this._sliderChangedId);
}
_sync() {
let visible = this._proxy.Brightness >= 0;
this._item.visible = visible;
if (visible)
this._slider.value = this._proxy.Brightness / 100.0;
this._changeSlider(this._proxy.Brightness / 100.0);
}
};

View File

@@ -1,5 +1,5 @@
project('gnome-shell', 'c',
version: '3.33.90',
version: '3.33.91',
meson_version: '>= 0.47.0',
license: 'GPLv2+'
)
@@ -26,7 +26,7 @@ gio_req = '>= 2.56.0'
gi_req = '>= 1.49.1'
gjs_req = '>= 1.57.3'
gtk_req = '>= 3.15.0'
mutter_req = '>= 3.33.90'
mutter_req = '>= 3.33.91'
polkit_req = '>= 0.100'
schemas_req = '>= 3.33.1'
startup_req = '>= 0.11'
@@ -132,9 +132,20 @@ else
have_systemd = false
endif
if get_option('extensions_tool')
autoar_dep = dependency('gnome-autoar-0')
json_dep = dependency('json-glib-1.0')
endif
bash_completion = dependency('bash-completion', required: false)
if get_option('man')
xsltproc = find_program('xsltproc')
if get_option('extensions_tool')
a2x = find_program('a2x')
endif
subdir('man')
endif

View File

@@ -1,3 +1,9 @@
option('extensions_tool',
type: 'boolean',
value: true,
description: 'Build gnome-extensions CLI tool'
)
option('gtk_doc',
type: 'boolean',
value: false,

View File

@@ -72,6 +72,17 @@ js/ui/windowAttentionHandler.js
js/ui/windowManager.js
js/ui/windowMenu.js
src/calendar-server/evolution-calendar.desktop.in
src/extensions-tool/command-create.c
src/extensions-tool/command-disable.c
src/extensions-tool/command-enable.c
src/extensions-tool/command-info.c
src/extensions-tool/command-install.c
src/extensions-tool/command-list.c
src/extensions-tool/command-pack.c
src/extensions-tool/command-prefs.c
src/extensions-tool/command-reset.c
src/extensions-tool/command-uninstall.c
src/extensions-tool/main.c
src/main.c
src/shell-app.c
src/shell-app-system.c

1386
po/ca.po

File diff suppressed because it is too large Load Diff

1277
po/de.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

632
po/es.po

File diff suppressed because it is too large Load Diff

671
po/eu.po

File diff suppressed because it is too large Load Diff

1870
po/fa.po

File diff suppressed because it is too large Load Diff

1353
po/fi.po

File diff suppressed because it is too large Load Diff

631
po/fur.po

File diff suppressed because it is too large Load Diff

2524
po/gl.po

File diff suppressed because it is too large Load Diff

282
po/id.po
View File

@@ -9,8 +9,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gnome-shell master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell/issues\n"
"POT-Creation-Date: 2019-07-31 19:09+0000\n"
"PO-Revision-Date: 2019-08-06 17:48+0700\n"
"POT-Creation-Date: 2019-08-12 19:40+0000\n"
"PO-Revision-Date: 2019-08-16 15:37+0700\n"
"Last-Translator: Kukuh Syafaat <kukuhsyafaat@gnome.org>\n"
"Language-Team: Indonesian <gnome-l10n-id@googlegroups.com>\n"
"Language: id\n"
@@ -272,54 +272,47 @@ msgid "Keybinding to focus the active notification."
msgstr "Kombinasi tombol untuk fokus pada pemberitahuan yang aktif."
#: data/org.gnome.shell.gschema.xml.in:155
msgid ""
"Keybinding that pauses and resumes all running tweens, for debugging purposes"
msgstr ""
"Pengikatan tombol yang mengistirahatkan dan melanjutkan semua tween yang "
"sedang berjalan, untuk tujuan pengawakutuan"
#: data/org.gnome.shell.gschema.xml.in:160
msgid "Switch to application 1"
msgstr "Beralih ke aplikasi 1"
#: data/org.gnome.shell.gschema.xml.in:164
#: data/org.gnome.shell.gschema.xml.in:159
msgid "Switch to application 2"
msgstr "Beralih ke aplikasi 2"
#: data/org.gnome.shell.gschema.xml.in:168
#: data/org.gnome.shell.gschema.xml.in:163
msgid "Switch to application 3"
msgstr "Beralih ke aplikasi 3"
#: data/org.gnome.shell.gschema.xml.in:172
#: data/org.gnome.shell.gschema.xml.in:167
msgid "Switch to application 4"
msgstr "Beralih ke aplikasi 4"
#: data/org.gnome.shell.gschema.xml.in:176
#: data/org.gnome.shell.gschema.xml.in:171
msgid "Switch to application 5"
msgstr "Beralih ke aplikasi 5"
#: data/org.gnome.shell.gschema.xml.in:180
#: data/org.gnome.shell.gschema.xml.in:175
msgid "Switch to application 6"
msgstr "Beralih ke aplikasi 6"
#: data/org.gnome.shell.gschema.xml.in:184
#: data/org.gnome.shell.gschema.xml.in:179
msgid "Switch to application 7"
msgstr "Beralih ke aplikasi 7"
#: data/org.gnome.shell.gschema.xml.in:188
#: data/org.gnome.shell.gschema.xml.in:183
msgid "Switch to application 8"
msgstr "Beralih ke aplikasi 8"
#: data/org.gnome.shell.gschema.xml.in:192
#: data/org.gnome.shell.gschema.xml.in:187
msgid "Switch to application 9"
msgstr "Beralih ke aplikasi 9"
#: data/org.gnome.shell.gschema.xml.in:201
#: data/org.gnome.shell.gschema.xml.in:228
#: data/org.gnome.shell.gschema.xml.in:196
#: data/org.gnome.shell.gschema.xml.in:223
msgid "Limit switcher to current workspace."
msgstr "Batasi pengalih ke ruang kerja saat ini."
#: data/org.gnome.shell.gschema.xml.in:202
#: data/org.gnome.shell.gschema.xml.in:197
msgid ""
"If true, only applications that have windows on the current workspace are "
"shown in the switcher. Otherwise, all applications are included."
@@ -327,11 +320,11 @@ msgstr ""
"Bila berisi true, hanya aplikasi yang punya jendela pada ruang kerja saat "
"ini ditampilkan pada penukar. Bila tidak, semua aplikasi disertakan."
#: data/org.gnome.shell.gschema.xml.in:219
#: data/org.gnome.shell.gschema.xml.in:214
msgid "The application icon mode."
msgstr "Mode ikon aplikasi."
#: data/org.gnome.shell.gschema.xml.in:220
#: data/org.gnome.shell.gschema.xml.in:215
msgid ""
"Configures how the windows are shown in the switcher. Valid possibilities "
"are “thumbnail-only” (shows a thumbnail of the window), “app-icon-"
@@ -341,7 +334,7 @@ msgstr ""
"adalah \"thumbnail-only\" (menampilkan gambar mini dari jendela), \"app-icon-"
"only\" (hanya menampilkan ikon aplikasi), atau \"both\" (keduanya)."
#: data/org.gnome.shell.gschema.xml.in:229
#: data/org.gnome.shell.gschema.xml.in:224
msgid ""
"If true, only windows from the current workspace are shown in the switcher. "
"Otherwise, all windows are included."
@@ -349,51 +342,59 @@ msgstr ""
"Bila berisi true, hanya jendela dari ruang kerja saat ini ditampilkan pada "
"penukar. Bila tidak, semua jendela disertakan."
#: data/org.gnome.shell.gschema.xml.in:239
#: data/org.gnome.shell.gschema.xml.in:234
msgid "Locations"
msgstr "Lokasi"
#: data/org.gnome.shell.gschema.xml.in:235
msgid "The locations to show in world clocks"
msgstr "Lokasi untuk ditampilkan di jam dunia"
#: data/org.gnome.shell.gschema.xml.in:245
msgid "Automatic location"
msgstr "Lokasi otomatis"
#: data/org.gnome.shell.gschema.xml.in:240
#: data/org.gnome.shell.gschema.xml.in:246
msgid "Whether to fetch the current location or not"
msgstr "Apakah akan mengambil lokasi saat ini atau tidak"
#: data/org.gnome.shell.gschema.xml.in:247
#: data/org.gnome.shell.gschema.xml.in:253
msgid "Location"
msgstr "Lokasi"
#: data/org.gnome.shell.gschema.xml.in:248
#: data/org.gnome.shell.gschema.xml.in:254
msgid "The location for which to show a forecast"
msgstr "Lokasi yang menunjukkan perkiraan"
#: data/org.gnome.shell.gschema.xml.in:260
#: data/org.gnome.shell.gschema.xml.in:266
msgid "Attach modal dialog to the parent window"
msgstr "Mencantolkan dialog modal ke jendela induk"
#: data/org.gnome.shell.gschema.xml.in:261
#: data/org.gnome.shell.gschema.xml.in:270
#: data/org.gnome.shell.gschema.xml.in:278
#: data/org.gnome.shell.gschema.xml.in:286
#: data/org.gnome.shell.gschema.xml.in:294
#: data/org.gnome.shell.gschema.xml.in:267
#: data/org.gnome.shell.gschema.xml.in:276
#: data/org.gnome.shell.gschema.xml.in:284
#: data/org.gnome.shell.gschema.xml.in:292
#: data/org.gnome.shell.gschema.xml.in:300
msgid ""
"This key overrides the key in org.gnome.mutter when running GNOME Shell."
msgstr ""
"Kunci ini menimpa kunci dalam org.gnome.mutter ketika menjalankan GNOME "
"Shell."
#: data/org.gnome.shell.gschema.xml.in:269
#: data/org.gnome.shell.gschema.xml.in:275
msgid "Enable edge tiling when dropping windows on screen edges"
msgstr ""
"Memfungsikan pengubinan tepi ketika menjatuhkan jendela pada tepi layar"
#: data/org.gnome.shell.gschema.xml.in:277
#: data/org.gnome.shell.gschema.xml.in:283
msgid "Workspaces are managed dynamically"
msgstr "Ruang kerja dikelola secara dinamis"
#: data/org.gnome.shell.gschema.xml.in:285
#: data/org.gnome.shell.gschema.xml.in:291
msgid "Workspaces only on primary monitor"
msgstr "Ruang kerja hanya pada monitor primer"
#: data/org.gnome.shell.gschema.xml.in:293
#: data/org.gnome.shell.gschema.xml.in:299
msgid "Delay focus changes in mouse mode until the pointer stops moving"
msgstr ""
"Tunda perubahan fokus dalam mode tetikus sampai penunjuk berhenti bergerak"
@@ -456,7 +457,7 @@ msgstr ""
"Kami sangat menyesal, tetapi tidak mungkin mendapatkan daftar ekstensi yang "
"dipasang. Pastikan Anda masuk ke GNOME dan coba lagi."
#: js/gdm/authPrompt.js:140 js/ui/audioDeviceSelection.js:53
#: js/gdm/authPrompt.js:139 js/ui/audioDeviceSelection.js:53
#: js/ui/components/networkAgent.js:120 js/ui/components/polkitAgent.js:138
#: js/ui/endSessionDialog.js:445 js/ui/extensionDownloader.js:189
#: js/ui/shellMountOperation.js:390 js/ui/shellMountOperation.js:399
@@ -464,28 +465,28 @@ msgstr ""
msgid "Cancel"
msgstr "Batal"
#: js/gdm/authPrompt.js:159 js/gdm/authPrompt.js:202 js/gdm/authPrompt.js:433
#: js/gdm/authPrompt.js:158 js/gdm/authPrompt.js:201 js/gdm/authPrompt.js:433
msgid "Next"
msgstr "Selanjutnya"
#: js/gdm/authPrompt.js:198 js/ui/shellMountOperation.js:394
#: js/gdm/authPrompt.js:197 js/ui/shellMountOperation.js:394
#: js/ui/unlockDialog.js:42
msgid "Unlock"
msgstr "Buka Kunci"
#: js/gdm/authPrompt.js:200
#: js/gdm/authPrompt.js:199
msgctxt "button"
msgid "Sign In"
msgstr "Masuk"
#: js/gdm/loginDialog.js:301
#: js/gdm/loginDialog.js:299
msgid "Choose Session"
msgstr "Pilih Sesi"
#. translators: this message is shown below the user list on the
#. login screen. It can be activated to reveal an entry for
#. manually entering the username.
#: js/gdm/loginDialog.js:445
#: js/gdm/loginDialog.js:443
msgid "Not listed?"
msgstr "Tak masuk daftar?"
@@ -508,7 +509,7 @@ msgstr "Nama pengguna: "
msgid "Login Window"
msgstr "Jendela Log Masuk"
#: js/gdm/util.js:339
#: js/gdm/util.js:338
msgid "Authentication error"
msgstr "Galat autentikasi"
@@ -517,7 +518,7 @@ msgstr "Galat autentikasi"
#. as a cue to display our own message.
#. Translators: this message is shown below the password entry field
#. to indicate the user can swipe their finger instead
#: js/gdm/util.js:474
#: js/gdm/util.js:473
msgid "(or swipe finger)"
msgstr "(atau gesekkan jari)"
@@ -587,65 +588,65 @@ msgstr "Kunci Orientasi"
msgid "lock orientation;screen;rotation"
msgstr "kunci orientasi;layar;rotasi"
#: js/misc/util.js:119
#: js/misc/util.js:117
msgid "Command not found"
msgstr "Perintah tidak ditemukan"
#. Replace "Error invoking GLib.shell_parse_argv: " with
#. something nicer
#: js/misc/util.js:152
#: js/misc/util.js:150
msgid "Could not parse command:"
msgstr "Tak dapat mengurai perintah:"
#: js/misc/util.js:160
#: js/misc/util.js:158
#, javascript-format
msgid "Execution of “%s” failed:"
msgstr "Eksekusi \"%s\" gagal:"
#: js/misc/util.js:177
#: js/misc/util.js:175
msgid "Just now"
msgstr "Baru saja"
#: js/misc/util.js:179
#: js/misc/util.js:177
#, javascript-format
msgid "%d minute ago"
msgid_plural "%d minutes ago"
msgstr[0] "%d menit yang lalu"
msgstr[1] "%d menit yang lalu"
#: js/misc/util.js:182
#: js/misc/util.js:180
#, javascript-format
msgid "%d hour ago"
msgid_plural "%d hours ago"
msgstr[0] "%d jam yang lalu"
msgstr[1] "%d jam yang lalu"
#: js/misc/util.js:185
#: js/misc/util.js:183
msgid "Yesterday"
msgstr "Kemarin"
#: js/misc/util.js:187
#: js/misc/util.js:185
#, javascript-format
msgid "%d day ago"
msgid_plural "%d days ago"
msgstr[0] "%d hari yang lalu"
msgstr[1] "%d hari yang lalu"
#: js/misc/util.js:190
#: js/misc/util.js:188
#, javascript-format
msgid "%d week ago"
msgid_plural "%d weeks ago"
msgstr[0] "%d minggu yang lalu"
msgstr[1] "%d minggu yang lalu"
#: js/misc/util.js:193
#: js/misc/util.js:191
#, javascript-format
msgid "%d month ago"
msgid_plural "%d months ago"
msgstr[0] "%d bulan yang lalu"
msgstr[1] "%d bulan yang lalu"
#: js/misc/util.js:195
#: js/misc/util.js:193
#, javascript-format
msgid "%d year ago"
msgid_plural "%d years ago"
@@ -653,20 +654,20 @@ msgstr[0] "%d tahun yang lalu"
msgstr[1] "%d tahun yang lalu"
#. Translators: Time in 24h format
#: js/misc/util.js:225
#: js/misc/util.js:223
msgid "%H%M"
msgstr "%H%M"
#. Translators: this is the word "Yesterday" followed by a
#. time string in 24h format. i.e. "Yesterday, 14:30"
#: js/misc/util.js:231
#: js/misc/util.js:229
#, no-c-format
msgid "Yesterday, %H%M"
msgstr "Kemarin, %H:%M"
#. Translators: this is the week day name followed by a time
#. string in 24h format. i.e. "Monday, 14:30"
#: js/misc/util.js:237
#: js/misc/util.js:235
#, no-c-format
msgid "%A, %H%M"
msgstr "%A, %H%M"
@@ -674,7 +675,7 @@ msgstr "%A, %H%M"
#. Translators: this is the month name and day number
#. followed by a time string in 24h format.
#. i.e. "May 25, 14:30"
#: js/misc/util.js:243
#: js/misc/util.js:241
#, no-c-format
msgid "%B %-d, %H%M"
msgstr "%d %B, %H%M"
@@ -682,26 +683,26 @@ msgstr "%d %B, %H%M"
#. Translators: this is the month name, day number, year
#. number followed by a time string in 24h format.
#. i.e. "May 25 2012, 14:30"
#: js/misc/util.js:249
#: js/misc/util.js:247
#, no-c-format
msgid "%B %-d %Y, %H%M"
msgstr "%d %B %Y, %H%M"
#. Translators: Time in 12h format
#: js/misc/util.js:254
#: js/misc/util.js:252
msgid "%l%M %p"
msgstr "%H%M"
#. Translators: this is the word "Yesterday" followed by a
#. time string in 12h format. i.e. "Yesterday, 2:30 pm"
#: js/misc/util.js:260
#: js/misc/util.js:258
#, no-c-format
msgid "Yesterday, %l%M %p"
msgstr "Kemarin, %l%M %p"
#. Translators: this is the week day name followed by a time
#. string in 12h format. i.e. "Monday, 2:30 pm"
#: js/misc/util.js:266
#: js/misc/util.js:264
#, no-c-format
msgid "%A, %l%M %p"
msgstr "%A, %l%M %p"
@@ -709,7 +710,7 @@ msgstr "%A, %l%M %p"
#. Translators: this is the month name and day number
#. followed by a time string in 12h format.
#. i.e. "May 25, 2:30 pm"
#: js/misc/util.js:272
#: js/misc/util.js:270
#, no-c-format
msgid "%B %-d, %l%M %p"
msgstr "%d %B, %l%M %p"
@@ -717,7 +718,7 @@ msgstr "%d %B, %l%M %p"
#. Translators: this is the month name, day number, year
#. number followed by a time string in 12h format.
#. i.e. "May 25 2012, 2:30 pm"
#: js/misc/util.js:278
#: js/misc/util.js:276
#, no-c-format
msgid "%B %-d %Y, %l%M %p"
msgstr "%d %B %Y, %l%M %p"
@@ -746,40 +747,44 @@ msgstr "Tolak Akses"
msgid "Grant Access"
msgstr "Beri Akses"
#: js/ui/appDisplay.js:684
#: js/ui/appDisplay.js:854
msgid "Unnamed Folder"
msgstr "Folder Tanpa Nama"
#: js/ui/appDisplay.js:874
msgid "Frequently used applications will appear here"
msgstr "Aplikasi yang sering dipakai akan muncul di sini"
#: js/ui/appDisplay.js:799
#: js/ui/appDisplay.js:997
msgid "Frequent"
msgstr "Sering"
#: js/ui/appDisplay.js:806
#: js/ui/appDisplay.js:1004
msgid "All"
msgstr "Semua"
#. Translators: This is the heading of a list of open windows
#: js/ui/appDisplay.js:1771 js/ui/panel.js:78
#: js/ui/appDisplay.js:2233 js/ui/panel.js:77
msgid "Open Windows"
msgstr "Buka Jendela"
#: js/ui/appDisplay.js:1790 js/ui/panel.js:85
#: js/ui/appDisplay.js:2252 js/ui/panel.js:84
msgid "New Window"
msgstr "Jendela Baru"
#: js/ui/appDisplay.js:1804
#: js/ui/appDisplay.js:2264
msgid "Launch using Dedicated Graphics Card"
msgstr "Luncurkan menggunakan Kartu Grafis Terdedikasi"
#: js/ui/appDisplay.js:1831 js/ui/dash.js:240
#: js/ui/appDisplay.js:2293 js/ui/dash.js:240
msgid "Remove from Favorites"
msgstr "Hapus dari Favorit"
#: js/ui/appDisplay.js:1837
#: js/ui/appDisplay.js:2299
msgid "Add to Favorites"
msgstr "Tambah ke Favorit"
#: js/ui/appDisplay.js:1847 js/ui/panel.js:96
#: js/ui/appDisplay.js:2309 js/ui/panel.js:95
msgid "Show Details"
msgstr "Tampilkan Rincian"
@@ -809,7 +814,7 @@ msgstr "Headphone"
msgid "Headset"
msgstr "Headset"
#: js/ui/audioDeviceSelection.js:64 js/ui/status/volume.js:240
#: js/ui/audioDeviceSelection.js:64 js/ui/status/volume.js:241
msgid "Microphone"
msgstr "Mikrofon"
@@ -949,12 +954,12 @@ msgid "Clear"
msgstr "Bersihkan"
#. Translators: %s is an application name
#: js/ui/closeDialog.js:43
#: js/ui/closeDialog.js:42
#, javascript-format
msgid "“%s” is not responding."
msgstr "\"%s\" tidak merespon."
#: js/ui/closeDialog.js:44
#: js/ui/closeDialog.js:43
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
@@ -962,11 +967,11 @@ msgstr ""
"Anda dapat memilih untuk menunggu sebentar untuk melanjutkan atau memaksa "
"aplikasi keluar."
#: js/ui/closeDialog.js:60
#: js/ui/closeDialog.js:59
msgid "Force Quit"
msgstr "Tutup Paksa"
#: js/ui/closeDialog.js:63
#: js/ui/closeDialog.js:62
msgid "Wait"
msgstr "Tunggu"
@@ -1113,7 +1118,7 @@ msgstr "Maaf, tidak berhasil. Silakan coba lagi."
msgid "%s is now known as %s"
msgstr "%s sekarang dikenal sebagai %s"
#: js/ui/ctrlAltTab.js:21 js/ui/viewSelector.js:170
#: js/ui/ctrlAltTab.js:21 js/ui/viewSelector.js:169
msgid "Windows"
msgstr "Jendela"
@@ -1123,7 +1128,7 @@ msgstr "Tampilkan Aplikasi"
#. Translators: this is the name of the dock/favorites area on
#. the left of the overview
#: js/ui/dash.js:391
#: js/ui/dash.js:390
msgid "Dash"
msgstr "Dash"
@@ -1132,7 +1137,7 @@ msgstr "Dash"
#. * "Tue 9:29 AM"). The string itself should become a full date, e.g.,
#. * "February 17 2015".
#.
#: js/ui/dateMenu.js:63
#: js/ui/dateMenu.js:68
msgid "%B %-d %Y"
msgstr "%e %B %Y"
@@ -1140,35 +1145,35 @@ msgstr "%e %B %Y"
#. * below the time in the shell; it should combine the weekday and the
#. * date, e.g. "Tuesday February 17 2015".
#.
#: js/ui/dateMenu.js:70
#: js/ui/dateMenu.js:75
msgid "%A %B %e %Y"
msgstr "%A %e %B %Y"
#: js/ui/dateMenu.js:132
#: js/ui/dateMenu.js:149
msgid "Add world clocks…"
msgstr "Tambah jam dunia…"
#: js/ui/dateMenu.js:133
#: js/ui/dateMenu.js:150
msgid "World Clocks"
msgstr "Jam Dunia"
#: js/ui/dateMenu.js:229
#: js/ui/dateMenu.js:265
msgid "Weather"
msgstr "Cuaca"
#: js/ui/dateMenu.js:312
#: js/ui/dateMenu.js:348
msgid "Select a location…"
msgstr "Pilih lokasi…"
#: js/ui/dateMenu.js:320
#: js/ui/dateMenu.js:356
msgid "Loading…"
msgstr "Memuat…"
#: js/ui/dateMenu.js:330
#: js/ui/dateMenu.js:366
msgid "Go online for weather information"
msgstr "Pergi daring untuk informasi cuaca"
#: js/ui/dateMenu.js:332
#: js/ui/dateMenu.js:368
msgid "Weather information is currently unavailable"
msgstr "Informasi cuaca saat ini tidak tersedia"
@@ -1417,59 +1422,59 @@ msgstr "Matikan"
msgid "Leave Off"
msgstr "Biarkan Mati"
#: js/ui/keyboard.js:201
#: js/ui/keyboard.js:200
msgid "Region & Language Settings"
msgstr "Pengaturan Wilayah & Bahasa"
#: js/ui/lookingGlass.js:621
#: js/ui/lookingGlass.js:624
msgid "No extensions installed"
msgstr "Tak ada ekstensi terpasang"
#. Translators: argument is an extension UUID.
#: js/ui/lookingGlass.js:676
#: js/ui/lookingGlass.js:679
#, javascript-format
msgid "%s has not emitted any errors."
msgstr "%s tidak menampilkan galat apa pun."
#: js/ui/lookingGlass.js:682
#: js/ui/lookingGlass.js:685
msgid "Hide Errors"
msgstr "Sembunyikan Galat"
#: js/ui/lookingGlass.js:686 js/ui/lookingGlass.js:745
#: js/ui/lookingGlass.js:689 js/ui/lookingGlass.js:748
msgid "Show Errors"
msgstr "Tampilkan Galat"
#: js/ui/lookingGlass.js:695
#: js/ui/lookingGlass.js:698
msgid "Enabled"
msgstr "Diaktifkan"
#. translators:
#. * The device has been disabled
#: js/ui/lookingGlass.js:698 subprojects/gvc/gvc-mixer-control.c:1864
#: js/ui/lookingGlass.js:701 subprojects/gvc/gvc-mixer-control.c:1864
msgid "Disabled"
msgstr "Dinonaktifkan"
#: js/ui/lookingGlass.js:700
#: js/ui/lookingGlass.js:703
msgid "Error"
msgstr "Galat"
#: js/ui/lookingGlass.js:702
#: js/ui/lookingGlass.js:705
msgid "Out of date"
msgstr "Kadaluarsa"
#: js/ui/lookingGlass.js:704
#: js/ui/lookingGlass.js:707
msgid "Downloading"
msgstr "Mengunduh"
#: js/ui/lookingGlass.js:727
#: js/ui/lookingGlass.js:730
msgid "View Source"
msgstr "Tilik Sumber"
#: js/ui/lookingGlass.js:736
#: js/ui/lookingGlass.js:739
msgid "Web Page"
msgstr "Halaman Web"
#: js/ui/messageTray.js:1480
#: js/ui/messageTray.js:1462
msgid "System Information"
msgstr "Informasi Sistem"
@@ -1481,13 +1486,13 @@ msgstr "Artis tak dikenal"
msgid "Unknown title"
msgstr "Judul tak dikenal"
#: js/ui/overview.js:74
#: js/ui/overview.js:73
msgid "Undo"
msgstr "Batal"
#. Translators: This is the main view to select
#. activities. See also note for "Activities" string.
#: js/ui/overview.js:101
#: js/ui/overview.js:100
msgid "Overview"
msgstr "Gambaran"
@@ -1495,7 +1500,7 @@ msgstr "Gambaran"
#. in the search entry when no search is
#. active; it should not exceed ~30
#. characters.
#: js/ui/overview.js:227
#: js/ui/overview.js:230
msgid "Type to search…"
msgstr "Ketik untuk mencari…"
@@ -1543,30 +1548,30 @@ msgstr "Tekan Esc untuk keluar"
msgid "Press any key to exit"
msgstr "Tekan tombol apa saja untuk keluar"
#: js/ui/panel.js:112
#: js/ui/panel.js:111
msgid "Quit"
msgstr "Keluar"
#. Translators: If there is no suitable word for "Activities"
#. in your language, you can use the word for "Overview".
#: js/ui/panel.js:429
#: js/ui/panel.js:428
msgid "Activities"
msgstr "Aktivitas"
#: js/ui/panel.js:702
#: js/ui/panel.js:701
msgctxt "System menu in the top bar"
msgid "System"
msgstr "Sistem"
#: js/ui/panel.js:821
#: js/ui/panel.js:820
msgid "Top Bar"
msgstr "Bar Atas"
#: js/ui/runDialog.js:59
#: js/ui/runDialog.js:58
msgid "Enter a Command"
msgstr "Ketikkan Perintah"
#: js/ui/runDialog.js:99 js/ui/windowMenu.js:167
#: js/ui/runDialog.js:98 js/ui/windowMenu.js:167
msgid "Close"
msgstr "Tutup"
@@ -1580,29 +1585,29 @@ msgstr "Memulai ulang…"
#. Translators: This is a time format for a date in
#. long format
#: js/ui/screenShield.js:75
#: js/ui/screenShield.js:73
msgid "%A, %B %d"
msgstr "%A, %d %B"
#: js/ui/screenShield.js:131
#: js/ui/screenShield.js:129
#, javascript-format
msgid "%d new message"
msgid_plural "%d new messages"
msgstr[0] "%d pesan baru"
msgstr[1] "%d pesan baru"
#: js/ui/screenShield.js:133
#: js/ui/screenShield.js:131
#, javascript-format
msgid "%d new notification"
msgid_plural "%d new notifications"
msgstr[0] "%d pemberitahuan baru"
msgstr[1] "%d pemberitahuan baru"
#: js/ui/screenShield.js:446 js/ui/status/system.js:269
#: js/ui/screenShield.js:444 js/ui/status/system.js:269
msgid "Lock"
msgstr "Kunci"
#: js/ui/screenShield.js:710
#: js/ui/screenShield.js:708
msgid "GNOME needs to lock the screen"
msgstr "GNOME perlu mengunci layar"
@@ -1621,15 +1626,15 @@ msgstr "Tak bisa mengunci"
msgid "Lock was blocked by an application"
msgstr "Kunci diblokir oleh suatu aplikasi"
#: js/ui/search.js:639
#: js/ui/search.js:647
msgid "Searching…"
msgstr "Mencari…"
#: js/ui/search.js:641
#: js/ui/search.js:649
msgid "No results."
msgstr "Tak ada yang cocok."
#: js/ui/search.js:765
#: js/ui/search.js:773
#, javascript-format
msgid "%d more"
msgid_plural "%d more"
@@ -2171,11 +2176,11 @@ msgstr "Autorisasi Thunderbolt galat"
msgid "Could not authorize the Thunderbolt device: %s"
msgstr "Tidak dapat mengautorisasi perangkat Thunderbolt: %s"
#: js/ui/status/volume.js:127
#: js/ui/status/volume.js:128
msgid "Volume changed"
msgstr "Volume diubah"
#: js/ui/status/volume.js:192
#: js/ui/status/volume.js:193
msgid "Volume"
msgstr "Volume"
@@ -2215,11 +2220,11 @@ msgstr "Masuk sebagai pengguna lain"
msgid "Unlock Window"
msgstr "Buka Kunci Jendela"
#: js/ui/viewSelector.js:174
#: js/ui/viewSelector.js:173
msgid "Applications"
msgstr "Aplikasi"
#: js/ui/viewSelector.js:178
#: js/ui/viewSelector.js:177
msgid "Search"
msgstr "Cari"
@@ -2228,22 +2233,22 @@ msgstr "Cari"
msgid "“%s” is ready"
msgstr "“%s” siap"
#: js/ui/windowManager.js:55
#: js/ui/windowManager.js:54
msgid "Do you want to keep these display settings?"
msgstr "Apakah Anda ingin mempertahankan pengaturan tampilan ini?"
#. Translators: this and the following message should be limited in length,
#. to avoid ellipsizing the labels.
#.
#: js/ui/windowManager.js:67
#: js/ui/windowManager.js:66
msgid "Revert Settings"
msgstr "Balikkan Tatanan"
#: js/ui/windowManager.js:70
#: js/ui/windowManager.js:69
msgid "Keep Changes"
msgstr "Simpan Perubahan"
#: js/ui/windowManager.js:88
#: js/ui/windowManager.js:87
#, javascript-format
msgid "Settings changes will revert in %d second"
msgid_plural "Settings changes will revert in %d seconds"
@@ -2252,7 +2257,7 @@ msgstr[1] "Perubahan tatanan akan dikembalikan dalam %d detik"
#. Translators: This represents the size of a window. The first number is
#. * the width of the window and the second is the height.
#: js/ui/windowManager.js:678
#: js/ui/windowManager.js:683
#, javascript-format
msgid "%d × %d"
msgstr "%d × %d"
@@ -2325,19 +2330,19 @@ msgstr "Pindahkan ke Monitor Kanan"
msgid "Evolution Calendar"
msgstr "Evolution Kalender"
#: src/main.c:464
#: src/main.c:460
msgid "Print version"
msgstr "Versi Cetak"
#: src/main.c:470
#: src/main.c:466
msgid "Mode used by GDM for login screen"
msgstr "Mode yang dipakai oleh layar log masuk GDM"
#: src/main.c:476
#: src/main.c:472
msgid "Use a specific mode, e.g. “gdm” for login screen"
msgstr "Menggunakan mode tertentu, mis. \"gdm\" untuk layar masuk"
#: src/main.c:482
#: src/main.c:478
msgid "List possible modes"
msgstr "Menampilkan mode yang mungkin"
@@ -2359,7 +2364,7 @@ msgstr "Sandi tidak cocok."
msgid "Password cannot be blank"
msgstr "Sandi tidak boleh kosong"
#: src/shell-polkit-authentication-agent.c:348
#: src/shell-polkit-authentication-agent.c:344
msgid "Authentication dialog was dismissed by the user"
msgstr "Dialog autentikasi ditolak oleh pengguna"
@@ -2385,6 +2390,13 @@ msgstr[1] "%u Masukan"
msgid "System Sounds"
msgstr "Suara Sistem"
#~ msgid ""
#~ "Keybinding that pauses and resumes all running tweens, for debugging "
#~ "purposes"
#~ msgstr ""
#~ "Pengikatan tombol yang mengistirahatkan dan melanjutkan semua tween yang "
#~ "sedang berjalan, untuk tujuan pengawakutuan"
#~ msgid "Which keyboard to use"
#~ msgstr "Papan tik mana yang akan dipakai"

1040
po/is.po

File diff suppressed because it is too large Load Diff

1297
po/ja.po

File diff suppressed because it is too large Load Diff

1019
po/lt.po

File diff suppressed because it is too large Load Diff

1367
po/lv.po

File diff suppressed because it is too large Load Diff

1700
po/ne.po

File diff suppressed because it is too large Load Diff

1374
po/pl.po

File diff suppressed because it is too large Load Diff

627
po/ro.po

File diff suppressed because it is too large Load Diff

1365
po/sl.po

File diff suppressed because it is too large Load Diff

622
po/sv.po

File diff suppressed because it is too large Load Diff

675
src/extensions-tool/COPYING Normal file
View File

@@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -0,0 +1,289 @@
/* command-create.c
*
* Copyright 2018 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gio/gunixinputstream.h>
#include "commands.h"
#include "common.h"
#include "config.h"
static char *
get_shell_version (GError **error)
{
g_autoptr (GDBusProxy) proxy = NULL;
g_autoptr (GVariant) variant = NULL;
g_auto (GStrv) split_version = NULL;
proxy = get_shell_proxy (error);
if (proxy == NULL)
return NULL;
variant = g_dbus_proxy_get_cached_property (proxy, "ShellVersion");
if (variant == NULL)
return NULL;
split_version = g_strsplit (g_variant_get_string (variant, NULL), ".", 3);
if (g_ascii_strtoll (split_version[1], NULL, 10) % 2 == 0)
g_clear_pointer (&split_version[2], g_free);
return g_strjoinv (".", split_version);
}
static gboolean
create_metadata (GFile *target_dir,
const char *uuid,
const char *name,
const char *description,
GError **error)
{
g_autoptr (GFile) target = NULL;
g_autoptr (GString) json = NULL;
g_autofree char *version = NULL;
version = get_shell_version (error);
if (version == NULL)
return FALSE;
json = g_string_new ("{\n");
g_string_append_printf (json, " \"name\": \"%s\",\n", name);
g_string_append_printf (json, " \"description\": \"%s\",\n", description);
g_string_append_printf (json, " \"uuid\": \"%s\",\n", uuid);
g_string_append_printf (json, " \"shell-version\": [\n");
g_string_append_printf (json, " \"%s\"\n", version);
g_string_append_printf (json, " ]\n}\n");
target = g_file_get_child (target_dir, "metadata.json");
return g_file_replace_contents (target,
json->str,
json->len,
NULL,
FALSE,
0,
NULL,
NULL,
error);
}
#define TEMPLATE_PATH "/org/gnome/extensions-tool/template"
static gboolean
copy_extension_template (GFile *target_dir, GError **error)
{
g_auto (GStrv) templates;
char **s;
templates = g_resources_enumerate_children (TEMPLATE_PATH, 0, NULL);
for (s = templates; *s; s++)
{
g_autoptr (GFile) target = NULL;
g_autoptr (GFile) source = NULL;
g_autofree char *uri = NULL;
uri = g_strdup_printf ("resource://%s/%s", TEMPLATE_PATH, *s);
source = g_file_new_for_uri (uri);
target = g_file_get_child (target_dir, *s);
if (!g_file_copy (source, target, G_FILE_COPY_TARGET_DEFAULT_PERMS, NULL, NULL, NULL, error))
return FALSE;
}
return TRUE;
}
static gboolean
launch_extension_source (GFile *dir, GError **error)
{
g_autoptr (GFile) main_source = NULL;
g_autoptr (GAppInfo) handler = NULL;
GList l;
main_source = g_file_get_child (dir, "extension.js");
handler = g_file_query_default_handler (main_source, NULL, error);
if (handler == NULL)
return FALSE;
l.data = main_source;
l.next = l.prev = NULL;
return g_app_info_launch (handler, &l, NULL, error);
}
static gboolean
create_extension (const char *uuid, const char *name, const char *description)
{
g_autoptr (GFile) dir = NULL;
g_autoptr (GError) error = NULL;
dir = g_file_new_build_filename (g_get_user_data_dir (),
"gnome-shell",
"extensions",
uuid,
NULL);
if (!g_file_make_directory_with_parents (dir, NULL, &error))
{
g_printerr ("%s\n", error->message);
return FALSE;
}
if (!create_metadata (dir, uuid, name, description, &error))
{
g_printerr ("%s\n", error->message);
return FALSE;
}
if (!copy_extension_template (dir, &error))
{
g_printerr ("%s\n", error->message);
return FALSE;
}
if (!launch_extension_source (dir, &error))
{
g_printerr ("%s\n", error->message);
return FALSE;
}
return TRUE;
}
static void
prompt_metadata (char **uuid, char **name, char **description)
{
g_autoptr (GInputStream) stdin = NULL;
g_autoptr (GDataInputStream) istream = NULL;
if ((uuid == NULL || *uuid != NULL) &&
(name == NULL || *name != NULL) &&
(description == NULL || *description != NULL))
return;
stdin = g_unix_input_stream_new (0, FALSE);
istream = g_data_input_stream_new (stdin);
if (name != NULL && *name == NULL)
{
char *line;
g_print (
_("Name should be a very short (ideally descriptive) string.\n"
"Examples are: %s"),
"“Click To Focus”, “Adblock”, “Shell Window Shrinker”\n");
g_print ("%s: ", _("Name"));
line = g_data_input_stream_read_line_utf8 (istream, NULL, NULL, NULL);
*name = g_strdelimit (line, "\n", '\0');
}
if (description != NULL && *description == NULL)
{
char *line;
g_print (
_("Description is a single-sentence explanation of what your extension does.\n"
"Examples are: %s"),
"“Make windows visible on click”, “Block advertisement popups”, “Animate windows shrinking on minimize”\n");
g_print ("%s: ", _("Description"));
line = g_data_input_stream_read_line_utf8 (istream, NULL, NULL, NULL);
*description = g_strdelimit (line, "\n", '\0');
}
if (uuid != NULL && *uuid == NULL)
{
char *line;
g_print (
_("UUID is a globally-unique identifier for your extension.\n"
"This should be in the format of an email address (clicktofocus@janedoe.example.com)\n"));
g_print ("UUID: ");
line = g_data_input_stream_read_line_utf8 (istream, NULL, NULL, NULL);
*uuid = g_strdelimit (line, "\n", '\0');
}
}
int
handle_create (int argc, char *argv[], gboolean do_help)
{
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
g_autofree char *name = NULL;
g_autofree char *description = NULL;
g_autofree char *uuid = NULL;
gboolean interactive = FALSE;
GOptionEntry entries[] = {
{ .long_name = "uuid",
.arg = G_OPTION_ARG_STRING, .arg_data = &uuid,
.arg_description = "UUID",
.description = _("The unique identifier of the new extension") },
{ .long_name = "name",
.arg = G_OPTION_ARG_STRING, .arg_data = &name,
.arg_description = _("NAME"),
.description = _("The user-visible name of the new extension") },
{ .long_name = "description",
.arg_description = _("DESCRIPTION"),
.arg = G_OPTION_ARG_STRING, .arg_data = &description,
.description = _("A short description of what the extension does") },
{ .long_name = "interactive", .short_name = 'i',
.arg = G_OPTION_ARG_NONE, .arg_data = &interactive,
.description = _("Enter extension information interactively") },
{ NULL }
};
g_set_prgname ("gnome-extensions create");
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Create a new extension"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (do_help)
{
show_help (context, NULL);
return 0;
}
if (!g_option_context_parse (context, &argc, &argv, &error))
{
show_help (context, error->message);
return 1;
}
if (argc > 1)
{
show_help (context, _("Unknown arguments"));
return 1;
}
if (interactive)
prompt_metadata (&uuid, &name, &description);
if (uuid == NULL || name == NULL || description == NULL)
{
show_help (context, _("UUID, name and description are required"));
return 1;
}
return create_extension (uuid, name, description) ? 0 : 2;
}

View File

@@ -0,0 +1,84 @@
/* command-disable.c
*
* Copyright 2018 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib/gi18n.h>
#include <gio/gio.h>
#include "commands.h"
#include "common.h"
#include "config.h"
static gboolean
disable_extension (const char *uuid)
{
g_autoptr(GSettings) settings = get_shell_settings ();
if (settings == NULL)
return FALSE;
return settings_list_remove (settings, "enabled-extensions", uuid) &&
settings_list_add (settings, "disabled-extensions", uuid);
}
int
handle_disable (int argc, char *argv[], gboolean do_help)
{
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
g_auto(GStrv) uuids = NULL;
GOptionEntry entries[] = {
{ .long_name = G_OPTION_REMAINING,
.arg_description = "UUID",
.arg = G_OPTION_ARG_STRING_ARRAY, .arg_data = &uuids },
{ NULL }
};
g_set_prgname ("gnome-extensions disable");
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Disable an extension"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (do_help)
{
show_help (context, NULL);
return 0;
}
if (!g_option_context_parse (context, &argc, &argv, &error))
{
show_help (context, error->message);
return 1;
}
if (uuids == NULL)
{
show_help (context, _("No UUID given"));
return 1;
}
else if (g_strv_length (uuids) > 1)
{
show_help (context, _("More than one UUID given"));
return 1;
}
return disable_extension (*uuids) ? 0 : 2;
}

View File

@@ -0,0 +1,84 @@
/* command-enable.c
*
* Copyright 2018 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib/gi18n.h>
#include <gio/gio.h>
#include "commands.h"
#include "common.h"
#include "config.h"
static gboolean
enable_extension (const char *uuid)
{
g_autoptr(GSettings) settings = get_shell_settings ();
if (settings == NULL)
return FALSE;
return settings_list_add (settings, "enabled-extensions", uuid) &&
settings_list_remove (settings, "disabled-extensions", uuid);
}
int
handle_enable (int argc, char *argv[], gboolean do_help)
{
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
g_auto(GStrv) uuids = NULL;
GOptionEntry entries[] = {
{ .long_name = G_OPTION_REMAINING,
.arg_description = "UUID",
.arg = G_OPTION_ARG_STRING_ARRAY, .arg_data = &uuids },
{ NULL }
};
g_set_prgname ("gnome-extensions enable");
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Enable an extension"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (do_help)
{
show_help (context, NULL);
return 0;
}
if (!g_option_context_parse (context, &argc, &argv, &error))
{
show_help (context, error->message);
return 1;
}
if (uuids == NULL)
{
show_help (context, _("No UUID given"));
return 1;
}
else if (g_strv_length (uuids) > 1)
{
show_help (context, _("More than one UUID given"));
return 1;
}
return enable_extension (*uuids) ? 0 : 2;
}

View File

@@ -0,0 +1,106 @@
/* commands-info.c
*
* Copyright 2018 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib/gi18n.h>
#include <gio/gio.h>
#include "commands.h"
#include "common.h"
#include "config.h"
static gboolean
show_extension_info (const char *uuid)
{
g_autoptr (GDBusProxy) proxy = NULL;
g_autoptr (GVariant) response = NULL;
g_autoptr (GVariant) asv = NULL;
g_autoptr (GVariantDict) info = NULL;
g_autoptr (GError) error = NULL;
proxy = get_shell_proxy (&error);
if (proxy == NULL)
return FALSE;
response = g_dbus_proxy_call_sync (proxy,
"GetExtensionInfo",
g_variant_new ("(s)", uuid),
0,
-1,
NULL,
&error);
if (response == NULL)
return FALSE;
asv = g_variant_get_child_value (response, 0);
info = g_variant_dict_new (asv);
if (!g_variant_dict_contains (info, "uuid"))
return FALSE;
print_extension_info (info, DISPLAY_DETAILED);
return TRUE;
}
int
handle_info (int argc, char *argv[], gboolean do_help)
{
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
g_auto(GStrv) uuids = NULL;
GOptionEntry entries[] = {
{ .long_name = G_OPTION_REMAINING,
.arg_description = "UUID",
.arg = G_OPTION_ARG_STRING_ARRAY, .arg_data = &uuids },
{ NULL }
};
g_set_prgname ("gnome-extensions info");
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Show extensions info"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (do_help)
{
show_help (context, NULL);
return 0;
}
if (!g_option_context_parse (context, &argc, &argv, &error))
{
show_help (context, error->message);
return 1;
}
if (uuids == NULL)
{
show_help (context, _("No UUID given"));
return 1;
}
else if (g_strv_length (uuids) > 1)
{
show_help (context, _("More than one UUID given"));
return 1;
}
return show_extension_info (*uuids) ? 0 : 2;
}

View File

@@ -0,0 +1,212 @@
/* command-install.c
*
* Copyright 2018 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gnome-autoar/gnome-autoar.h>
#include <json-glib/json-glib.h>
#include "commands.h"
#include "common.h"
#include "config.h"
static JsonObject *
load_metadata (GFile *dir,
GError **error)
{
g_autoptr (JsonParser) parser = NULL;
g_autoptr (GInputStream) stream = NULL;
g_autoptr (GFile) file = NULL;
file = g_file_get_child (dir, "metadata.json");
stream = G_INPUT_STREAM (g_file_read (file, NULL, error));
if (stream == NULL)
return NULL;
parser = json_parser_new_immutable ();
if (!json_parser_load_from_stream (parser, stream, NULL, error))
return NULL;
return json_node_dup_object (json_parser_get_root (parser));
}
static void
on_error (AutoarExtractor *extractor,
GError *error,
gpointer data)
{
*((GError **)data) = g_error_copy (error);
}
static GFile *
on_decide_destination (AutoarExtractor *extractor,
GFile *dest,
GList *files,
gpointer data)
{
g_autofree char *dest_path = NULL;
GFile *new_dest;
int copy = 1;
dest_path = g_file_get_path (dest);
new_dest = g_object_ref (dest);
while (g_file_query_exists (new_dest, NULL))
{
g_autofree char *new_path = g_strdup_printf ("%s (%d)", dest_path, copy);
g_object_unref (new_dest);
new_dest = g_file_new_for_path (new_path);
copy++;
}
*((GFile **)data) = g_object_ref (new_dest);
return new_dest;
}
static int
install_extension (const char *bundle,
gboolean force)
{
g_autoptr (AutoarExtractor) extractor = NULL;
g_autoptr (JsonObject) metadata = NULL;
g_autoptr (GFile) cachedir = NULL;
g_autoptr (GFile) tmpdir = NULL;
g_autoptr (GFile) src = NULL;
g_autoptr (GFile) dst = NULL;
g_autoptr (GFile) dstdir = NULL;
g_autoptr (GError) error = NULL;
g_autofree char *cwd = NULL;
const char *uuid;
cwd = g_get_current_dir ();
src = g_file_new_for_commandline_arg_and_cwd (bundle, cwd);
cachedir = g_file_new_for_path (g_get_user_cache_dir ());
extractor = autoar_extractor_new (src, cachedir);
g_signal_connect (extractor, "error", G_CALLBACK (on_error), &error);
g_signal_connect (extractor, "decide-destination", G_CALLBACK (on_decide_destination), &tmpdir);
autoar_extractor_start (extractor, NULL);
if (error != NULL)
goto err;
metadata = load_metadata (tmpdir, &error);
if (metadata == NULL)
goto err;
dstdir = g_file_new_build_filename (g_get_user_data_dir (),
"gnome-shell", "extensions", NULL);
if (!g_file_make_directory_with_parents (dstdir, NULL, &error))
{
if (error->code == G_IO_ERROR_EXISTS)
g_clear_error (&error);
else
goto err;
}
uuid = json_object_get_string_member (metadata, "uuid");
dst = g_file_get_child (dstdir, uuid);
if (g_file_query_exists (dst, NULL))
{
if (!force)
{
g_set_error (&error, G_IO_ERROR, G_IO_ERROR_EXISTS,
"%s exists and --force was not specified", uuid);
goto err;
}
else if (!file_delete_recursively (dst, &error))
{
goto err;
}
}
if (!g_file_move (tmpdir, dst, G_FILE_COPY_NONE, NULL, NULL, NULL, &error))
goto err;
return 0;
err:
if (error != NULL)
g_printerr ("%s\n", error->message);
if (tmpdir != NULL)
file_delete_recursively (tmpdir, NULL);
return 2;
}
int
handle_install (int argc, char *argv[], gboolean do_help)
{
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
g_auto (GStrv) filenames = NULL;
gboolean force = FALSE;
GOptionEntry entries[] = {
{ .long_name = "force", .short_name = 'f',
.arg = G_OPTION_ARG_NONE, .arg_data = &force,
.description = _("Overwrite an existing extension") },
{ .long_name = G_OPTION_REMAINING,
.arg_description =_("EXTENSION_BUNDLE"),
.arg = G_OPTION_ARG_FILENAME_ARRAY, .arg_data = &filenames },
{ NULL }
};
g_set_prgname ("gnome-extensions install");
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Install an extension bundle"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (do_help)
{
show_help (context, NULL);
return 0;
}
if (!g_option_context_parse (context, &argc, &argv, &error))
{
show_help (context, error->message);
return 1;
}
if (filenames == NULL)
{
show_help (context, _("No extension bundle specified"));
return 1;
}
if (g_strv_length (filenames) > 1)
{
show_help (context, _("More than one extension bundle specified"));
return 1;
}
return install_extension (*filenames, force);
}

View File

@@ -0,0 +1,179 @@
/* command-list.c
*
* Copyright 2018 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib/gi18n.h>
#include <gio/gio.h>
#include "commands.h"
#include "common.h"
#include "config.h"
typedef enum {
LIST_FLAGS_NONE = 0,
LIST_FLAGS_USER = 1 << 0,
LIST_FLAGS_SYSTEM = 1 << 1,
LIST_FLAGS_ENABLED = 1 << 2,
LIST_FLAGS_DISABLED = 1 << 3,
LIST_FLAGS_NO_PREFS = 1 << 4
} ListFilterFlags;
static gboolean
list_extensions (ListFilterFlags filter, DisplayFormat format)
{
g_autoptr (GDBusProxy) proxy = NULL;
g_autoptr (GVariant) response = NULL;
g_autoptr (GVariant) extensions = NULL;
g_autoptr (GError) error = NULL;
gboolean needs_newline = FALSE;
GVariantIter iter;
GVariant *value;
char *uuid;
proxy = get_shell_proxy (&error);
if (proxy == NULL)
return FALSE;
response = g_dbus_proxy_call_sync (proxy,
"ListExtensions",
NULL,
0,
-1,
NULL,
&error);
if (response == NULL)
return FALSE;
extensions = g_variant_get_child_value (response, 0);
g_variant_iter_init (&iter, extensions);
while (g_variant_iter_loop (&iter, "{s@a{sv}}", &uuid, &value))
{
g_autoptr (GVariantDict) info = NULL;
double type, state;
gboolean has_prefs;
info = g_variant_dict_new (value);
g_variant_dict_lookup (info, "type", "d", &type);
g_variant_dict_lookup (info, "state", "d", &state);
g_variant_dict_lookup (info, "hasPrefs", "b", &has_prefs);
if (type == TYPE_USER && (filter & LIST_FLAGS_USER) == 0)
continue;
if (type == TYPE_SYSTEM && (filter & LIST_FLAGS_SYSTEM) == 0)
continue;
if (state == STATE_ENABLED && (filter & LIST_FLAGS_ENABLED) == 0)
continue;
if (state != STATE_ENABLED && (filter & LIST_FLAGS_DISABLED) == 0)
continue;
if (!has_prefs && (filter & LIST_FLAGS_NO_PREFS) == 0)
continue;
if (needs_newline)
g_print ("\n");
print_extension_info (info, format);
needs_newline = (format != DISPLAY_ONELINE);
}
return TRUE;
}
int
handle_list (int argc, char *argv[], gboolean do_help)
{
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
int flags = LIST_FLAGS_NONE;
gboolean details = FALSE;
gboolean user = FALSE;
gboolean system = FALSE;
gboolean enabled = FALSE;
gboolean disabled = FALSE;
gboolean has_prefs = FALSE;
GOptionEntry entries[] = {
{ .long_name = "user",
.arg = G_OPTION_ARG_NONE, .arg_data = &user,
.description = _("Show user-installed extensions") },
{ .long_name = "system",
.arg = G_OPTION_ARG_NONE, .arg_data = &system,
.description = _("Show system-installed extensions") },
{ .long_name = "enabled",
.arg = G_OPTION_ARG_NONE, .arg_data = &enabled,
.description = _("Show enabled extensions") },
{ .long_name = "disabled",
.arg = G_OPTION_ARG_NONE, .arg_data = &disabled,
.description = _("Show disabled extensions") },
{ .long_name = "prefs",
.arg = G_OPTION_ARG_NONE, .arg_data = &has_prefs,
.description = _("Show extensions with preferences") },
{ .long_name = "details", .short_name = 'd',
.arg = G_OPTION_ARG_NONE, .arg_data = &details,
.description = _("Print extension details") },
{ NULL }
};
g_set_prgname ("gnome-extensions list");
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("List installed extensions"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (do_help)
{
show_help (context, NULL);
return 0;
}
if (!g_option_context_parse (context, &argc, &argv, &error))
{
show_help (context, error->message);
return 1;
}
if (argc > 1)
{
show_help (context, _("Unknown arguments"));
return 1;
}
if (user || !system)
flags |= LIST_FLAGS_USER;
if (system || !user)
flags |= LIST_FLAGS_SYSTEM;
if (enabled || !disabled)
flags |= LIST_FLAGS_ENABLED;
if (disabled || !enabled)
flags |= LIST_FLAGS_DISABLED;
if (!has_prefs)
flags |= LIST_FLAGS_NO_PREFS;
return list_extensions (flags, details ? DISPLAY_DETAILED
: DISPLAY_ONELINE) ? 0 : 2;
}

View File

@@ -0,0 +1,515 @@
/* command-pack.c
*
* Copyright 2018 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gnome-autoar/gnome-autoar.h>
#include <json-glib/json-glib.h>
#include "commands.h"
#include "common.h"
#include "config.h"
typedef struct _ExtensionPack {
GHashTable *files;
JsonObject *metadata;
GFile *tmpdir;
char *srcdir;
} ExtensionPack;
static void extension_pack_free (ExtensionPack *);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExtensionPack, extension_pack_free);
static ExtensionPack *
extension_pack_new (const char *srcdir)
{
ExtensionPack *pack = g_new0 (ExtensionPack, 1);
pack->srcdir = g_strdup (srcdir);
pack->files = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_object_unref);
return pack;
}
static void
extension_pack_free (ExtensionPack *pack)
{
if (pack->tmpdir)
file_delete_recursively (pack->tmpdir, NULL);
g_clear_pointer (&pack->files, g_hash_table_destroy);
g_clear_pointer (&pack->metadata, json_object_unref);
g_clear_pointer (&pack->srcdir, g_free);
g_clear_object (&pack->tmpdir);
g_free (pack);
}
static void
extension_pack_add_source (ExtensionPack *pack,
const char *filename)
{
g_autoptr (GFile) file = NULL;
file = g_file_new_for_commandline_arg_and_cwd (filename, pack->srcdir);
if (g_file_query_exists (file, NULL))
g_hash_table_insert (pack->files,
g_path_get_basename (filename), g_steal_pointer (&file));
}
static gboolean
extension_pack_check_required_file (ExtensionPack *pack,
const char *filename,
GError **error)
{
if (!g_hash_table_contains (pack->files, filename))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
"Missing %s in extension pack", filename);
return FALSE;
}
return TRUE;
}
static gboolean
ensure_tmpdir (ExtensionPack *pack,
GError **error)
{
g_autofree char *path = NULL;
if (pack->tmpdir != NULL)
return TRUE;
path = g_dir_make_tmp ("gnome-extensions.XXXXXX", error);
if (path != NULL)
pack->tmpdir = g_file_new_for_path (path);
return pack->tmpdir != NULL;
}
static gboolean
ensure_metadata (ExtensionPack *pack,
GError **error)
{
g_autoptr (JsonParser) parser = NULL;
g_autoptr (GInputStream) stream = NULL;
GFile *file = NULL;
if (pack->metadata != NULL)
return TRUE;
if (!extension_pack_check_required_file (pack, "metadata.json", error))
return FALSE;
file = g_hash_table_lookup (pack->files, "metadata.json");
stream = G_INPUT_STREAM (g_file_read (file, NULL, error));
if (stream == NULL)
return FALSE;
parser = json_parser_new_immutable ();
if (!json_parser_load_from_stream (parser, stream, NULL, error))
return FALSE;
pack->metadata = json_node_dup_object (json_parser_get_root (parser));
return TRUE;
}
static gboolean
extension_pack_add_schemas (ExtensionPack *pack,
char **schemas,
GError **error)
{
g_autoptr (GSubprocess) proc = NULL;
g_autoptr (GFile) dstdir = NULL;
g_autofree char *dstpath = NULL;
char **s;
if (!ensure_tmpdir (pack, error))
return FALSE;
dstdir = g_file_get_child (pack->tmpdir, "schemas");
if (!g_file_make_directory (dstdir, NULL, error))
return FALSE;
for (s = schemas; s && *s; s++)
{
g_autoptr (GFile) src = NULL;
g_autoptr (GFile) dst = NULL;
g_autofree char *basename = NULL;
src = g_file_new_for_commandline_arg_and_cwd (*s, pack->srcdir);
basename = g_file_get_basename (src);
dst = g_file_get_child (dstdir, basename);
if (!g_file_copy (src, dst, G_FILE_COPY_NONE, NULL, NULL, NULL, error))
return FALSE;
}
dstpath = g_file_get_path (dstdir);
proc = g_subprocess_new (G_SUBPROCESS_FLAGS_STDERR_SILENCE, error,
"glib-compile-schemas", "--strict", dstpath, NULL);
if (!g_subprocess_wait_check (proc, NULL, error))
return FALSE;
g_hash_table_insert (pack->files,
g_strdup ("schemas"), g_steal_pointer (&dstdir));
return TRUE;
}
static gboolean
extension_pack_add_locales (ExtensionPack *pack,
const char *podir,
const char *gettext_domain,
GError **error)
{
g_autoptr (GFile) dstdir = NULL;
g_autoptr (GFile) srcdir = NULL;
g_autoptr (GFileEnumerator) file_enum = NULL;
g_autofree char *dstpath = NULL;
g_autofree char *moname = NULL;
GFile *child;
GFileInfo *info;
if (!ensure_tmpdir (pack, error))
return FALSE;
dstdir = g_file_get_child (pack->tmpdir, "locale");
if (!g_file_make_directory (dstdir, NULL, error))
return FALSE;
srcdir = g_file_new_for_commandline_arg_and_cwd (podir, pack->srcdir);
file_enum = g_file_enumerate_children (srcdir,
G_FILE_ATTRIBUTE_STANDARD_NAME,
G_FILE_QUERY_INFO_NONE,
NULL,
error);
if (file_enum == NULL)
return FALSE;
if (gettext_domain == NULL)
{
if (!ensure_metadata (pack, error))
return FALSE;
if (json_object_has_member (pack->metadata, "gettext-domain"))
gettext_domain = json_object_get_string_member (pack->metadata,
"gettext-domain");
else
gettext_domain = json_object_get_string_member (pack->metadata,
"uuid");
}
dstpath = g_file_get_path (dstdir);
moname = g_strdup_printf ("%s.mo", gettext_domain);
while (TRUE)
{
g_autoptr (GSubprocess) proc = NULL;
g_autoptr (GFile) modir = NULL;
g_autofree char *popath = NULL;
g_autofree char *mopath = NULL;
g_autofree char *lang = NULL;
const char *name;
if (!g_file_enumerator_iterate (file_enum, &info, &child, NULL, error))
return FALSE;
if (info == NULL)
break;
name = g_file_info_get_name (info);
if (!g_str_has_suffix (name, ".po"))
continue;
lang = g_strndup (name, strlen (name) - 3 /* strlen (".po") */);
modir = g_file_new_build_filename (dstpath, lang, "LC_MESSAGES", NULL);
if (!g_file_make_directory_with_parents (modir, NULL, error))
return FALSE;
mopath = g_build_filename (dstpath, lang, "LC_MESSAGES", moname, NULL);
popath = g_file_get_path (child);
proc = g_subprocess_new (G_SUBPROCESS_FLAGS_STDERR_SILENCE, error,
"msgfmt", "-o", mopath, popath, NULL);
if (!g_subprocess_wait_check (proc, NULL, error))
return FALSE;
}
g_hash_table_insert (pack->files,
g_strdup ("locale"), g_steal_pointer (&dstdir));
return TRUE;
}
static void
on_error (AutoarCompressor *compressor,
GError *error,
gpointer data)
{
*((GError **)data) = g_error_copy (error);
}
static gboolean
extension_pack_compress (ExtensionPack *pack,
const char *outdir,
gboolean overwrite,
GError **error)
{
g_autoptr (AutoarCompressor) compressor = NULL;
g_autoptr (GError) err = NULL;
g_autoptr (GFile) outfile = NULL;
g_autofree char *name = NULL;
const char *uuid;
if (!ensure_metadata (pack, error))
return FALSE;
uuid = json_object_get_string_member (pack->metadata, "uuid");
name = g_strdup_printf ("%s.shell-extension.zip", uuid);
outfile = g_file_new_for_commandline_arg_and_cwd (name, outdir);
if (g_file_query_exists (outfile, NULL))
{
if (!overwrite)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS,
"%s exists and --force was not specified", name);
return FALSE;
}
else if (!g_file_delete (outfile, NULL, error))
{
return FALSE;
}
}
compressor = autoar_compressor_new (g_hash_table_get_values (pack->files),
outfile,
AUTOAR_FORMAT_ZIP,
AUTOAR_FILTER_NONE,
FALSE);
autoar_compressor_set_output_is_dest (compressor, TRUE);
g_signal_connect (compressor, "error", G_CALLBACK (on_error), err);
autoar_compressor_start (compressor, NULL);
if (err != NULL)
{
g_propagate_error (error, err);
return FALSE;
}
return TRUE;
}
static char **
find_schemas (const char *basepath,
GError **error)
{
g_autoptr (GFile) basedir = NULL;
g_autoptr (GFile) schemadir = NULL;
g_autoptr (GFileEnumerator) file_enum = NULL;
g_autoptr (GPtrArray) schemas = NULL;
GFile *child;
GFileInfo *info;
basedir = g_file_new_for_path (basepath);
schemadir = g_file_get_child (basedir, "schemas");
file_enum = g_file_enumerate_children (schemadir,
G_FILE_ATTRIBUTE_STANDARD_NAME,
G_FILE_QUERY_INFO_NONE,
NULL, error);
if (error && *error)
{
if (g_error_matches (*error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) ||
g_error_matches (*error, G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY))
g_clear_error (error);
return NULL;
}
schemas = g_ptr_array_new_with_free_func (g_free);
while (TRUE)
{
if (!g_file_enumerator_iterate (file_enum, &info, &child, NULL, error))
return NULL;
if (child == NULL)
break;
if (!g_str_has_suffix (g_file_info_get_name (info), ".gschema.xml"))
continue;
g_ptr_array_add (schemas, g_file_get_relative_path (basedir, child));
}
g_ptr_array_add (schemas, NULL);
return (char **)g_ptr_array_free (g_ptr_array_ref (schemas), FALSE);
}
static int
pack_extension (char *srcdir,
char *dstdir,
gboolean force,
char **extra_sources,
char **schemas,
char *podir,
char *gettext_domain)
{
g_autoptr (ExtensionPack) pack = NULL;
g_autoptr (GError) error = NULL;
char **s;
pack = extension_pack_new (srcdir);
extension_pack_add_source (pack, "extension.js");
extension_pack_add_source (pack, "metadata.json");
extension_pack_add_source (pack, "stylesheet.css");
extension_pack_add_source (pack, "prefs.js");
for (s = extra_sources; s && *s; s++)
extension_pack_add_source (pack, *s);
if (!extension_pack_check_required_file (pack, "extension.js", &error))
goto err;
if (!extension_pack_check_required_file (pack, "metadata.json", &error))
goto err;
if (schemas == NULL)
schemas = find_schemas (srcdir, &error);
if (schemas != NULL)
extension_pack_add_schemas (pack, schemas, &error);
if (error)
goto err;
if (podir == NULL)
{
g_autoptr (GFile) dir = NULL;
dir = g_file_new_for_commandline_arg_and_cwd ("po", srcdir);
if (g_file_query_exists (dir, NULL))
podir = (char *)"po";
}
if (podir != NULL)
extension_pack_add_locales (pack, podir, gettext_domain, &error);
if (error)
goto err;
extension_pack_compress (pack, dstdir, force, &error);
err:
if (error)
{
g_printerr ("%s\n", error->message);
return 2;
}
return 0;
}
int
handle_pack (int argc, char *argv[], gboolean do_help)
{
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
g_auto(GStrv) extra_sources = NULL;
g_auto(GStrv) schemas = NULL;
g_auto(GStrv) srcdirs = NULL;
g_autofree char *podir = NULL;
g_autofree char *srcdir = NULL;
g_autofree char *dstdir = NULL;
g_autofree char *gettext_domain = NULL;
gboolean force = FALSE;
GOptionEntry entries[] = {
{ .long_name = "extra-source",
.arg = G_OPTION_ARG_FILENAME_ARRAY, .arg_data = &extra_sources,
.arg_description = _("FILE"),
.description = _("Additional source to include in the bundle") },
{ .long_name = "schema",
.arg = G_OPTION_ARG_FILENAME_ARRAY, .arg_data = &schemas,
.arg_description = _("SCHEMA"),
.description = _("A GSettings schema that should be included") },
{ .long_name = "podir",
.arg_description = _("DIRECTORY"),
.arg = G_OPTION_ARG_FILENAME, .arg_data = &podir,
.description = _("The directory where translations are found") },
{ .long_name = "gettext-domain",
.arg_description = _("DOMAIN"),
.arg = G_OPTION_ARG_STRING, .arg_data = &gettext_domain,
.description = _("The gettext domain to use for translations") },
{ .long_name = "force", .short_name = 'f',
.arg = G_OPTION_ARG_NONE, .arg_data = &force,
.description = _("Overwrite an existing pack") },
{ .long_name = "out-dir", .short_name = 'o',
.arg_description = _("DIRECTORY"),
.arg = G_OPTION_ARG_FILENAME, .arg_data = &dstdir,
.description = _("The directory where the pack should be created") },
{ .long_name = G_OPTION_REMAINING,
.arg_description =_("SOURCE_DIRECTORY"),
.arg = G_OPTION_ARG_FILENAME_ARRAY, .arg_data = &srcdirs },
{ NULL }
};
g_set_prgname ("gnome-extensions pack");
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Create an extension bundle"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (do_help)
{
show_help (context, NULL);
return 0;
}
if (!g_option_context_parse (context, &argc, &argv, &error))
{
show_help (context, error->message);
return 1;
}
if (srcdirs)
{
if (g_strv_length (srcdirs) > 1)
{
show_help (context, _("More than one source directory specified"));
return 1;
}
srcdir = g_strdup (*srcdirs);
}
else
{
srcdir = g_get_current_dir ();
}
if (dstdir == NULL)
dstdir = g_get_current_dir ();
return pack_extension (srcdir, dstdir, force,
extra_sources, schemas, podir, gettext_domain);
}

View File

@@ -0,0 +1,117 @@
/* commands-prefs.c
*
* Copyright 2019 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib/gi18n.h>
#include <gio/gio.h>
#include "commands.h"
#include "common.h"
#include "config.h"
static gboolean
launch_extension_prefs (const char *uuid)
{
g_autoptr (GDBusProxy) proxy = NULL;
g_autoptr (GVariant) response = NULL;
g_autoptr (GVariant) asv = NULL;
g_autoptr (GVariantDict) info = NULL;
g_autoptr (GError) error = NULL;
gboolean has_prefs;
proxy = get_shell_proxy (&error);
if (proxy == NULL)
return FALSE;
response = g_dbus_proxy_call_sync (proxy,
"GetExtensionInfo",
g_variant_new ("(s)", uuid),
0,
-1,
NULL,
&error);
if (response == NULL)
return FALSE;
asv = g_variant_get_child_value (response, 0);
info = g_variant_dict_new (asv);
if (!g_variant_dict_contains (info, "uuid"))
return FALSE;
g_variant_dict_lookup (info, "hasPrefs", "b", &has_prefs);
if (!has_prefs)
return FALSE;
g_dbus_proxy_call_sync (proxy,
"LaunchExtensionPrefs",
g_variant_new ("(s)", uuid),
0,
-1,
NULL,
&error);
return TRUE;
}
int
handle_prefs (int argc, char *argv[], gboolean do_help)
{
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
g_auto(GStrv) uuids = NULL;
GOptionEntry entries[] = {
{ .long_name = G_OPTION_REMAINING,
.arg_description = "UUID",
.arg = G_OPTION_ARG_STRING_ARRAY, .arg_data = &uuids },
{ NULL }
};
g_set_prgname ("gnome-extensions prefs");
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Opens extension preferences"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (do_help)
{
show_help (context, NULL);
return 0;
}
if (!g_option_context_parse (context, &argc, &argv, &error))
{
show_help (context, error->message);
return 1;
}
if (uuids == NULL)
{
show_help (context, _("No UUID given"));
return 1;
}
else if (g_strv_length (uuids) > 1)
{
show_help (context, _("More than one UUID given"));
return 1;
}
return launch_extension_prefs (*uuids) ? 0 : 2;
}

View File

@@ -0,0 +1,84 @@
/* command-reset.c
*
* Copyright 2019 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib/gi18n.h>
#include <gio/gio.h>
#include "commands.h"
#include "common.h"
#include "config.h"
static gboolean
reset_extension (const char *uuid)
{
g_autoptr(GSettings) settings = get_shell_settings();
if (settings == NULL)
return FALSE;
return settings_list_remove (settings, "enabled-extensions", uuid) &&
settings_list_remove (settings, "disabled-extensions", uuid);
}
int
handle_reset (int argc, char *argv[], gboolean do_help)
{
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
g_auto(GStrv) uuids = NULL;
GOptionEntry entries[] = {
{ .long_name = G_OPTION_REMAINING,
.arg_description = "UUID",
.arg = G_OPTION_ARG_STRING_ARRAY, .arg_data = &uuids },
{ NULL }
};
g_set_prgname ("gnome-extensions reset");
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Reset an extension"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (do_help)
{
show_help (context, NULL);
return 0;
}
if (!g_option_context_parse (context, &argc, &argv, &error))
{
show_help (context, error->message);
return 1;
}
if (uuids == NULL)
{
show_help (context, _("No UUID given"));
return 1;
}
else if (g_strv_length (uuids) > 1)
{
show_help (context, _("More than one UUID given"));
return 1;
}
return reset_extension (*uuids) ? 0 : 2;
}

View File

@@ -0,0 +1,99 @@
/* commands-uninstall.c
*
* Copyright 2019 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib/gi18n.h>
#include <gio/gio.h>
#include "commands.h"
#include "common.h"
#include "config.h"
static gboolean
uninstall_extension (const char *uuid)
{
g_autoptr (GDBusProxy) proxy = NULL;
g_autoptr (GVariant) response = NULL;
g_autoptr (GError) error = NULL;
gboolean success = FALSE;
proxy = get_shell_proxy (&error);
if (proxy == NULL)
return FALSE;
response = g_dbus_proxy_call_sync (proxy,
"UninstallExtension",
g_variant_new ("(s)", uuid),
0,
-1,
NULL,
&error);
if (response == NULL)
return FALSE;
g_variant_get (response, "(b)", &success);
return success;
}
int
handle_uninstall (int argc, char *argv[], gboolean do_help)
{
g_autoptr (GOptionContext) context = NULL;
g_autoptr (GError) error = NULL;
g_auto(GStrv) uuids = NULL;
GOptionEntry entries[] = {
{ .long_name = G_OPTION_REMAINING,
.arg_description = "UUID",
.arg = G_OPTION_ARG_STRING_ARRAY, .arg_data = &uuids },
{ NULL }
};
g_set_prgname ("gnome-extensions uninstall");
context = g_option_context_new (NULL);
g_option_context_set_help_enabled (context, FALSE);
g_option_context_set_summary (context, _("Uninstall an extension"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
if (do_help)
{
show_help (context, NULL);
return 0;
}
if (!g_option_context_parse (context, &argc, &argv, &error))
{
show_help (context, error->message);
return 1;
}
if (uuids == NULL)
{
show_help (context, _("No UUID given"));
return 1;
}
else if (g_strv_length (uuids) > 1)
{
show_help (context, _("More than one UUID given"));
return 1;
}
return uninstall_extension (*uuids) ? 0 : 2;
}

View File

@@ -0,0 +1,38 @@
/* commands.h
*
* Copyright 2018 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <glib.h>
G_BEGIN_DECLS
int handle_enable (int argc, char *argv[], gboolean do_help);
int handle_disable (int argc, char *argv[], gboolean do_help);
int handle_reset (int argc, char *argv[], gboolean do_help);
int handle_list (int argc, char *argv[], gboolean do_help);
int handle_info (int argc, char *argv[], gboolean do_help);
int handle_prefs (int argc, char *argv[], gboolean do_help);
int handle_create (int argc, char *argv[], gboolean do_help);
int handle_pack (int argc, char *argv[], gboolean do_help);
int handle_install (int argc, char *argv[], gboolean do_help);
int handle_uninstall (int argc, char *argv[], gboolean do_help);
G_END_DECLS

View File

@@ -0,0 +1,67 @@
/* common.h
*
* Copyright 2018 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gio/gio.h>
G_BEGIN_DECLS
typedef enum {
TYPE_SYSTEM = 1,
TYPE_USER
} ExtensionType;
typedef enum {
STATE_ENABLED = 1,
STATE_DISABLED,
STATE_ERROR,
STATE_OUT_OF_DATE,
STATE_DOWNLOADING,
STATE_INITIALIZED,
STATE_UNINSTALLED = 99
} ExtensionState;
typedef enum {
DISPLAY_ONELINE,
DISPLAY_DETAILED
} DisplayFormat;
void show_help (GOptionContext *context,
const char *message);
void print_extension_info (GVariantDict *info,
DisplayFormat format);
GDBusProxy *get_shell_proxy (GError **error);
GSettings *get_shell_settings (void);
gboolean settings_list_add (GSettings *settings,
const char *key,
const char *value);
gboolean settings_list_remove (GSettings *settings,
const char *key,
const char *value);
gboolean file_delete_recursively (GFile *file,
GError **error);
G_END_DECLS

View File

@@ -0,0 +1,83 @@
# Check for bash
[ -z "$BASH_VERSION" ] && return
################################################################################
__gnome_extensions() {
local commands="version enable disable reset info install show list create pack prefs uninstall"
local COMMAND=${COMP_WORDS[1]}
_init_completion -s || return
case "${COMP_CWORD}" in
1)
COMPREPLY=($(compgen -W "help $commands" -- "$2"))
return 0
;;
2)
case "$COMMAND" in
help)
COMPREPLY=($(compgen -W "$commands" -- "$2"))
return 0
;;
disable)
local list_opt=--enabled
;;&
enable)
local list_opt=--disabled
;;&
prefs)
local list_opt=--prefs
;;&
uninstall)
local list_opt=--user
;;&
enable|disable|info|show|prefs|reset|uninstall)
COMPREPLY=($(compgen -W "`gnome-extensions list $list_opt`" -- "$2"))
return 0
;;
esac
;;
esac
case "$COMMAND" in
pack)
case "$prev" in
--podir|--out-dir|-o)
_filedir -d
return 0
;;
--schema)
_filedir gschema.xml
return 0
;;
--extra-source)
_filedir
return 0
;;
esac
;;
install)
if [[ $cur != -* ]]
then
_filedir zip
return 0
fi
;;
esac
# Stop if we are currently waiting for an option value
$split && return
# Otherwise, get the supported options for ${COMMAND} (if any)
COMPREPLY=($(compgen -W "$(_parse_help $1 "help $COMMAND")" -- "$2"))
[[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
}
################################################################################
complete -F __gnome_extensions gnome-extensions

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/extensions-tool">
<file>template/extension.js</file>
<file>template/stylesheet.css</file>
</gresource>
</gresources>

335
src/extensions-tool/main.c Normal file
View File

@@ -0,0 +1,335 @@
/* main.c
*
* Copyright 2018 Florian Müllner <fmuellner@gnome.org>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <gio/gio.h>
#include <glib/gi18n.h>
#include <locale.h>
#include "config.h"
#include "commands.h"
#include "common.h"
static const char *
extension_state_to_string (ExtensionState state)
{
switch (state)
{
case STATE_ENABLED:
return "ENABLED";
case STATE_DISABLED:
return "DISABLED";
case STATE_ERROR:
return "ERROR";
case STATE_OUT_OF_DATE:
return "OUT OF DATE";
case STATE_DOWNLOADING:
return "DOWNLOADING";
case STATE_INITIALIZED:
return "INITIALIZED";
case STATE_UNINSTALLED:
return "UNINSTALLED";
}
return "UNKNOWN";
}
void
show_help (GOptionContext *context, const char *message)
{
g_autofree char *help = NULL;
if (message)
g_printerr ("gnome-extensions: %s\n\n", message);
help = g_option_context_get_help (context, TRUE, NULL);
g_printerr ("%s", help);
}
GDBusProxy *
get_shell_proxy (GError **error)
{
return g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
"org.gnome.Shell",
"/org/gnome/Shell",
"org.gnome.Shell.Extensions",
NULL,
error);
}
GSettings *
get_shell_settings (void)
{
g_autoptr (GSettingsSchema) schema = NULL;
GSettingsSchemaSource *schema_source;
schema_source = g_settings_schema_source_get_default ();
schema = g_settings_schema_source_lookup (schema_source,
"org.gnome.shell",
TRUE);
if (schema == NULL)
return NULL;
return g_settings_new_full (schema, NULL, NULL);
}
gboolean
settings_list_add (GSettings *settings,
const char *key,
const char *value)
{
g_auto(GStrv) list = NULL;
g_auto(GStrv) new_value = NULL;
guint n_values;
int i;
if (!g_settings_is_writable (settings, key))
return FALSE;
list = g_settings_get_strv (settings, key);
if (g_strv_contains ((const char **)list, value))
return TRUE;
n_values = g_strv_length (list);
new_value = g_new0 (char *, n_values + 2);
for (i = 0; i < n_values; i++)
new_value[i] = g_strdup (list[i]);
new_value[i] = g_strdup (value);
g_settings_set_strv (settings, key, (const char **)new_value);
g_settings_sync ();
return TRUE;
}
gboolean
settings_list_remove (GSettings *settings,
const char *key,
const char *value)
{
g_auto(GStrv) list = NULL;
g_auto(GStrv) new_value = NULL;
const char **s;
guint n_values;
int i;
if (!g_settings_is_writable (settings, key))
return FALSE;
list = g_settings_get_strv (settings, key);
if (!g_strv_contains ((const char **)list, value))
return TRUE;
n_values = g_strv_length (list);
new_value = g_new0 (char *, n_values);
for (i = 0, s = (const char **)list; i < n_values; i++, s++)
if (!g_str_equal (*s, value))
new_value[i] = g_strdup (*s);
g_settings_set_strv (settings, key, (const char **)new_value);
g_settings_sync ();
return TRUE;
}
void
print_extension_info (GVariantDict *info,
DisplayFormat format)
{
const char *uuid, *name, *desc, *path, *url, *author;
double state, version;
g_variant_dict_lookup (info, "uuid", "&s", &uuid);
g_print ("%s\n", uuid);
if (format == DISPLAY_ONELINE)
return;
g_variant_dict_lookup (info, "name", "&s", &name);
g_print (" %s: %s\n", _("Name"), name);
g_variant_dict_lookup (info, "description", "&s", &desc);
g_print (" %s: %s\n", _("Description"), desc);
g_variant_dict_lookup (info, "path", "&s", &path);
g_print (" %s: %s\n", _("Path"), path);
if (g_variant_dict_lookup (info, "url", "&s", &url))
g_print (" %s: %s\n", _("URL"), url);
if (g_variant_dict_lookup (info, "original-author", "&s", &author))
g_print (" %s: %s\n", _("Original author"), author);
if (g_variant_dict_lookup (info, "version", "d", &version))
g_print (" %s: %.0f\n", _("Version"), version);
g_variant_dict_lookup (info, "state", "d", &state);
g_print (" %s: %s\n", _("State"), extension_state_to_string (state));
}
gboolean
file_delete_recursively (GFile *file,
GError **error)
{
g_autoptr (GFileEnumerator) file_enum = NULL;
GFile *child;
file_enum = g_file_enumerate_children (file, NULL, 0, NULL, NULL);
if (file_enum)
while (TRUE)
{
if (!g_file_enumerator_iterate (file_enum, NULL, &child, NULL, error))
return FALSE;
if (child == NULL)
break;
if (!file_delete_recursively (child, error))
return FALSE;
}
return g_file_delete (file, NULL, error);
}
static int
handle_version (int argc, char *argv[], gboolean do_help)
{
if (do_help || argc > 1)
{
if (!do_help)
g_printerr ("gnome-extensions: %s\n\n", _("“version” takes no arguments"));
g_printerr ("%s\n", _("Usage:"));
g_printerr (" gnome-extensions version\n");
g_printerr ("\n");
g_printerr ("%s\n", _("Print version information and exit."));
return do_help ? 0 : 2;
}
g_print ("%s\n", VERSION);
return 0;
}
static void
usage (void)
{
g_printerr ("%s\n", _("Usage:"));
g_printerr (" gnome-extensions %s %s\n", _("COMMAND"), _("[ARGS…]"));
g_printerr ("\n");
g_printerr ("%s\n", _("Commands:"));
g_printerr (" help %s\n", _("Print help"));
g_printerr (" version %s\n", _("Print version"));
g_printerr (" enable %s\n", _("Enable extension"));
g_printerr (" disable %s\n", _("Disable extension"));
g_printerr (" reset %s\n", _("Reset extension"));
g_printerr (" uninstall %s\n", _("Uninstall extension"));
g_printerr (" list %s\n", _("List extensions"));
g_printerr (" info %s\n", _("Show extension info"));
g_printerr (" show %s\n", _("Show extension info"));
g_printerr (" prefs %s\n", _("Open extension preferences"));
g_printerr (" create %s\n", _("Create extension"));
g_printerr (" pack %s\n", _("Package extension"));
g_printerr (" install %s\n", _("Install extension bundle"));
g_printerr ("\n");
g_printerr (_("Use %s to get detailed help.\n"), "“gnome-extensions help COMMAND”");
}
int
main (int argc, char *argv[])
{
const char *command;
gboolean do_help = FALSE;
setlocale (LC_ALL, "");
textdomain (GETTEXT_PACKAGE);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
if (argc < 2)
{
usage ();
return 1;
}
command = argv[1];
argc--;
argv++;
if (g_str_equal (command, "help"))
{
if (argc == 1)
{
usage ();
return 0;
}
else
{
command = argv[1];
do_help = TRUE;
}
}
else if (g_str_equal (command, "--help"))
{
usage ();
return 0;
}
else if (g_str_equal (command, "--version"))
{
command = "version";
}
if (g_str_equal (command, "version"))
return handle_version (argc, argv, do_help);
else if (g_str_equal (command, "enable"))
return handle_enable (argc, argv, do_help);
else if (g_str_equal (command, "disable"))
return handle_disable (argc, argv, do_help);
else if (g_str_equal (command, "reset"))
return handle_reset (argc, argv, do_help);
else if (g_str_equal (command, "list"))
return handle_list (argc, argv, do_help);
else if (g_str_equal (command, "info"))
return handle_info (argc, argv, do_help);
else if (g_str_equal (command, "show"))
return handle_info (argc, argv, do_help);
else if (g_str_equal (command, "prefs"))
return handle_prefs (argc, argv, do_help);
else if (g_str_equal (command, "create"))
return handle_create (argc, argv, do_help);
else if (g_str_equal (command, "pack"))
return handle_pack (argc, argv, do_help);
else if (g_str_equal (command, "install"))
return handle_install (argc, argv, do_help);
else if (g_str_equal (command, "uninstall"))
return handle_uninstall (argc, argv, do_help);
else
usage ();
return 1;
}

View File

@@ -0,0 +1,199 @@
GNOME-EXTENSIONS(1)
===================
:man manual: User Commands
:man source: GNOME-EXTENSIONS-TOOL
:doctype: manpage
:date: August 2018
NAME
----
gnome-extensions - Command line tool for managing GNOME extensions
SYNOPSIS
--------
*gnome-extensions* help ['COMMAND']
*gnome-extensions* version
*gnome-extensions* enable 'UUID'
*gnome-extensions* disable 'UUID'
*gnome-extensions* reset 'UUID'
*gnome-extensions* info 'UUID'
*gnome-extensions* show 'UUID'
*gnome-extensions* list ['OPTION'...]
*gnome-extensions* prefs 'UUID'
*gnome-extensions* create ['OPTION'...]
*gnome-extensions* pack ['OPTION'...]
*gnome-extensions* install ['OPTION'...] 'PACK'
*gnome-extensions* uninstall 'UUID'
DESCRIPTION
-----------
*gnome-extensions* is a utility that makes some common GNOME extensions
operations available on the command line.
COMMANDS
--------
*help* ['COMMAND']::
Displays a short synopsis of the available commands or provides
detailed help on a specific command.
*version*::
Prints the program version.
*enable* 'UUID'::
Enables the extension identified by 'UUID'.
+
The command will not detect any errors from the extension itself, use the
*info* command to confirm that the extension state is *ENABLED*.
+
If the extension is already enabled, the command will do nothing.
*disable* 'UUID'::
Disables the extension identified by 'UUID'.
+
If the extension is not enabled, the command will do nothing.
*reset* 'UUID'::
Reset the extension identified by 'UUID'.
+
The extension will be disabled in GNOME, but may be enabled by other sessions
like GNOME Classic.
*info* 'UUID'::
Show details of the extension identified by 'UUID', including name,
description and state.
*show* 'UUID'::
Synonym of info.
*list* ['OPTION'...]::
Displays a list of installed extensions.
+
.Options
*--user*;;
Include extensions installed in the user's *$HOME*
*--system*;;
Include extensions installed in the system
*--enabled*;;
Include enabled extensions
*--disabled*;;
Include disabled extensions
*--prefs*;;
Only include extensions with preferences
*-d*;;
*--details*;;
Show some extra information for each extension
*prefs* 'UUID'::
Open the preference dialog of the extension identified by 'UUID'.
*create* ['OPTION'...]::
Creates a new extension from a template.
+
.Options
*--name*='NAME':::
Set the user-visible name in the extension's metadata
to 'NAME'
*--description*='DESC':::
Set the description in the extension's metadata to 'DESC'
*--uuid*='UUID':::
Set the unique extension ID in the metadata to 'UUID'
*-i*:::
*--interactive*:::
Prompt for any extension metadata that hasn't been provided
on the command line
*pack* ['OPTION'...] ['SOURCE-DIRECTORY']::
Creates an extension bundle that is suitable for publishing.
+
The bundle will always include the required files extension.js
and metadata.json, as well as the optional stylesheet.css and
prefs.js if found. Each additional source that should be included
must be specified with *--extra-source*.
+
If the extension includes one or more GSettings schemas, they can
either be placed in a schemas/ folder to be picked up automatically,
or be specified with *--schema*.
+
Similarily, translations are included automatically when they are
located in a po/ folder, otherwise the *--podir* option can be
used to point to the correct directory. If no gettext domain is
provided on the command line, the value of the *gettext-domain*
metadata field is used if it exists, and the extension UUID
if not.
+
All files are searched in 'SOURCE-DIRECTORY' if specified, or
the current directory otherwise.
+
.Options
*--extra-source*='FILE':::
Additional source to include in the bundle
*--schema*='SCHEMA':::
A GSettings schema that should be compiled and
included
*--podir*='PODIR':::
A directory with translations that should be
compiled and included
*--gettext-domain*='DOMAIN':::
The gettext domain to use for translations
*-f*:::
*--force*:::
Overwrite an existing pack
*-o*:::
*--out-dir*='DIRECTORY':::
The directory where the pack should be created
*install* ['OPTION'...] 'PACK'::
Installs an extension from the bundle 'PACK'.
+
The command unpacks the extension files and moves them to
the expected location in the user's *$HOME*, so that it
will be loaded in the next session.
+
It is mainly intended for testing, not as a replacement for
GNOME Software or the extension website. As extensions have
privileged access to the user's session, it is advised to
never load extensions from untrusted sources without carefully
reviewing their content.
+
.Options
*--force*:::
Override an existing extension
*uninstall* 'UUID'::
Uninstalls the extension identified by 'UUID'.
EXIT STATUS
-----------
On success 0 is returned, a non-zero failure code otherwise.
BUGS
----
The tool is part of the gnome-shell project, and bugs should be reported
in its issue tracker at https://gitlab.gnome.org/GNOME/gnome-shell/issues.

View File

@@ -0,0 +1,7 @@
custom_target('gnome-extensions.1',
input: ['gnome-extensions.txt', 'stylesheet.xsl'],
output: 'gnome-extensions.1',
command: [a2x, '-D', '@OUTDIR@', '--xsl-file', '@INPUT1@', '-f', 'manpage', '@INPUT0@'],
install_dir: mandir + '/man1',
install: true
)

View File

@@ -0,0 +1,27 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
<xsl:template match="variablelist/title">
<xsl:text>.PP&#10;</xsl:text>
<xsl:call-template name="bold">
<xsl:with-param name="node" select="."/>
<xsl:with-param name="context" select=".."/>
</xsl:call-template>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="varlistentry[preceding-sibling::title]">
<xsl:if test="not(preceding-sibling::varlistentry)">
<xsl:text>.RS 4&#10;</xsl:text>
<!-- comment out the leading .PP added by the original template -->
<xsl:text>.\"</xsl:text>
</xsl:if>
<xsl:apply-imports/>
<xsl:if test="position() = last()">
<xsl:text>.RE&#10;</xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,24 @@
sources = [
'commands.h',
'command-create.c',
'command-disable.c',
'command-enable.c',
'command-info.c',
'command-install.c',
'command-list.c',
'command-pack.c',
'command-prefs.c',
'common.h',
'main.c'
]
resources = gnome.compile_resources('resources',
'gnome-extensions-tool.gresource.xml',
source_dir: '.'
)
executable('gnome-extensions',
sources, resources,
dependencies: [gio_dep, gio_unix_dep, autoar_dep, json_dep],
install: true
)

View File

@@ -0,0 +1,44 @@
config_h = configuration_data()
config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name())
config_h.set_quoted('VERSION', meson.project_version())
config_h.set_quoted('LOCALEDIR', localedir)
config_h.set('HAVE_BIND_TEXTDOMAIN_CODESET', cc.has_function('bind_textdomain_codeset'))
configure_file(
output: 'config.h',
configuration: config_h,
)
sources = [
'command-create.c',
'command-disable.c',
'command-enable.c',
'command-info.c',
'command-install.c',
'command-list.c',
'command-pack.c',
'command-prefs.c',
'command-reset.c',
'command-uninstall.c',
'main.c'
]
resources = gnome.compile_resources('resources',
'gnome-extensions-tool.gresource.xml',
source_dir: '.'
)
executable('gnome-extensions',
sources, resources,
dependencies: [gio_dep, gio_unix_dep, autoar_dep, json_dep],
install: true
)
if bash_completion.found()
install_data('completion/bash/gnome-extensions',
install_dir: bash_completion.get_pkgconfig_variable('completionsdir')
)
endif
if get_option('man')
subdir('man')
endif

View File

@@ -0,0 +1,34 @@
/* extension.js
*
* 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 2 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* exported init */
class Extension {
constructor() {
}
enable() {
}
disable() {
}
}
function init() {
return new Extension();
}

View File

@@ -0,0 +1 @@
/* Add your custom extension styling here */

View File

@@ -1,200 +1,27 @@
#!@PYTHON@
# -*- mode: Python; indent-tabs-mode: nil; -*-
import os
import re
import socket
import subprocess
import sys
import optparse
import tempfile
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
print('The Python simplejson module is required')
sys.exit(1)
from gi.repository import Gio, GLib
SAMPLE_EXTENSION_FILES = {
"extension.js": """
const St = imports.gi.St;
const Main = imports.ui.main;
let text, button;
function _hideHello() {
Main.uiGroup.remove_actor(text);
text = null;
}
function _showHello() {
if (!text) {
text = new St.Label({ style_class: 'helloworld-label', text: "Hello, world!" });
Main.uiGroup.add_actor(text);
}
text.opacity = 255;
let monitor = Main.layoutManager.primaryMonitor;
text.set_position(monitor.x + Math.floor(monitor.width / 2 - text.width / 2),
monitor.y + Math.floor(monitor.height / 2 - text.height / 2));
text.ease({
opacity: 0,
duration: 2000,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => _hideHello()
});
}
function init() {
button = new St.Bin({ style_class: 'panel-button',
reactive: true,
can_focus: true,
x_fill: true,
y_fill: false,
track_hover: true });
let icon = new St.Icon({ icon_name: 'system-run-symbolic',
style_class: 'system-status-icon' });
button.set_child(icon);
button.connect('button-press-event', _showHello);
}
function enable() {
Main.panel._rightBox.insert_child_at_index(button, 0);
}
function disable() {
Main.panel._rightBox.remove_child(button);
}
""",
"stylesheet.css": """
.helloworld-label {
font-size: 36px;
font-weight: bold;
color: #ffffff;
background-color: rgba(10,10,10,0.7);
border-radius: 5px;
padding: .5em;
}
""",
}
def extension_command(args):
print("gnome-shell-extension-tool is deprecated, use gnome-extensions instead",
file=sys.stderr)
subprocess.run(["@bindir@/gnome-extensions"] + args)
def create_extension():
print()
print('''Name should be a very short (ideally descriptive) string.
Examples are: "Click To Focus", "Adblock", "Shell Window Shrinker".
''')
name = input('Name: ').strip()
print()
print('''Description is a single-sentence explanation of what your extension does.
Examples are: "Make windows visible on click", "Block advertisement popups"
"Animate windows shrinking on minimize"
''')
description = input('Description: ').strip()
underifier = re.compile('[^A-Za-z]')
sample_uuid = underifier.sub('_', name)
# TODO use evolution data server
hostname = socket.gethostname()
sample_uuid = sample_uuid + '@' + hostname
print()
print('''Uuid is a globally-unique identifier for your extension.
This should be in the format of an email address (foo.bar@extensions.example.com), but
need not be an actual email address, though it's a good idea to base the uuid on your
email address. For example, if your email address is janedoe@example.com, you might
use an extension title clicktofocus@janedoe.example.com.''')
uuid = input('Uuid [%s]: ' % (sample_uuid, )).strip()
if uuid == '':
uuid = sample_uuid
extension_path = os.path.join(os.path.expanduser('~/.local'), 'share', 'gnome-shell', 'extensions', uuid)
if os.path.exists(extension_path):
print("Extension path %r already exists" % (extension_path, ))
sys.exit(0)
os.makedirs(extension_path)
meta = { 'name': name,
'description': description,
'uuid': uuid,
'shell-version': ['@VERSION@'] }
f = open(os.path.join(extension_path, 'metadata.json'), 'w')
try:
json.dump(meta, f)
except AttributeError:
# For Python versions older than 2.6, try using the json-py module
f.write(json.write(meta) + '\n')
f.close()
for filename, contents in SAMPLE_EXTENSION_FILES.items():
path = os.path.join(extension_path, filename)
f = open(path, 'w')
f.write(contents)
f.close()
print("Created extension in %r" % (extension_path, ))
extensionjs_path = os.path.join(extension_path, 'extension.js')
subprocess.Popen(['xdg-open', extensionjs_path])
ENABLED_EXTENSIONS_KEY = 'enabled-extensions'
extension_command(["create", "--interactive"])
def enable_extension(uuid):
settings = Gio.Settings(schema='org.gnome.shell')
extensions = settings.get_strv(ENABLED_EXTENSIONS_KEY)
if uuid in extensions:
print("%r is already enabled." % (uuid,), file=sys.stderr)
sys.exit(1)
extensions.append(uuid)
settings.set_strv(ENABLED_EXTENSIONS_KEY, extensions)
print("%r is now enabled." % (uuid,), file=sys.stderr)
extension_command(["enable", uuid])
def disable_extension(uuid):
settings = Gio.Settings(schema='org.gnome.shell')
extensions = settings.get_strv(ENABLED_EXTENSIONS_KEY)
if uuid not in extensions:
print("%r is not enabled or installed." % (uuid,), file=sys.stderr)
sys.exit(1)
# Use a while loop here to remove *all* mentions instances
# of the extension. Some faulty tools like to append more than one.
while uuid in extensions:
extensions.remove(uuid)
settings.set_strv(ENABLED_EXTENSIONS_KEY, extensions)
print("%r is now disabled." % (uuid,), file=sys.stderr)
extension_command(["disable", uuid])
def reload_extension(uuid):
settings = Gio.Settings(schema='org.gnome.shell')
extensions = settings.get_strv(ENABLED_EXTENSIONS_KEY)
if uuid not in extensions:
print("%r is not enabled or installed." % (uuid,), file=sys.stderr)
sys.exit(1)
proxy = Gio.DBusProxy.new_sync(Gio.bus_get_sync(Gio.BusType.SESSION, None),
Gio.DBusProxyFlags.NONE,
None,
'org.gnome.Shell',
'/org/gnome/Shell',
'org.gnome.Shell.Extensions',
None)
proxy.call_sync('ReloadExtension',
GLib.Variant('(s)', (uuid,)),
Gio.DBusCallFlags.NONE,
-1,
None)
print("%r reloaded." % (uuid,), file=sys.stderr)
print("Reloading extensions does not work correctly and is no longer supported",
file=sys.stderr)
def main():
parser = optparse.OptionParser()

View File

@@ -24,6 +24,14 @@
#include "shell-perf-log.h"
#include "st.h"
#ifdef HAVE_SYSTEMD
#include <systemd/sd-daemon.h>
#else
/* So we don't need to add ifdef's everywhere */
#define sd_notify(u, m) do {} while (0)
#define sd_notifyf(u, m, ...) do {} while (0)
#endif
extern GType gnome_shell_plugin_get_type (void);
#define SHELL_DBUS_SERVICE "org.gnome.Shell"
@@ -524,6 +532,7 @@ main (int argc, char **argv)
shell_init_debug (g_getenv ("SHELL_DEBUG"));
shell_dbus_init (meta_get_replace_current_wm ());
sd_notify (0, "READY=1");
shell_a11y_init ();
shell_perf_log_init ();
shell_introspection_init ();

View File

@@ -6,6 +6,10 @@ subdir('hotplug-sniffer')
subdir('st')
subdir('tray')
if get_option('extensions_tool')
subdir('extensions-tool')
endif
script_data = configuration_data()
script_data.set('bindir', bindir)
script_data.set('datadir', datadir)
@@ -16,7 +20,13 @@ script_data.set('pkglibdir', pkglibdir)
script_data.set('PYTHON', python.path())
script_data.set('VERSION', meson.project_version())
foreach tool : ['gnome-shell-extension-tool', 'gnome-shell-perf-tool']
script_tools = ['gnome-shell-perf-tool']
if get_option('extensions_tool')
script_tools += 'gnome-shell-extension-tool'
endif
foreach tool : script_tools
configure_file(
input: tool + '.in',
output: tool,

View File

@@ -30,11 +30,8 @@
#include <stdlib.h>
#include <string.h>
#include <clutter/x11/clutter-x11.h>
#include <gdk/gdkx.h>
#include <girepository.h>
#include <gjs/gjs.h>
#include <gtk/gtk.h>
#include "shell-global.h"
#include "shell-global-private.h"
@@ -59,17 +56,6 @@ main(int argc, char **argv)
gsize len;
int code;
gdk_set_allowed_backends("x11");
gtk_init (&argc, &argv);
clutter_x11_set_display (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return 1;
gdk_x11_display_set_window_scale (gdk_display_get_default (), 1);
context = g_option_context_new (NULL);
/* pass unknown through to the JS script */

View File

@@ -614,11 +614,12 @@ static void
sync_input_region (ShellGlobal *global)
{
MetaDisplay *display = global->meta_display;
MetaX11Display *x11_display = meta_display_get_x11_display (display);
if (global->has_modal)
meta_set_stage_input_region (display, None);
meta_x11_display_set_stage_input_region (x11_display, None);
else
meta_set_stage_input_region (display, global->input_region);
meta_x11_display_set_stage_input_region (x11_display, global->input_region);
}
/**
@@ -937,7 +938,8 @@ shell_global_begin_modal (ShellGlobal *global,
return FALSE;
global->has_modal = meta_plugin_begin_modal (global->plugin, options, timestamp);
sync_input_region (global);
if (!meta_is_wayland_compositor ())
sync_input_region (global);
return global->has_modal;
}
@@ -967,7 +969,8 @@ shell_global_end_modal (ShellGlobal *global,
meta_display_focus_default_window (global->meta_display,
get_current_time_maybe_roundtrip (global));
sync_input_region (global);
if (!meta_is_wayland_compositor ())
sync_input_region (global);
}
/* Code to close all file descriptors before we exec; copied from gspawn.c in GLib.

View File

@@ -535,12 +535,17 @@ track_window (ShellWindowTracker *self,
static void
shell_window_tracker_on_window_added (MetaWorkspace *workspace,
MetaWindow *window,
gpointer user_data)
MetaWindow *window,
gpointer user_data)
{
ShellWindowTracker *self = SHELL_WINDOW_TRACKER (user_data);
MetaWindowType window_type = meta_window_get_window_type (window);
track_window (self, window);
if (window_type == META_WINDOW_NORMAL ||
window_type == META_WINDOW_DIALOG ||
window_type == META_WINDOW_UTILITY ||
window_type == META_WINDOW_MODAL_DIALOG)
track_window (self, window);
}
static void

View File

@@ -136,7 +136,7 @@ libst_dep = declare_dependency(link_with: libst,
test_theme = executable('test-theme',
sources: 'test-theme.c',
c_args: st_cflags,
dependencies: [clutter_dep, gtk_dep],
dependencies: [mutter_dep, gtk_dep],
build_rpath: mutter_typelibdir,
link_with: libst
)

View File

@@ -25,6 +25,7 @@
#include "st-button.h"
#include <math.h>
#include <string.h>
#include <meta/main.h>
static ClutterActor *stage;
static StThemeNode *root;
@@ -536,11 +537,16 @@ main (int argc, char **argv)
StThemeContext *context;
PangoFontDescription *font_desc;
GFile *file;
g_autofree char *cwd = NULL;
gtk_init (&argc, &argv);
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return 1;
/* meta_init() cds to $HOME */
cwd = g_get_current_dir ();
meta_test_init ();
chdir (cwd);
/* Make sure our assumptions about resolution are correct */
g_object_set (clutter_settings_get_default (), "font-dpi", -1, NULL);