[gnome] Fix extension locations

This commit is contained in:
2024-01-23 15:31:15 -05:00
parent 2f029aee37
commit 5ac7107501
331 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1,34 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// See the GNU General Public License, version 3 or later for details.
import St from 'gi://St';
import Gio from 'gi://Gio';
const CLIPBOARD_TYPE = St.ClipboardType.CLIPBOARD;
export default class BWClipboard {
constructor() {
this.clipboard = St.Clipboard.get_default();
}
setImage(filename) {
try {
let file = Gio.File.new_for_path(filename);
let [success, image_data] = file.load_contents(null);
//log('error: '+success);
if (success)
this.clipboard.set_content(CLIPBOARD_TYPE, 'image/jpeg', image_data);
} catch (err) {
log('unable to set clipboard to data in '+filename);
}
}
setText(text) {
this.clipboard.set_text(CLIPBOARD_TYPE, text);
}
};

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:
{project} Copyright (C) {year} {fullname}
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,99 @@
# GNOME Shell extension - Bing Wallpaper
Bring some color to your GNOME desktop by syncing your desktop and lockscreen wallpapers with today's Microsoft Bing image of the day (the image you see when you visit Bing.com) with this extension. The intention of this extension is to just do what it needs to do and stay out of your way, with a few optional features to improve quality-of-life.
[![Get it on GNOME extensions](/screenshot/get_it_on_gnome_extensions.png)](https://extensions.gnome.org/extension/1262/bing-wallpaper-changer/) [![<3 Sponsor this project on GitHub <3](/screenshot/sponsor.png)](https://github.com/sponsors/neffo)
![Screenshot](/screenshot/notification.png)
As featured on [OMG! Ubuntu](https://www.omgubuntu.co.uk/2017/07/bing-wallpaper-changer-gnome-extension).
Also, check out my related [Google Earth View wallpaper extension](https://github.com/neffo/earth-view-wallpaper-gnome-extension) and the partially-derived [Bing Desktop Wallpaper for Cinnamon](https://cinnamon-spices.linuxmint.com/applets/view/320) applet by Starcross.
## Features
* Automatically sets the Bing [Image of the Day](https://www.microsoft.com/en-us/bing/bing-wallpaper) as both lock screen and desktop wallpapers
* Only attempts to download wallpapers when they have been updated - doesn't poll continuously
* Shuffle/randomise wallpapers at adjustable intervals (including from your stored Bing images)
* Image gallery to view, select and curate stored images
* Optionally delete old images after a week, or you can keep (and curate) them forever
* Override the lockscreen blur (NEW: lockscreen blur is now dynamic!)
* Language support: English (en), German (de), Dutch (nl), Italian (it), Polish (pl), Chinese (zh_CN, zh_TW), French (fr_FR), Portuguese (pt, pt_BR), Ukrainian (uk), Russian (ru_RU), Spanish (es), Korean (ko), Indonesian (id), Catalan (ca), Norwegian Bokmål (nb) & Nynorsk (nn), Swedish (sv), Arabic (ar), Hungarian (hu), Japanese (ja), Czech (cs_CZ), Finnish (fi_FI) and Turkish (tr) - a HUGE thanks to the translators
* Image preview in menus & ability to manually set wallpapers individually or copy image to clipboard
* A selection of different theme-aware indicator (tray) icons to choose (or hide it completely)
## TODO
* add more languages (#14) - [please help if you can](https://github.com/neffo/bing-wallpaper-gnome-extension/issues/14)
* add user features requests - [lots have already been implemented](https://github.com/neffo/bing-wallpaper-gnome-extension/issues?q=is%3Aissue+label%3Aenhancement+is%3Aclosed)
## Known Issues
* In China, users are limited to 'Chinese China', 'English - International' markets (this is the way Bing handles the Chinese market/locale, not an extension 'bug' - sorry!)
* Bing may detect your location incorrectly (and force a locale as above) - if you see this, please let me know what Bing.com itself does
* GNOME Shell themes can break some GNOME popup menu elements (toggle switches for example). This impacts GNOME more generally, not just this extension. Double check you are running latest versions of your themes (or disable them).
## Requirements
GNOME 3.36+ or 40+ (Ubuntu 20.04 LTS or later, older versions of the extension work with 3.18+, but are no longer supported).
## Install
[Install from extensions.gnome.org](https://extensions.gnome.org/extension/1262/bing-wallpaper-changer/)
or install directly to your GNOME extensions directory (useful if you want to hack on it)
```
mkdir ~/Desktop/source
cd ~/Desktop/source
git clone https://github.com/neffo/bing-wallpaper-gnome-extension.git
cd bing-wallpaper-gnome-extension
sh install.sh
```
## Enable debug logging
Enable debug logging through the exptension preferences 'Debug options' tab or if unable to open preferences you can enable debugging using dconf-editor with this command:
```
GSETTINGS_SCHEMA_DIR=$HOME/.local/share/gnome-shell/extensions/BingWallpaper@ineffable-gmail.com/schemas dconf-editor /org/gnome/shell/extensions/bingwallpaper/
```
Please include logs from your journal when submitting bug notices (make sure nothing sensitive is included in the text!).
## Screenshots
### Image gallery
![Settings](/screenshot/settings5.png)
### Preferences
![Settings](/screenshot/settings.png)
![Settings](/screenshot/settings2.png)
![Settings](/screenshot/settings3.png)
![Settings](/screenshot/settings4.png)
### Lockscreen blur control
From left to right:
* no blur/no dimming
* slight blur/default dimming
* default blur/default dimming
![Blur example](/screenshot/blurexample.jpg)
## Toss a coin to your coder
Do you like this extension and want to show that you appreciate the work that goes into adding new features and keeping it maintained? Please consider buying me a coffee on [GitHub Sponsors](https://github.com/sponsors/neffo) or on [Flattr](https://flattr.com/@neffo).
## Disclaimer
This extension is unofficial and not affiliated with Bing or Microsoft in any way. Images are protected by copyright, and are licensed only for use as wallpapers.
## Special Thanks
This extension is based on the NASA APOD extension by [Elinvention](https://github.com/Elinvention)
and inspired by Bing Desktop WallpaperChanger by [Utkarsh Gupta](https://github.com/UtkarshGpta). Lockscreen blur code is based on [Pratap-Kumar's extension](https://github.com/PRATAP-KUMAR/Control_Blur_Effect_On_Lock_Screen). I'd like to give a special shout out to those who have [contributed code and translations](https://github.com/neffo/bing-wallpaper-gnome-extension/graphs/contributors) as well as everyone who has reported bugs or provided feedback and suggestions for improvements. Also, thanks to Microsoft for this great API and wallpaper collection.
## License
This extension is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

View File

@ -0,0 +1,159 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// See the GNU General Public License, version 3 or later for details.
// Based on GNOME shell extension NASA APOD by Elia Argentieri https://github.com/Elinvention/gnome-shell-extension-nasa-apod
// This code based on https://github.com/PRATAP-KUMAR/Control_Blur_Effect_On_Lock_Screen
// and https://github.com/sunwxg/gnome-shell-extension-unlockDialogBackground
import St from 'gi://St';
import * as UnlockDialog from 'resource:///org/gnome/shell/ui/unlockDialog.js';
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
var _updateBackgroundEffects = UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects;
var _showClock = UnlockDialog.UnlockDialog.prototype._showClock;
var _showPrompt = UnlockDialog.UnlockDialog.prototype._showPrompt;
var shellVersionMajor = parseInt(Config.PACKAGE_VERSION.split('.')[0]);
var shellVersionMinor = parseInt(Config.PACKAGE_VERSION.split('.')[1]);
var shellVersionPoint = parseInt(Config.PACKAGE_VERSION.split('.')[2]);
// default BWP mild blur
var BWP_BLUR_SIGMA = 2;
var BWP_BLUR_BRIGHTNESS = 55;
// GNOME defaults
var BLUR_BRIGHTNESS = 0.55;
var BLUR_SIGMA = 60;
var debug = false;
var promptActive = false; // default GNOME method of testing this relies on state of a transisiton
// so we are being explicit here (do not want any races, thanks)
function log(msg) {
if (debug) // set 'debug' above to false to keep the noise down in journal
console.log("BingWallpaper extension/Blur: " + msg);
}
// we patch UnlockDialog._updateBackgroundEffects()
function _updateBackgroundEffects_BWP(monitorIndex) {
// GNOME shell 3.36.4 and above
log("_updateBackgroundEffects_BWP() called for shell >= 3.36.4");
const themeContext = St.ThemeContext.get_for_stage(global.stage);
for (const widget of this._backgroundGroup.get_children()) {
// set blur effects, we have two modes in lockscreen: login prompt or clock
// blur on when clock is visible is adjustable
const effect = widget.get_effect('blur');
if (promptActive) {
log('default blur active');
if (effect) {
effect.set({ // GNOME defaults when login prompt is visible
brightness: BLUR_BRIGHTNESS,
sigma: BLUR_SIGMA * themeContext.scale_factor,
});
}
}
else {
log('adjustable blur active');
if (effect) {
effect.set({ // adjustable blur when clock is visible
brightness: BWP_BLUR_BRIGHTNESS * 0.01, // we use 0-100 rather than 0-1, so divide by 100
sigma: BWP_BLUR_SIGMA * themeContext.scale_factor,
});
}
}
}
}
// we patch both UnlockDialog._showClock() and UnlockDialog._showPrompt() to let us
// adjustable blur in a Windows-like way (this ensures login prompt is readable)
function _showClock_BWP() {
promptActive = false;
this._showClock_GNOME(); // pass to default GNOME function
this._updateBackgroundEffects();
}
function _showPrompt_BWP() {
promptActive = true;
this._showPrompt_GNOME(); // pass to default GNOME function
this._updateBackgroundEffects();
}
export default class Blur {
constructor() {
this.enabled = false;
log('Bing Wallpaper adjustable blur is '+supportedVersion()?'available':'not available');
}
set_blur_strength(value) {
BWP_BLUR_SIGMA = this._clampValue(value);
log("lockscreen blur strength set to "+BWP_BLUR_SIGMA);
}
set_blur_brightness(value) {
BWP_BLUR_BRIGHTNESS = this._clampValue(value);
log("lockscreen brightness set to " + BWP_BLUR_BRIGHTNESS);
}
// valid values are 0 to 100
_clampValue(value) {
if (value > 100)
value = 100;
if (value < 0 )
value = 0;
return value;
}
_switch(enabled) {
if (enabled && !this.enabled) {
this._enable();
}
else {
this._disable();
}
}
_enable() {
if (supportedVersion()) {
log("Blur._enable() called on GNOME "+Config.PACKAGE_VERSION);
UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects_BWP;
// we override _showClock and _showPrompt to patch in updates to blur effect before calling the GNOME functions
UnlockDialog.UnlockDialog.prototype._showClock = _showClock_BWP;
UnlockDialog.UnlockDialog.prototype._showPrompt = _showPrompt_BWP;
// this are the original functions which we call into from our versions above
UnlockDialog.UnlockDialog.prototype._showClock_GNOME = _showClock;
UnlockDialog.UnlockDialog.prototype._showPrompt_GNOME = _showPrompt;
}
this.enabled = true;
}
_disable() {
if (!this.enabled)
return;
log("_lockscreen_blur_disable() called");
if (supportedVersion()) {
// restore default functions
UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects;
UnlockDialog.UnlockDialog.prototype._showClock = _showClock;
UnlockDialog.UnlockDialog.prototype._showPrompt = _showPrompt;
// clean up unused functions we created
UnlockDialog.UnlockDialog.prototype._showClock_GNOME = null;
delete UnlockDialog.UnlockDialog.prototype._showClock_GNOME;
UnlockDialog.UnlockDialog.prototype._showPrompt_GNOME = null;
delete UnlockDialog.UnlockDialog.prototype._showPrompt_GNOME;
}
this.enabled = false;
}
};
function supportedVersion() { // when current lockscren blur implementation was first shipped (we ignore earlier weird version)
if (shellVersionMajor >= 40 ||
(shellVersionMajor == 3 && shellVersionMinor == 36 && shellVersionPoint >= 4)) {
return true;
}
return false;
}

View File

@ -0,0 +1,228 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// See the GNU General Public License, version 3 or later for details.
// Based on GNOME shell extension NASA APOD by Elia Argentieri https://github.com/Elinvention/gnome-shell-extension-nasa-apod
import Gtk from 'gi://Gtk';
import GdkPixbuf from 'gi://GdkPixbuf';
import Gio from 'gi://Gio';
import * as Utils from './utils.js';
import {gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
const default_dimensions = [30, 30, 1650, 800]; // TODO: pull from and save dimensions to settings, but perhaps verify that dimensions are ok
const GALLERY_THUMB_WIDTH = 320;
const GALLERY_THUMB_HEIGHT = 180;
export default class Carousel {
constructor(settings, button = null, callbackfunc = null, prefs_flowbox = null, extensionPath = null) {
//create_gallery(widget, settings);
this.settings = settings;
this.button = button;
this.callbackfunc = callbackfunc;
this.flowBox = null;
this.window = null;
this.imageList = Utils.imageListSortByDate(Utils.getImageList(this.settings)).reverse(); // get images and reverse order
this.searchEntry = null;
this.extensionPath = extensionPath
this.log('create carousel...');
this.flowBox = prefs_flowbox;
this.flowBox.insert(this._create_placeholder_item(), -1);
}
_enable_button() {
if (this.button) {
this.button.set_sensitive(state);
}
}
_create_gallery() {
Utils.randomIntervals.forEach((x) => {
let item = this._create_random_item(x.value, _(x.title));
this.flowBox.insert(item, -1);
});
this.imageList.forEach((image) => {
let item = this._create_gallery_item(image);
this.flowBox.insert(item, -1);
});
}
_create_gallery_item(image) {
let buildable = new Gtk.Builder();
// grab appropriate object from UI file
buildable.add_objects_from_file(this.extensionPath + '/ui/carousel4.ui', ["flowBoxChild"]);
// assign variables to the UI objects we've just loaded
let galleryImage = buildable.get_object('galleryImage');
let filename = Utils.imageToFilename(this.settings, image);
let viewButton = buildable.get_object('viewButton');
let applyButton = buildable.get_object('applyButton');
let infoButton = buildable.get_object('infoButton');
let deleteButton = buildable.get_object('deleteButton');
let favButton = buildable.get_object('favButton');
let unfavButton = buildable.get_object('unfavButton');
if (Utils.isFavourite(image)) {
favButton.set_visible(false);
this.log('image is favourited');
}
else {
unfavButton.set_visible(false);
}
try {
this._load_image(galleryImage, filename);
}
catch (e) {
galleryImage.set_from_icon_name('image-missing');
galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE;
this.log('create_gallery_image: '+e);
}
galleryImage.set_tooltip_text(image.copyright);
// set up actions for when a image button is clicked
viewButton.connect('clicked', () => {
Utils.openInSystemViewer(filename);
});
applyButton.connect('clicked', () => {
this.settings.set_string('selected-image', Utils.getImageUrlBase(image));
this.log('gallery selected '+Utils.getImageUrlBase(image));
});
infoButton.connect('clicked', () => {
Utils.openInSystemViewer(image.copyrightlink, false);
this.log('info page link opened '+image.copyrightlink);
});
deleteButton.connect('clicked', (widget) => {
this.log('Delete requested for '+filename);
Utils.deleteImage(filename);
//Utils.cleanupImageList(this.settings); // hide image instead
Utils.hideImage(this.settings, [image]);
widget.get_parent().get_parent().set_visible(false); // bit of a hack
if (this.callbackfunc)
this.callbackfunc();
});
// button is unchecked, so we want to make the checked one visible
favButton.connect('clicked', (widget) => {
this.log('favourited '+Utils.getImageUrlBase(image));
widget.set_visible(false);
unfavButton.set_visible(true);
Utils.setImageFavouriteStatus(this.settings, image.urlbase, true);
});
// button is checked, so we want to make the unchecked one visible
unfavButton.connect('clicked', (widget) => {
this.log('unfavourited '+Utils.getImageUrlBase(image));
widget.set_visible(false);
favButton.set_visible(true);
Utils.setImageFavouriteStatus(this.settings, image.urlbase, false);
});
let item = buildable.get_object('flowBoxChild');
return item;
}
_create_random_item(interval, title) {
let buildable = new Gtk.Builder();
// grab appropriate object from UI file
buildable.add_objects_from_file(this.extensionPath + '/ui/carousel4.ui', ["flowBoxRandom"]);
let randomLabel = buildable.get_object('randomLabel');
randomLabel.set_text(title);
let filename = 'random';
let applyButton = buildable.get_object('randomButton');
applyButton.connect('clicked', (widget) => {
this.settings.set_string('random-interval-mode', interval);
this.settings.set_boolean('random-mode-enabled', true);
this.log('gallery selected random with interval '+interval+' ('+title+')');
});
let item = buildable.get_object('flowBoxRandom');
return item;
}
_create_placeholder_item() {
let buildable = new Gtk.Builder();
this.flowBox.set_max_children_per_line(1);
// grab appropriate object from UI file
buildable.add_objects_from_file(this.extensionPath + '/ui/carousel4.ui', ["flowBoxPlaceholder"]);
let loadButton = buildable.get_object('loadButton');
loadButton.connect('clicked', (widget) => {
widget.set_label(_("Loading...")); // does this work???
this.flowBox.remove(widget.get_parent());
this.flowBox.set_max_children_per_line(2);
this._create_gallery();
});
let item = buildable.get_object('flowBoxPlaceholder');
return item;
}
_load_image(galleryImage, filename) {
let thumb_path = Utils.getWallpaperDir(this.settings)+'.thumbs/';
let thumb_dir = Gio.file_new_for_path(thumb_path);
let save_thumbs = !this.settings.get_boolean('delete-previous') && this.settings.get_boolean('create-thumbs'); // create thumbs only if not deleting previous and thumbs are enabled
if (!thumb_dir.query_exists(null)) {
thumb_dir.make_directory_with_parents(null);
}
let image_file = Gio.file_new_for_path(filename);
// load gallery image or create new thumbnail if it doesn't
if (!image_file.query_exists(null)){
this._set_blank_image(galleryImage);
}
else {
let image_thumb_path = thumb_path + image_file.get_basename();
let image_thumb = Gio.file_new_for_path(image_thumb_path);
try {
let pixbuf;
// use thumbnail if available
if (image_thumb.query_exists(null)) {
pixbuf = GdkPixbuf.Pixbuf.new_from_file(image_thumb_path);
}
else { // save changed thumbnail significantly speeds up gallery loading, but costs some addtional disk space
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(filename, GALLERY_THUMB_WIDTH, GALLERY_THUMB_HEIGHT);
if (save_thumbs)
pixbuf.savev(image_thumb_path,'jpeg',['quality'], ['90']);
}
galleryImage.set_pixbuf(pixbuf);
}
catch (e) {
this._set_blank_image(galleryImage);
this.log('create_gallery_image: '+e);
}
}
}
_set_blank_image(galleryImage) {
//galleryImage.set_from_icon_name('image-missing');
//galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE;
}
log(msg) {
if (this.settings.get_boolean('debug-logging'))
console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal
}
};

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="bing.svg"
inkscape:export-filename="/home/giulio/Scaricati/bing.svg.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.28574218"
inkscape:cx="360.85355"
inkscape:cy="487.41923"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-left="0"
fit-margin-bottom="0"
fit-margin-top="0"
fit-margin-right="0"
inkscape:window-width="1307"
inkscape:window-height="704"
inkscape:window-x="59"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2996"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="226.45871"
originy="5.9950575"
spacingx="1.0666667"
spacingy="1.0666667" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(226.45871,-1000.5147)">
<path
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.06666672"
d="m -207.22508,1000.5147 25.56889,8.995 0,90.0025 36.01496,-20.7906 -17.65737,-8.2848 -11.13975,-27.7264 56.74602,19.9359 0,28.9836 -63.94928,36.8848 -25.58347,-14.2309 z"
id="path2998"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 128.00033 120.875"
xml:space="preserve"
sodipodi:docname="brick2.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
width="128.00034"
height="120.875"><metadata
id="metadata39"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs37" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2202"
inkscape:window-height="1449"
id="namedview35"
showgrid="false"
inkscape:zoom="1.0050722"
inkscape:cx="-133.99539"
inkscape:cy="3.4704905"
inkscape:window-x="238"
inkscape:window-y="59"
inkscape:window-maximized="0"
inkscape:current-layer="Capa_1" />
<rect
x="-53.404499"
y="-53.404499"
width="128.00034"
height="120.875"
style="fill:#000000;fill-opacity:0;stroke:none;stroke-width:0.97177076"
id="rect5" />
<path
d="M 4.08844,23.702082 C 1.834347,23.702082 0,21.75341 0,19.35754 V 4.344542 C 0,1.948672 1.834347,0 4.08844,0 h 51.734577 c 2.25409,0 4.08844,1.948672 4.08844,4.344542 V 19.35754 c 0,2.39587 -1.83435,4.344542 -4.08844,4.344542 z m 119.82346,0 c 2.25409,0 4.08844,-1.948672 4.08844,-4.344542 V 4.344542 C 128.00034,1.948672 126.16599,0 123.9119,0 H 72.177317 c -2.25409,0 -4.08844,1.948672 -4.08844,4.344542 V 19.35754 c 0,2.39587 1.83435,4.344542 4.08844,4.344542 z M 89.867177,56.09267 c 2.2541,0 4.08844,-1.94925 4.08844,-4.34454 V 36.735707 c 0,-2.395869 -1.83434,-4.344541 -4.08844,-4.344541 h -51.73457 c -2.254093,0 -4.08844,1.948672 -4.08844,4.344541 V 51.74871 c 0,2.39529 1.834347,4.34454 4.08844,4.34454 h 51.73457 z m -68.088329,0 c 2.254638,0 4.088439,-1.94867 4.088439,-4.34454 V 36.735707 c 0,-2.395869 -1.833801,-4.344541 -4.088439,-4.344541 H 4.387169 c -2.254638,0 -4.08844,1.948672 -4.08844,4.344541 V 51.74871 c 0,2.39587 1.833802,4.34454 4.08844,4.34454 h 17.391679 z m 101.834322,0 c 2.25464,0 4.08844,-1.94867 4.08844,-4.34454 V 36.735707 c 0,-2.395869 -1.8338,-4.344541 -4.08844,-4.344541 h -17.39168 c -2.25464,0 -4.08844,1.948672 -4.08844,4.344541 V 51.74871 c 0,2.39587 1.8338,4.34454 4.08844,4.34454 h 17.39168 z M 55.823017,88.48383 c 2.25409,0 4.08844,-1.94867 4.08844,-4.34454 v -15.013 c 0,-2.39529 -1.83435,-4.34454 -4.08844,-4.34454 H 4.08844 C 1.834347,64.78175 0,66.731 0,69.12629 v 15.013 c 0,2.39587 1.834347,4.34454 4.08844,4.34454 z m 68.088883,0 c 2.25409,0 4.08844,-1.94867 4.08844,-4.34454 v -15.013 c 0,-2.39529 -1.83435,-4.34454 -4.08844,-4.34454 H 72.177317 c -2.25409,0 -4.08844,1.94925 -4.08844,4.34454 v 15.013 c 0,2.39587 1.83435,4.34454 4.08844,4.34454 z M 89.867177,120.875 c 2.2541,0 4.08844,-1.94867 4.08844,-4.34454 v -15.013 c 0,-2.39587 -1.83434,-4.34454 -4.08844,-4.34454 h -51.73457 c -2.254093,0 -4.08844,1.94867 -4.08844,4.34454 v 15.013 c 0,2.39587 1.834347,4.34454 4.08844,4.34454 z m -68.088329,0 c 2.254638,0 4.088439,-1.94867 4.088439,-4.34454 v -15.013 c 0,-2.39587 -1.833801,-4.34454 -4.088439,-4.34454 H 4.387169 c -2.254638,0 -4.08844,1.94867 -4.08844,4.34454 v 15.013 c 0,2.39587 1.833802,4.34454 4.08844,4.34454 z m 101.834322,0 c 2.25464,0 4.08844,-1.94867 4.08844,-4.34454 v -15.013 c 0,-2.39587 -1.8338,-4.34454 -4.08844,-4.34454 h -17.39168 c -2.25464,0 -4.08844,1.94867 -4.08844,4.34454 v 15.013 c 0,2.39587 1.8338,4.34454 4.08844,4.34454 z"
id="path2"
style="fill:#cccccc;fill-opacity:1;stroke-width:0.56193948"
inkscape:connector-curvature="0" />
<g
id="g4"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g6"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g8"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g10"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g12"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g14"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g16"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g18"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g20"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g22"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g24"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g26"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g28"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g30"
transform="translate(-53.404333,-56.967)">
</g>
<g
id="g32"
transform="translate(-53.404333,-56.967)">
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M20.95 31.95 35.4 17.5l-2.15-2.15-12.3 12.3L15 21.7l-2.15 2.15ZM9 42q-1.2 0-2.1-.9Q6 40.2 6 39V9q0-1.2.9-2.1Q7.8 6 9 6h30q1.2 0 2.1.9.9.9.9 2.1v30q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h30V9H9v30ZM9 9v30V9Z"/></svg>

After

Width:  |  Height:  |  Size: 277 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m24 41.95-2.05-1.85q-5.3-4.85-8.75-8.375-3.45-3.525-5.5-6.3T4.825 20.4Q4 18.15 4 15.85q0-4.5 3.025-7.525Q10.05 5.3 14.5 5.3q2.85 0 5.275 1.35Q22.2 8 24 10.55q2.1-2.7 4.45-3.975T33.5 5.3q4.45 0 7.475 3.025Q44 11.35 44 15.85q0 2.3-.825 4.55T40.3 25.425q-2.05 2.775-5.5 6.3T26.05 40.1Z"/></svg>

After

Width:  |  Height:  |  Size: 363 B

View File

@ -0,0 +1,11 @@
<svg viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
<g>
<path d="M26.49,55.55c1.8,5.02,1.26,10.22-2.59,11.6c-3.85,1.38-8.46-2.05-10.23-6.96c-1.81-5.02-1.36-10.23,2.59-11.6 C20.13,47.26,24.69,50.53,26.49,55.55z"/>
<path d="M50.1,111.9c-3.74,1.64-8.81-1.77-10.92-6.55c-2.15-4.88-1.83-10.23,1.91-11.87c3.75-1.64,8.59,1.24,10.73,6.12 S53.84,110.26,50.1,111.9z"/>
<ellipse cx="64.29" cy="29.27" rx="13.81" ry="9.93"/>
<path d="M87.6,106.06c-2.85,4.66-8.18,6.82-11.39,4.86c-3.21-1.96-3.65-7.63-0.73-12.24c3.28-5.19,8.25-6.57,11.46-4.61 S90.45,101.4,87.6,106.06z"/>
<path d="M100.58,83.5c-2.82,4.83-8.22,7.14-11.54,5.2c-3.31-1.94-3.83-7.58-1.01-12.42c2.82-4.82,8.33-6.97,11.65-5.03 S103.4,78.68,100.58,83.5z"/>
<path d="M113.2,61.77c-2.71,4.74-7.97,7.05-11.24,5.19c-3.27-1.86-3.63-7.23-0.92-11.97c2.71-4.75,7.88-7.05,11.15-5.19 C115.45,51.67,115.91,57.02,113.2,61.77z"/>
<path d="M120.63,49.77v-0.12c0.03-2.18,0.03-4.15-0.04-5.46c-0.19-3.62-0.93-6.51-2.83-10.16c-0.12-0.23-0.24-0.45-0.37-0.68 c-0.24-0.43-0.5-0.86-0.77-1.28c-0.01-0.02-0.03-0.05-0.04-0.07c-0.23-0.35-0.46-0.7-0.7-1.05c-0.36-0.52-0.73-1.02-1.11-1.5 c-0.15-0.2-0.31-0.4-0.47-0.59c-0.16-0.19-0.31-0.38-0.47-0.57c-0.55-0.65-1.09-1.25-1.6-1.77c-0.14-0.15-0.28-0.28-0.41-0.41 c-0.27-0.26-0.52-0.5-0.76-0.71c0-0.01-0.01-0.02-0.01-0.02c-0.35-0.38-0.76-0.75-1.22-1.1C103.99,19.91,77.88,7.8,72.34,5.76 c-1.79-0.66-5.35-1.55-9.16-1.55c-2.21,0-4.5,0.3-6.6,1.11c-4.52,1.75-33.19,15.02-35.96,16.77c-0.35,0.22-0.7,0.46-1.04,0.71 c-0.01,0.01-0.02,0.01-0.03,0.02c-0.01,0-0.01,0.01-0.02,0.01c-0.24,0.15-0.47,0.29-0.64,0.42c-3.29,2.38-7.29,5.41-9.41,9.46 c-2.03,3.87-2.84,6.83-2.99,11.79v0.41c-0.01,0.06-0.01,0.12-0.01,0.18C6.33,50.26,6.64,81.82,6.71,86.1 c0.07,4.72,1.23,9.97,4.37,12.66c3.14,2.69,28.57,18.82,34.29,21.29c0.47,0.2,0.93,0.38,1.4,0.53c0.03,0.01,0.06,0.02,0.09,0.03 c0.53,0.22,1.09,0.45,1.66,0.66c0.69,0.26,1.4,0.52,2.14,0.76c0.36,0.12,0.73,0.24,1.11,0.35c0.23,0.07,0.47,0.14,0.72,0.21 c0.22,0.07,0.44,0.13,0.67,0.19c2.3,0.62,4.83,1.1,7.55,1.3c0.42,0.03,0.85,0.06,1.29,0.07c0.47,0.02,0.95,0.03,1.43,0.03 c0.23,0,0.46-0.01,0.69-0.01c8.02-0.15,13.29-2.62,16.36-4.08l0.01-0.01c0.01,0,0.01-0.01,0.02-0.01c0.03-0.01,0.06-0.02,0.09-0.03 c0.39-0.17,0.79-0.33,1.19-0.51c0.35-0.16,0.7-0.32,1.05-0.48c0.12-0.06,0.25-0.12,0.38-0.18c0.37-0.18,0.75-0.37,1.14-0.57 c0.04-0.02,0.08-0.04,0.13-0.07c0.88-0.45,1.78-0.93,2.68-1.43c0.09-0.05,0.18-0.1,0.27-0.15c0.52-0.29,1.03-0.59,1.55-0.89 c0.26-0.15,0.51-0.3,0.77-0.46c0.52-0.3,1.03-0.61,1.54-0.92c3.58-2.18,7.03-4.45,9.97-6.21c6.72-4.03,11.96-7.45,14.3-9.37 c3-2.45,5.03-8.38,5.14-13.42C120.8,81.15,120.71,57.83,120.63,49.77z M61.73,111.09c-0.25,3.9-1.98,6.81-4.54,8.5 c-2.85-0.52-5.76-1.41-8.8-2.67l-0.13-0.06l-0.13-0.04l-0.09-0.03l-0.03-0.01l-0.02-0.01c-0.3-0.1-0.64-0.22-1.03-0.39 c-3.09-1.34-12.67-7.15-20.8-12.31c-6.04-3.85-11.29-7.33-12.48-8.35c-1.77-1.51-2.9-5.22-2.97-9.69 c-0.01-0.59-0.02-1.66-0.04-3.08c-0.1-9.15-0.31-32.95-0.2-37.62l0.02-0.09v-0.68c0.09-2.82,0.38-4.8,1.11-6.82 c2.14-0.56,4.57-0.16,6.53,0.96c3.18,1.83,34.18,19.61,38.1,22.3c3.92,2.69,5.72,7.97,5.72,11.55S62.29,102.46,61.73,111.09z M27.55,40.33c-6.91-3.51-10.79-5.67-11.82-9.33c1.61-1.64,3.57-3.11,5.5-4.51c0.03-0.02,0.16-0.11,0.38-0.24l0.17-0.1l0.16-0.12 c0.22-0.17,0.49-0.35,0.82-0.56c1.9-1.2,20.88-10.1,30.49-14.37c2.18-0.97,3.87-1.7,4.78-2.05c1.43-0.56,3.17-0.84,5.15-0.84 c3.34,0,6.46,0.82,7.78,1.3c0.61,0.23,1.44,0.56,2.46,0.99c0,0,0.01,0.01,0.02,0.01C81.7,14,101.78,23.5,107.07,27.22l1.35,1.18 c0.82,0.73,2.08,2.05,3.33,3.67c-0.64,1.06-1.63,2.05-2.94,2.9c-4.53,2.93-35.89,21.99-44.35,21.7 C56,56.38,35.58,44.41,27.55,40.33z M116.71,85.29c-0.1,4.52-1.98,9.03-3.68,10.42c-2.14,1.75-7.18,5.05-13.82,9.03 c-1.54,0.93-3.19,1.97-4.94,3.07c-2.42,1.53-5,3.16-7.57,4.66c-2.64,1.53-5.28,2.92-7.71,3.9l-0.76,0.32l-0.09,0.08 c-1.83,0.86-4.34,1.96-7.69,2.67c-2.86-2.34-4.52-6.19-4.59-8.13c-0.11-3.25,0.11-35.19,0.11-39.33c0-4.14,1.35-7.98,4.71-10.64 c4.82-3.81,35.07-21.86,41.23-23.2c1.26-0.27,2.36-0.3,3.31-0.11c0,0.01,0,0.01,0,0.01c0.86,2.07,1.25,3.96,1.38,6.36 c0.05,1.07,0.06,2.76,0.03,5.2v0.09c0.04,3.7,0.08,10.75,0.1,17.66C116.75,75.28,116.76,83.02,116.71,85.29z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="96pt"
height="76.800003pt"
viewBox="0 0 96 76.800003"
version="1.1"
id="svg7"
sodipodi:docname="low-frame2.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata13">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs11" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1466"
inkscape:window-height="1148"
id="namedview9"
showgrid="false"
inkscape:zoom="0.921875"
inkscape:cx="-150.77966"
inkscape:cy="51.2"
inkscape:window-x="60"
inkscape:window-y="30"
inkscape:window-maximized="0"
inkscape:current-layer="surface1296651" />
<g
id="surface1296651"
transform="translate(-48,-57.6)">
<rect
x="0"
y="0"
width="192"
height="192"
style="fill:#000000;fill-opacity:0.0044053;stroke:none"
id="rect2" />
<path
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.60000002"
d="M 134.4,57.6 H 57.6 c -5.303906,0 -9.6,4.296094 -9.6,9.6 v 57.6 c 0,5.30391 4.296094,9.6 9.6,9.6 h 76.8 c 5.30391,0 9.6,-4.29609 9.6,-9.6 V 67.2 c 0,-5.303906 -4.29609,-9.6 -9.6,-9.6 z m -68.985937,58.52578 11.953124,-15.36797 c 0.939844,-1.211716 2.758594,-1.239841 3.738282,-0.0586 L 91.2,112.84687 106.07109,93.686719 c 0.96797,-1.253906 2.86407,-1.232813 3.81563,0.03281 l 16.83281,22.441411 C 127.90547,117.74297 126.77813,120 124.8,120 H 67.305469 c -1.996875,0 -3.119532,-2.29922 -1.891406,-3.87422 z m 0,0"
id="path4"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="96pt"
height="96pt"
viewBox="0 0 96 96"
version="1.1"
id="svg7"
sodipodi:docname="mid-frame2.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata13">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs11" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="977"
inkscape:window-height="803"
id="namedview9"
showgrid="false"
inkscape:zoom="1.3828125"
inkscape:cx="63.999998"
inkscape:cy="64.000002"
inkscape:window-x="526"
inkscape:window-y="574"
inkscape:window-maximized="0"
inkscape:current-layer="svg7" />
<g
id="surface1295461"
transform="scale(0.74999998)">
<rect
x="0"
y="0"
width="128"
height="128"
style="fill:#000000;fill-opacity:0;stroke:none"
id="rect2" />
<path
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 8,20 v 88 H 120 V 20 Z m 8,8 h 96 V 83.625 L 90.875,62.375 88,59.5 69.875,77.625 46.875,54.375 44,51.5 16,79.5 Z m 80,8 c -4.421875,0 -8,3.578125 -8,8 0,4.421875 3.578125,8 8,8 4.42188,0 8,-3.578125 8,-8 0,-4.421875 -3.57812,-8 -8,-8 z M 44,62.875 80.75,100 H 16 v -9.125 z m 44,8 24,24 V 100 H 92.125 L 75.5,83.25 Z m 0,0"
id="path4"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
<g>
<ellipse style="fill:#000000;" cx="63.94" cy="104.89" rx="35" ry="13.61"/>
<path style="fill:#000000;" d="M108.51,32.83l-2.26,12.33l-6.61-6.61l3.44-3.44l-9.75,2.84l0.6,0.6l-8.09,8.09l-6.54-6.54
l-9.63,0.82l-5.72,5.72l-6.2-6.2l-8.96-0.52l-6.72,6.72l-8.09-8.09l0.83-0.83l-9.36-1.98l2.81,2.81l-6.39,6.39L19.63,32.6
l-4.56-2.58l14.51,80.37C30.7,118.02,45.29,124,64.05,124s33.08-5.98,34.51-13.61l14.6-80.45L108.51,32.83z M84.06,110.53
l-6.32-6.32l8.09-8.09l8.09,8.09l0,0l-4.72,4.72C87.58,109.51,85.86,110.04,84.06,110.53z M39.21,109.46l-5.25-5.25l0,0l8.09-8.09
l8.09,8.09l-6.51,6.51C42.09,110.34,40.61,109.91,39.21,109.46z M72.03,104.22l-8.09,8.09l-8.09-8.09l8.09-8.09L72.03,104.22z
M66.8,93.27l8.09-8.09l8.09,8.09l-8.09,8.09L66.8,93.27z M52.99,101.36l-8.09-8.09l8.09-8.09l8.09,8.09L52.99,101.36z
M52.99,107.07l6.13,6.13c-3.65-0.25-7.33-0.75-10.84-1.43L52.99,107.07z M68.76,113.2l6.13-6.13l4.58,4.58
C75.99,112.39,72.36,112.94,68.76,113.2z M96.07,100.65l-7.38-7.38l8.09-8.09l1.8,1.8L96.07,100.65z M100.67,75.57l-3.89,3.89
l-8.09-8.09l8.09-8.09l5.19,5.19L100.67,75.57z M93.92,82.32l-8.09,8.09l-8.09-8.09l8.09-8.09L93.92,82.32z M74.88,79.47
l-8.09-8.09l8.09-8.09l8.09,8.09L74.88,79.47z M72.03,82.32l-8.09,8.09l-8.09-8.09l8.09-8.09L72.03,82.32z M52.99,79.47l-8.09-8.09
l8.09-8.09l8.09,8.09L52.99,79.47z M50.13,82.32l-8.09,8.09l-8.09-8.09l8.09-8.09L50.13,82.32z M31.1,79.47l-3.72-3.72l-1.33-7.4
l5.05-5.05l8.09,8.09L31.1,79.47z M31.1,85.18l8.09,8.09l-7.35,7.35L29.38,86.9L31.1,85.18z M102.85,63.65l-3.22-3.22l4.67-4.67
L102.85,63.65z M96.78,41.4l8.09,8.09l-8.09,8.09l-8.09-8.09L96.78,41.4z M85.83,52.34l8.09,8.09l-8.09,8.09l-8.09-8.09
L85.83,52.34z M74.88,41.4l8.09,8.09l-8.09,8.09l-8.09-8.09L74.88,41.4z M72.03,60.43l-8.09,8.09l-8.09-8.09l8.09-8.09L72.03,60.43
z M52.99,41.4l8.09,8.09l-8.09,8.09l-8.09-8.09L52.99,41.4z M50.13,60.43l-8.09,8.09l-8.09-8.09l8.09-8.09L50.13,60.43z M31.1,41.4
l8.09,8.09l-8.09,8.09l-8.09-8.09L31.1,41.4z M28.24,60.43l-3.06,3.06l-1.34-7.47L28.24,60.43z"/>
<path style="fill:#000000;" d="M64,4C34.17,4,9.99,9.9,9.99,22.74c0,10.24,24.18,18.74,54.01,18.74c29.83,0,54.01-8.5,54.01-18.74
C118.01,11.29,93.83,4,64,4z M64,34.36c-24.01,0-43.47-5.98-43.47-13.35c0-7.37,19.46-11.69,43.47-11.69
c24.01,0,43.47,4.32,43.47,11.69C107.47,28.38,88.01,34.36,64,34.36z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version="1.1"
id="Layer_4"
x="0px"
y="0px"
viewBox="0 0 128 128"
xml:space="preserve"
sodipodi:docname="trashcan-symbolic.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<g
id="surface1295461"
transform="translate(-7.5935033,-12.2479)"><g
id="g2016"
transform="matrix(0.1102846,-0.73545299,0.80952843,0.0919598,17.044863,109.0104)"
inkscape:label="g2016"><path
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 8,20 v 88 H 120 V 20 Z m 8,8 h 96 V 83.625 L 90.875,62.375 88,59.5 69.875,77.625 46.875,54.375 44,51.5 16,79.5 Z m 80,8 c -4.421875,0 -8,3.578125 -8,8 0,4.421875 3.578125,8 8,8 4.42188,0 8,-3.578125 8,-8 0,-4.421875 -3.57812,-8 -8,-8 z M 44,62.875 80.75,100 H 16 v -9.125 z m 44,8 24,24 V 100 H 92.125 L 75.5,83.25 Z m 0,0"
id="path4"
inkscape:connector-curvature="0"
sodipodi:insensitive="true" /></g></g><g
id="g86">
<ellipse
style="fill:#000000"
cx="63.939999"
cy="104.89"
rx="35"
ry="13.61"
id="ellipse67" />
<linearGradient
id="SVGID_1_"
gradientUnits="userSpaceOnUse"
x1="64.110703"
y1="89.9664"
x2="64.110703"
y2="147.6283">
<stop
offset="0"
style="stop-color:#82AFC1"
id="stop71" />
<stop
offset="1"
style="stop-color:#2F7889"
id="stop73" />
</linearGradient>
<path
style="fill:#000000"
d="m 108.51,32.83 -2.26,12.33 -6.61,-6.61 3.44,-3.44 -9.75,2.84 0.6,0.6 -8.09,8.09 -6.54,-6.54 -9.63,0.82 -5.72,5.72 -6.2,-6.2 -8.96,-0.52 -6.72,6.72 -8.09,-8.09 0.83,-0.83 -9.36,-1.98 2.81,2.81 -6.39,6.39 -2.24,-12.34 -4.56,-2.58 14.51,80.37 c 1.12,7.63 15.71,13.61 34.47,13.61 18.76,0 33.08,-5.98 34.51,-13.61 l 14.6,-80.45 z m -24.45,77.7 -6.32,-6.32 8.09,-8.09 8.09,8.09 v 0 l -4.72,4.72 c -1.62,0.58 -3.34,1.11 -5.14,1.6 z m -44.85,-1.07 -5.25,-5.25 v 0 l 8.09,-8.09 8.09,8.09 -6.51,6.51 c -1.54,-0.38 -3.02,-0.81 -4.42,-1.26 z m 32.82,-5.24 -8.09,8.09 -8.09,-8.09 8.09,-8.09 z m -5.23,-10.95 8.09,-8.09 8.09,8.09 -8.09,8.09 z m -13.81,8.09 -8.09,-8.09 8.09,-8.09 8.09,8.09 z m 0,5.71 6.13,6.13 c -3.65,-0.25 -7.33,-0.75 -10.84,-1.43 z m 15.77,6.13 6.13,-6.13 4.58,4.58 c -3.48,0.74 -7.11,1.29 -10.71,1.55 z m 27.31,-12.55 -7.38,-7.38 8.09,-8.09 1.8,1.8 z m 4.6,-25.08 -3.89,3.89 -8.09,-8.09 8.09,-8.09 5.19,5.19 z m -6.75,6.75 -8.09,8.09 -8.09,-8.09 8.09,-8.09 z m -19.04,-2.85 -8.09,-8.09 8.09,-8.09 8.09,8.09 z m -2.85,2.85 -8.09,8.09 -8.09,-8.09 8.09,-8.09 z m -19.04,-2.85 -8.09,-8.09 8.09,-8.09 8.09,8.09 z m -2.86,2.85 -8.09,8.09 -8.09,-8.09 8.09,-8.09 z m -19.03,-2.85 -3.72,-3.72 -1.33,-7.4 5.05,-5.05 8.09,8.09 z m 0,5.71 8.09,8.09 -7.35,7.35 -2.46,-13.72 z m 71.75,-21.53 -3.22,-3.22 4.67,-4.67 z m -6.07,-22.25 8.09,8.09 -8.09,8.09 -8.09,-8.09 z m -10.95,10.94 8.09,8.09 -8.09,8.09 -8.09,-8.09 z M 74.88,41.4 l 8.09,8.09 -8.09,8.09 -8.09,-8.09 z m -2.85,19.03 -8.09,8.09 -8.09,-8.09 8.09,-8.09 z M 52.99,41.4 l 8.09,8.09 -8.09,8.09 -8.09,-8.09 z m -2.86,19.03 -8.09,8.09 -8.09,-8.09 8.09,-8.09 z M 31.1,41.4 l 8.09,8.09 -8.09,8.09 -8.09,-8.09 z m -2.86,19.03 -3.06,3.06 -1.34,-7.47 z"
id="path76" />
<path
style="fill:#000000"
d="M 64,4 C 34.17,4 9.99,9.9 9.99,22.74 c 0,10.24 24.18,18.74 54.01,18.74 29.83,0 54.01,-8.5 54.01,-18.74 C 118.01,11.29 93.83,4 64,4 Z m 0,30.36 C 39.99,34.36 20.53,28.38 20.53,21.01 20.53,13.64 39.99,9.32 64,9.32 c 24.01,0 43.47,4.32 43.47,11.69 0,7.37 -19.46,13.35 -43.47,13.35 z"
id="path78" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M9 42q-1.2 0-2.1-.9Q6 40.2 6 39V9q0-1.2.9-2.1Q7.8 6 9 6h30q1.2 0 2.1.9.9.9.9 2.1v30q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h30V9H9v30Z"/></svg>

After

Width:  |  Height:  |  Size: 204 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m24 41.95-2.05-1.85q-5.3-4.85-8.75-8.375-3.45-3.525-5.5-6.3T4.825 20.4Q4 18.15 4 15.85q0-4.5 3.025-7.525Q10.05 5.3 14.5 5.3q2.85 0 5.275 1.35Q22.2 8 24 10.55q2.1-2.7 4.45-3.975T33.5 5.3q4.45 0 7.475 3.025Q44 11.35 44 15.85q0 2.3-.825 4.55T40.3 25.425q-2.05 2.775-5.5 6.3T26.05 40.1ZM24 38q5.05-4.65 8.325-7.975 3.275-3.325 5.2-5.825 1.925-2.5 2.7-4.45.775-1.95.775-3.9 0-3.3-2.1-5.425T33.5 8.3q-2.55 0-4.75 1.575T25.2 14.3h-2.45q-1.3-2.8-3.5-4.4-2.2-1.6-4.75-1.6-3.3 0-5.4 2.125Q7 12.55 7 15.85q0 1.95.775 3.925.775 1.975 2.7 4.5Q12.4 26.8 15.7 30.1 19 33.4 24 38Zm0-14.85Z"/></svg>

After

Width:  |  Height:  |  Size: 654 B

View File

@ -0,0 +1,13 @@
{
"_generated": "Generated by SweetTooth, do not edit",
"description": "Sync your wallpaper to today's Microsoft Bing image of the day (the image you see when you visit Bing.com).\n\n *Disclaimer*: this extension is unofficial and not affiliated with Bing or Microsoft in any way. Images are protected by copyright and are licensed only for use as wallpapers.\n\nFeatures:\n* UHD resolution wallpapers\n* Automatically fetches current Bing wallpaper of the day and sets as both lock screen and desktop wallpaper (user selectable on GNOME versions that support it)\n* Doesn't poll continuously - only once per day and on startup (schedules a refresh when Bing is due to update)\n * random mode (from previously downloaded wallpapers)\n *NEW: select/cycle wallpaper through previously downloaded images\n* Language support: English (en), German (de), Dutch (nl), Italian (it), Polish (pl), Chinese (zh_CN, zh_TW), French (fr), Portuguese (pt), Ukrainian (uk), Russian (ru_RU), Spanish (es), Korean (ko), Indonesian (id), Catalan (ca), Norwegian Bokm\u00e5l (nb) & Nynorsk (ni), Swedish (sv), Arabic (ar), Hungarian (hu) and Japanese (ja) - a HUGE thanks to the translators\n\nThis extension was forked from the NASA APOD extension by Elinvention (https://github.com/Elinvention) and inspired by Bing Desktop Wallpaper Changer by Utkarsh Gupta (https://github.com/UtkarshGpta).\n\nAlways restart GNOME after manually updating extensions. Please report bugs to the GitHub page below:",
"gettext-domain": "BingWallpaper",
"name": "Bing Wallpaper",
"settings-schema": "org.gnome.shell.extensions.bingwallpaper",
"shell-version": [
"45"
],
"url": "https://github.com/neffo/bing-wallpaper-gnome-extension",
"uuid": "BingWallpaper@ineffable-gmail.com",
"version": 48
}

View File

@ -0,0 +1,247 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// See the GNU General Public License, version 3 or later for details.
// Based on GNOME shell extension NASA APOD by Elia Argentieri https://github.com/Elinvention/gnome-shell-extension-nasa-apod
import Gtk from 'gi://Gtk';
import Gdk from 'gi://Gdk';
import Gio from 'gi://Gio';
import Soup from 'gi://Soup';
import Adw from 'gi://Adw';
import {ExtensionPreferences, gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
import * as Config from 'resource:///org/gnome/Shell/Extensions/js/misc/config.js';
import * as Utils from './utils.js';
import Carousel from './carousel.js';
const BingImageURL = Utils.BingImageURL;
var DESKTOP_SCHEMA = 'org.gnome.desktop.background';
var PREFS_DEFAULT_WIDTH = 950;
var PREFS_DEFAULT_HEIGHT = 950;
export default class BingWallpaperExtensionPreferences extends ExtensionPreferences {
fillPreferencesWindow(window) {
// formally globals
let settings = this.getSettings(Utils.BING_SCHEMA);
let desktop_settings = this.getSettings(Utils.DESKTOP_SCHEMA);
window.set_default_size(PREFS_DEFAULT_WIDTH, PREFS_DEFAULT_HEIGHT);
let icon_image = null;
let provider = new Gtk.CssProvider();
let carousel = null;
let httpSession = null;
let log = (msg) => { // avoids need for globals
if (settings.get_boolean('debug-logging'))
console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal
}
// Prepare labels and controls
let buildable = new Gtk.Builder();
// GTK4 removes some properties, and builder breaks when it sees them
buildable.add_from_file( this.dir.get_path() + '/ui/Settings4.ui' );
provider.load_from_path(this.dir.get_path() + '/ui/prefs.css');
Gtk.StyleContext.add_provider_for_display(
Gdk.Display.get_default(),
provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
let box = buildable.get_object('prefs_widget');
// fix size of prefs window in GNOME shell 40+ (but super racy, so is unreliable)
buildable.get_object('extension_version').set_text(this.metadata.version.toString());
buildable.get_object('extension_name').set_text(this.metadata.name.toString());
// assign variables to UI objects we've loaded
let hideSwitch = buildable.get_object('hide');
let iconEntry = buildable.get_object('icon');
let notifySwitch = buildable.get_object('notify');
let bgSwitch = buildable.get_object('background');
let styleEntry = buildable.get_object('background_style');
let fileChooserBtn = buildable.get_object('download_folder');
let fileChooser = buildable.get_object('file_chooser'); // this should only exist on Gtk4
let folderOpenBtn = buildable.get_object('button_open_download_folder');
let marketEntry = buildable.get_object('market');
let resolutionEntry = buildable.get_object('resolution');
let historyEntry = buildable.get_object('history');
icon_image = buildable.get_object('icon_image');
let overrideSwitch = buildable.get_object('lockscreen_override');
let strengthEntry = buildable.get_object('entry_strength');
let brightnessEntry = buildable.get_object('entry_brightness');
let debugSwitch = buildable.get_object('debug_switch');
let revertSwitch = buildable.get_object('revert_switch');
let unsafeSwitch = buildable.get_object('unsafe_switch');
let randomIntervalEntry = buildable.get_object('entry_random_interval');
let change_log = buildable.get_object('change_log');
let buttonGDMdefault = buildable.get_object('button_default_gnome');
let buttonnoblur = buildable.get_object('button_no_blur');
let buttonslightblur = buildable.get_object('button_slight_blur');
let buttonImportData = buildable.get_object('button_json_import');
let buttonExportData = buildable.get_object('button_json_export');
let switchAlwaysExport = buildable.get_object('always_export_switch');
let switchEnableShuffle = buildable.get_object('shuffle_enabled_switch');
let entryShuffleMode = buildable.get_object('shuffle_mode_combo');
let carouselFlowBox = (Gtk.get_major_version() == 4) ? buildable.get_object('carouselFlowBox'): null;
try {
httpSession = new Soup.Session();
httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; GNOME Shell/' + Config.PACKAGE_VERSION + '; Linux x86_64; +https://github.com/neffo/bing-wallpaper-gnome-extension ) BingWallpaper Gnome Extension/' + this.metadata.version;
}
catch (e) {
log("Error creating httpSession: " + e);
}
// check that these are valid (can be edited through dconf-editor)
Utils.validate_resolution(settings);
Utils.validate_icon(settings, this.path, icon_image);
// Indicator & notifications
settings.bind('hide', hideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('notify', notifySwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
// add markets to dropdown list (aka a GtkComboText)
Utils.icon_list.forEach((iconname, index) => {
iconEntry.append(iconname, iconname);
});
// user selectable indicator icons
settings.bind('icon-name', iconEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT);
settings.connect('changed::icon-name', () => {
Utils.validate_icon(settings, this.path, icon_image);
});
iconEntry.set_active_id(settings.get_string('icon-name'));
// connect switches to settings changes
settings.bind('set-background', bgSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('debug-logging', debugSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('revert-to-current-image', revertSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('override-unsafe-wayland', unsafeSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('random-interval', randomIntervalEntry, 'value', Gio.SettingsBindFlags.DEFAULT);
settings.bind('always-export-bing-json', switchAlwaysExport, 'active', Gio.SettingsBindFlags.DEFAULT);
// button opens Nautilus at our image folder
folderOpenBtn.connect('clicked', (widget) => {
Utils.openImageFolder(settings);
});
// we populate the tab (gtk4+, gnome 40+), this was previously a button to open a new window in gtk3
carousel = new Carousel(settings, null, null, carouselFlowBox, this.dir.get_path()); // auto load carousel
// this is intended for migrating image folders between computers (or even sharing) or backups
// we export the Bing JSON data to the image directory, so this folder becomes portable
buttonImportData.connect('clicked', () => {
Utils.importBingJSON(settings);
});
buttonExportData.connect('clicked', () => {
Utils.exportBingJSON(settings);
});
//download folder
fileChooserBtn.set_label(Utils.getWallpaperDir(settings));
fileChooserBtn.connect('clicked', (widget) => {
let parent = widget.get_root();
let curWallpaperDir = Gio.File.new_for_path(Utils.getWallpaperDir(settings));
fileChooser.set_current_folder(curWallpaperDir.get_parent());
fileChooser.set_action(Gtk.FileChooserAction.SELECT_FOLDER);
fileChooser.set_transient_for(parent);
fileChooser.set_accept_label(_('Select folder'));
fileChooser.show();
});
fileChooser.connect('response', (widget, response) => {
if (response !== Gtk.ResponseType.ACCEPT) {
return;
}
let fileURI = fileChooser.get_file().get_path().replace('file://', '');
fileChooserBtn.set_label(fileURI);
Utils.moveImagesToNewFolder(settings, Utils.getWallpaperDir(settings), fileURI);
Utils.setWallpaperDir(settings, fileURI);
});
// in Gtk 4 instead we use a DropDown, but we need to treat it a bit special
let market_grid = buildable.get_object('market_grid');
marketEntry = Gtk.DropDown.new_from_strings(Utils.marketName);
marketEntry.set_selected(Utils.markets.indexOf(settings.get_string('market')));
market_grid.attach(marketEntry, 1, 0, 1, 2);
marketEntry.connect('notify::selected-item', () => {
let id = marketEntry.get_selected();
settings.set_string('market', Utils.markets[id]);
});
settings.connect('changed::market', () => {
marketEntry.set_selected(Utils.markets.indexOf(settings.get_string('market')));
});
settings.connect('changed::download-folder', () => {
fileChooserBtn.set_label(Utils.getWallpaperDir(settings));
});
// Resolution
Utils.resolutions.forEach((res) => { // add res to dropdown list (aka a GtkComboText)
resolutionEntry.append(res, res);
});
settings.bind('resolution', resolutionEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT);
settings.connect('changed::resolution', () => {
Utils.validate_resolution(settings);
});
// shuffle modes
settings.bind('random-mode-enabled', switchEnableShuffle, 'active', Gio.SettingsBindFlags.DEFAULT);
Utils.randomIntervals.forEach((x) => {
entryShuffleMode.append(x.value, _(x.title));
});
settings.bind('random-interval-mode', entryShuffleMode, 'active_id', Gio.SettingsBindFlags.DEFAULT);
// selected image can no longer be changed through a dropdown (didn't scale)
settings.bind('selected-image', historyEntry, 'label', Gio.SettingsBindFlags.DEFAULT);
settings.connect('changed::selected-image', () => {
Utils.validate_imagename(settings);
});
// background styles (e.g. zoom or span)
Utils.backgroundStyle.forEach((style) => {
styleEntry.append(style, style);
});
desktop_settings.bind('picture-options', styleEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT);
// GDM3 lockscreen blur override
settings.bind('override-lockscreen-blur', overrideSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
settings.bind('lockscreen-blur-strength', strengthEntry, 'value', Gio.SettingsBindFlags.DEFAULT);
settings.bind('lockscreen-blur-brightness', brightnessEntry, 'value', Gio.SettingsBindFlags.DEFAULT);
// add a couple of preset buttons
buttonGDMdefault.connect('clicked', (widget) => {
Utils.set_blur_preset(settings, Utils.PRESET_GNOME_DEFAULT);
});
buttonnoblur.connect('clicked', (widget) => {
Utils.set_blur_preset(settings, Utils.PRESET_NO_BLUR);
});
buttonslightblur.connect('clicked', (widget) => {
Utils.set_blur_preset(settings, Utils.PRESET_SLIGHT_BLUR);
});
// fetch
if (httpSession)
Utils.fetch_change_log(this.metadata.version.toString(), change_log, httpSession);
const page = new Adw.PreferencesPage();
const group = new Adw.PreferencesGroup();
group.add(box);
page.add(group);
window.add(page);
}
}

View File

@ -0,0 +1,249 @@
<schemalist gettext-domain="gnome-shell-extensions">
<schema id="org.gnome.shell.extensions.bingwallpaper"
path="/org/gnome/shell/extensions/bingwallpaper/">
<key name="hide" type="b">
<default>false</default>
<summary>Hide indicator</summary>
<description>Hide indicator icon from status area</description>
</key>
<key name="notify" type="b">
<default>false</default>
<summary>Send a notifications</summary>
<description>Send a notification with explanation when a new image is available</description>
</key>
<key name="notify-only-latest" type="b">
<default>true</default>
<summary>Send a notifications only on most recent image</summary>
<description>Notify only the most recent image, in combination with 'notify' setting</description>
</key>
<key name="transient" type="b">
<default>true</default>
<summary>Use transient notifications (auto dismiss)</summary>
<description></description>
</key>
<key name="set-background" type="b">
<default>true</default>
<summary>Set background</summary>
<description>Set background to Bing's background</description>
</key>
<key name="set-lock-screen" type="b">
<default>false</default>
<summary>Set lock screen</summary>
<description>Set lock screen to Bing's background</description>
</key>
<key name="download-folder" type="s">
<default>""</default>
<summary>Where to download pictures.</summary>
<description></description>
</key>
<key name="market" type="s">
<default>"auto"</default>
<summary>Default Market for Bing</summary>
<description></description>
</key>
<key name="resolution" type="s">
<default>"auto"</default>
<summary>Screen Size</summary>
<description>Valid sizes are '800x600', '1024x768', '1280x720', '1280x768', '1366x768', '1920x1080', '1920x1200' and 'UHD'</description>
</key>
<key name="debug-logging" type="b">
<default>false</default>
<summary>Log messages to systemd journal</summary>
<description>Unlikely to be useful for ordinary users, but helpful for debugging</description>
</key>
<key name="delete-previous" type="b">
<default>false</default>
<summary>Delete previous wallpapers</summary>
<description>Save disk space</description>
</key>
<key name="previous-days" type="i">
<default>8</default>
<summary>Number of days to keep wallpapers</summary>
<description>Delete wallpapers after this number of days</description>
</key>
<key name="replace-watermark" type="s">
<default>""</default>
<summary>Replace or remove Bing watermark on high-res images</summary>
<description>Set to "none", "Gnome" or "Ubuntu"</description>
</key>
<key name="icon-name" type="s">
<default>"bing-symbolic"</default>
<summary>Icon Name</summary>
<description>Icon filename to use for extension applet</description>
</key>
<key name="override-wp-flag" type="b">
<default>false</default>
<summary>Ignore Bing permitted for use as wallpaper flag</summary>
<description>Used when wallpaper is animated, or not licensed for wallpaper use</description>
</key>
<key name="override-lockscreen-blur" type="b">
<default>false</default>
<summary>Override GNOME lockscreen (gdm3) wallpaper blur</summary>
<description>Applies to GNOME 3.36 and above only</description>
</key>
<key name="lockscreen-blur-strength" type="i">
<range min="0" max="100" />
<default>2</default>
<summary>GNOME lockscreen (gdm3) wallpaper blur strength</summary>
<description>Degree of fuzziness</description>
</key>
<key name="lockscreen-blur-brightness" type="i">
<range min="0" max="100" />
<default>50</default>
<summary>GNOME lockscreen (gdm3) wallpaper blur Brightness</summary>
<description>Used to darken the wallpaper to improve visibility</description>
</key>
<key name="selected-image" type="s">
<default>"current"</default>
<summary>Use older Bing image, select by filename</summary>
<description></description>
</key>
<key name="revert-to-current-image" type="b">
<default>true</default>
<summary>Revert to showing the current image when a new one arrives</summary>
<description>This setting may best reflect what users want from selectable or random images</description>
</key>
<key name="state" type="s">
<default>"[]"</default>
<summary>Store state in JSON format so we can restore details immediately on boot</summary>
<description></description>
</key>
<key name="bing-json" type="s">
<default>"[]"</default>
<summary>Store Bing image details for rollback</summary>
<description></description>
</key>
<key name="random-interval-mode" type="s">
<default>"daily"</default>
<summary>Set to either 'daily', 'hourly', 'weekly', 'custom'</summary>
<description>Daily is midnight, hourly is on the hour, weekly is midnight on Sunday, or custom as defined by the 'random-interval'</description>
</key>
<key name="random-interval" type="i">
<range min="300" max="86400" />
<default>3600</default>
<summary>How frequently to change the wallpaper when on random mode</summary>
<description></description>
</key>
<key name="random-mode-include-only-favourites" type="b">
<default>false</default>
<summary>Only pick from favourites in random mode</summary>
<description></description>
</key>
<key name="random-mode-enabled" type="b">
<default>false</default>
<summary>Pick a random image at random-interval</summary>
<description></description>
</key>
<key name="random-mode-include-only-uhd" type="b">
<default>false</default>
<summary>Only pick from UHD in random mode</summary>
<description></description>
</key>
<key name="random-mode-include-only-unhidden" type="b">
<default>true</default>
<summary>Only pick from unhidden in random mode</summary>
<description></description>
</key>
<key name="override-unsafe-wayland" type="b">
<default>true</default>
<summary>Override safe defaults for Wayland desktop</summary>
<description>Enables features which may or may not be unstable or untested in all cases</description>
</key>
<key name="create-thumbs" type="b">
<default>true</default>
<summary>Create thumbnails to speed up image gallery loading</summary>
<description>Speeds up subsequent loads, but requires some additional disk space</description>
</key>
<key name="min-uhd-height" type="i">
<range min="1080" max="3000" />
<default>2160</default>
<summary>Minimum image height to be considered UHD</summary>
<description></description>
</key>
<key name="always-export-bing-json" type="b">
<default>false</default>
<summary>Save backup copy of Bing JSON to wallpaper directory</summary>
<description>Enables migration to new install or restoration from back up</description>
</key>
<key name="show-count-in-image-title" type="b">
<default>false</default>
<summary>Include current index and total image count in image title</summary>
</key>
<key name="controls-icon-size" type="i">
<range min="16" max="48" />
<default>32</default>
<summary>Size of icons for controls in popup menu</summary>
</key>
<key name="trash-deletes-images" type="b">
<default>false</default>
<summary>Trash deletes images or just marks as bad</summary>
</key>
<!-- not currently used
<key name="gallery-width" type="i">
<range min="1000" max="9600" />
<default>1600</default>
<summary>Gallery window width</summary>
<description></description>
</key>
<key name="gallery-height" type="i">
<range min="700" max="9600" />
<default>800</default>
<summary>Gallery window height</summary>
<description></description>
</key>
<key name="gallery-top" type="i">
<range min="0" max="9600" />
<default>30</default>
<summary>Gallery window x-pos</summary>
<description></description>
</key>
<key name="gallery-left" type="i">
<range min="0" max="9600" />
<default>30</default>
<summary>Gallery window y-pos</summary>
<description></description>
</key>
-->
</schema>
</schemalist>

View File

@ -0,0 +1,2 @@
.wp-thumbnail-image:focus, .wp-thumbnail-image:hover {
background-color: rgba(247, 247, 247, 0.1) !important; }

View File

@ -0,0 +1,29 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// See the GNU General Public License, version 3 or later for details.
import Gio from 'gi://Gio';
import GdkPixbuf from 'gi://GdkPixbuf';
const THUMBNAIL_WIDTH = 480;
const THUMBNAIL_HEIGHT = 270;
export default class Thumbnail {
constructor(filePath, scale = 1.0) {
if (!filePath) {
throw new Error(`need argument ${filePath}`);
}
try {
let w = Math.round(THUMBNAIL_WIDTH * scale);
let h = Math.round(THUMBNAIL_HEIGHT * scale);
this.pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(filePath, w, h);
this.srcFile = Gio.File.new_for_path(filePath);
} catch (err) {
log('Unable to create thumbnail for corrupt or incomplete file: ' + filePath + ' err: ' + err);
}
}
};

View File

@ -0,0 +1,209 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2
Copyright (C) 2017-2021
This file is part of Bing Wallpaper.
Bing Wallpaper 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.
Bing Wallpaper 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 Bing Wallpaper. If not, see <http://www.gnu.org/licenses/>.
Author: Michael Carroll
-->
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GtkScrolledWindow" id="carouselScrollable">
<property name="hscrollbar-policy">never</property>
<property name="child">
<object class="GtkViewport" id="carouselViewPort">
<property name="can-focus">0</property>
<property name="vexpand">0</property>
<property name="height-request">500</property>
<property name="child">
<object class="GtkFlowBox" id="carouselFlowBox">
<property name="can-focus">0</property>
<property name="halign">center</property>
<property name="homogeneous">1</property>
<!-- <property name="max-children-per-line">5</property> -->
<property name="min-children-per-line">2</property>
<property name="row-spacing">10</property>
<property name="column-spacing">4</property>
</object>
</property>
</object>
</property>
</object>
<object class="GtkFlowBoxChild" id="flowBoxChild">
<property name="can-focus">0</property>
<property name="child">
<object class="GtkBox" id="imageGrid">
<property name="can-focus">0</property>
<property name="homogeneous">0</property>
<property name="spacing">5</property>
<!-- <property name="orientation">vertical</property> -->
<child>
<object class="GtkPicture" id="galleryImage">
<property name="width-request">320</property>
<property name="height-request">180</property>
<property name="can-focus">0</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
</object>
</child>
<child>
<object class="GtkBox" id="buttonBar">
<property name="can-focus">0</property>
<property name="orientation">vertical</property>
<property name="vexpand">1</property>
<property name="valign">center</property>
<child>
<object class="GtkButton" id="favButton">
<property name="tooltip-text" translatable="yes">Favorite</property>
<property name='icon-name'>checkbox</property>
<!-- <property name='icon-name'>checkbox-checked</property> -->
<property name="receives-default">1</property>
<property name="hexpand">0</property>
<property name="halign">center</property>
</object>
</child>
<child>
<object class="GtkButton" id="unfavButton">
<property name="tooltip-text" translatable="yes">Favorite</property>
<property name='icon-name'>checkbox-checked</property>
<!-- <property name='icon-name'>checkbox-checked</property> -->
<property name="receives-default">1</property>
<property name="hexpand">0</property>
<property name="halign">center</property>
</object>
</child>
<child>
<object class="GtkButton" id="applyButton">
<property name="tooltip-text" translatable="yes">Apply</property>
<property name='icon-name'>preferences-desktop-wallpaper</property>
<property name="receives-default">1</property>
<property name="hexpand">0</property>
<property name="halign">center</property>
</object>
</child>
<child>
<object class="GtkButton" id="viewButton">
<property name="tooltip-text" translatable="yes">View</property>
<property name='icon-name'>view-reveal</property>
<property name="receives-default">1</property>
<property name="hexpand">0</property>
<property name="halign">center</property>
</object>
</child>
<child>
<object class="GtkButton" id="infoButton">
<property name="tooltip-text" translatable="yes">Info</property>
<property name='icon-name'>preferences-system-details</property>
<property name="receives-default">1</property>
<property name="hexpand">0</property>
<property name="halign">center</property>
</object>
</child>
<child>
<object class="GtkButton" id="deleteButton">
<property name="tooltip-text" translatable="yes">Delete</property>
<property name='icon-name'>edit-delete</property>
<property name="receives-default">1</property>
<property name="hexpand">0</property>
<property name="halign">center</property>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
<object class="GtkFlowBoxChild" id="flowBoxRandom">
<property name="can-focus">0</property>
<property name="child">
<object class="GtkGrid" id="imageGrid">
<property name="can-focus">0</property>
<property name="halign">center</property>
<child>
<object class="GtkImage" id="randomImage">
<property name="width-request">320</property>
<property name="height-request">120</property>
<property name="can-focus">0</property>
<property name="icon-name">media-playlist-shuffle</property>
<property name="icon_size">2</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel" id="randomLabel">
<property name="can-focus">0</property>
<property name="label" translatable="yes">&lt;image name here&gt;</property>
<layout>
<property name="column">0</property>
<property name="row">1</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton" id="randomButton">
<property name="label" translatable="yes">Set random mode</property>
<property name="receives-default">1</property>
<layout>
<property name="column">0</property>
<property name="row">2</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
</object>
</property>
</object>
<object class="GtkFlowBoxChild" id="flowBoxPlaceholder">
<property name="can-focus">0</property>
<property name="child">
<object class="GtkGrid" id="loadGrid">
<property name="can-focus">0</property>
<property name="halign">center</property>
<child>
<object class="GtkImage" id="loadImage">
<property name="width-request">320</property>
<property name="height-request">120</property>
<property name="can-focus">0</property>
<property name="icon-name">preferences-desktop-wallpaper-symbolic</property>
<property name="icon_size">3</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton" id="loadButton">
<property name="label" translatable="yes">Load image gallery</property>
<property name="receives-default">1</property>
<layout>
<property name="column">0</property>
<property name="row">1</property>
</layout>
</object>
</child>
</object>
</property>
</object>
</interface>

View File

@ -0,0 +1,4 @@
.icon_image_black_bg
{
background-color: rgba(0, 0, 0, 1);
}

View File

@ -0,0 +1,623 @@
// Bing Wallpaper GNOME extension
// Copyright (C) 2017-2023 Michael Carroll
// This extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// See the GNU General Public License, version 3 or later for details.
// Based on GNOME shell extension NASA APOD by Elia Argentieri https://github.com/Elinvention/gnome-shell-extension-nasa-apod
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import Soup from 'gi://Soup';
import GdkPixbuf from 'gi://GdkPixbuf';
export var PRESET_GNOME_DEFAULT = { blur: 60, dim: 55 }; // as at GNOME 40
export var PRESET_NO_BLUR = { blur: 0, dim: 60 };
export var PRESET_SLIGHT_BLUR = { blur: 2, dim: 60 };
export var BING_SCHEMA = 'org.gnome.shell.extensions.bingwallpaper';
export var DESKTOP_SCHEMA = 'org.gnome.desktop.background';
var vertical_blur = null;
var horizontal_blur = null;
let gitreleaseurl = 'https://api.github.com/repos/neffo/bing-wallpaper-gnome-extension/releases/tags/';
let debug = false;
export var icon_list = ['bing-symbolic', 'brick-symbolic', 'high-frame-symbolic', 'mid-frame-symbolic', 'low-frame-symbolic'];
export var resolutions = ['auto', 'UHD', '1920x1200', '1920x1080', '1366x768', '1280x720', '1024x768', '800x600'];
export var markets = ['auto', 'ar-XA', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'en-AU', 'en-CA', 'en-GB',
'en-ID', 'en-IE', 'en-IN', 'en-MY', 'en-NZ', 'en-PH', 'en-SG', 'en-US', 'en-WW', 'en-XA', 'en-ZA', 'es-AR',
'es-CL', 'es-ES', 'es-MX', 'es-US', 'es-XL', 'et-EE', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR',
'he-IL', 'hr-HR', 'hu-HU', 'it-IT', 'ja-JP', 'ko-KR', 'lt-LT', 'lv-LV', 'nb-NO', 'nl-BE', 'nl-NL',
'pl-PL', 'pt-BR', 'pt-PT', 'ro-RO', 'ru-RU', 'sk-SK', 'sl-SL', 'sv-SE', 'th-TH', 'tr-TR', 'uk-UA',
'zh-CN', 'zh-HK', 'zh-TW'];
export var marketName = [
'auto', '(شبه الجزيرة العربية‎) العربية', 'dansk (Danmark)', 'Deutsch (Österreich)',
'Deutsch (Schweiz)', 'Deutsch (Deutschland)', 'English (Australia)', 'English (Canada)',
'English (United Kingdom)', 'English (Indonesia)', 'English (Ireland)', 'English (India)', 'English (Malaysia)',
'English (New Zealand)', 'English (Philippines)', 'English (Singapore)', 'English (United States)',
'English (International)', 'English (Arabia)', 'English (South Africa)', 'español (Argentina)', 'español (Chile)',
'español (España)', 'español (México)', 'español (Estados Unidos)', 'español (Latinoamérica)', 'eesti (Eesti)',
'suomi (Suomi)', 'français (Belgique)', 'français (Canada)', 'français (Suisse)', 'français (France)',
'(עברית (ישראל', 'hrvatski (Hrvatska)', 'magyar (Magyarország)', 'italiano (Italia)', '日本語 (日本)', '한국어(대한민국)',
'lietuvių (Lietuva)', 'latviešu (Latvija)', 'norsk bokmål (Norge)', 'Nederlands (België)', 'Nederlands (Nederland)',
'polski (Polska)', 'português (Brasil)', 'português (Portugal)', 'română (România)', 'русский (Россия)',
'slovenčina (Slovensko)', 'slovenščina (Slovenija)', 'svenska (Sverige)', 'ไทย (ไทย)', 'Türkçe (Türkiye)',
'українська (Україна)', '中文(中国)', '中文(中國香港特別行政區)', '中文(台灣)'
];
export var backgroundStyle = ['none', 'wallpaper', 'centered', 'scaled', 'stretched', 'zoom', 'spanned']; // this may change in the future
export var randomIntervals = [ {value: 'hourly', title: ('on the hour')},
{value: 'daily', title: ('every day at midnight')},
{value: 'weekly', title: ('every Sunday at midnight')} ];
export var BingImageURL = 'https://www.bing.com/HPImageArchive.aspx';
export var BingParams = { format: 'js', idx: '0' , n: '8' , mbl: '1' , mkt: '' } ;
export function validate_icon(settings, extension_path, icon_image = null) {
BingLog('validate_icon()');
let icon_name = settings.get_string('icon-name');
if (icon_name == '' || icon_list.indexOf(icon_name) == -1) {
settings.reset('icon-name');
icon_name = settings.get_string('icon-name');
}
// if called from prefs
if (icon_image) {
BingLog('set icon to: ' + extension_path + '/icons/' + icon_name + '.svg');
let pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(extension_path + '/icons/' + icon_name + '.svg', 32, 32);
icon_image.set_from_pixbuf(pixbuf);
}
}
export function validate_resolution(settings) {
let resolution = settings.get_string('resolution');
if (resolution == '' || resolutions.indexOf(resolution) == -1) // if not a valid resolution
settings.reset('resolution');
}
// FIXME: needs work
export function validate_imagename(settings) {
let filename = settings.get_string('selected-image');
if (filename != 'current' || filename != 'random') // FIXME: remove this when we move to new shuffle mode
return;
if (!inImageList(getImageList(settings), filename)) {
BingLog('invalid image selected');
//settings.reset('selected-image');
settings.set_string('selected-image', 'current');
}
}
export function get_current_bg(schema) {
let gsettings = new Gio.Settings({ schema: schema });
let cur = gsettings.get_string('picture-uri');
return (cur);
}
export function fetch_change_log(version, label, httpSession) {
const decoder = new TextDecoder();
// create an http message
let url = gitreleaseurl + "v" + version;
let request = Soup.Message.new('GET', url);
request.request_headers.append('Accept', 'application/json');
BingLog("Fetching " + url);
// queue the http request
try {
if (Soup.MAJOR_VERSION >= 3) {
httpSession.send_and_read_async(request, GLib.PRIORITY_DEFAULT, null, (httpSession, message) => {
let data = decoder.decode(httpSession.send_and_read_finish(message).get_data());
let text = JSON.parse(data).body;
label.set_label(text);
});
}
else {
httpSession.queue_message(request, (httpSession, message) => {
let data = message.response_body.data;
let text = JSON.parse(data).body;
label.set_label(text);
});
}
}
catch (error) {
BingLog("Error fetching change log: " + error);
label.set_label(_("Error fetching change log: "+error));
}
}
export function set_blur_preset(settings, preset) {
settings.set_int('lockscreen-blur-strength', preset.blur);
settings.set_int('lockscreen-blur-brightness', preset.dim);
BingLog("Set blur preset to " + preset.blur + " brightness to " + preset.dim);
}
export function imageHasBasename(image_item, i, b) {
//log("imageHasBasename : " + image_item.urlbase + " =? " + this);
if (this && this.search(image_item.urlbase.replace('th?id=OHR.', '')))
return true;
return false;
}
export function dateFromLongDate(longdate, add_seconds) {
if (typeof longdate === 'number')
longdate = longdate.toString();
return GLib.DateTime.new(GLib.TimeZone.new_utc(),
parseInt(longdate.substr(0, 4)), // year
parseInt(longdate.substr(4, 2)), // month
parseInt(longdate.substr(6, 2)), // day
parseInt(longdate.substr(8, 2)), // hour
parseInt(longdate.substr(10, 2)), // mins
0 ).add_seconds(add_seconds); // seconds
}
export function dateFromShortDate(shortdate) {
if (typeof shortdate === 'number')
shortdate = shortdate.toString();
return GLib.DateTime.new(GLib.TimeZone.new_utc(),
parseInt(shortdate.substr(0, 4)), // year
parseInt(shortdate.substr(4, 2)), // month
parseInt(shortdate.substr(6, 2)), // day
0, 0, 0 );
}
export function getImageList(settings, filter = null) {
let image_list = JSON.parse(settings.get_string('bing-json'));
if (!filter) {
return image_list;
}
else {
return image_list.filter((x, i) => {
if (filter.faves && !x.favourite)
return false;
if (filter.min_height && x.height < filter.min_height)
return false;
if (filter.hidden && x.hidden)
return false;
return true;
});
}
}
export function setImageList(settings, imageList) {
settings.set_string('bing-json', JSON.stringify(imageList));
if (settings.get_boolean('always-export-bing-json')) { // save copy of current JSON
exportBingJSON(settings);
}
}
export function setImageHiddenStatus(settings, hide_image_list, hide_status) {
// get current image list
let image_list = getImageList(settings);
image_list.forEach( (x, i) => {
hide_image_list.forEach(u => {
if (u.includes(x.urlbase)) {
// mark as hidden
x.hidden = hide_status;
}
});
});
// export image list back to settings
setImageList(settings, image_list);
}
export function getImageTitle(image_data) {
return image_data.copyright.replace(/\s*\(.*?\)\s*/g, '');
}
export function getImageUrlBase(image_data) {
return image_data.urlbase.replace('/th?id=OHR.', '');
}
export function getMaxLongDate(settings) {
let imageList = getImageList(settings);
return Math.max.apply(Math, imageList.map(function(o) { return o.fullstartdate; }));
}
export function getCurrentImageIndex (imageList) {
if (!imageList)
return -1;
let maxLongDate = Math.max.apply(Math, imageList.map(function(o) { return o.fullstartdate; }));
let index = imageList.map(p => parseInt(p.fullstartdate)).indexOf(maxLongDate);
BingLog('getCurrentImageIndex for ' + maxLongDate + ': ' + index);
return index;
}
export function setImageFavouriteStatus(settings, imageURL, newState) {
BingLog('set favourite status of '+imageURL+' to '+newState);
let imageList = getImageList(settings);
imageList.forEach(function(x, i) {
//log('testing: '+imageURL+' includes '+x.urlbase);
if (imageURL.includes(x.urlbase)) {
BingLog('setting index '+i+' to '+newState?'true':'false');
imageList[i].favourite = newState;
}
});
setImageList(settings, imageList); // save back to settings
}
export function getCurrentImage(imageList) {
if (!imageList || imageList.length == 0)
return null;
let index = getCurrentImageIndex(imageList);
if (index == -1)
return imageList[0]; // give something sensible
return imageList[index];
}
export function inImageList(imageList, urlbase) {
let image = null;
imageList.forEach(function(x, i) {
if (urlbase.replace('/th?id=OHR.', '') == x.urlbase.replace('/th?id=OHR.', ''))
image = x;
});
return image;
}
export function inImageListByTitle(imageList, title) {
let image = null;
imageList.forEach(function(x, i) {
BingLog('inImageListbyTitle(): ' + title + ' == ' + getImageTitle(x));
if (getImageTitle(x) == title)
image = x;
});
return image;
}
export function mergeImageLists(settings, imageList) {
let curList = getImageList(settings);
let newList = []; // list of only new images (for future notifications)
imageList.forEach(function(x, i) {
if (!inImageList(curList, x.urlbase)) {// if not in the list, add it
curList.unshift(x); // use unshift to maintain reverse chronological order
newList.unshift(x);
}
});
setImageList(settings, imageListSortByDate(curList)); // sort then save back to settings
return newList; // return this to caller for notifications
}
export function imageIndex(imageList, urlbase) {
return imageList.map(p => p.urlbase.replace('/th?id=OHR.', '')).indexOf(urlbase.replace('/th?id=OHR.', ''));
}
export function isFavourite(image) {
return (image.favourite && image.favourite === true);
}
export function getImageByIndex(imageList, index) {
if (imageList.length == 0 || index < 0 || index > imageList.length - 1)
return null;
return imageList[index];
}
export function cleanupImageList(settings) {
let curList = imageListSortByDate(getImageList(settings));
let cutOff = GLib.DateTime.new_now_utc().add_days(-8); // 8 days ago
let newList = [];
curList.forEach( function (x, i) {
let filename = imageToFilename(settings, x);
let diff = dateFromLongDate(x.fullstartdate, 0).difference(cutOff);
// image is still downloadable (< 8 days old) or still on disk, so we keep
if (diff > 0 || Gio.file_new_for_path(filename).query_exists(null)) {
newList.push(x);
}
else {
BingLog('Cleaning up: '+filename);
}
});
setImageList(settings, newList);
}
export function populateImageListResolutions(settings) {
let curList = imageListSortByDate(getImageList(settings));
let newList = [];
curList.forEach( function (x, i) {
let filename = imageToFilename(settings, x);
let width, height;
if (!x.width || !x.height) {
[width, height] = getFileDimensions(filename);
x.width = width;
x.height = height;
}
newList.push(x);
});
setImageList(settings, newList);
}
export function getFetchableImageList(settings) {
let imageList = getImageList(settings);
let cutOff = GLib.DateTime.new_now_utc().add_days(-8); // 8 days ago
let dlList = [];
imageList.forEach( function (x, i) {
let diff = dateFromLongDate(x.fullstartdate, 0).difference(cutOff);
let filename = imageToFilename(settings, x);
// image is still downloadable (< 8 days old) but not on disk
if (diff > 0 && !Gio.file_new_for_path(filename).query_exists(null)) {
dlList.push(x);
}
});
return dlList;
}
export function getWallpaperDir(settings) {
let homeDir = GLib.get_home_dir();
let BingWallpaperDir = settings.get_string('download-folder').replace('~', homeDir);
let userPicturesDir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES);
let userDesktopDir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DESKTOP); // seems to be a safer default
if (BingWallpaperDir == '') {
BingWallpaperDir = (userPicturesDir?userPicturesDir:userDesktopDir) + '/BingWallpaper/';
BingLog('Using default download folder: ' + BingWallpaperDir);
setWallpaperDir(settings, BingWallpaperDir);
}
else if (!BingWallpaperDir.endsWith('/')) {
BingWallpaperDir += '/';
}
let dir = Gio.file_new_for_path(BingWallpaperDir);
if (!dir.query_exists(null)) {
dir.make_directory_with_parents(null);
}
//FIXME: test if dir is good and writable
return BingWallpaperDir;
}
export function setWallpaperDir(settings, uri) {
let homeDir = GLib.get_home_dir();
let relUri = uri.replace(homeDir, '~');
settings.set_string('download-folder', relUri);
}
export function imageToFilename(settings, image, resolution = null) {
return getWallpaperDir(settings) + image.startdate + '-' +
image.urlbase.replace(/^.*[\\\/]/, '').replace('th?id=OHR.', '') + '_'
+ (resolution ? resolution : getResolution(settings, image)) + '.jpg';
}
export function getRandomInt(max) {
return Math.floor(Math.random() * max);
}
// Utility function
export function dump(object, level = 0) {
let output = '';
for (let property in object) {
output += ' - '.repeat(level)+property + ': ' + object[property]+'\n ';
if ( typeof object[property] === 'object' )
output += dump(object[property], level+1);
}
if (level == 0)
BingLog(output);
return(output);
}
export function friendly_time_diff(time, short = true) {
// short we want to keep ~4-5 characters
let now = GLib.DateTime.new_now_local().to_unix();
let seconds = time.to_unix() - now;
if (seconds <= 0) {
return "now";
}
else if (seconds < 60) {
return "< 1 " + (short ? "m" : _("minutes"));
}
else if (seconds < 3600) {
return Math.round(seconds / 60) + " " + (short ? "m" : _("minutes"));
}
else if (seconds > 86400) {
return Math.round(seconds / 86400) + " " + (short ? "d" : _("days"));
}
else {
return Math.round(seconds / 3600) + " " + (short ? "h" : _("hours"));
}
}
export function seconds_until(until) {
let now = GLib.DateTime.new_now_local();
let end, day;
if (until == 'hourly') {
end = GLib.DateTime.new_local(
now.get_year(),
now.get_month(),
now.get_day_of_month(),
now.get_hour()+1, // should roll over to next day if results in >23
0, 0);
}
else {
if (until == 'weekly') {
day = now.add_days(7 - now.get_day_of_week());
}
else {
day = now.add_days(1);
}
end = GLib.DateTime.new_local(
day.get_year(),
day.get_month(),
day.get_day_of_month(),
0, 0, 0); // midnight
}
BingLog('shuffle timer will be set to '+end.format_iso8601());
return(Math.floor(end.difference(now)/1000000)); // difference in μs -> s
}
export function getResolution(settings, image) {
let resolution = settings.get_string('resolution');
if (resolutions.indexOf(resolution) == -1 || (image ? image.wp == false : true) || // wp == false when background is animated
settings.get_string('resolution') == 'auto' ) {
// resolution invalid, animated background or autoselected
resolution = 'UHD';
}
return resolution;
}
export function openImageFolder(settings) {
//const context = global?global.create_app_launch_context(0, -1):null;
Gio.AppInfo.launch_default_for_uri('file://' + getWallpaperDir(settings), null);
}
export function imageListSortByDate(imageList) {
return imageList.sort(function(a, b) {
var x = parseInt(a.fullstartdate); var y = parseInt(b.fullstartdate);
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
});
}
export function shortenName(string, limit) {
if (string.length > limit) {
string = string.substr(0, limit - 4) + '...';
}
return string;
}
export function moveImagesToNewFolder(settings, oldPath, newPath) {
// possible race condition here, need to think about how to fix it
//let BingWallpaperDir = settings.get_string('download-folder');
let dir = Gio.file_new_for_path(oldPath);
let dirIter = dir.enumerate_children('', Gio.FileQueryInfoFlags.NONE, null );
let newDir = Gio.file_new_for_path(newPath);
if (!newDir.query_exists(null)) {
newDir.make_directory_with_parents(null);
}
let file = null;
while (file = dirIter.next_file(null)) {
let filename = file.get_name(); // we only want to move files that we think we own
if (filename.match(/\d{8}\-.+\.jpg/i)) {
BingLog('file: ' + slash(oldPath) + filename + ' -> ' + slash(newPath) + filename);
let cur = Gio.file_new_for_path(slash(oldPath) + filename);
let dest = Gio.file_new_for_path(slash(newPath) + filename);
cur.move(dest, Gio.FileCopyFlags.OVERWRITE, null, function () { BingLog ('...moved'); });
}
}
// correct filenames for GNOME backgrounds
if (settings.get_boolean('set-background'))
moveBackground(oldPath, newPath, DESKTOP_SCHEMA);
}
export function dirname(path) {
return path.match(/.*\//);
}
export function slash(path) {
if (!path.endsWith('/'))
return path += '/';
return path;
}
export function moveBackground(oldPath, newPath, schema) {
let gsettings = new Gio.Settings({schema: schema});
let uri = gsettings.get_string('picture-uri');
gsettings.set_string('picture-uri', uri.replace(oldPath, newPath));
try {
let dark_uri = gsettings.get_string('picture-uri-dark');
gsettings.set_string('picture-uri-dark', dark_uri.replace(oldPath, newPath));
}
catch (e) {
BingLog('no dark background gsettings key found ('+e+')');
}
Gio.Settings.sync();
gsettings.apply();
}
export function BingLog(msg) {
if (debug)
print("BingWallpaper extension: " + msg); // disable to keep the noise down in journal
}
export function deleteImage(to_delete) {
var file = Gio.file_new_for_path(to_delete);
if (file.query_exists(null)) {
try {
file.delete(null);
BingLog("deleted file: " + to_delete);
}
catch (error) {
BingLog("an error occured deleting " + to_delete + " : " + error);
}
}
}
// add image to persistant list so we can delete it later (in chronological order), delete the oldest image (if user wants this)
export function purgeImages(settings) {
let deletepictures = settings.get_boolean('delete-previous');
if (deletepictures === false)
return;
let imagelist = imageListSortByDate(getImageList(settings));
let maxpictures = settings.get_int('previous-days');
let origlength = imagelist.length;
while (imagelist.length > maxpictures) {
var to_delete = imagelist.shift(); // get the first (oldest item from the list)
if (deletepictures && to_delete != '') {
let imageFilename = imageToFilename(settings, to_delete);
BingLog('deleting '+imageFilename);
deleteImage(imageFilename);
}
}
BingLog('cleaned up image list, count was '+origlength+' now '+imagelist.length);
cleanupImageList(settings);
validate_imagename(settings); // if we deleted our current image, we want to reset it to something valid
}
export function openInSystemViewer(filename, is_file = true) {
let context;
try {
context = global.create_app_launch_context(0, -1);
}
catch (error) {
context = null;
}
if (is_file)
filename = 'file://'+filename;
Gio.AppInfo.launch_default_for_uri(filename, context);
}
export function exportBingJSON(settings) {
let json = settings.get_string('bing-json');
let filepath = getWallpaperDir(settings) + 'bing.json';
let file = Gio.file_new_for_path(filepath);
let [success, error] = file.replace_contents(json, null, false, Gio.FileCreateFlags.REPLACE_DESTINATION, null);
if (!success) {
BingLog('error saving bing-json from '+filepath+': '+error);
}
}
export function importBingJSON(settings) {
const decoder = new TextDecoder();
let filepath = getWallpaperDir(settings) + 'bing.json';
let file = Gio.file_new_for_path(filepath);
if (file.query_exists(null)) {
let [success, contents, etag_out] = file.load_contents(null);
if (!success) {
BingLog('error loading bing-json '+filepath+' - '+etag_out);
}
else {
BingLog('JSON import success');
let parsed = JSON.parse(decoder.decode(contents)); // FIXME: triggers GJS warning without the conversion, need to investigate
// need to implement some checks for validity here
mergeImageLists(settings, parsed);
cleanupImageList(settings); // remove the older missing images
}
}
else {
BingLog('JSON import file not found');
}
}
export function getFileDimensions(filepath) {
let format, width, height;
try {
[format, width, height] = GdkPixbuf.Pixbuf.get_file_info(filepath);
return [width, height];
}
catch (e) {
BingLog('unable to getFileDimensions('+filepath+') '+e);
return [null, null];
}
}
export function toFilename(wallpaperDir, startdate, imageURL, resolution) {
return wallpaperDir + startdate + '-' + imageURL.replace(/^.*[\\\/]/, '').replace('th?id=OHR.', '') + '_' + resolution + '.jpg';
}