├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── .gitignore ├── CREDITS ├── LICENSE ├── Makefile ├── README.md ├── blyr@yozoon.dev.gmail.com ├── assets │ └── kingscanyon.png ├── connections.js ├── convenience.js ├── effect.js ├── extension.js ├── locale │ ├── blyr.pot │ ├── de │ │ └── LC_MESSAGES │ │ │ ├── blyr.mo │ │ │ └── blyr.po │ ├── nl │ │ └── LC_MESSAGES │ │ │ ├── blyr.mo │ │ │ └── blyr.po │ ├── pl │ │ └── LC_MESSAGES │ │ │ ├── blyr.mo │ │ │ └── blyr.po │ └── uk │ │ └── LC_MESSAGES │ │ ├── blyr.mo │ │ └── blyr.po ├── metadata.json ├── prefs.js ├── schemas │ ├── gschemas.compiled │ └── org.gnome.shell.extensions.blyr.gschema.xml ├── shader.glsl └── shared.js ├── img ├── Overview_10.png ├── Overview_30.png ├── Panel_Blur.png ├── Prefs_10.png ├── Prefs_30.png ├── Tweak_10.png ├── Tweak_30.png ├── blyr.png └── blyr.svg └── tools ├── calculate_weights.html └── deactivate.sh /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve the extension 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **Expected behavior** 14 | A clear and concise description of what you expected to happen. 15 | 16 | **Configuration (please complete the following information):** 17 | - GNOME Shell version (e.g. 3.34.1) 18 | - Distribution (e.g. Ubuntu 18.04, Fedora 30, Arch...) 19 | - Wayland or Xorg session 20 | - List of installed extensions that might interfere with the function of this extension 21 | 22 | **Screenshots** 23 | If applicable, add screenshots to help explain your problem. 24 | 25 | **Additional context** 26 | Add any other context about the problem here. 27 | - Wallpaper changing applications, etc. 28 | 29 | If you observe graphics artifacts or if the effects seems to be visually off in a different way, please also mention your GPU and CPU model. 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | Luca Viggiani 2 | The extension windows-blur-effect written by Luca Viggiani 3 | gave me lots of useful information about the general structure of GNOME Shell 4 | extensions and connection callbacks. 5 | https://github.com/lviggiani/gnome-shell-extension-wbe/ 6 | 7 | Florian Mounier 8 | The gnome-shell-shader-extension by Florian Mounier showed me how to implement 9 | custom GLSL Shaders as Clutter Effects. 10 | https://github.com/paradoxxxzero/gnome-shell-shader-extension/ 11 | 12 | Optimisme 13 | Credit also goes to GitHub user Optimisme, who made some great GJS examples 14 | available, which helped me to get the general idea of how to use a GTK Embed. 15 | https://github.com/optimisme/gjs-examples 16 | 17 | Jonatan Hatakeyama Zeidler 18 | Implemented the translation framework for the extension and contributed the 19 | German translation. 20 | https://github.com/jonnius 21 | 22 | Piotr Komur 23 | Contributed the Polish translation. 24 | https://github.com/pkomur 25 | 26 | Alice Charlotte Liddell 27 | Contributed the Ukrainian translation. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | UUID = blyr@yozoon.dev.gmail.com 2 | BUILDDIR = build 3 | SOURCEDIR = $(UUID) 4 | LOCALPREFIX = $(HOME)/.local/share/gnome-shell/extensions 5 | 6 | all: 7 | @ # Ensure that build/ exists 8 | @ mkdir -p "$(BUILDDIR)" 9 | @ # Ensure that extensions/ directory exists 10 | @ mkdir -p "$(LOCALPREFIX)" 11 | @ # Compile gschemas 12 | @ if [ -d "$(SOURCEDIR)/schemas/" ]; then \ 13 | glib-compile-schemas "$(SOURCEDIR)/schemas/"; \ 14 | else \ 15 | echo "Gschema directory not found."; \ 16 | fi 17 | 18 | zip-file: all 19 | @ # Create zip of the source directory 20 | @ ( cd "$(SOURCEDIR)"; \ 21 | zip -r "../$(BUILDDIR)/$(UUID).zip" . -x *.vscode* -x *outline.txt*); 22 | 23 | local-install: all local-uninstall 24 | @ cp -rf "$(SOURCEDIR)" "$(LOCALPREFIX)/$(UUID)" 25 | @ echo "Extension successfully installed." 26 | 27 | local-uninstall: 28 | @ # If installed, remove the extension 29 | @ if [ -d "$(LOCALPREFIX)/$(UUID)" ]; then \ 30 | rm -rf "$(LOCALPREFIX)/$(UUID)"; \ 31 | echo "Extension successfully removed."; \ 32 | else \ 33 | echo "Nothing to remove."; \ 34 | fi 35 | 36 | clean: 37 | @ # Delete all items in the build/ directory 38 | @ if [ -d "$(BUILDDIR)" ]; then \ 39 | rm -rf "$(BUILDDIR)/"; \ 40 | echo "Files successfully removed.";\ 41 | else \ 42 | echo "Nothing to be done here."; \ 43 | fi 44 | 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > :warning: UNMAINTAINED :warning: 2 | > 3 | > I highly recommend you to check out [Blur my Shell](https://github.com/aunetx/blur-my-shell) (GNOME 3.36+) 4 | 5 | # GNOME Shell Extension - Blyr 6 | 7 | [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) 8 | 9 | Apply a Blur Effect to GNOME Shell UI elements 10 | 11 | ## Screenshots 12 | ### Activities Background Blur: 13 | Overview with a blur intensity of 10: 14 | 15 | ![](https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/master/img/Overview_10.png "Overview 10") 16 | 17 | Overview with a blur intensity of 30: 18 | 19 | ![](https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/master/img/Overview_30.png "Overview 30") 20 | 21 | ### Panel Blur: 22 | GNOME Shell 3.26+: 23 | 24 | ![](https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/master/img/Panel_Blur.png "Panel Blur") 25 | 26 | With GNOME Shell version 3.32 the panel transparency was removed. In order to use the blurred panel feature, you can install the Dynamic Panel Transparency [extension](https://extensions.gnome.org/extension/1011/dynamic-panel-transparency/). 27 | 28 | ### Extension Preferences: 29 | ![](https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/master/img/Prefs_30.png "Prefs 30") 30 | 31 | ## Installation 32 | ### Official 33 | Install *blyr* using the official repository: 34 | [extensions.gnome.org](https://extensions.gnome.org/extension/1251/blyr/) 35 | 36 | ### Manual 37 | 38 | ```bash 39 | git clone https://github.com/yozoon/gnome-shell-extension-blyr.git 40 | cd gnome-shell-extension-blyr/ 41 | make local-install 42 | ``` 43 | Now just restart the Shell and enable the extension. 44 | 45 | To remove the extension just run: 46 | 47 | ```bash 48 | make local-uninstall 49 | ``` 50 | 51 | ## Troubleshooting 52 | Some Ubuntu users reported that the preferences dialog didn't appear after opening it from the GNOME Tweaks application. To fix the issue install the gtkclutter bindings as follows: 53 | 54 | ```bash 55 | sudo apt install gir1.2-gtkclutter-1.0 56 | ``` 57 | -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/assets/kingscanyon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/blyr@yozoon.dev.gmail.com/assets/kingscanyon.png -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/connections.js: -------------------------------------------------------------------------------- 1 | /* 2 | This file was originally a part of AppIndicator/KStatusNotifierItem GNOME Shell extension 3 | (https://github.com/ubuntu/gnome-shell-extension-appindicator/) specifically the util.js file. 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | const GObject = imports.gi.GObject; 20 | 21 | const connectSmart3A = function(src, signal, handler) { 22 | let id = src.connect(signal, handler) 23 | 24 | if (src.connect && (!(src instanceof GObject.Object) || GObject.signal_lookup('destroy', src))) { 25 | let destroy_id = src.connect('destroy', () => { 26 | src.disconnect(id) 27 | src.disconnect(destroy_id) 28 | }) 29 | } 30 | } 31 | 32 | const connectSmart4A = function(src, signal, target, method) { 33 | if (typeof method === 'string') 34 | method = target[method].bind(target) 35 | if (typeof method === 'function') 36 | method = method.bind(target) 37 | 38 | let signal_id = src.connect(signal, method) 39 | 40 | // GObject classes might or might not have a destroy signal 41 | // JS Classes will not complain when connecting to non-existent signals 42 | let src_destroy_id = src.connect && (!(src instanceof GObject.Object) || GObject.signal_lookup('destroy', src)) ? src.connect('destroy', on_destroy) : 0 43 | let tgt_destroy_id = target.connect && (!(target instanceof GObject.Object) || GObject.signal_lookup('destroy', target)) ? target.connect('destroy', on_destroy) : 0 44 | 45 | function on_destroy() { 46 | src.disconnect(signal_id) 47 | if (src_destroy_id) src.disconnect(src_destroy_id) 48 | if (tgt_destroy_id) target.disconnect(tgt_destroy_id) 49 | } 50 | } 51 | 52 | /** 53 | * Connect signals to slots, and remove the connection when either source or 54 | * target are destroyed 55 | * 56 | * Usage: 57 | * Connections.connectSmart(srcOb, 'signal', tgtObj, 'handler') 58 | * or 59 | * Connections.connectSmart(srcOb, 'signal', () => { ... }) 60 | */ 61 | var connectSmart = function() { 62 | if (arguments.length == 4) 63 | return connectSmart4A.apply(null, arguments) 64 | else 65 | return connectSmart3A.apply(null, arguments) 66 | } -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/convenience.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011-2012, Giovanni Campagna 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the GNOME nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | const GObject = imports.gi.GObject; 27 | const Gettext = imports.gettext; 28 | const Gio = imports.gi.Gio; 29 | 30 | const Config = imports.misc.config; 31 | const ExtensionUtils = imports.misc.extensionUtils; 32 | 33 | /** 34 | * initTranslations: 35 | * @domain: (optional): the gettext domain to use 36 | * 37 | * Initialize Gettext to load translations from extensionsdir/locale. 38 | * If @domain is not provided, it will be taken from metadata['gettext-domain'] 39 | */ 40 | function initTranslations(domain) { 41 | let extension = ExtensionUtils.getCurrentExtension(); 42 | 43 | domain = domain || extension.metadata['gettext-domain']; 44 | 45 | // check if this extension was built with "make zip-file", and thus 46 | // has the locale files in a subfolder 47 | // otherwise assume that extension has been installed in the 48 | // same prefix as gnome-shell 49 | let localeDir = extension.dir.get_child('locale'); 50 | if (localeDir.query_exists(null)) 51 | Gettext.bindtextdomain(domain, localeDir.get_path()); 52 | else 53 | Gettext.bindtextdomain(domain, Config.LOCALEDIR); 54 | } 55 | -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/effect.js: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Blyr. 3 | Copyright © 2017-2020 Julius Piso 4 | 5 | Blyr is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | Blyr is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Blyr. If not, see . 17 | */ 18 | 19 | const Gio = imports.gi.Gio; 20 | const GObject = imports.gi.GObject; 21 | const Clutter = imports.gi.Clutter; 22 | const ExtensionUtils = imports.misc.extensionUtils; 23 | const ByteArray = imports.byteArray; 24 | 25 | const Extension = ExtensionUtils.getCurrentExtension(); 26 | const Shared = Extension.imports.shared; 27 | 28 | const settings = Shared.getSettings(Shared.SCHEMA_NAME, 29 | Extension.dir.get_child('schemas').get_path()); 30 | 31 | // Source: https://stackoverflow.com/a/21146281 32 | // Author: https://stackoverflow.com/users/2037383/abp 33 | function readShaderFile(filename) { 34 | let input_file = Gio.file_new_for_path(filename); 35 | let size = input_file.query_info( 36 | "standard::size", 37 | Gio.FileQueryInfoFlags.NONE, 38 | null).get_size(); 39 | let stream = input_file.read(null); 40 | let data = stream.read_bytes(size, null).get_data(); 41 | stream.close(null); 42 | var content = ByteArray.toString(data); 43 | // Compatability check: if the first character is a "[" we assume that 44 | // the byte array conversion did not work the way we expected so we 45 | // fall back to the previous array.toString() method 46 | if (content[0] == "[") { 47 | return data.toString(); 48 | } else { 49 | return content; 50 | } 51 | } 52 | 53 | var BlurEffect = GObject.registerClass( 54 | class BlurEffect extends Clutter.ShaderEffect { 55 | _init(width, height, direction, intensity, brightness) { 56 | // Initialize the parent instance 57 | super._init({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER }); 58 | 59 | // Read shader and set it as source 60 | this.SHADER = readShaderFile(Extension.dir.get_path() 61 | + "/shader.glsl"); 62 | this.set_shader_source(this.SHADER); 63 | 64 | // Set shader values 65 | this.set_uniform_value('dir', direction); 66 | this.set_uniform_value('width', width); 67 | this.set_uniform_value('height', height); 68 | this.set_uniform_value('radius', parseFloat(intensity-1e-6)); 69 | this.set_uniform_value('brightness', parseFloat(brightness-1e-6)); 70 | } 71 | 72 | updateUniforms(intensity, brightness) { 73 | this.set_uniform_value('radius', parseFloat(intensity-1e-6)); 74 | this.set_uniform_value('brightness', parseFloat(brightness-1e-6)); 75 | } 76 | } 77 | ); -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/extension.js: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Blyr. 3 | Copyright © 2017-2020 Julius Piso 4 | 5 | Blyr is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | Blyr is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Blyr. If not, see . 17 | */ 18 | 19 | const Gio = imports.gi.Gio; 20 | const Meta = imports.gi.Meta; 21 | const GLib = imports.gi.GLib; 22 | const Shell = imports.gi.Shell; 23 | const Clutter = imports.gi.Clutter; 24 | 25 | const Main = imports.ui.main; 26 | const Tweener = imports.ui.tweener; 27 | const Overview = imports.ui.overview; 28 | const ExtensionUtils = imports.misc.extensionUtils; 29 | const LoginManager = imports.misc.loginManager; 30 | 31 | const Extension = ExtensionUtils.getCurrentExtension(); 32 | const Effect = Extension.imports.effect; 33 | const Shared = Extension.imports.shared; 34 | const Connections = Extension.imports.connections; 35 | const Settings = Shared.getSettings(Shared.SCHEMA_NAME, 36 | Extension.dir.get_child('schemas').get_path()); 37 | 38 | const GSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.background' }); 39 | 40 | const supportsNativeBlur = Shared.supportsNativeBlur(); 41 | 42 | // Make a "backup" copy of the gnome-shell functions we are going to overwrite 43 | const _shadeBackgrounds = Main.overview._shadeBackgrounds; 44 | const _unshadeBackgrounds = Main.overview._unshadeBackgrounds; 45 | 46 | const OVERVIEW_CONTAINER_NAME = 'blyr_overview_container'; 47 | const OVERVIEW_BACKGROUND_NAME = 'blyr_overview_background'; 48 | const PANEL_CONTAINER_NAME = 'blyr_panel_container'; 49 | const SHELL_BLUR_MODE_ACTOR = 0; 50 | 51 | function log(msg) { 52 | if (Settings.get_boolean('debug-logging')) { 53 | print('[Blyr] ' + msg); 54 | } 55 | } 56 | 57 | class Blyr { 58 | constructor(params) { 59 | log('Starting extension...'); 60 | 61 | // Start in specified mode 62 | this._enterMode(); 63 | 64 | // Connect the listeners 65 | // Settings changed listeners 66 | Connections.connectSmart(Settings, 'changed::mode', this, '_enterMode'); 67 | Connections.connectSmart(Settings, 'changed::intensity', () => { 68 | this._updateBlurredPanelActor(); 69 | this._updateBlurredOverviewActors(); 70 | }); 71 | Connections.connectSmart(Settings, 'changed::panelbrightness', this, '_updateBlurredPanelActor'); 72 | Connections.connectSmart(Settings, 'changed::activitiesbrightness', this, '_updateBlurredOverviewActors'); 73 | 74 | // listens to changes of the wallpaper url in gsettings 75 | Connections.connectSmart(GSettings, 'changed::picture-uri', this, '_regenerateBlurredActors'); 76 | 77 | // listens to changed signal on bg manager (useful if the url of a 78 | // wallpaper doesn't change, but the wallpaper itself changed) 79 | Connections.connectSmart(Main.layoutManager._bgManagers[Main.layoutManager.primaryIndex], 80 | 'changed', this, '_regenerateBlurredActors'); 81 | 82 | // session mode listener 83 | //Connections.connectSmart(Main.sessionMode, 'updated', this, '_onSessionModeChange'); 84 | 85 | // screensaver listener 86 | Connections.connectSmart(Main.screenShield, 'locked-changed', () => { 87 | // let's refresh the effect only if the screensaver is disabled 88 | if (!Main.screenShield.locked) { 89 | this._regenerateBlurredActors(); 90 | } 91 | }); 92 | 93 | Connections.connectSmart(Main.layoutManager, 'startup-complete', this, '_regenerateBlurredActors'); 94 | 95 | // Monitors changed listener 96 | Connections.connectSmart(Main.layoutManager, 'monitors-changed', () => { 97 | if (!Main.screenShield.locked) { 98 | this._regenerateBlurredActors(); 99 | } 100 | }); 101 | } 102 | 103 | _enterMode() { 104 | let mode = Settings.get_int('mode'); 105 | log('Entering mode: ' + mode); 106 | // Restore UI to initial state 107 | this.restore(); 108 | if (mode == 1) { // Blur Panel only 109 | // Apply panel blur 110 | this._createBlurredPanelActor(); 111 | // Dim activities screen with brightness set from preferences 112 | this._overrideVignetteEffect(); 113 | } else if (mode == 2) { // Blur Activities only 114 | // Disable vignette effect 115 | this._disableVignetteEffect(); 116 | // Create overview background actors 117 | this._createBlurredOverviewActors(); 118 | // Connect overview listeners 119 | this._connectOverviewListeners(); 120 | } else if (mode == 3) { // Blur Panel and Activities 121 | // Disable vignette effect 122 | this._disableVignetteEffect(); 123 | // Apply panel blur 124 | this._createBlurredPanelActor(); 125 | // activities_only 126 | this._createBlurredOverviewActors(); 127 | // Connect overview listeners 128 | this._connectOverviewListeners(); 129 | } else { 130 | log('Mode ' + mode + ' not defined'); 131 | } 132 | } 133 | 134 | _regenerateBlurredActors() { 135 | if (this.regeneration_timeout) 136 | return; 137 | 138 | // Delayed function call to let the old backgrounds fade out 139 | this.regeneration_timeout = GLib.timeout_add(GLib.PRIORITY_LOW, 100, 140 | () => { 141 | log('regenerate actors'); 142 | this._enterMode(); 143 | this.regeneration_timeout = null; 144 | return GLib.SOURCE_REMOVE; 145 | } 146 | ); 147 | } 148 | 149 | /*************************************************************** 150 | * Listeners * 151 | ***************************************************************/ 152 | _connectOverviewListeners() { 153 | // Overview showing listener 154 | this.overview_showing_connection = Main.overview.connect('showing', 155 | () => { 156 | // Fade out the untouched overview background actors to reveal 157 | // our copied actors. 158 | Main.overview._backgroundGroup.get_children().forEach( 159 | (actor) => { 160 | if (actor.is_realized() && actor['name'] != OVERVIEW_BACKGROUND_NAME) 161 | this._fadeOut(actor); 162 | }); 163 | } 164 | ); 165 | // Overview Hiding listener 166 | this.overview_hiding_connection = Main.overview.connect('hiding', 167 | () => { 168 | // Fade in the untouched overview background actors to cover 169 | // our copied actors. 170 | Main.overview._backgroundGroup.get_children().forEach( 171 | (actor) => { 172 | if (actor.is_realized() && actor['name'] != OVERVIEW_BACKGROUND_NAME) 173 | this._fadeIn(actor); 174 | }); 175 | } 176 | ); 177 | } 178 | 179 | _disconnectOverviewListeners() { 180 | if (this.overview_showing_connection) { 181 | Main.overview.disconnect(this.overview_showing_connection); 182 | this.overview_showing_connection = null; 183 | } 184 | if (this.overview_hiding_connection) { 185 | Main.overview.disconnect(this.overview_hiding_connection); 186 | this.overview_hiding_connection = null; 187 | } 188 | } 189 | 190 | /*************************************************************** 191 | * Blur Effect and Animation Utilities * 192 | ***************************************************************/ 193 | _applyTwoPassBlur(actor, intensity, brightness = 1.0) { 194 | if (supportsNativeBlur) { 195 | if (!actor.get_effect('blur')) { 196 | actor.add_effect_with_name('blur', new Shell.BlurEffect({ 197 | mode: SHELL_BLUR_MODE_ACTOR, 198 | brightness: parseFloat(brightness), 199 | sigma: parseFloat(intensity), 200 | })); 201 | } 202 | } else { 203 | if (!actor.get_effect('vertical_blur')) 204 | actor.add_effect_with_name('vertical_blur', new Effect.BlurEffect( 205 | actor.width, actor.height, 0, intensity, brightness)); 206 | if (!actor.get_effect('horizontal_blur')) 207 | actor.add_effect_with_name('horizontal_blur', new Effect.BlurEffect( 208 | actor.width, actor.height, 1, intensity, brightness)); 209 | } 210 | } 211 | 212 | _fadeIn(actor) { 213 | // Transition animation: change opacity to 255 (fully opaque) 214 | if (actor.ease_property == undefined) { 215 | Tweener.addTween(actor, 216 | { 217 | opacity: 255, 218 | time: Overview.SHADE_ANIMATION_TIME, 219 | transition: 'easeOutQuad' 220 | }); 221 | } else { 222 | actor.ease_property('opacity', 255, { 223 | duration: Overview.SHADE_ANIMATION_TIME, 224 | mode: Clutter.AnimationMode.EASE_OUT_QUAD 225 | }); 226 | } 227 | } 228 | 229 | _fadeOut(actor) { 230 | // Transition animation: change opacity to 0 (fully transparent) 231 | if (actor.ease_property == undefined) { 232 | Tweener.addTween(actor, 233 | { 234 | opacity: 0, 235 | time: Overview.SHADE_ANIMATION_TIME, 236 | transition: 'easeOutQuad' 237 | }); 238 | } else { 239 | actor.ease_property('opacity', 0, { 240 | duration: Overview.SHADE_ANIMATION_TIME, 241 | mode: Clutter.AnimationMode.EASE_OUT_QUAD 242 | }); 243 | } 244 | } 245 | 246 | /*************************************************************** 247 | * Vignette Effect * 248 | ***************************************************************/ 249 | _disableVignetteEffect() { 250 | log('disable vignette effect'); 251 | // Remove the code responsible for the vignette effect 252 | Main.overview._shadeBackgrounds = function () { }; 253 | Main.overview._unshadeBackgrounds = function () { }; 254 | 255 | // Disable the vignette effect for each actor 256 | Main.overview._backgroundGroup.get_children().forEach((actor) => { 257 | actor.vignette = false; 258 | }, null); 259 | } 260 | 261 | _overrideVignetteEffect() { 262 | log('override vignette effect'); 263 | // Inject a new function handling the shading of the activities background 264 | Main.overview._shadeBackgrounds = function () { 265 | Main.overview._backgroundGroup.get_children().forEach((actor) => { 266 | this.activities_brightness = Settings.get_double('activitiesbrightness'); 267 | actor.vignette = true; 268 | actor.brightness = 1.0; 269 | actor['vignette_sharpness'] = 0; 270 | if (actor.ease_property == undefined) { 271 | Tweener.addTween(actor, 272 | { 273 | brightness: this.activities_brightness, 274 | time: Overview.SHADE_ANIMATION_TIME, 275 | transition: 'easeOutQuad' 276 | }); 277 | } else { 278 | actor.ease_property('brightness', this.activities_brightness, { 279 | duration: Overview.SHADE_ANIMATION_TIME, 280 | mode: Clutter.AnimationMode.EASE_OUT_QUAD 281 | }); 282 | } 283 | }, this) 284 | }; 285 | 286 | // Inject a new function handling the unshading of the activities background 287 | Main.overview._unshadeBackgrounds = function () { 288 | Main.overview._backgroundGroup.get_children().forEach((actor) => { 289 | this.activities_brightness = Settings.get_double('activitiesbrightness'); 290 | actor.vignette = true; 291 | actor.brightness = this.activities_brightness; 292 | actor['vignette_sharpness'] = 0; 293 | if (actor.ease_property == undefined) { 294 | Tweener.addTween(actor, 295 | { 296 | brightness: 1.0, 297 | time: Overview.SHADE_ANIMATION_TIME, 298 | transition: 'easeOutQuad' 299 | }); 300 | } else { 301 | actor.ease_property('brightness', 1.0, { 302 | duration: Overview.SHADE_ANIMATION_TIME, 303 | mode: Clutter.AnimationMode.EASE_OUT_QUAD 304 | }); 305 | } 306 | }, this) 307 | }; 308 | } 309 | 310 | _restoreVignetteEffect() { 311 | // Reassign the code responsible for the vignette effect 312 | Main.overview._shadeBackgrounds = _shadeBackgrounds; 313 | Main.overview._unshadeBackgrounds = _unshadeBackgrounds; 314 | 315 | // Re-enable the vignette effect for each actor 316 | Main.overview._backgroundGroup.get_children().forEach((actor) => { 317 | actor.vignette = true; 318 | }, null); 319 | } 320 | 321 | /*************************************************************** 322 | * Overview Backgrounds * 323 | ***************************************************************/ 324 | _createBlurredOverviewActors() { 325 | // Remove current blurred background actors 326 | this._removeBlurredActors(Main.overview._backgroundGroup, OVERVIEW_BACKGROUND_NAME); 327 | log('Creating blurred overview actors'); 328 | 329 | // Update backgrounds to prevent ghost actors 330 | Main.overview._updateBackgrounds(); 331 | 332 | // Get current activities background brighness and blur intensity value 333 | let activities_brightness = Settings.get_double('activitiesbrightness'); 334 | let intensity = Settings.get_double('intensity'); 335 | 336 | // Only create copies of background actors with full opacity 337 | // This is needed to prevent copying of actors which are currently beeing 338 | // removed by the background manager. We are receiving the change signal 339 | // before the fadeout animation is completed. Adding one of the actors 340 | // which are beeing phased out later causes issues as they appear as plane 341 | // white backgrounds instead of the actual image. 342 | Main.overview._backgroundGroup.get_children().forEach( 343 | (bg) => { 344 | if (bg.opacity == 255) { 345 | bg.vignette = false; 346 | bg.brightness = 1.0; 347 | 348 | // Clone the background actor 349 | let blurred_bg = new Meta.BackgroundActor({ 350 | name: OVERVIEW_BACKGROUND_NAME, 351 | background: bg.background, 352 | width: bg['width'], 353 | height: bg['height'], 354 | monitor: bg['monitor'], 355 | x: bg['x'], 356 | y: bg['y'], 357 | reactive: true 358 | }); 359 | 360 | // Apply blur effect 361 | this._applyTwoPassBlur(blurred_bg, intensity, activities_brightness); 362 | 363 | // Add child to our modified BG actor 364 | Main.overview._backgroundGroup.add_child(blurred_bg); 365 | Main.overview._backgroundGroup.set_child_below_sibling(blurred_bg, bg); 366 | } 367 | } 368 | ); 369 | } 370 | 371 | _updateBlurredOverviewActors() { 372 | // Get current activities background brighness and blur intensity value 373 | let activities_brightness = Settings.get_double('activitiesbrightness'); 374 | let intensity = Settings.get_double('intensity'); 375 | // Remove and reapply blur effect for each actor 376 | Main.overview._backgroundGroup.get_children().forEach( 377 | (bg) => { 378 | if (bg['name'] == OVERVIEW_BACKGROUND_NAME) { 379 | bg.clear_effects(); 380 | this._applyTwoPassBlur(bg, intensity, activities_brightness); 381 | } 382 | } 383 | ); 384 | } 385 | 386 | /*************************************************************** 387 | * Panel Background * 388 | ***************************************************************/ 389 | _createBlurredPanelActor() { 390 | // Remove current blurred panel bgs 391 | this._removeBlurredActors(Main.layoutManager.panelBox, PANEL_CONTAINER_NAME); 392 | log('Creating blurred panel actor'); 393 | 394 | // Update backgrounds to prevent ghost actors 395 | Main.overview._updateBackgrounds(); 396 | 397 | // Create list of backgrounds with full opacity 398 | let bgs = []; 399 | Main.overview._backgroundGroup.get_children().forEach( 400 | (bg) => { 401 | if (bg.opacity == 255 && bg.visible) { 402 | bgs.push(bg); 403 | } 404 | }); 405 | 406 | // Calculate index of primary background 407 | // Check wheter the global display object has a get_primary_monitor method 408 | if (global.display.get_primary_monitor == undefined) { 409 | var bgIndex = bgs.length - global.screen.get_primary_monitor() - 1; 410 | } else { 411 | var bgIndex = bgs.length - global.display.get_primary_monitor() - 1; 412 | } 413 | 414 | // Select primary background 415 | this.primaryBackground = bgs[bgIndex]; 416 | 417 | // Clutter Actor with height 0 which will contain the actual blurred background 418 | this.panelContainer = new Clutter.Actor({ 419 | name: PANEL_CONTAINER_NAME, 420 | width: 0, 421 | height: 0 422 | }); 423 | 424 | let [tpx, tpy] = Main.layoutManager.panelBox.get_transformed_position(); 425 | 426 | // Clone primary background instance (we need to clone it, not just 427 | // assign it, so we can modify it without influencing the main 428 | // desktop background) 429 | this.panel_bg = new Meta.BackgroundActor({ 430 | background: this.primaryBackground['background'], 431 | monitor: this.primaryBackground['monitor'], 432 | width: this.primaryBackground.width, 433 | height: this.primaryBackground.height, 434 | x: -1 * tpx, 435 | y: -1 * tpy 436 | }); 437 | 438 | // Only show one part of the panel background actor as large as the 439 | // panel itself 440 | this.panel_bg.set_clip( 441 | tpx, 442 | tpy, 443 | Main.layoutManager.panelBox.width, 444 | Main.layoutManager.panelBox.height); 445 | 446 | // Get current panel brightness and blur intensity value 447 | let panel_brightness = Settings.get_double('panelbrightness'); 448 | let intensity = Settings.get_double('intensity'); 449 | 450 | // Apply the blur effect to the panel background 451 | this._applyTwoPassBlur(this.panel_bg, intensity, panel_brightness); 452 | 453 | // Add the background texture to the background container 454 | this.panelContainer.add_actor(this.panel_bg); 455 | 456 | // Add the background container to the system panel box 457 | Main.layoutManager.panelBox.add_actor(this.panelContainer); 458 | Main.layoutManager.panelBox.set_child_at_index(this.panelContainer, 0); 459 | } 460 | 461 | _updateBlurredPanelActor() { 462 | this.panel_bg.clear_effects(); 463 | let panel_brightness = Settings.get_double('panelbrightness'); 464 | let intensity = Settings.get_double('intensity'); 465 | this._applyTwoPassBlur(this.panel_bg, intensity, panel_brightness); 466 | } 467 | 468 | /*************************************************************** 469 | * Restore Shell State * 470 | ***************************************************************/ 471 | _removeBlurredActors(parent, name) { 472 | log('removing blurred actors with the name: ' + name); 473 | parent.get_children().forEach( 474 | (child) => { 475 | if (child.name == name) { 476 | parent.remove_child(child); 477 | child.destroy(); 478 | } 479 | } 480 | ) 481 | } 482 | 483 | restore() { 484 | // Disconnect Listeners 485 | this._disconnectOverviewListeners(); 486 | 487 | // Remove modified backgrounds 488 | this._removeBlurredActors(Main.layoutManager.panelBox, PANEL_CONTAINER_NAME); 489 | this._removeBlurredActors(Main.overview._backgroundGroup, OVERVIEW_BACKGROUND_NAME); 490 | 491 | // Restore vignette effect 492 | this._restoreVignetteEffect(); 493 | } 494 | } 495 | 496 | var blyr; 497 | 498 | function init() { } 499 | 500 | function enable() { 501 | blyr = new Blyr(); 502 | } 503 | 504 | function disable() { 505 | blyr.restore(); 506 | }; 507 | -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/locale/blyr.pot: -------------------------------------------------------------------------------- 1 | # Blyr translation file 2 | # Copyright (C) 2017 Jonatan Hatakeyama Zeidler 3 | # This file is distributed under the same license as Blyr. 4 | # Jonatan Hatakeyama Zeidler jonatan_zeidler@, 2017. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Blyr\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2017-12-03 16:24+0100\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: Jonatan Hatakeyama Zeidler\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Poedit 2.0.1\n" 19 | 20 | #: prefs.js: 123 21 | msgid "Apply Effect to" 22 | msgstr "" 23 | 24 | #: prefs.js: 134 25 | msgid "Panel" 26 | msgstr "" 27 | 28 | #: prefs.js: 135 29 | msgid "Activities Screen" 30 | msgstr "" 31 | 32 | #: prefs.js: 136 33 | msgid "Activities + Panel" 34 | msgstr "" 35 | 36 | #: prefs.js:153 37 | msgid "Blur Intensity" 38 | msgstr "" 39 | 40 | #: prefs.js:172 41 | msgid "Activities Background Brightness" 42 | msgstr "" 43 | 44 | #: prefs.js:193 45 | msgid "Panel Background Brightness" 46 | msgstr "" 47 | -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/locale/de/LC_MESSAGES/blyr.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/blyr@yozoon.dev.gmail.com/locale/de/LC_MESSAGES/blyr.mo -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/locale/de/LC_MESSAGES/blyr.po: -------------------------------------------------------------------------------- 1 | # Blyr translation file 2 | # Copyright (C) 2017 Jonatan Hatakeyama Zeidler 3 | # This file is distributed under the same license as Blyr. 4 | # Jonatan Hatakeyama Zeidler jonatan_zeidler@, 2017. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: Blyr\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2017-12-03 16:24+0100\n" 11 | "PO-Revision-Date: 2017-12-03 16:29+0100\n" 12 | "Language-Team: Jonatan Hatakeyama Zeidler\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "X-Generator: Poedit 2.0.4\n" 17 | "Last-Translator: Julius Piso yozoon.dev@gmail.com\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | "Language: de\n" 20 | 21 | #: prefs.js:123 22 | msgid "Apply Effect to" 23 | msgstr "Effekt anwenden auf" 24 | 25 | #: prefs.js:134 26 | msgid "Panel" 27 | msgstr "Panel" 28 | 29 | #: prefs.js:135 30 | msgid "Activities Screen" 31 | msgstr "Aktivitäten-Übersicht" 32 | 33 | #: prefs.js:136 34 | msgid "Activities + Panel" 35 | msgstr "Übersicht + Panel" 36 | 37 | #: prefs.js:153 38 | msgid "Blur Intensity" 39 | msgstr "Blur Intensität" 40 | 41 | #: prefs.js:172 42 | msgid "Activities Background Brightness" 43 | msgstr "Helligkeit der Aktivitäten-Übersicht" 44 | 45 | #: prefs.js:193 46 | msgid "Panel Background Brightness" 47 | msgstr "Helligkeit des Panel-Hintergrunds" 48 | -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/locale/nl/LC_MESSAGES/blyr.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/blyr@yozoon.dev.gmail.com/locale/nl/LC_MESSAGES/blyr.mo -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/locale/nl/LC_MESSAGES/blyr.po: -------------------------------------------------------------------------------- 1 | # Blyr translation file 2 | # Copyright (C) 2017 Jonatan Hatakeyama Zeidler 3 | # This file is distributed under the same license as Blyr. 4 | # First translator: Heimen Stoffels, , 2020 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: Blyr\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2017-12-03 16:24+0100\n" 11 | "PO-Revision-Date: 2020-09-05 18:10+0200\n" 12 | "Language-Team: Jonatan Hatakeyama Zeidler\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "X-Generator: Poedit 2.4.1\n" 17 | "Last-Translator: Heimen Stoffels \n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | "Language: nl\n" 20 | 21 | #: prefs.js:123 22 | msgid "Apply Effect to" 23 | msgstr "Effect toepassen op" 24 | 25 | #: prefs.js:134 26 | msgid "Panel" 27 | msgstr "Paneel" 28 | 29 | #: prefs.js:135 30 | msgid "Activities Screen" 31 | msgstr "Activiteitenoverzicht" 32 | 33 | #: prefs.js:136 34 | msgid "Activities + Panel" 35 | msgstr "Activiteitenoverzicht en paneel" 36 | 37 | #: prefs.js:153 38 | msgid "Blur Intensity" 39 | msgstr "Vervaagintensiteit" 40 | 41 | #: prefs.js:172 42 | msgid "Activities Background Brightness" 43 | msgstr "Helderheid van activiteitenachtergrond" 44 | 45 | #: prefs.js:193 46 | msgid "Panel Background Brightness" 47 | msgstr "Helderheid van paneelachtergrond" 48 | -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/locale/pl/LC_MESSAGES/blyr.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/blyr@yozoon.dev.gmail.com/locale/pl/LC_MESSAGES/blyr.mo -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/locale/pl/LC_MESSAGES/blyr.po: -------------------------------------------------------------------------------- 1 | # Blyr translation file 2 | # Copyright (C) 2017 Jonatan Hatakeyama Zeidler 3 | # This file is distributed under the same license as Blyr. 4 | # Jonatan Hatakeyama Zeidler jonatan_zeidler@, 2017. 5 | # First translator: Piotr Komur, pkomur@gmail.com, 2017 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: Blyr\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2017-12-03 16:24+0100\n" 11 | "PO-Revision-Date: 2018-11-09 21:47+0100\n" 12 | "Last-Translator: Piotr Komur \n" 13 | "Language-Team: Piotr Komur\n" 14 | "Language: pl\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Poedit 2.2\n" 19 | "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " 20 | "|| n%100>=20) ? 1 : 2);\n" 21 | 22 | #: prefs.js:123 23 | msgid "Apply Effect to" 24 | msgstr "Zastosuj efekt dla" 25 | 26 | #: prefs.js:134 27 | msgid "Panel" 28 | msgstr "Panel" 29 | 30 | #: prefs.js:135 31 | msgid "Activities Screen" 32 | msgstr "Podgląd" 33 | 34 | #: prefs.js:136 35 | msgid "Activities + Panel" 36 | msgstr "Podgląd i panel" 37 | 38 | #: prefs.js:153 39 | msgid "Blur Intensity" 40 | msgstr "Intensywność rozmycia" 41 | 42 | #: prefs.js:172 43 | msgid "Activities Background Brightness" 44 | msgstr "Jasność tła dla podglądu" 45 | 46 | #: prefs.js:193 47 | msgid "Panel Background Brightness" 48 | msgstr "Jasność tła dla panelu" 49 | -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/locale/uk/LC_MESSAGES/blyr.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/blyr@yozoon.dev.gmail.com/locale/uk/LC_MESSAGES/blyr.mo -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/locale/uk/LC_MESSAGES/blyr.po: -------------------------------------------------------------------------------- 1 | # Blyr translation file 2 | # Copyright (C) 2017 Jonatan Hatakeyama Zeidler 3 | # This file is distributed under the same license as Blyr. 4 | # Jonatan Hatakeyama Zeidler jonatan_zeidler@, 2017. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: Blyr\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2017-12-03 16:24+0100\n" 11 | "PO-Revision-Date: 2017-12-04 18:29+0200\n" 12 | "Language-Team: Jonatan Hatakeyama Zeidler\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "X-Generator: Poedit 2.0.4\n" 17 | "Last-Translator: Alice Charlotte Liddell \n" 18 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" 19 | "Language: uk\n" 20 | 21 | #: prefs.js:123 22 | msgid "Apply Effect to" 23 | msgstr "Застсовувати ефект до" 24 | 25 | #: prefs.js:134 26 | msgid "Panel" 27 | msgstr "Панелі" 28 | 29 | #: prefs.js:135 30 | msgid "Activities Screen" 31 | msgstr "Екрану Діяльності" 32 | 33 | #: prefs.js:136 34 | msgid "Activities + Panel" 35 | msgstr "Діяльностей та Панелі" 36 | 37 | #: prefs.js:153 38 | msgid "Blur Intensity" 39 | msgstr "Інтенсивність розмивання" 40 | 41 | #: prefs.js:172 42 | msgid "Activities Background Brightness" 43 | msgstr "Яскравість екрану Діяльності" 44 | 45 | #: prefs.js:193 46 | msgid "Panel Background Brightness" 47 | msgstr "Яскравість панелі" 48 | -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Blyr", 3 | "description": "Apply a Blur Effect to GNOME Shell UI elements.", 4 | "uuid": "blyr@yozoon.dev.gmail.com", 5 | "shell-version": [ 6 | "3.26", 7 | "3.28", 8 | "3.30", 9 | "3.32", 10 | "3.34", 11 | "3.36" 12 | ], 13 | "url": "https://github.com/yozoon/gnome-shell-extension-blyr", 14 | "version": 8 15 | } -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/prefs.js: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Blyr. 3 | Copyright © 2017-2020 Julius Piso 4 | 5 | Blyr is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | Blyr is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Blyr. If not, see . 17 | */ 18 | 19 | const Gtk = imports.gi.Gtk; 20 | const GLib = imports.gi.GLib; 21 | const GObject = imports.gi.GObject; 22 | const Clutter = imports.gi.Clutter; 23 | const GtkClutter = imports.gi.GtkClutter; 24 | const ExtensionUtils = imports.misc.extensionUtils; 25 | 26 | const Lang = imports.lang; 27 | 28 | const Extension = ExtensionUtils.getCurrentExtension(); 29 | const Shared = Extension.imports.shared; 30 | const Effect = Extension.imports.effect; 31 | const Mainloop = imports.mainloop; 32 | 33 | const Convenience = Extension.imports.convenience; 34 | const Gettext = imports.gettext.domain('blyr'); 35 | const _ = Gettext.gettext; 36 | 37 | const supportsNativeBlur = Shared.supportsNativeBlur(); 38 | 39 | const UPDATE_TIMEOUT = 500; 40 | 41 | const BlyrPrefsWidget = new Lang.Class ({ 42 | Name: 'BlyrPrefsWidget', 43 | Extends: Gtk.VBox, 44 | 45 | _init: function(showPreview) { 46 | this.parent(); 47 | 48 | this.settings = Shared.getSettings(Shared.SCHEMA_NAME, 49 | Extension.dir.get_child('schemas').get_path()); 50 | 51 | this.showPreview = showPreview; 52 | this.intensity_timeout = 0; 53 | this.activities_brightness_timeout = 0; 54 | this.mode = this.settings.get_int("mode"); 55 | this.intensity = this.settings.get_double("intensity"); 56 | this.activities_brightness = this.settings.get_double("activitiesbrightness"); 57 | this.panel_brightness = this.settings.get_double("panelbrightness"); 58 | this.panel_brightness_timeout = null; 59 | 60 | this._buildUI(); 61 | }, 62 | 63 | _buildUI: function() { 64 | /* 65 | ** EFFECT PREVIEW 66 | */ 67 | if(this.showPreview) { 68 | // Effect Preview 69 | this.previewBox = new Gtk.Box({ expand: false }); 70 | let embed = new GtkClutter.Embed({ expand: false }); 71 | embed.set_size_request(600, 150); 72 | 73 | // Get extension path 74 | let path = Extension.dir.get_child('assets').get_path(); 75 | 76 | // Create Clutter.Texture from image 77 | this.texture = new Clutter.Texture({ 78 | filename: path + '/kingscanyon.png', 79 | width : 600 80 | }); 81 | 82 | // Apply blur 83 | this.vertical_blur = new Effect.BlurEffect(this.texture.width, this.texture.height, 0, this.intensity, this.activities_brightness); 84 | this.texture.add_effect_with_name('vertical_blur', this.vertical_blur); 85 | this.horizontal_blur = new Effect.BlurEffect(this.texture.width, this.texture.height, 1, this.intensity, this.activities_brightness); 86 | this.texture.add_effect_with_name('vertical_blur', this.horizontal_blur); 87 | 88 | // Add the clutter texture to the gtk embed 89 | embed.get_stage().add_child(this.texture); 90 | 91 | // Connect button press callback 92 | this.previewBox.connect('button_press_event', Lang.bind(this, this._previewClicked)); 93 | 94 | this.previewBox.pack_start(embed, false, false, 0); 95 | } 96 | 97 | /* 98 | ** MODE SELECTOR 99 | */ 100 | this.selectBox = new Gtk.HBox({ spacing: 8, margin: 8, homogeneous: true }); 101 | 102 | // Select label 103 | this.select_label = new Gtk.Label({ halign : Gtk.Align.START }); 104 | this.select_label.set_markup(""+_("Apply Effect to")+""); 105 | 106 | // Dropdown menu 107 | this.model = new Gtk.ListStore(); 108 | this.model.set_column_types([GObject.TYPE_INT, GObject.TYPE_STRING]); 109 | 110 | this.combobox = new Gtk.ComboBox({model: this.model }); 111 | let renderer = new Gtk.CellRendererText(); 112 | this.combobox.pack_start(renderer, true); 113 | this.combobox.add_attribute(renderer, 'text', 1); 114 | 115 | this.model.set(this.model.append(), [0, 1], [1,_("Panel")]); 116 | this.model.set(this.model.append(), [0, 1], [2,_("Activities Screen")]); 117 | this.model.set(this.model.append(), [0, 1], [3,_("Activities + Panel")]); 118 | 119 | this.combobox.set_active(this.mode - 1); // I know... the problems of starting the index with 1 120 | 121 | // Connect changed callback 122 | this.combobox.connect('changed', Lang.bind(this, this._modeChanged)); 123 | 124 | this.selectBox.pack_start(this.select_label, true, true, 0); 125 | this.selectBox.pack_start(this.combobox, true, true, 0); 126 | 127 | /* 128 | ** BLUR INTENSITY 129 | **/ 130 | this.intensityBox = new Gtk.HBox({ spacing: 8, margin: 8, homogeneous: true }); 131 | // Blur label 132 | let intensity_label = new Gtk.Label({ halign : Gtk.Align.START }); 133 | intensity_label.set_markup(""+_("Blur Intensity")+""); 134 | 135 | // Blur slider 136 | this.intensity_slider = Gtk.Scale.new_with_range(Gtk.Orientation.HORIZONTAL, 1.0, 29.9, 0.1); 137 | this.intensity_slider.set_value(this.intensity); 138 | 139 | // Connect value-changed callback 140 | this.intensity_slider.connect('value-changed', Lang.bind(this, this._intensityChanged)); 141 | 142 | this.intensityBox.pack_start(intensity_label, true, true, 0); 143 | this.intensityBox.pack_start(this.intensity_slider, true, true, 0); 144 | 145 | /* 146 | ** ACTIVITIES BRIGHTNESS 147 | */ 148 | this.activities_brightnessBox = new Gtk.HBox({ spacing: 8, margin: 8, homogeneous: true }); 149 | 150 | // Brightness label 151 | let brightness_label = new Gtk.Label({ halign : Gtk.Align.START }); 152 | brightness_label.set_markup(""+_("Activities Background Brightness")+""); 153 | 154 | // Brightness slider 155 | this.activities_brightness_slider = Gtk.Scale.new_with_range(Gtk.Orientation.HORIZONTAL, 0.0, 1.0,0.01); 156 | this.activities_brightness_slider.set_value(this.activities_brightness); 157 | 158 | // Connect value-changed callback 159 | this.activities_brightness_slider.connect('value-changed', Lang.bind(this, this._activitiesBrightnessChanged)); 160 | 161 | this.activities_brightnessBox.pack_start(brightness_label, true, true, 0); 162 | this.activities_brightnessBox.pack_start(this.activities_brightness_slider, true, true, 0); 163 | 164 | /* 165 | ** PANEL BRIGHTNESS 166 | */ 167 | this.panelBrightnessBox = new Gtk.HBox({ spacing: 8, margin: 8, homogeneous: true }); 168 | 169 | // Brightness label 170 | let panel_brightness_label = new Gtk.Label({ halign : Gtk.Align.START }); 171 | panel_brightness_label.set_markup(""+_("Panel Background Brightness")+""); 172 | 173 | // Brightness slider 174 | this.panel_brightness_slider = Gtk.Scale.new_with_range(Gtk.Orientation.HORIZONTAL, 0.0, 1.0,0.01); 175 | this.panel_brightness_slider.set_value(this.panel_brightness); 176 | 177 | // Connect value-changed callback 178 | this.panel_brightness_slider.connect('value-changed', Lang.bind(this, this._panelBrightnessChanged)); 179 | 180 | this.panelBrightnessBox.pack_start(panel_brightness_label, true, true, 0); 181 | this.panelBrightnessBox.pack_start(this.panel_brightness_slider, true, true, 0); 182 | 183 | /* 184 | ** ATTACH WIDGETS TO PARENT 185 | */ 186 | // Preview box 187 | if(this.showPreview) 188 | this.pack_start(this.previewBox, false, false, 0); 189 | 190 | // Mode selector 191 | this.pack_start(this.selectBox, false, false, 0); 192 | 193 | // Intensity slider 194 | this.pack_start(this.intensityBox, false, false, 0); 195 | 196 | // Brightness slider 197 | this.pack_start(this.activities_brightnessBox, false, false, 0); 198 | 199 | // Panel brightness slider 200 | this.pack_start(this.panelBrightnessBox, false, false, 0); 201 | }, 202 | 203 | _previewClicked: function() { 204 | if(this.texture.has_effects()) { 205 | this.texture.clear_effects(); 206 | } else { 207 | this.texture.add_effect_with_name('vertical_blur', this.vertical_blur); 208 | this.texture.add_effect_with_name('vertical_blur', this.horizontal_blur); 209 | } 210 | }, 211 | 212 | _modeChanged: function() { 213 | let [success, iter] = this.combobox.get_active_iter(); 214 | if (!success) 215 | return; 216 | this.mode = this.model.get_value(iter, 0); 217 | this.settings.set_int('mode', this.mode); 218 | }, 219 | 220 | _intensityChanged: function() { 221 | if (this.intensity_timeout > 0) 222 | Mainloop.source_remove(this.intensity_timeout); 223 | 224 | // Delay updating so we don't get overrun by effect updates 225 | this.intensity_timeout = Mainloop.timeout_add(UPDATE_TIMEOUT, Lang.bind(this, 226 | function() { 227 | // Get intensity from scale 228 | this.intensity = this.intensity_slider.get_value(); 229 | // Save current intensity 230 | this.settings.set_double("intensity", this.intensity); 231 | // Apply effect if not applied 232 | if(!this.texture.has_effects()) 233 | this._previewClicked(); 234 | // Update preview 235 | this._updatePreview(); 236 | return GLib.SOURCE_REMOVE; 237 | })); 238 | }, 239 | 240 | _activitiesBrightnessChanged: function() { 241 | if (this.activities_brightness_timeout > 0) 242 | Mainloop.source_remove(this.activities_brightness_timeout); 243 | // Delay updating so we don't get overrun by effect updates 244 | this.activities_brightness_timeout = Mainloop.timeout_add(UPDATE_TIMEOUT, Lang.bind(this, 245 | function() { 246 | // Get brightness from scale 247 | this.activities_brightness = this.activities_brightness_slider.get_value(); 248 | // Save current brightness 249 | this.settings.set_double("activitiesbrightness", this.activities_brightness); 250 | // Apply effect if not applied 251 | if(!this.texture.has_effects()) 252 | this._previewClicked(); 253 | // Update preview 254 | this._updatePreview(); 255 | return GLib.SOURCE_REMOVE; 256 | })); 257 | }, 258 | 259 | _panelBrightnessChanged: function() { 260 | if (this.panel_brightness_timeout > 0) 261 | Mainloop.source_remove(this.panel_brightness_timeout); 262 | // Delay updating so we don't get overrun by effect updates 263 | this.panel_brightness_timeout = Mainloop.timeout_add(UPDATE_TIMEOUT, Lang.bind(this, 264 | function() { 265 | // Get brightness from scale 266 | this.panel_brightness = this.panel_brightness_slider.get_value(); 267 | // Save current brightness 268 | this.settings.set_double("panelbrightness", this.panel_brightness); 269 | return GLib.SOURCE_REMOVE; 270 | })); 271 | }, 272 | 273 | _updatePreview: function() { 274 | if(this.showPreview) { 275 | // Update effects with new values 276 | this.vertical_blur.updateUniforms(this.intensity, this.activities_brightness); 277 | this.horizontal_blur.updateUniforms(this.intensity, this.activities_brightness); 278 | } 279 | } 280 | }); 281 | 282 | function init(){ 283 | Convenience.initTranslations("blyr"); 284 | } 285 | 286 | function buildPrefsWidget() { 287 | var showPreview = false; 288 | 289 | // Try to initialise GtkClutter and Clutter which are required to show the blur preview. 290 | // If this fails we will not generate the preview actor to keep all the main functionality 291 | // of the preferences dialog accessible. 292 | try { 293 | // Init GtkClutter and Clutter 294 | GtkClutter.init(null); 295 | Clutter.init(null); 296 | showPreview = true; 297 | } catch(err) { 298 | log("Clutter or GtkClutter init failed with the following " + err); 299 | } 300 | 301 | let PrefsWidget = new BlyrPrefsWidget(showPreview); 302 | PrefsWidget.show_all(); 303 | 304 | return PrefsWidget; 305 | } -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/schemas/gschemas.compiled: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/blyr@yozoon.dev.gmail.com/schemas/gschemas.compiled -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/schemas/org.gnome.shell.extensions.blyr.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10.0 7 | Blur intensity 8 | Influences the blur effect strenght 9 | 10 | 11 | 0.7 12 | Brightness value 13 | Sets the brightness of the Activities background 14 | 15 | 16 | 1.0 17 | Brightness value 18 | Sets the brightness of the Panel background 19 | 20 | 21 | 2 22 | Selects UI elements 23 | Selects the UI elements to get a blurred background; 1 = panel-only, 2 = activities-only, 3 = blur-both 24 | 25 | 26 | false 27 | Log messages to systemd journal 28 | Helpful for debugging purposes 29 | 30 | 31 | -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/shader.glsl: -------------------------------------------------------------------------------- 1 | uniform sampler2D tex; 2 | uniform int width; 3 | uniform int height; 4 | uniform int dir; 5 | uniform float radius; 6 | uniform float brightness; 7 | 8 | float radius_band = 5; 9 | int band = int(radius/radius_band); 10 | int elements; 11 | float[31] weights; 12 | 13 | /* 14 | ** initWeights gets executed on every pixel instance of the shader. Because of the parallel execution of the main instances every pixel instance gets a copy of the global variables, 15 | ** which also means that those instances can't change the value of the global variable. 16 | */ 17 | 18 | void initWeights() { 19 | if(band == 1) { 20 | elements = 11; 21 | weights = float[](0.0877142386894625, 0.08571761885514498, 0.0799963364506413, 0.07129680990889681, 0.06068342691594618, 0.049325341222694934, 0.03828865390084329, 0.02838377126232145, 0.020094171210084107, 0.013585327059749568, 0.008771423868946249, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); 22 | } else if(band == 2) { 23 | elements = 16; 24 | weights = float[](0.0586256816448148, 0.058028782785674825, 0.056274303376764534, 0.05346725712469989, 0.04977104899549517, 0.04539173617000566, 0.0405590622531167, 0.035506685021076116, 0.030453938115135727, 0.025591038213833354, 0.02106897757449955, 0.016994567929708503, 0.01343036777015676, 0.010398646009483488, 0.007888179673460876, 0.005862568164481478, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); 25 | } else if(band == 3) { 26 | elements = 21; 27 | weights = float[](0.0440280172323652, 0.043775299669453475, 0.04302581720435111, 0.04180508663519469, 0.040154028951265845, 0.038126692151510426, 0.03578731597266526, 0.033206960669429846, 0.03045994590950288, 0.02762034683326305, 0.024758773555951772, 0.021939621342538233, 0.019218926584070265, 0.016642904755081178, 0.014247187103581744, 0.01205671868468385, 0.01008623604931275, 0.00834121139372131, 0.006819132478725233, 0.005510983716277974, 0.004402801723236519, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); 28 | } else if(band == 4) { 29 | elements = 26; 30 | weights = float[](0.035251311548426645, 0.03512167985428671, 0.03473563797921578, 0.034101641135581943, 0.03323343864771841, 0.032149578233677256, 0.030872747420843664, 0.02942898474365488, 0.02784679898571322, 0.026156237964777153, 0.02438794909471392, 0.022572272253890677, 0.0207384015755935, 0.01891364702785695, 0.017122819549254917, 0.01538775559811883, 0.013726988815983374, 0.012155568634473212, 0.010685018534585205, 0.009323420668711375, 0.00807560893439296, 0.006943449478165318, 0.005926186022712806, 0.00502082725973912, 0.004222554657282778, 0.0035251311548426634, 0.0, 0.0, 0.0, 0.0, 0.0); 31 | } else if(band == 5) { 32 | elements = 31; 33 | weights = float[](0.02939238997940825, 0.0293172877821358, 0.02909313061808605, 0.028723337500726337, 0.02821351026143142, 0.02757129236128949, 0.026806178255796353, 0.025929279956616785, 0.024953058808301565, 0.023891031518258905, 0.022757460108256487, 0.02156703567869248, 0.020334565697082033, 0.019074673963800762, 0.017801521513017445, 0.01652855553153197, 0.015268291990392636, 0.014032136157813015, 0.012830243573388909, 0.011671422487248699, 0.010563077271987156, 0.009511190959338476, 0.008520343885258975, 0.007593764480959185, 0.0067334075441362, 0.005940054871217317, 0.0052134329221157774, 0.004552342206966415, 0.003954793303635894, 0.0034181448028725646, 0.0029392389979408244); 34 | } else { // default 35 | elements = 6; 36 | weights = float[](0.1742497602122148, 0.15891767006870802, 0.12055138079000842, 0.07606277909668431, 0.03991831391727037, 0.017424976021221478, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); 37 | } 38 | } 39 | 40 | vec2 step_size = vec2((mod(radius, radius_band)/15.0 + 1.0)/(4/3*float(width)), (mod(radius, radius_band)/15.0 + 1.0)/(4/3*float(height))); 41 | 42 | vec2 direction = vec2(dir, (1.0-dir)); 43 | 44 | void main(void) { 45 | initWeights(); 46 | 47 | vec2 pos = cogl_tex_coord_in[0].xy; 48 | 49 | cogl_color_out = texture2D(tex, pos) * weights[0]; 50 | for(int t = 1; t < elements; t++) { 51 | cogl_color_out += texture2D(tex, pos + t * step_size * direction) * weights[t]; 52 | cogl_color_out += texture2D(tex, pos - t * step_size * direction) * weights[t]; 53 | } 54 | 55 | cogl_color_out.a = 1.0; 56 | cogl_color_out.rgb *= brightness; 57 | } -------------------------------------------------------------------------------- /blyr@yozoon.dev.gmail.com/shared.js: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Blyr. 3 | Copyright © 2017-2020 Julius Piso 4 | 5 | Blyr is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | Blyr is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Blyr. If not, see . 17 | */ 18 | 19 | const Gio = imports.gi.Gio; 20 | const GLib = imports.gi.GLib; 21 | const Config = imports.misc.config; 22 | 23 | var SCHEMA_NAME = "org.gnome.shell.extensions.blyr"; 24 | 25 | function getSettings(schemaName, schemaDir) { 26 | // Extension installed in .local 27 | if (GLib.file_test(schemaDir + '/' + schemaName + ".gschema.xml", GLib.FileTest.EXISTS)) { 28 | var schemaSource = Gio.SettingsSchemaSource.new_from_directory(schemaDir, 29 | Gio.SettingsSchemaSource.get_default(), false); 30 | var schema = schemaSource.lookup(schemaName, false); 31 | 32 | return new Gio.Settings({ settings_schema: schema }); 33 | } 34 | } 35 | 36 | // Check Gnome shell version 37 | function checkShellVersion() { 38 | let shell_array = Config.PACKAGE_VERSION.split("."); 39 | let shell_version = shell_array[0] + shell_array[1]; // Don't include subversions 40 | return shell_version; 41 | } 42 | 43 | function supportsNativeBlur() { 44 | let shell_version = checkShellVersion(); 45 | let native; 46 | if(shell_version >= 336) { 47 | native = true; 48 | } else { 49 | native = false; 50 | } 51 | return native; 52 | } 53 | -------------------------------------------------------------------------------- /img/Overview_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/img/Overview_10.png -------------------------------------------------------------------------------- /img/Overview_30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/img/Overview_30.png -------------------------------------------------------------------------------- /img/Panel_Blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/img/Panel_Blur.png -------------------------------------------------------------------------------- /img/Prefs_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/img/Prefs_10.png -------------------------------------------------------------------------------- /img/Prefs_30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/img/Prefs_30.png -------------------------------------------------------------------------------- /img/Tweak_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/img/Tweak_10.png -------------------------------------------------------------------------------- /img/Tweak_30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/img/Tweak_30.png -------------------------------------------------------------------------------- /img/blyr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yozoon/gnome-shell-extension-blyr/8b1d82d8550f59d0f49703b08baa931f96b9ac61/img/blyr.png -------------------------------------------------------------------------------- /tools/calculate_weights.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 88 | 89 | -------------------------------------------------------------------------------- /tools/deactivate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # removes blyr from the enabled-extensions list 3 | gsettings set org.gnome.shell enabled-extensions "$(gsettings get org.gnome.shell enabled-extensions | { read test; echo "${test//blyr\@yozoon.dev.gmail.com}"; })" 4 | --------------------------------------------------------------------------------