diff --git a/tromjaro/gnome/Packages-Desktop b/tromjaro/gnome/Packages-Desktop index fe2b3ec6..d16083dd 100644 --- a/tromjaro/gnome/Packages-Desktop +++ b/tromjaro/gnome/Packages-Desktop @@ -9,9 +9,6 @@ kvantum-theme-vimix-git imageburner timeshift-autosnap dat-fox-helper-git -gnome-shell-extension-unite -gnome-shell-extension-dash-to-dock - #TROM tromjaro-gnome-shell-fix @@ -105,6 +102,7 @@ hunspell hunspell-en_US inxi #cli tool# +kernel-alive pacui mc mhwd-tui @@ -112,6 +110,8 @@ mhwd-tui manjaro-alsa manjaro-hotfixes manjaro-pulse +manjaro-settings-manager + mesa-demos mobile-broadband-provider-info modemmanager diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/COPYING b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/COPYING new file mode 100644 index 00000000..8d61b15e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/COPYING @@ -0,0 +1,341 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. + + 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 +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This 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 Library General +Public License instead of this License. + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/README.md b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/README.md new file mode 100644 index 00000000..e2a1b8c3 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/README.md @@ -0,0 +1,28 @@ +# Dash to Dock +![screenshot](https://github.com/micheleg/dash-to-dock/raw/master/media/screenshot.jpg) + +## A dock for the GNOME Shell +This extension enhances the dash moving it out of the overview and transforming it in a dock for an easier launching of applications and a faster switching between windows and desktops without having to leave the desktop view. + +[](https://extensions.gnome.org/extension/307/dash-to-dock) + +For additional installation instructions and more information visit [https://micheleg.github.io/dash-to-dock/](https://micheleg.github.io/dash-to-dock/). + +## Installation from source + +The extension can be installed directly from source, either for the convenience of using git or to test the latest development version. Clone the desired branch with git + +
git clone https://github.com/micheleg/dash-to-dock.git
+or download the branch from github. A simple Makefile is included. Then run +
make
+make install
+
+to install the extension in your home directory. A Shell reload is required Alt+F2 r Enter and the extension has to be enabled with *gnome-tweak-tool* or with *dconf*. + +## Bug Reporting + +Bugs should be reported to the Github bug tracker [https://github.com/micheleg/dash-to-dock/issues](https://github.com/micheleg/dash-to-dock/issues). + +## License +Dash to Dock Gnome Shell extension is distributed under the terms of the GNU General Public License, +version 2 or later. See the COPYING file for details. diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/Settings.ui b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/Settings.ui new file mode 100644 index 00000000..240c2f44 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/Settings.ui @@ -0,0 +1,3419 @@ + + + + + + 1 + 0.050000000000000003 + 0.25 + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + When set to minimize, double clicking minimizes all the windows of the application. + True + 40 + 0 + + + + 0 + 1 + + + + + True + False + True + Shift+Click action + 0 + + + 0 + 0 + + + + + True + False + center + + Raise window + Minimize window + Launch new instance + Cycle through windows + Minimize or overview + Show window previews + Minimize or show previews + Focus or show previews + Quit + + + + 1 + 0 + 2 + + + + + + + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behavior for Middle-Click. + True + 40 + 0 + + + + 0 + 1 + + + + + True + False + True + Middle-Click action + 0 + + + 0 + 0 + + + + + True + False + center + + Raise window + Minimize window + Launch new instance + Cycle through windows + Minimize or overview + Show window previews + Minimize or show previews + Focus or show previews + Quit + + + + 1 + 0 + 2 + + + + + + + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behavior for Shift+Middle-Click. + True + 40 + 0 + + + + 0 + 1 + + + + + True + False + True + Shift+Middle-Click action + 0 + + + 0 + 0 + + + + + True + False + center + + Raise window + Minimize window + Launch new instance + Cycle through windows + Minimize or overview + Show window previews + Minimize or show previews + Focus or show previews + Quit + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 0 + + + + + 1 + 0.01 + 0.10000000000000001 + + + 0.33000000000000002 + 1 + 0.01 + 0.10000000000000001 + + + 10 + 1 + 5 + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + vertical + 12 + + + True + False + 32 + + + True + False + center + Enable Unity7 like glossy backlit items + 0 + + + True + True + 0 + + + + + True + True + center + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + + + True + False + start + Use dominant color + + + True + True + 0 + + + + + True + True + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + 32 + + + True + True + + + 1 + 0 + + + + + True + False + True + Customize indicator style + fill + 0 + + + 0 + 0 + + + + + False + True + 2 + + + + + True + False + 1 + vertical + 12 + + + True + False + 32 + + + True + False + Color + 0 + + + True + True + 0 + + + + + True + True + True + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + 32 + + + True + False + Border color + 0 + + + True + True + 0 + + + + + True + True + True + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + 32 + + + True + False + Border width + 0 + + + True + True + 0 + + + + + True + True + dot_border_width_adjustment + + + False + True + 1 + + + + + False + True + 2 + + + + + False + True + 3 + + + + + + + + + + + + + + False + True + 0 + + + + + 1 + 0.050000000000000003 + 0.25 + + + 16 + 128 + 1 + 10 + + + True + True + 6 + 6 + 6 + 6 + + + True + False + 24 + 24 + 24 + 24 + vertical + 24 + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Show the dock on + 0 + + + 0 + 0 + + + + + True + False + center + + + + 1 + 0 + + + + + Show on all monitors. + True + True + False + 12 + 0 + True + + + 0 + 2 + 2 + + + + + + + + + + + + + + + 100 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Position on screen + 0 + + + False + True + 0 + + + + + True + False + 32 + + + Left + True + True + False + end + center + 0 + True + + + + False + True + 0 + + + + + Bottom + True + True + False + center + 0 + True + position_left_button + + + + False + True + 1 + + + + + Top + True + True + False + center + 0 + bottom + True + position_left_button + + + + False + True + 2 + + + + + Right + True + True + False + center + 0 + True + position_left_button + + + + False + True + 3 + + + + + False + True + 1 + + + + + + + + + + + + + + False + True + 0 + + + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Hide the dock when it obstructs a window of the current application. More refined settings are available. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Intelligent autohide + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + center + 0.46000000834465027 + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + True + end + center + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 1 + + + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Dock size limit + 0 + + + 0 + 0 + + + + + True + True + baseline + True + dock_size_adjustment + 0 + 2 + right + + + + + 1 + 0 + + + + + Panel mode: extend to the screen edge + True + True + False + 12 + 0 + True + + + 0 + 1 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Icon size limit + 0 + + + 0 + 0 + + + + + True + True + baseline + True + icon_size_adjustment + 1 + 0 + right + + + + + 1 + 0 + + + + + Fixed icon size: scroll to reveal other icons + True + True + False + 12 + 0 + True + + + 0 + 1 + 2 + + + + + + + + + + + + + + False + True + 2 + + + + + + + True + False + Position and size + + + False + + + + + True + False + 24 + 24 + 24 + 24 + vertical + 24 + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + + + + + True + False + True + Show favorite applications + 0 + + + 0 + 0 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + + + + + True + False + True + Show running applications + 0 + + + 0 + 0 + + + + + Isolate workspaces. + True + True + False + 12 + 0 + True + + + 0 + 2 + 2 + + + + + Isolate monitors. + True + True + False + 12 + 0 + True + + + 0 + 3 + 2 + + + + + True + True + False + 3 + 0 + True + + + True + False + Show open windows previews. + True + + + + + 0 + 1 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + True + If disabled, these settings are accessible from gnome-tweak-tool or the extension website. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Show <i>Applications</i> icon + True + 0 + + + 0 + 0 + + + + + Move the applications button at the beginning of the dock. + True + True + False + 12 + 0 + True + + + 0 + 2 + 2 + + + + + True + True + False + 3 + 0 + 0.43000000715255737 + True + + + True + False + Animate <i>Show Applications</i>. + True + + + + + 0 + 3 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + + + + + True + False + True + Show trash can + 0 + + + 0 + 0 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + + + + + True + False + True + Show mounted volumes and devices + 0 + + + 0 + 0 + + + + + + + + + + + + + + False + True + 0 + + + + + 1 + + + + + True + False + Launchers + + + 1 + False + + + + + True + False + 24 + 24 + 24 + 24 + vertical + 24 + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Enable Super+(0-9) as shortcuts to activate apps. It can also be used together with Shift and Ctrl. + True + True + 0 + + + + 0 + 1 + + + + + True + False + True + Use keyboard shortcuts to activate apps + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + center + 0.46000000834465027 + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + True + end + center + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 1 + + + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behaviour when clicking on the icon of a running application. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Click action + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + False + center + + Raise window + Minimize + Launch new instance + Cycle through windows + Minimize or overview + Show window previews + Minimize or show previews + Focus or show previews + + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 2 + + + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behaviour when scrolling on the icon of an application. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Scroll action + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + False + center + + Do nothing + Cycle through windows + Switch workspace + + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 3 + + + + + 2 + + + + + True + False + Behavior + + + 2 + False + + + + + True + False + 24 + 24 + 24 + 24 + vertical + 24 + + + True + False + 0 + in + + + True + True + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Few customizations meant to integrate the dock with the default GNOME theme. Alternatively, specific options can be enabled below. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Use built-in theme + 0 + + + 0 + 0 + + + + + True + True + end + center + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 0 + + + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + True + Save space reducing padding and border radius. + 0 + + + + 0 + 1 + + + + + True + False + True + Shrink the dash + 0 + + + 0 + 0 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Customize windows counter indicators + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + center + 0.46000000834465027 + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + False + + Default + Dots + Squares + Dashes + Segmented + Solid + Ciliora + Metro + + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Set the background color for the dash. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Customize the dash color + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + center + 0.46000000834465027 + + + False + True + 1 + + + + + True + True + end + center + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + True + True + + + True + False + vertical + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Tune the dash background opacity. + 0 + + + + 0 + 1 + + + + + True + False + True + Customize opacity + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + center + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + False + center + + Default + Fixed + Dynamic + + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + False + True + 0 + + + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Opacity + + + False + True + 0 + + + + + True + True + custom_opacity_adjustement + on + False + 0 + 0 + 2 + right + + + + + True + True + 1 + + + + + False + True + 1 + + + + + + + + + 100 + 80 + True + True + + + True + False + 32 + + + True + False + center + 12 + Force straight corner + + 0 + + + True + True + 0 + + + + + True + True + center + 3 + + + False + True + 12 + 1 + + + + + + + + + + + + + + False + True + 1 + + + + + 3 + + + + + True + False + Appearance + + + 3 + False + + + + + False + 24 + 24 + True + True + vertical + 5 + + + + False + True + 10 + 0 + + + + + True + False + <b>Dash to Dock</b> + True + + + False + True + 1 + + + + + True + False + center + + + True + False + end + version: + + + False + True + 0 + + + + + True + False + start + ... + + + False + True + 1 + + + + + False + True + 2 + + + + + True + False + Moves the dash out of the overview transforming it in a dock + center + True + + + False + True + 3 + + + + + True + False + center + 5 + + + True + False + Created by + + + False + True + 0 + + + + + True + True + Michele (<a href="mailto:micxgx@gmail.com">micxgx@gmail.com</a>) + True + + + False + True + 1 + + + + + False + True + 4 + + + + + Webpage + True + True + True + + center + none + https://micheleg.github.io/dash-to-dock/ + + + False + True + 5 + + + + + True + True + end + <span size="small">This program comes with ABSOLUTELY NO WARRANTY. +See the <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, version 2 or later</a> for details.</span> + True + center + True + + + True + True + 6 + + + + + 4 + + + + + True + False + About + + + 4 + False + + + + + 1 + 0.01 + 0.10000000000000001 + + + 1 + 0.01 + 0.10000000000000001 + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + vertical + 12 + + + True + False + 32 + + + True + True + + + 1 + 0 + + + + + True + False + True + Customize minimum and maximum opacity values + fill + 0 + + + 0 + 0 + + + + + False + True + 0 + + + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Minimum opacity + + + False + True + 0 + + + + + True + True + min_opacity_adjustement + on + False + 0 + 0 + 2 + right + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Maximum opacity + + + False + True + 0 + + + + + True + True + max_opacity_adjustement + on + False + 0 + 0 + 2 + right + + + + + True + True + 1 + + + + + False + True + 1 + + + + + + + + + + + + + + False + True + 0 + + + + + 1000 + 50 + 250 + + + 10 + 0.25 + 1 + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + True + Number overlay + 0 + + + 0 + 0 + + + + + True + False + Temporarily show the application numbers over the icons, corresponding to the shortcut. + True + 40 + 0 + + + + 0 + 1 + + + + + + + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + True + Show the dock if it is hidden + 0 + + + 0 + 0 + + + + + True + False + If using autohide, the dock will appear for a short time when triggering the shortcut. + True + 40 + 0 + + + + 0 + 1 + + + + + + + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + center + 12 + + + 1 + 0 + + + + + True + False + True + Shortcut for the options above + 0 + + + 0 + 0 + + + + + True + False + Syntax: <Shift>, <Ctrl>, <Alt>, <Super> + True + 40 + 0 + + + + 0 + 1 + + + + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + True + 6 + 32 + + + True + True + end + shortcut_time_adjustment + 3 + + + 1 + 0 + + + + + True + False + True + Hide timeout (s) + 0 + + + 0 + 0 + + + + + + + + + + + + + + False + True + 0 + + + + + 1 + 0.050000000000000003 + 0.25 + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Show the dock by mouse hover on the screen edge. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Autohide + 0 + + + 0 + 0 + + + + + True + True + end + center + + + 1 + 0 + 2 + + + + + Push to show: require pressure to show the dock + True + True + False + 0 + True + + + 0 + 3 + 2 + + + + + Enable in fullscreen mode + True + True + False + 12 + 0 + True + + + 0 + 2 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Show the dock when it doesn't obstruct application windows. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Dodge windows + 0 + + + 0 + 0 + + + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + vertical + + + All windows + True + True + False + 12 + 0 + True + True + + + + False + True + 0 + + + + + Only focused application's windows + True + True + False + 0 + True + True + all_windows_radio_button + + + + False + True + 1 + + + + + Only maximized windows + True + True + False + 0 + True + True + all_windows_radio_button + + + + False + True + 2 + + + + + 0 + 2 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + True + 6 + 32 + + + True + True + end + animation_time_adjustment + 3 + + + 1 + 0 + + + + + True + False + True + Animation duration (s) + 0 + + + 0 + 0 + + + + + True + True + end + hide_timeout_adjustment + 3 + + + 1 + 1 + + + + + True + True + end + show_timeout_adjustment + 3 + + + 1 + 2 + + + + + True + True + 0.000 + pressure_threshold_adjustment + + + 1 + 3 + + + + + True + False + True + Hide timeout (s) + 0 + + + 0 + 1 + + + + + True + False + True + Show timeout (s) + 0 + + + 0 + 2 + + + + + True + False + True + Pressure threshold + 0 + + + 0 + 3 + + + + + + + + + + + + + + False + True + 0 + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIconIndicators.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIconIndicators.js new file mode 100644 index 00000000..ff9d9813 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIconIndicators.js @@ -0,0 +1,1130 @@ +const Cogl = imports.gi.Cogl; +const Cairo = imports.cairo; +const Clutter = imports.gi.Clutter; +const GdkPixbuf = imports.gi.GdkPixbuf +const Gio = imports.gi.Gio; +const Gtk = imports.gi.Gtk; +const Pango = imports.gi.Pango; +const Shell = imports.gi.Shell; +const St = imports.gi.St; + +const Util = imports.misc.util; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; +const Utils = Me.imports.utils; + +let tracker = Shell.WindowTracker.get_default(); + +const RunningIndicatorStyle = { + DEFAULT: 0, + DOTS: 1, + SQUARES: 2, + DASHES: 3, + SEGMENTED: 4, + SOLID: 5, + CILIORA: 6, + METRO: 7 +}; + +const MAX_WINDOWS_CLASSES = 4; + + +/* + * This is the main indicator class to be used. The desired bahviour is + * obtained by composing the desired classes below based on the settings. + * + */ +var AppIconIndicator = class DashToDock_AppIconIndicator { + + constructor(source) { + this._indicators = []; + + // Unity indicators always enabled for now + let unityIndicator = new UnityIndicator(source); + this._indicators.push(unityIndicator); + + // Choose the style for the running indicators + let runningIndicator = null; + let runningIndicatorStyle; + + let settings = Docking.DockManager.settings; + if (settings.get_boolean('apply-custom-theme' )) { + runningIndicatorStyle = RunningIndicatorStyle.DOTS; + } else { + runningIndicatorStyle = settings.get_enum('running-indicator-style'); + } + + switch (runningIndicatorStyle) { + case RunningIndicatorStyle.DEFAULT: + runningIndicator = new RunningIndicatorDefault(source); + break; + + case RunningIndicatorStyle.DOTS: + runningIndicator = new RunningIndicatorDots(source); + break; + + case RunningIndicatorStyle.SQUARES: + runningIndicator = new RunningIndicatorSquares(source); + break; + + case RunningIndicatorStyle.DASHES: + runningIndicator = new RunningIndicatorDashes(source); + break; + + case RunningIndicatorStyle.SEGMENTED: + runningIndicator = new RunningIndicatorSegmented(source); + break; + + case RunningIndicatorStyle.SOLID: + runningIndicator = new RunningIndicatorSolid(source); + break; + + case RunningIndicatorStyle.CILIORA: + runningIndicator = new RunningIndicatorCiliora(source); + break; + + case RunningIndicatorStyle.METRO: + runningIndicator = new RunningIndicatorMetro(source); + break; + + default: + runningIndicator = new RunningIndicatorBase(source); + } + + this._indicators.push(runningIndicator); + } + + update() { + for (let i=0; i { + this._signalsHandler.destroy(); + }); + } + + update() { + } + + destroy() { + this._source.actor.disconnect(this._sourceDestroyId); + this._signalsHandler.destroy(); + } +}; + +/* + * A base indicator class for running style, from which all other EunningIndicators should derive, + * providing some basic methods, variables definitions and their update, css style classes handling. + * + */ +var RunningIndicatorBase = class DashToDock_RunningIndicatorBase extends IndicatorBase { + + constructor(source) { + super(source) + + this._side = Utils.getPosition(); + this._nWindows = 0; + + this._dominantColorExtractor = new DominantColorExtractor(this._source.app); + + // These statuses take into account the workspace/monitor isolation + this._isFocused = false; + this._isRunning = false; + } + + update() { + // Limit to 1 to MAX_WINDOWS_CLASSES windows classes + this._nWindows = Math.min(this._source.getInterestingWindows().length, MAX_WINDOWS_CLASSES); + + // We need to check the number of windows, as the focus might be + // happening on another monitor if using isolation + if (tracker.focus_app == this._source.app && this._nWindows > 0) + this._isFocused = true; + else + this._isFocused = false; + + // In the case of workspace isolation, we need to hide the dots of apps with + // no windows in the current workspace + if ((this._source.app.state != Shell.AppState.STOPPED || this._source.isLocation()) && this._nWindows > 0) + this._isRunning = true; + else + this._isRunning = false; + + this._updateCounterClass(); + this._updateFocusClass(); + this._updateDefaultDot(); + } + + _updateCounterClass() { + for (let i = 1; i <= MAX_WINDOWS_CLASSES; i++) { + let className = 'running' + i; + if (i != this._nWindows) + this._source.actor.remove_style_class_name(className); + else + this._source.actor.add_style_class_name(className); + } + } + + _updateFocusClass() { + if (this._isFocused) + this._source.actor.add_style_class_name('focused'); + else + this._source.actor.remove_style_class_name('focused'); + } + + _updateDefaultDot() { + if (this._isRunning) + this._source._dot.show(); + else + this._source._dot.hide(); + } + + _hideDefaultDot() { + // I use opacity to hide the default dot because the show/hide function + // are used by the parent class. + this._source._dot.opacity = 0; + } + + _restoreDefaultDot() { + this._source._dot.opacity = 255; + } + + _enableBacklight() { + + let colorPalette = this._dominantColorExtractor._getColorPalette(); + + // Fallback + if (colorPalette === null) { + this._source._iconContainer.set_style( + 'border-radius: 5px;' + + 'background-gradient-direction: vertical;' + + 'background-gradient-start: #e0e0e0;' + + 'background-gradient-end: darkgray;' + ); + + return; + } + + this._source._iconContainer.set_style( + 'border-radius: 5px;' + + 'background-gradient-direction: vertical;' + + 'background-gradient-start: ' + colorPalette.original + ';' + + 'background-gradient-end: ' + colorPalette.darker + ';' + ); + + } + + _disableBacklight() { + this._source._iconContainer.set_style(null); + } + + destroy() { + this._disableBacklight(); + // Remove glossy background if the children still exists + if (this._source._iconContainer.get_children().length > 1) + this._source._iconContainer.get_children()[1].set_style(null); + this._restoreDefaultDot(); + + super.destroy(); + } +}; + +// We add a css class so third parties themes can limit their indicaor customization +// to the case we do nothing +var RunningIndicatorDefault = class DashToDock_RunningIndicatorDefault extends RunningIndicatorBase { + + constructor(source) { + super(source); + this._source.actor.add_style_class_name('default'); + } + + destory() { + this._source.actor.remove_style_class_name('default'); + super.destroy(); + } +}; + +var RunningIndicatorDots = class DashToDock_RunningIndicatorDots extends RunningIndicatorBase { + + constructor(source) { + super(source) + + this._hideDefaultDot(); + + this._area = new St.DrawingArea({x_expand: true, y_expand: true}); + + // We draw for the bottom case and rotate the canvas for other placements + //set center of rotatoins to the center + this._area.set_pivot_point(0.5, 0.5); + // prepare transformation matrix + let m = new Cogl.Matrix(); + m.init_identity(); + + switch (this._side) { + case St.Side.TOP: + m.xx = -1; + m.rotate(180, 0, 0, 1); + break + + case St.Side.BOTTOM: + // nothing + break; + + case St.Side.LEFT: + m.yy = -1; + m.rotate(90, 0, 0, 1); + break; + + case St.Side.RIGHT: + m.rotate(-90, 0, 0, 1); + break + } + + this._area.set_transform(m); + + this._area.connect('repaint', this._updateIndicator.bind(this)); + this._source._iconContainer.add_child(this._area); + + let keys = ['custom-theme-running-dots-color', + 'custom-theme-running-dots-border-color', + 'custom-theme-running-dots-border-width', + 'custom-theme-customize-running-dots', + 'unity-backlit-items', + 'running-indicator-dominant-color']; + + keys.forEach(function(key) { + this._signalsHandler.add([ + Docking.DockManager.settings, + 'changed::' + key, + this.update.bind(this) + ]); + }, this); + + // Apply glossy background + // TODO: move to enable/disableBacklit to apply itonly to the running apps? + // TODO: move to css class for theming support + this._glossyBackgroundStyle = 'background-image: url(\'' + Me.path + '/media/glossy.svg\');' + + 'background-size: contain;'; + } + + update() { + super.update(); + + // Enable / Disable the backlight of running apps + if (!Docking.DockManager.settings.get_boolean('apply-custom-theme') && + Docking.DockManager.settings.get_boolean('unity-backlit-items')) { + this._source._iconContainer.get_children()[1].set_style(this._glossyBackgroundStyle); + if (this._isRunning) + this._enableBacklight(); + else + this._disableBacklight(); + } else { + this._disableBacklight(); + this._source._iconContainer.get_children()[1].set_style(null); + } + + if (this._area) + this._area.queue_repaint(); + } + + _computeStyle() { + + let [width, height] = this._area.get_surface_size(); + this._width = height; + this._height = width; + + // By defaut re-use the style - background color, and border width and color - + // of the default dot + let themeNode = this._source._dot.get_theme_node(); + this._borderColor = themeNode.get_border_color(this._side); + this._borderWidth = themeNode.get_border_width(this._side); + this._bodyColor = themeNode.get_background_color(); + + let settings = Docking.DockManager.settings; + if (!settings.get_boolean('apply-custom-theme')) { + // Adjust for the backlit case + if (settings.get_boolean('unity-backlit-items')) { + // Use dominant color for dots too if the backlit is enables + let colorPalette = this._dominantColorExtractor._getColorPalette(); + + // Slightly adjust the styling + this._borderWidth = 2; + + if (colorPalette !== null) { + this._borderColor = Clutter.color_from_string(colorPalette.lighter)[1] ; + this._bodyColor = Clutter.color_from_string(colorPalette.darker)[1]; + } else { + // Fallback + this._borderColor = Clutter.color_from_string('white')[1]; + this._bodyColor = Clutter.color_from_string('gray')[1]; + } + } + + // Apply dominant color if requested + if (settings.get_boolean('running-indicator-dominant-color')) { + let colorPalette = this._dominantColorExtractor._getColorPalette(); + if (colorPalette !== null) { + this._bodyColor = Clutter.color_from_string(colorPalette.original)[1]; + } + } + + // Finally, use customize style if requested + if (settings.get_boolean('custom-theme-customize-running-dots')) { + this._borderColor = Clutter.color_from_string(settings.get_string('custom-theme-running-dots-border-color'))[1]; + this._borderWidth = settings.get_int('custom-theme-running-dots-border-width'); + this._bodyColor = Clutter.color_from_string(settings.get_string('custom-theme-running-dots-color'))[1]; + } + } + + // Define the radius as an arbitrary size, but keep large enough to account + // for the drawing of the border. + this._radius = Math.max(this._width/22, this._borderWidth/2); + this._padding = 0; // distance from the margin + this._spacing = this._radius + this._borderWidth; // separation between the dots + } + + _updateIndicator() { + + let area = this._area; + let cr = this._area.get_context(); + + this._computeStyle(); + this._drawIndicator(cr); + cr.$dispose(); + } + + _drawIndicator(cr) { + // Draw the required numbers of dots + let n = this._nWindows; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + // draw for the bottom case: + cr.translate((this._width - (2*n)*this._radius - (n-1)*this._spacing)/2, this._height - this._padding); + for (let i = 0; i < n; i++) { + cr.newSubPath(); + cr.arc((2*i+1)*this._radius + i*this._spacing, -this._radius - this._borderWidth/2, this._radius, 0, 2*Math.PI); + } + + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill(); + } + + destroy() { + this._area.destroy(); + super.destroy(); + } +}; + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorCiliora = class DashToDock_RunningIndicatorCiliora extends RunningIndicatorDots { + + _drawIndicator(cr) { + if (this._isRunning) { + + let size = Math.max(this._width/20, this._borderWidth); + let spacing = size; // separation between the dots + let lineLength = this._width - (size*(this._nWindows-1)) - (spacing*(this._nWindows-1)); + let padding = this._borderWidth; + // For the backlit case here we don't want the outer border visible + if (Docking.DockManager.settings.get_boolean('unity-backlit-items') && + !Docking.DockManager.settings.get_boolean('custom-theme-customize-running-dots')) + padding = 0; + let yOffset = this._height - padding - size; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + cr.translate(0, yOffset); + cr.newSubPath(); + cr.rectangle(0, 0, lineLength, size); + for (let i = 1; i < this._nWindows; i++) { + cr.newSubPath(); + cr.rectangle(lineLength + (i*spacing) + ((i-1)*size), 0, size, size); + } + + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill(); + } + } +}; + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorSegmented = class DashToDock_RunningIndicatorSegmented extends RunningIndicatorDots { + + _drawIndicator(cr) { + if (this._isRunning) { + let size = Math.max(this._width/20, this._borderWidth); + let spacing = Math.ceil(this._width/18); // separation between the dots + let dashLength = Math.ceil((this._width - ((this._nWindows-1)*spacing))/this._nWindows); + let lineLength = this._width - (size*(this._nWindows-1)) - (spacing*(this._nWindows-1)); + let padding = this._borderWidth; + // For the backlit case here we don't want the outer border visible + if (Docking.DockManager.settings.get_boolean('unity-backlit-items') && + !Docking.DockManager.settings.get_boolean('custom-theme-customize-running-dots')) + padding = 0; + let yOffset = this._height - padding - size; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + cr.translate(0, yOffset); + for (let i = 0; i < this._nWindows; i++) { + cr.newSubPath(); + cr.rectangle(i*dashLength + i*spacing, 0, dashLength, size); + } + + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill() + } + } +}; + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorSolid = class DashToDock_RunningIndicatorSolid extends RunningIndicatorDots { + + _drawIndicator(cr) { + if (this._isRunning) { + + let size = Math.max(this._width/20, this._borderWidth); + let padding = this._borderWidth; + // For the backlit case here we don't want the outer border visible + if (Docking.DockManager.settings.get_boolean('unity-backlit-items') && + !Docking.DockManager.settings.get_boolean('custom-theme-customize-running-dots')) + padding = 0; + let yOffset = this._height - padding - size; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + cr.translate(0, yOffset); + cr.newSubPath(); + cr.rectangle(0, 0, this._width, size); + + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill(); + + } + } +}; + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorSquares = class DashToDock_RunningIndicatorSquares extends RunningIndicatorDots { + + _drawIndicator(cr) { + if (this._isRunning) { + let size = Math.max(this._width/11, this._borderWidth); + let padding = this._borderWidth; + let spacing = Math.ceil(this._width/18); // separation between the dots + let yOffset = this._height - padding - size; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + cr.translate(Math.floor((this._width - this._nWindows*size - (this._nWindows-1)*spacing)/2), yOffset); + for (let i = 0; i < this._nWindows; i++) { + cr.newSubPath(); + cr.rectangle(i*size + i*spacing, 0, size, size); + } + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill(); + } + } +} + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorDashes = class DashToDock_RunningIndicatorDashes extends RunningIndicatorDots { + + _drawIndicator(cr) { + if (this._isRunning) { + let size = Math.max(this._width/20, this._borderWidth); + let padding = this._borderWidth; + let spacing = Math.ceil(this._width/18); // separation between the dots + let dashLength = Math.floor(this._width/4) - spacing; + let yOffset = this._height - padding - size; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + cr.translate(Math.floor((this._width - this._nWindows*dashLength - (this._nWindows-1)*spacing)/2), yOffset); + for (let i = 0; i < this._nWindows; i++) { + cr.newSubPath(); + cr.rectangle(i*dashLength + i*spacing, 0, dashLength, size); + } + + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill(); + } + } +} + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorMetro = class DashToDock_RunningIndicatorMetro extends RunningIndicatorDots { + + constructor(source) { + super(source); + this._source.actor.add_style_class_name('metro'); + } + + destroy() { + this._source.actor.remove_style_class_name('metro'); + super.destroy(); + } + + _drawIndicator(cr) { + if (this._isRunning) { + let size = Math.max(this._width/20, this._borderWidth); + let padding = 0; + // For the backlit case here we don't want the outer border visible + if (Docking.DockManager.settings.get_boolean('unity-backlit-items') && + !Docking.DockManager.settings.get_boolean('custom-theme-customize-running-dots')) + padding = 0; + let yOffset = this._height - padding - size; + + let n = this._nWindows; + if(n <= 1) { + cr.translate(0, yOffset); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.newSubPath(); + cr.rectangle(0, 0, this._width, size); + cr.fill(); + } else { + let blackenedLength = (1/48)*this._width; // need to scale with the SVG for the stacked highlight + let darkenedLength = this._isFocused ? (2/48)*this._width : (10/48)*this._width; + let blackenedColor = this._bodyColor.shade(.3); + let darkenedColor = this._bodyColor.shade(.7); + + cr.translate(0, yOffset); + + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.newSubPath(); + cr.rectangle(0, 0, this._width - darkenedLength - blackenedLength, size); + cr.fill(); + Clutter.cairo_set_source_color(cr, blackenedColor); + cr.newSubPath(); + cr.rectangle(this._width - darkenedLength - blackenedLength, 0, 1, size); + cr.fill(); + Clutter.cairo_set_source_color(cr, darkenedColor); + cr.newSubPath(); + cr.rectangle(this._width - darkenedLength, 0, darkenedLength, size); + cr.fill(); + } + } + } +} + +/* + * Unity like notification and progress indicators + */ +var UnityIndicator = class DashToDock_UnityIndicator extends IndicatorBase { + + constructor(source) { + + super(source); + + this._notificationBadgeLabel = new St.Label(); + this._notificationBadgeBin = new St.Bin({ + child: this._notificationBadgeLabel, + x_align: St.Align.END, y_align: St.Align.START, + x_expand: true, y_expand: true + }); + this._notificationBadgeLabel.add_style_class_name('notification-badge'); + this._notificationBadgeCount = 0; + this._notificationBadgeBin.hide(); + + this._source._iconContainer.add_child(this._notificationBadgeBin); + this._source._iconContainer.connect('allocation-changed', this.updateNotificationBadge.bind(this)); + + this._remoteEntries = []; + this._source.remoteModel.lookupById(this._source.app.id).forEach( + (entry) => { + this.insertEntryRemote(entry); + } + ); + + this._signalsHandler.add([ + this._source.remoteModel, + 'entry-added', + this._onLauncherEntryRemoteAdded.bind(this) + ], [ + this._source.remoteModel, + 'entry-removed', + this._onLauncherEntryRemoteRemoved.bind(this) + ]) + } + + _onLauncherEntryRemoteAdded(remoteModel, entry) { + if (!entry || !entry.appId()) + return; + if (this._source && this._source.app && this._source.app.id == entry.appId()) { + this.insertEntryRemote(entry); + } + } + + _onLauncherEntryRemoteRemoved(remoteModel, entry) { + if (!entry || !entry.appId()) + return; + + if (this._source && this._source.app && this._source.app.id == entry.appId()) { + this.removeEntryRemote(entry); + } + } + + updateNotificationBadge() { + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + let [minWidth, natWidth] = this._source._iconContainer.get_preferred_width(-1); + let logicalNatWidth = natWidth / scaleFactor; + let font_size = Math.max(10, Math.round(logicalNatWidth / 5)); + let margin_left = Math.round(logicalNatWidth / 4); + + this._notificationBadgeLabel.set_style( + 'font-size: ' + font_size + 'px;' + + 'margin-left: ' + margin_left + 'px;' + ); + + this._notificationBadgeBin.width = Math.round(logicalNatWidth - margin_left); + this._notificationBadgeLabel.clutter_text.ellipsize = Pango.EllipsizeMode.MIDDLE; + } + + _notificationBadgeCountToText(count) { + if (count <= 9999) { + return count.toString(); + } else if (count < 1e5) { + let thousands = count / 1e3; + return thousands.toFixed(1).toString() + "k"; + } else if (count < 1e6) { + let thousands = count / 1e3; + return thousands.toFixed(0).toString() + "k"; + } else if (count < 1e8) { + let millions = count / 1e6; + return millions.toFixed(1).toString() + "M"; + } else if (count < 1e9) { + let millions = count / 1e6; + return millions.toFixed(0).toString() + "M"; + } else { + let billions = count / 1e9; + return billions.toFixed(1).toString() + "B"; + } + } + + setNotificationBadge(count) { + this._notificationBadgeCount = count; + let text = this._notificationBadgeCountToText(count); + this._notificationBadgeLabel.set_text(text); + } + + toggleNotificationBadge(activate) { + if (activate && this._notificationBadgeCount > 0) { + this.updateNotificationBadge(); + this._notificationBadgeBin.show(); + } + else + this._notificationBadgeBin.hide(); + } + + _showProgressOverlay() { + if (this._progressOverlayArea) { + this._updateProgressOverlay(); + return; + } + + this._progressOverlayArea = new St.DrawingArea({x_expand: true, y_expand: true}); + this._progressOverlayArea.add_style_class_name('progress-bar'); + this._progressOverlayArea.connect('repaint', () => { + this._drawProgressOverlay(this._progressOverlayArea); + }); + + this._source._iconContainer.add_child(this._progressOverlayArea); + let node = this._progressOverlayArea.get_theme_node(); + + let [hasColor, color] = node.lookup_color('-progress-bar-background', false); + if (hasColor) + this._progressbar_background = color + else + this._progressbar_background = new Clutter.Color({red: 204, green: 204, blue: 204, alpha: 255}); + + [hasColor, color] = node.lookup_color('-progress-bar-border', false); + if (hasColor) + this._progressbar_border = color; + else + this._progressbar_border = new Clutter.Color({red: 230, green: 230, blue: 230, alpha: 255}); + + this._updateProgressOverlay(); + } + + _hideProgressOverlay() { + if (this._progressOverlayArea) + this._progressOverlayArea.destroy(); + this._progressOverlayArea = null; + this._progressbar_background = null; + this._progressbar_border = null; + } + + _updateProgressOverlay() { + if (this._progressOverlayArea) + this._progressOverlayArea.queue_repaint(); + } + + _drawProgressOverlay(area) { + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + let [surfaceWidth, surfaceHeight] = area.get_surface_size(); + let cr = area.get_context(); + + let iconSize = this._source.icon.iconSize * scaleFactor; + + let x = Math.floor((surfaceWidth - iconSize) / 2); + let y = Math.floor((surfaceHeight - iconSize) / 2); + + let lineWidth = Math.floor(1.0 * scaleFactor); + let padding = Math.floor(iconSize * 0.05); + let width = iconSize - 2.0*padding; + let height = Math.floor(Math.min(18.0*scaleFactor, 0.20*iconSize)); + x += padding; + y += iconSize - height - padding; + + cr.setLineWidth(lineWidth); + + // Draw the outer stroke + let stroke = new Cairo.LinearGradient(0, y, 0, y + height); + let fill = null; + stroke.addColorStopRGBA(0.5, 0.5, 0.5, 0.5, 0.1); + stroke.addColorStopRGBA(0.9, 0.8, 0.8, 0.8, 0.4); + Utils.drawRoundedLine(cr, x + lineWidth/2.0, y + lineWidth/2.0, width, height, true, true, stroke, fill); + + // Draw the background + x += lineWidth; + y += lineWidth; + width -= 2.0*lineWidth; + height -= 2.0*lineWidth; + + stroke = Cairo.SolidPattern.createRGBA(0.20, 0.20, 0.20, 0.9); + fill = new Cairo.LinearGradient(0, y, 0, y + height); + fill.addColorStopRGBA(0.4, 0.25, 0.25, 0.25, 1.0); + fill.addColorStopRGBA(0.9, 0.35, 0.35, 0.35, 1.0); + Utils.drawRoundedLine(cr, x + lineWidth/2.0, y + lineWidth/2.0, width, height, true, true, stroke, fill); + + // Draw the finished bar + x += lineWidth; + y += lineWidth; + width -= 2.0*lineWidth; + height -= 2.0*lineWidth; + + let finishedWidth = Math.ceil(this._progress * width); + + let bg = this._progressbar_background; + let bd = this._progressbar_border; + + stroke = Cairo.SolidPattern.createRGBA(bd.red/255, bd.green/255, bd.blue/255, bd.alpha/255); + fill = Cairo.SolidPattern.createRGBA(bg.red/255, bg.green/255, bg.blue/255, bg.alpha/255); + + if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) + Utils.drawRoundedLine(cr, x + lineWidth/2.0 + width - finishedWidth, y + lineWidth/2.0, finishedWidth, height, true, true, stroke, fill); + else + Utils.drawRoundedLine(cr, x + lineWidth/2.0, y + lineWidth/2.0, finishedWidth, height, true, true, stroke, fill); + + cr.$dispose(); + } + + setProgress(progress) { + this._progress = Math.min(Math.max(progress, 0.0), 1.0); + this._updateProgressOverlay(); + } + + toggleProgressOverlay(activate) { + if (activate) { + this._showProgressOverlay(); + } + else { + this._hideProgressOverlay(); + } + } + + insertEntryRemote(remote) { + if (!remote || this._remoteEntries.indexOf(remote) !== -1) + return; + + this._remoteEntries.push(remote); + this._selectEntryRemote(remote); + } + + removeEntryRemote(remote) { + if (!remote || this._remoteEntries.indexOf(remote) == -1) + return; + + this._remoteEntries.splice(this._remoteEntries.indexOf(remote), 1); + + if (this._remoteEntries.length > 0) { + this._selectEntryRemote(this._remoteEntries[this._remoteEntries.length-1]); + } else { + this.setNotificationBadge(0); + this.toggleNotificationBadge(false); + this.setProgress(0); + this.toggleProgressOverlay(false); + } + } + + _selectEntryRemote(remote) { + if (!remote) + return; + + this._signalsHandler.removeWithLabel('entry-remotes'); + + this._signalsHandler.addWithLabel('entry-remotes', + [ + remote, + 'count-changed', + (remote, value) => { + this.setNotificationBadge(value); + } + ], [ + remote, + 'count-visible-changed', + (remote, value) => { + this.toggleNotificationBadge(value); + } + ], [ + remote, + 'progress-changed', + (remote, value) => { + this.setProgress(value); + } + ], [ + remote, + 'progress-visible-changed', + (remote, value) => { + this.toggleProgressOverlay(value); + } + ]); + + this.setNotificationBadge(remote.count()); + this.toggleNotificationBadge(remote.countVisible()); + this.setProgress(remote.progress()); + this.toggleProgressOverlay(remote.progressVisible()); + } +} + + +// We need an icons theme object, this is the only way I managed to get +// pixel buffers that can be used for calculating the backlight color +let themeLoader = null; + +// Global icon cache. Used for Unity7 styling. +let iconCacheMap = new Map(); +// Max number of items to store +// We don't expect to ever reach this number, but let's put an hard limit to avoid +// even the remote possibility of the cached items to grow indefinitely. +const MAX_CACHED_ITEMS = 1000; +// When the size exceed it, the oldest 'n' ones are deleted +const BATCH_SIZE_TO_DELETE = 50; +// The icon size used to extract the dominant color +const DOMINANT_COLOR_ICON_SIZE = 64; + +// Compute dominant color frim the app icon. +// The color is cached for efficiency. +var DominantColorExtractor = class DashToDock_DominantColorExtractor { + + constructor(app) { + this._app = app; + } + + /** + * Try to get the pixel buffer for the current icon, if not fail gracefully + */ + _getIconPixBuf() { + let iconTexture = this._app.create_icon_texture(16); + + if (themeLoader === null) { + let ifaceSettings = new Gio.Settings({ schema: "org.gnome.desktop.interface" }); + + themeLoader = new Gtk.IconTheme(), + themeLoader.set_custom_theme(ifaceSettings.get_string('icon-theme')); // Make sure the correct theme is loaded + } + + // Unable to load the icon texture, use fallback + if (iconTexture instanceof St.Icon === false) { + return null; + } + + iconTexture = iconTexture.get_gicon(); + + // Unable to load the icon texture, use fallback + if (iconTexture === null) { + return null; + } + + if (iconTexture instanceof Gio.FileIcon) { + // Use GdkPixBuf to load the pixel buffer from the provided file path + return GdkPixbuf.Pixbuf.new_from_file(iconTexture.get_file().get_path()); + } + + // Get the pixel buffer from the icon theme + let icon_info = themeLoader.lookup_icon(iconTexture.get_names()[0], DOMINANT_COLOR_ICON_SIZE, 0); + if (icon_info !== null) + return icon_info.load_icon(); + else + return null; + } + + /** + * The backlight color choosing algorithm was mostly ported to javascript from the + * Unity7 C++ source of Canonicals: + * https://bazaar.launchpad.net/~unity-team/unity/trunk/view/head:/launcher/LauncherIcon.cpp + * so it more or less works the same way. + */ + _getColorPalette() { + if (iconCacheMap.get(this._app.get_id())) { + // We already know the answer + return iconCacheMap.get(this._app.get_id()); + } + + let pixBuf = this._getIconPixBuf(); + if (pixBuf == null) + return null; + + let pixels = pixBuf.get_pixels(), + offset = 0; + + let total = 0, + rTotal = 0, + gTotal = 0, + bTotal = 0; + + let resample_y = 1, + resample_x = 1; + + // Resampling of large icons + // We resample icons larger than twice the desired size, as the resampling + // to a size s + // DOMINANT_COLOR_ICON_SIZE < s < 2*DOMINANT_COLOR_ICON_SIZE, + // most of the case exactly DOMINANT_COLOR_ICON_SIZE as the icon size is tipycally + // a multiple of it. + let width = pixBuf.get_width(); + let height = pixBuf.get_height(); + + // Resample + if (height >= 2* DOMINANT_COLOR_ICON_SIZE) + resample_y = Math.floor(height/DOMINANT_COLOR_ICON_SIZE); + + if (width >= 2* DOMINANT_COLOR_ICON_SIZE) + resample_x = Math.floor(width/DOMINANT_COLOR_ICON_SIZE); + + if (resample_x !==1 || resample_y !== 1) + pixels = this._resamplePixels(pixels, resample_x, resample_y); + + // computing the limit outside the for (where it would be repeated at each iteration) + // for performance reasons + let limit = pixels.length; + for (let offset = 0; offset < limit; offset+=4) { + let r = pixels[offset], + g = pixels[offset + 1], + b = pixels[offset + 2], + a = pixels[offset + 3]; + + let saturation = (Math.max(r,g, b) - Math.min(r,g, b)); + let relevance = 0.1 * 255 * 255 + 0.9 * a * saturation; + + rTotal += r * relevance; + gTotal += g * relevance; + bTotal += b * relevance; + + total += relevance; + } + + total = total * 255; + + let r = rTotal / total, + g = gTotal / total, + b = bTotal / total; + + let hsv = Utils.ColorUtils.RGBtoHSV(r * 255, g * 255, b * 255); + + if (hsv.s > 0.15) + hsv.s = 0.65; + hsv.v = 0.90; + + let rgb = Utils.ColorUtils.HSVtoRGB(hsv.h, hsv.s, hsv.v); + + // Cache the result. + let backgroundColor = { + lighter: Utils.ColorUtils.ColorLuminance(rgb.r, rgb.g, rgb.b, 0.2), + original: Utils.ColorUtils.ColorLuminance(rgb.r, rgb.g, rgb.b, 0), + darker: Utils.ColorUtils.ColorLuminance(rgb.r, rgb.g, rgb.b, -0.5) + }; + + if (iconCacheMap.size >= MAX_CACHED_ITEMS) { + //delete oldest cached values (which are in order of insertions) + let ctr=0; + for (let key of iconCacheMap.keys()) { + if (++ctr > BATCH_SIZE_TO_DELETE) + break; + iconCacheMap.delete(key); + } + } + + iconCacheMap.set(this._app.get_id(), backgroundColor); + + return backgroundColor; + } + + /** + * Downsample large icons before scanning for the backlight color to + * improve performance. + * + * @param pixBuf + * @param pixels + * @param resampleX + * @param resampleY + * + * @return []; + */ + _resamplePixels (pixels, resampleX, resampleY) { + let resampledPixels = []; + // computing the limit outside the for (where it would be repeated at each iteration) + // for performance reasons + let limit = pixels.length / (resampleX * resampleY) / 4; + for (let i = 0; i < limit; i++) { + let pixel = i * resampleX * resampleY; + + resampledPixels.push(pixels[pixel * 4]); + resampledPixels.push(pixels[pixel * 4 + 1]); + resampledPixels.push(pixels[pixel * 4 + 2]); + resampledPixels.push(pixels[pixel * 4 + 3]); + } + + return resampledPixels; + } +}; diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js new file mode 100644 index 00000000..071dfd60 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js @@ -0,0 +1,1207 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Clutter = imports.gi.Clutter; +const GdkPixbuf = imports.gi.GdkPixbuf +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Gtk = imports.gi.Gtk; +const Signals = imports.signals; +const Meta = imports.gi.Meta; +const Shell = imports.gi.Shell; +const St = imports.gi.St; +const Mainloop = imports.mainloop; + +// Use __ () and N__() for the extension gettext domain, and reuse +// the shell domain with the default _() and N_() +const Gettext = imports.gettext.domain('dashtodock'); +const __ = Gettext.gettext; +const N__ = function(e) { return e }; + +const AppDisplay = imports.ui.appDisplay; +const AppFavorites = imports.ui.appFavorites; +const Dash = imports.ui.dash; +const DND = imports.ui.dnd; +const IconGrid = imports.ui.iconGrid; +const Main = imports.ui.main; +const PopupMenu = imports.ui.popupMenu; +const Util = imports.misc.util; +const Workspace = imports.ui.workspace; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; +const Utils = Me.imports.utils; +const WindowPreview = Me.imports.windowPreview; +const AppIconIndicators = Me.imports.appIconIndicators; + +let tracker = Shell.WindowTracker.get_default(); + +const clickAction = { + SKIP: 0, + MINIMIZE: 1, + LAUNCH: 2, + CYCLE_WINDOWS: 3, + MINIMIZE_OR_OVERVIEW: 4, + PREVIEWS: 5, + MINIMIZE_OR_PREVIEWS: 6, + FOCUS_OR_PREVIEWS: 7, + QUIT: 8, +}; + +const scrollAction = { + DO_NOTHING: 0, + CYCLE_WINDOWS: 1, + SWITCH_WORKSPACE: 2 +}; + +let recentlyClickedAppLoopId = 0; +let recentlyClickedApp = null; +let recentlyClickedAppWindows = null; +let recentlyClickedAppIndex = 0; +let recentlyClickedAppMonitor = -1; + +/** + * Extend AppIcon + * + * - Apply a css class based on the number of windows of each application (#N); + * - Customized indicators for running applications in place of the default "dot" style which is hidden (#N); + * a class of the form "running#N" is applied to the AppWellIcon actor. + * like the original .running one. + * - Add a .focused style to the focused app + * - Customize click actions. + * - Update minimization animation target + * - Update menu if open on windows change + */ +var MyAppIcon = class DashToDock_AppIcon extends AppDisplay.AppIcon { + + // settings are required inside. + constructor(remoteModel, app, monitorIndex, iconParams) { + super(app, iconParams); + + // a prefix is required to avoid conflicting with the parent class variable + this.monitorIndex = monitorIndex; + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this.remoteModel = remoteModel; + this._indicator = null; + + let appInfo = app.get_app_info(); + this._location = appInfo ? appInfo.get_string('XdtdUri') : null; + + this._updateIndicatorStyle(); + this._optionalScrollCycleWindows(); + + // Monitor windows-changes instead of app state. + // Keep using the same Id and function callback (that is extended) + if (this._stateChangedId > 0) { + this.app.disconnect(this._stateChangedId); + this._stateChangedId = 0; + } + + this._windowsChangedId = this.app.connect('windows-changed', + this.onWindowsChanged.bind(this)); + this._focusAppChangeId = tracker.connect('notify::focus-app', + this._onFocusAppChanged.bind(this)); + + // In Wayland sessions, this signal is needed to track the state of windows dragged + // from one monitor to another. As this is triggered quite often (whenever a new winow + // of any application opened or moved to a different desktop), + // we restrict this signal to the case when 'isolate-monitors' is true, + // and if there are at least 2 monitors. + if (Docking.DockManager.settings.get_boolean('isolate-monitors') && + Main.layoutManager.monitors.length > 1) { + this._signalsHandler.removeWithLabel('isolate-monitors'); + this._signalsHandler.addWithLabel('isolate-monitors', [ + global.display, + 'window-entered-monitor', + this._onWindowEntered.bind(this) + ]); + } + + this._progressOverlayArea = null; + this._progress = 0; + + let keys = ['apply-custom-theme', + 'running-indicator-style', + ]; + + keys.forEach(function(key) { + this._signalsHandler.add([ + Docking.DockManager.settings, + 'changed::' + key, + this._updateIndicatorStyle.bind(this) + ]); + }, this); + + if (this._location) { + this._signalsHandler.add([ + Docking.DockManager.getDefault().fm1Client, + 'windows-changed', + this.onWindowsChanged.bind(this) + ]); + } + + this._signalsHandler.add([ + Docking.DockManager.settings, + 'changed::scroll-action', + this._optionalScrollCycleWindows.bind(this) + ]); + + this._numberOverlay(); + + this._previewMenuManager = null; + this._previewMenu = null; + } + + _onDestroy() { + super._onDestroy(); + + // This is necessary due to an upstream bug + // https://bugzilla.gnome.org/show_bug.cgi?id=757556 + // It can be safely removed once it get solved upstrea. + if (this._menu) + this._menu.close(false); + + // Disconect global signals + + if (this._windowsChangedId > 0) + this.app.disconnect(this._windowsChangedId); + this._windowsChangedId = 0; + + if (this._focusAppChangeId > 0) { + tracker.disconnect(this._focusAppChangeId); + this._focusAppChangeId = 0; + } + + this._signalsHandler.destroy(); + + if (this._scrollEventHandler) + this.actor.disconnect(this._scrollEventHandler); + } + + // TOOD Rename this function + _updateIndicatorStyle() { + + if (this._indicator !== null) { + this._indicator.destroy(); + this._indicator = null; + } + this._indicator = new AppIconIndicators.AppIconIndicator(this); + this._indicator.update(); + } + + _onWindowEntered(metaScreen, monitorIndex, metaWin) { + let app = Shell.WindowTracker.get_default().get_window_app(metaWin); + if (app && app.get_id() == this.app.get_id()) + this.onWindowsChanged(); + } + + _optionalScrollCycleWindows() { + if (this._scrollEventHandler) { + this.actor.disconnect(this._scrollEventHandler); + this._scrollEventHandler = 0; + } + + let settings = Docking.DockManager.settings; + let isEnabled = settings.get_enum('scroll-action') === scrollAction.CYCLE_WINDOWS; + if (!isEnabled) return; + this._scrollEventHandler = this.actor.connect('scroll-event', + this.onScrollEvent.bind(this)); + } + + onScrollEvent(actor, event) { + + // We only activate windows of running applications, i.e. we never open new windows + // We check if the app is running, and that the # of windows is > 0 in + // case we use workspace isolation, + let appIsRunning = this.app.state == Shell.AppState.RUNNING + && this.getInterestingWindows().length > 0; + + if (!appIsRunning) + return false + + if (this._optionalScrollCycleWindowsDeadTimeId) + return false; + else + this._optionalScrollCycleWindowsDeadTimeId = Mainloop.timeout_add(250, () => { + this._optionalScrollCycleWindowsDeadTimeId = 0; + }); + + let direction = null; + + switch (event.get_scroll_direction()) { + case Clutter.ScrollDirection.UP: + direction = Meta.MotionDirection.UP; + break; + case Clutter.ScrollDirection.DOWN: + direction = Meta.MotionDirection.DOWN; + break; + case Clutter.ScrollDirection.SMOOTH: + let [dx, dy] = event.get_scroll_delta(); + if (dy < 0) + direction = Meta.MotionDirection.UP; + else if (dy > 0) + direction = Meta.MotionDirection.DOWN; + break; + } + + let focusedApp = tracker.focus_app; + if (!Main.overview._shown) { + let reversed = direction === Meta.MotionDirection.UP; + if (this.app == focusedApp) + this._cycleThroughWindows(reversed); + else { + // Activate the first window + let windows = this.getInterestingWindows(); + if (windows.length > 0) { + let w = windows[0]; + Main.activateWindow(w); + } + } + } + else + this.app.activate(); + return true; + } + + onWindowsChanged() { + + if (this._menu && this._menu.isOpen) + this._menu.update(); + + this._indicator.update(); + this.updateIconGeometry(); + } + + /** + * Update taraget for minimization animation + */ + updateIconGeometry() { + // If (for unknown reason) the actor is not on the stage the reported size + // and position are random values, which might exceeds the integer range + // resulting in an error when assigned to the a rect. This is a more like + // a workaround to prevent flooding the system with errors. + if (this.actor.get_stage() == null) + return; + + let rect = new Meta.Rectangle(); + + [rect.x, rect.y] = this.actor.get_transformed_position(); + [rect.width, rect.height] = this.actor.get_transformed_size(); + + let windows = this.getWindows(); + if (Docking.DockManager.settings.get_boolean('multi-monitor')) { + let monitorIndex = this.monitorIndex; + windows = windows.filter(function(w) { + return w.get_monitor() == monitorIndex; + }); + } + windows.forEach(function(w) { + w.set_icon_geometry(rect); + }); + } + + _updateRunningStyle() { + // The logic originally in this function has been moved to + // AppIconIndicatorBase._updateDefaultDot(). However it cannot be removed as + // it called by the parent constructor. + } + + popupMenu() { + this._removeMenuTimeout(); + this.actor.fake_release(); + this._draggable.fakeRelease(); + + if (!this._menu) { + this._menu = new MyAppIconMenu(this); + this._menu.connect('activate-window', (menu, window) => { + this.activateWindow(window); + }); + this._menu.connect('open-state-changed', (menu, isPoppedUp) => { + if (!isPoppedUp) + this._onMenuPoppedDown(); + else { + // Setting the max-height is s useful if part of the menu is + // scrollable so the minimum height is smaller than the natural height. + let monitor_index = Main.layoutManager.findIndexForActor(this.actor); + let workArea = Main.layoutManager.getWorkAreaForMonitor(monitor_index); + let position = Utils.getPosition(); + this._isHorizontal = ( position == St.Side.TOP || + position == St.Side.BOTTOM); + // If horizontal also remove the height of the dash + let fixedDock = Docking.DockManager.settings.get_boolean('dock-fixed'); + let additional_margin = this._isHorizontal && !fixedDock ? Main.overview._dash.actor.height : 0; + let verticalMargins = this._menu.actor.margin_top + this._menu.actor.margin_bottom; + // Also set a max width to the menu, so long labels (long windows title) get truncated + this._menu.actor.style = ('max-height: ' + Math.round(workArea.height - additional_margin - verticalMargins) + 'px;' + + 'max-width: 400px'); + } + }); + let id = Main.overview.connect('hiding', () => { + this._menu.close(); + }); + this._menu.actor.connect('destroy', function() { + Main.overview.disconnect(id); + }); + + this._menuManager.addMenu(this._menu); + } + + this.emit('menu-state-changed', true); + + this.actor.set_hover(true); + this._menu.popup(); + this._menuManager.ignoreRelease(); + this.emit('sync-tooltip'); + + return false; + } + + _onFocusAppChanged() { + this._indicator.update(); + } + + activate(button) { + let event = Clutter.get_current_event(); + let modifiers = event ? event.get_state() : 0; + let focusedApp = tracker.focus_app; + + // Only consider SHIFT and CONTROL as modifiers (exclude SUPER, CAPS-LOCK, etc.) + modifiers = modifiers & (Clutter.ModifierType.SHIFT_MASK | Clutter.ModifierType.CONTROL_MASK); + + // We don't change the CTRL-click behaviour: in such case we just chain + // up the parent method and return. + if (modifiers & Clutter.ModifierType.CONTROL_MASK) { + // Keep default behaviour: launch new window + // By calling the parent method I make it compatible + // with other extensions tweaking ctrl + click + super.activate(button); + return; + } + + // We check what type of click we have and if the modifier SHIFT is + // being used. We then define what buttonAction should be for this + // event. + let buttonAction = 0; + let settings = Docking.DockManager.settings; + if (button && button == 2 ) { + if (modifiers & Clutter.ModifierType.SHIFT_MASK) + buttonAction = settings.get_enum('shift-middle-click-action'); + else + buttonAction = settings.get_enum('middle-click-action'); + } + else if (button && button == 1) { + if (modifiers & Clutter.ModifierType.SHIFT_MASK) + buttonAction = settings.get_enum('shift-click-action'); + else + buttonAction = settings.get_enum('click-action'); + } + + // We check if the app is running, and that the # of windows is > 0 in + // case we use workspace isolation. + let windows = this.getInterestingWindows(); + let appIsRunning = (this.app.state == Shell.AppState.RUNNING || this.isLocation()) + && windows.length > 0; + + // Some action modes (e.g. MINIMIZE_OR_OVERVIEW) require overview to remain open + // This variable keeps track of this + let shouldHideOverview = true; + + // We customize the action only when the application is already running + if (appIsRunning) { + switch (buttonAction) { + case clickAction.MINIMIZE: + // In overview just activate the app, unless the acion is explicitely + // requested with a keyboard modifier + if (!Main.overview._shown || modifiers){ + // If we have button=2 or a modifier, allow minimization even if + // the app is not focused + if (this.app == focusedApp || button == 2 || modifiers & Clutter.ModifierType.SHIFT_MASK) { + // minimize all windows on double click and always in the case of primary click without + // additional modifiers + let click_count = 0; + if (Clutter.EventType.CLUTTER_BUTTON_PRESS) + click_count = event.get_click_count(); + let all_windows = (button == 1 && ! modifiers) || click_count > 1; + this._minimizeWindow(all_windows); + } + else + this._activateAllWindows(); + } + else { + let w = windows[0]; + Main.activateWindow(w); + } + break; + + case clickAction.MINIMIZE_OR_OVERVIEW: + // When a single window is present, toggle minimization + // If only one windows is present toggle minimization, but only when trigggered with the + // simple click action (no modifiers, no middle click). + if (windows.length == 1 && !modifiers && button == 1) { + let w = windows[0]; + if (this.app == focusedApp) { + // Window is raised, minimize it + this._minimizeWindow(w); + } else { + // Window is minimized, raise it + Main.activateWindow(w); + } + // Launch overview when multiple windows are present + // TODO: only show current app windows when gnome shell API will allow it + } else { + shouldHideOverview = false; + Main.overview.toggle(); + } + break; + + case clickAction.CYCLE_WINDOWS: + if (!Main.overview._shown){ + if (this.app == focusedApp) + this._cycleThroughWindows(); + else { + // Activate the first window + let w = windows[0]; + Main.activateWindow(w); + } + } + else + this.app.activate(); + break; + + case clickAction.FOCUS_OR_PREVIEWS: + if (this.app == focusedApp && + (windows.length > 1 || modifiers || button != 1)) { + this._windowPreviews(); + } else { + // Activate the first window + let w = windows[0]; + Main.activateWindow(w); + } + break; + + case clickAction.LAUNCH: + this.launchNewWindow(); + break; + + case clickAction.PREVIEWS: + if (!Main.overview._shown) { + // If only one windows is present just switch to it, but only when trigggered with the + // simple click action (no modifiers, no middle click). + if (windows.length == 1 && !modifiers && button == 1) { + let w = windows[0]; + Main.activateWindow(w); + } else + this._windowPreviews(); + } + else { + this.app.activate(); + } + break; + + case clickAction.MINIMIZE_OR_PREVIEWS: + // When a single window is present, toggle minimization + // If only one windows is present toggle minimization, but only when trigggered with the + // simple click action (no modifiers, no middle click). + if (!Main.overview._shown){ + if (windows.length == 1 && !modifiers && button == 1) { + let w = windows[0]; + if (this.app == focusedApp) { + // Window is raised, minimize it + this._minimizeWindow(w); + } else { + // Window is minimized, raise it + Main.activateWindow(w); + } + } else { + // Launch previews when multiple windows are present + this._windowPreviews(); + } + } else { + this.app.activate(); + } + break; + + case clickAction.QUIT: + this.closeAllWindows(); + break; + + case clickAction.SKIP: + let w = windows[0]; + Main.activateWindow(w); + break; + } + } + else { + this.launchNewWindow(); + } + + // Hide overview except when action mode requires it + if(shouldHideOverview) { + Main.overview.hide(); + } + } + + shouldShowTooltip() { + return this.actor.hover && (!this._menu || !this._menu.isOpen) && + (!this._previewMenu || !this._previewMenu.isOpen); + } + + _windowPreviews() { + if (!this._previewMenu) { + this._previewMenuManager = new PopupMenu.PopupMenuManager(this.actor); + + this._previewMenu = new WindowPreview.WindowPreviewMenu(this); + + this._previewMenuManager.addMenu(this._previewMenu); + + this._previewMenu.connect('open-state-changed', (menu, isPoppedUp) => { + if (!isPoppedUp) + this._onMenuPoppedDown(); + }); + let id = Main.overview.connect('hiding', () => { + this._previewMenu.close(); + }); + this._previewMenu.actor.connect('destroy', function() { + Main.overview.disconnect(id); + }); + + } + + if (this._previewMenu.isOpen) + this._previewMenu.close(); + else + this._previewMenu.popup(); + + return false; + } + + // Try to do the right thing when attempting to launch a new window of an app. In + // particular, if the application doens't allow to launch a new window, activate + // the existing window instead. + launchNewWindow(p) { + let appInfo = this.app.get_app_info(); + let actions = appInfo.list_actions(); + if (this.app.can_open_new_window()) { + this.animateLaunch(); + // This is used as a workaround for a bug resulting in no new windows being opened + // for certain running applications when calling open_new_window(). + // + // https://bugzilla.gnome.org/show_bug.cgi?id=756844 + // + // Similar to what done when generating the popupMenu entries, if the application provides + // a "New Window" action, use it instead of directly requesting a new window with + // open_new_window(), which fails for certain application, notably Nautilus. + if (actions.indexOf('new-window') == -1) { + this.app.open_new_window(-1); + } + else { + let i = actions.indexOf('new-window'); + if (i !== -1) + this.app.launch_action(actions[i], global.get_current_time(), -1); + } + } + else { + // Try to manually activate the first window. Otherwise, when the app is activated by + // switching to a different workspace, a launch spinning icon is shown and disappers only + // after a timeout. + let windows = this.getWindows(); + if (windows.length > 0) + Main.activateWindow(windows[0]) + else + this.app.activate(); + } + } + + _numberOverlay() { + // Add label for a Hot-Key visual aid + this._numberOverlayLabel = new St.Label(); + this._numberOverlayBin = new St.Bin({ + child: this._numberOverlayLabel, + x_align: St.Align.START, y_align: St.Align.START, + x_expand: true, y_expand: true + }); + this._numberOverlayLabel.add_style_class_name('number-overlay'); + this._numberOverlayOrder = -1; + this._numberOverlayBin.hide(); + + this._iconContainer.add_child(this._numberOverlayBin); + + } + + updateNumberOverlay() { + // We apply an overall scale factor that might come from a HiDPI monitor. + // Clutter dimensions are in physical pixels, but CSS measures are in logical + // pixels, so make sure to consider the scale. + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + // Set the font size to something smaller than the whole icon so it is + // still visible. The border radius is large to make the shape circular + let [minWidth, natWidth] = this._iconContainer.get_preferred_width(-1); + let font_size = Math.round(Math.max(12, 0.3*natWidth) / scaleFactor); + let size = Math.round(font_size*1.2); + this._numberOverlayLabel.set_style( + 'font-size: ' + font_size + 'px;' + + 'border-radius: ' + this.icon.iconSize + 'px;' + + 'width: ' + size + 'px; height: ' + size +'px;' + ); + } + + setNumberOverlay(number) { + this._numberOverlayOrder = number; + this._numberOverlayLabel.set_text(number.toString()); + } + + toggleNumberOverlay(activate) { + if (activate && this._numberOverlayOrder > -1) { + this.updateNumberOverlay(); + this._numberOverlayBin.show(); + } + else + this._numberOverlayBin.hide(); + } + + _minimizeWindow(param) { + // Param true make all app windows minimize + let windows = this.getInterestingWindows(); + let current_workspace = global.workspace_manager.get_active_workspace(); + for (let i = 0; i < windows.length; i++) { + let w = windows[i]; + if (w.get_workspace() == current_workspace && w.showing_on_its_workspace()) { + w.minimize(); + // Just minimize one window. By specification it should be the + // focused window on the current workspace. + if(!param) + break; + } + } + } + + // By default only non minimized windows are activated. + // This activates all windows in the current workspace. + _activateAllWindows() { + // First activate first window so workspace is switched if needed. + // We don't do this if isolation is on! + if (!Docking.DockManager.settings.get_boolean('isolate-workspaces') && + !Docking.DockManager.settings.get_boolean('isolate-monitors')) + this.app.activate(); + + // then activate all other app windows in the current workspace + let windows = this.getInterestingWindows(); + let activeWorkspace = global.workspace_manager.get_active_workspace_index(); + + if (windows.length <= 0) + return; + + let activatedWindows = 0; + + for (let i = windows.length - 1; i >= 0; i--) { + if (windows[i].get_workspace().index() == activeWorkspace) { + Main.activateWindow(windows[i]); + activatedWindows++; + } + } + } + + //This closes all windows of the app. + closeAllWindows() { + let windows = this.getInterestingWindows(); + for (let i = 0; i < windows.length; i++) + windows[i].delete(global.get_current_time()); + } + + _cycleThroughWindows(reversed) { + // Store for a little amount of time last clicked app and its windows + // since the order changes upon window interaction + let MEMORY_TIME=3000; + + let app_windows = this.getInterestingWindows(); + + if (app_windows.length <1) + return + + if (recentlyClickedAppLoopId > 0) + Mainloop.source_remove(recentlyClickedAppLoopId); + recentlyClickedAppLoopId = Mainloop.timeout_add(MEMORY_TIME, this._resetRecentlyClickedApp); + + // If there isn't already a list of windows for the current app, + // or the stored list is outdated, use the current windows list. + let monitorIsolation = Docking.DockManager.settings.get_boolean('isolate-monitors'); + if (!recentlyClickedApp || + recentlyClickedApp.get_id() != this.app.get_id() || + recentlyClickedAppWindows.length != app_windows.length || + (recentlyClickedAppMonitor != this.monitorIndex && monitorIsolation)) { + recentlyClickedApp = this.app; + recentlyClickedAppWindows = app_windows; + recentlyClickedAppMonitor = this.monitorIndex; + recentlyClickedAppIndex = 0; + } + + if (reversed) { + recentlyClickedAppIndex--; + if (recentlyClickedAppIndex < 0) recentlyClickedAppIndex = recentlyClickedAppWindows.length - 1; + } else { + recentlyClickedAppIndex++; + } + let index = recentlyClickedAppIndex % recentlyClickedAppWindows.length; + let window = recentlyClickedAppWindows[index]; + + Main.activateWindow(window); + } + + _resetRecentlyClickedApp() { + if (recentlyClickedAppLoopId > 0) + Mainloop.source_remove(recentlyClickedAppLoopId); + recentlyClickedAppLoopId=0; + recentlyClickedApp =null; + recentlyClickedAppWindows = null; + recentlyClickedAppIndex = 0; + recentlyClickedAppMonitor = -1; + + return false; + } + + getWindows() { + return getWindows(this.app, this._location); + } + + // Filter out unnecessary windows, for instance + // nautilus desktop window. + getInterestingWindows() { + return getInterestingWindows(this.app, this.monitorIndex, this._location); + } + + // Does the Icon represent a location rather than an App + isLocation() { + return this._location != null; + } +}; +/** + * Extend AppIconMenu + * + * - set popup arrow side based on dash orientation + * - Add close windows option based on quitfromdash extension + * (https://github.com/deuill/shell-extension-quitfromdash) + * - Add open windows thumbnails instead of list + * - update menu when application windows change + */ +const MyAppIconMenu = class DashToDock_MyAppIconMenu extends AppDisplay.AppIconMenu { + + constructor(source) { + let side = Utils.getPosition(); + + // Damm it, there has to be a proper way of doing this... + // As I can't call the parent parent constructor (?) passing the side + // parameter, I overwite what I need later + super(source); + + // Change the initialized side where required. + this._arrowSide = side; + this._boxPointer._arrowSide = side; + this._boxPointer._userArrowSide = side; + } + + _redisplay() { + this.removeAll(); + + if (Docking.DockManager.settings.get_boolean('show-windows-preview')) { + // Display the app windows menu items and the separator between windows + // of the current desktop and other windows. + + this._allWindowsMenuItem = new PopupMenu.PopupSubMenuMenuItem(__('All Windows'), false); + this._allWindowsMenuItem.actor.hide(); + this.addMenuItem(this._allWindowsMenuItem); + + if (!this._source.app.is_window_backed()) { + this._appendSeparator(); + + let appInfo = this._source.app.get_app_info(); + let actions = appInfo.list_actions(); + if (this._source.app.can_open_new_window() && + actions.indexOf('new-window') == -1) { + this._newWindowMenuItem = this._appendMenuItem(_("New Window")); + this._newWindowMenuItem.connect('activate', () => { + if (this._source.app.state == Shell.AppState.STOPPED) + this._source.animateLaunch(); + + this._source.app.open_new_window(-1); + this.emit('activate-window', null); + }); + this._appendSeparator(); + } + + + if (AppDisplay.discreteGpuAvailable && + this._source.app.state == Shell.AppState.STOPPED && + actions.indexOf('activate-discrete-gpu') == -1) { + this._onDiscreteGpuMenuItem = this._appendMenuItem(_("Launch using Dedicated Graphics Card")); + this._onDiscreteGpuMenuItem.connect('activate', () => { + if (this._source.app.state == Shell.AppState.STOPPED) + this._source.animateLaunch(); + + this._source.app.launch(0, -1, true); + this.emit('activate-window', null); + }); + } + + for (let i = 0; i < actions.length; i++) { + let action = actions[i]; + let item = this._appendMenuItem(appInfo.get_action_name(action)); + item.connect('activate', (emitter, event) => { + this._source.app.launch_action(action, event.get_time(), -1); + this.emit('activate-window', null); + }); + } + + let canFavorite = global.settings.is_writable('favorite-apps') && + !this._source.isLocation(); + + if (canFavorite) { + this._appendSeparator(); + + let isFavorite = AppFavorites.getAppFavorites().isFavorite(this._source.app.get_id()); + + if (isFavorite) { + let item = this._appendMenuItem(_("Remove from Favorites")); + item.connect('activate', () => { + let favs = AppFavorites.getAppFavorites(); + favs.removeFavorite(this._source.app.get_id()); + }); + } else { + let item = this._appendMenuItem(_("Add to Favorites")); + item.connect('activate', () => { + let favs = AppFavorites.getAppFavorites(); + favs.addFavorite(this._source.app.get_id()); + }); + } + } + + if (Shell.AppSystem.get_default().lookup_app('org.gnome.Software.desktop') && + !this._source.isLocation()) { + this._appendSeparator(); + let item = this._appendMenuItem(_("Show Details")); + item.connect('activate', () => { + let id = this._source.app.get_id(); + let args = GLib.Variant.new('(ss)', [id, '']); + Gio.DBus.get(Gio.BusType.SESSION, null, + function(o, res) { + let bus = Gio.DBus.get_finish(res); + bus.call('org.gnome.Software', + '/org/gnome/Software', + 'org.gtk.Actions', 'Activate', + GLib.Variant.new('(sava{sv})', + ['details', [args], null]), + null, 0, -1, null, null); + Main.overview.hide(); + }); + }); + } + } + + } else { + super._redisplay(); + } + + // quit menu + this._appendSeparator(); + this._quitfromDashMenuItem = this._appendMenuItem(_("Quit")); + this._quitfromDashMenuItem.connect('activate', () => { + this._source.closeAllWindows(); + }); + + this.update(); + } + + // update menu content when application windows change. This is desirable as actions + // acting on windows (closing) are performed while the menu is shown. + update() { + + if(Docking.DockManager.settings.get_boolean('show-windows-preview')){ + + let windows = this._source.getInterestingWindows(); + + // update, show or hide the quit menu + if ( windows.length > 0) { + let quitFromDashMenuText = ""; + if (windows.length == 1) + this._quitfromDashMenuItem.label.set_text(_("Quit")); + else + this._quitfromDashMenuItem.label.set_text(_("Quit %d Windows").format(windows.length)); + + this._quitfromDashMenuItem.actor.show(); + + } else { + this._quitfromDashMenuItem.actor.hide(); + } + + // update, show, or hide the allWindows menu + // Check if there are new windows not already displayed. In such case, repopulate the allWindows + // menu. Windows removal is already handled by each preview being connected to the destroy signal + let old_windows = this._allWindowsMenuItem.menu._getMenuItems().map(function(item){ + return item._window; + }); + + let new_windows = windows.filter(function(w) {return old_windows.indexOf(w) < 0;}); + if (new_windows.length > 0) { + this._populateAllWindowMenu(windows); + + // Try to set the width to that of the submenu. + // TODO: can't get the actual size, getting a bit less. + // Temporary workaround: add 15px to compensate + this._allWindowsMenuItem.actor.width = this._allWindowsMenuItem.menu.actor.width + 15; + + } + + // The menu is created hidden and never hidded after being shown. Instead, a singlal + // connected to its items destroy will set is insensitive if no more windows preview are shown. + if (windows.length > 0){ + this._allWindowsMenuItem.actor.show(); + this._allWindowsMenuItem.setSensitive(true); + } + + // Update separators + this._getMenuItems().forEach(this._updateSeparatorVisibility.bind(this)); + } + + + } + + _populateAllWindowMenu(windows) { + + this._allWindowsMenuItem.menu.removeAll(); + + if (windows.length > 0) { + + let activeWorkspace = global.workspace_manager.get_active_workspace(); + let separatorShown = windows[0].get_workspace() != activeWorkspace; + + for (let i = 0; i < windows.length; i++) { + let window = windows[i]; + if (!separatorShown && window.get_workspace() != activeWorkspace) { + this._allWindowsMenuItem.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); + separatorShown = true; + } + + let item = new WindowPreview.WindowPreviewMenuItem(window); + this._allWindowsMenuItem.menu.addMenuItem(item); + item.connect('activate', () => { + this.emit('activate-window', window); + }); + + // This is to achieve a more gracefull transition when the last windows is closed. + item.connect('destroy', () => { + if(this._allWindowsMenuItem.menu._getMenuItems().length == 1) // It's still counting the item just going to be destroyed + this._allWindowsMenuItem.setSensitive(false); + }); + } + } + } +}; +Signals.addSignalMethods(MyAppIconMenu.prototype); + +function getWindows(app, location) { + if (location != null && Docking.DockManager.getDefault().fm1Client) { + return Docking.DockManager.getDefault().fm1Client.getWindows(location); + } else { + return app.get_windows(); + } +} + +// Filter out unnecessary windows, for instance +// nautilus desktop window. +function getInterestingWindows(app, monitorIndex, location) { + let windows = getWindows(app, location).filter(function(w) { + return !w.skip_taskbar; + }); + + let settings = Docking.DockManager.settings; + + // When using workspace isolation, we filter out windows + // that are not in the current workspace + if (settings.get_boolean('isolate-workspaces')) + windows = windows.filter(function(w) { + return w.get_workspace().index() == global.workspace_manager.get_active_workspace_index(); + }); + + if (settings.get_boolean('isolate-monitors')) + windows = windows.filter(function(w) { + return w.get_monitor() == monitorIndex; + }); + + return windows; +} + +/** + * A ShowAppsIcon improved class. + * + * - set label position based on dash orientation (Note, I am reusing most machinery of the appIcon class) + * - implement a popupMenu based on the AppIcon code (Note, I am reusing most machinery of the appIcon class) + * + */ + +var MyShowAppsIcon = GObject.registerClass({ + Signals: { + 'menu-state-changed': { param_types: [GObject.TYPE_BOOLEAN] }, + 'sync-tooltip': {} + } +} +, class DashToDock_MyShowAppsIcon extends Dash.ShowAppsIcon { + _init() { + super._init(); + + // Re-use appIcon methods + let appIconPrototype = AppDisplay.AppIcon.prototype; + this.actor.connect('leave-event', appIconPrototype._onLeaveEvent.bind(this)); + this.actor.connect('button-press-event', appIconPrototype._onButtonPress.bind(this)); + this.actor.connect('touch-event', appIconPrototype._onTouchEvent.bind(this)); + this.actor.connect('popup-menu', appIconPrototype._onKeyboardPopupMenu.bind(this)); + this.actor.connect('clicked', this._removeMenuTimeout.bind(this)); + + this._menu = null; + this._menuManager = new PopupMenu.PopupMenuManager(this.actor); + this._menuTimeoutId = 0; + } + + get actor() { + /* Until GNOME Shell AppIcon is an actor we need to provide this + * compatibility layer or the shell won't be able to access to the + * actual actor */ + return this.toggleButton; + } + + showLabel() { + itemShowLabel.call(this); + } + + _onMenuPoppedDown() { + AppDisplay.AppIcon.prototype._onMenuPoppedDown.apply(this, arguments); + } + + _setPopupTimeout() { + AppDisplay.AppIcon.prototype._onMenuPoppedDown.apply(this, arguments); + } + + _removeMenuTimeout() { + AppDisplay.AppIcon.prototype._removeMenuTimeout.apply(this, arguments); + } + + popupMenu() { + this._removeMenuTimeout(); + this.actor.fake_release(); + + if (!this._menu) { + this._menu = new MyShowAppsIconMenu(this); + this._menu.connect('open-state-changed', (menu, isPoppedUp) => { + if (!isPoppedUp) + this._onMenuPoppedDown(); + }); + let id = Main.overview.connect('hiding', () => { + this._menu.close(); + }); + this._menu.actor.connect('destroy', function() { + Main.overview.disconnect(id); + }); + this._menuManager.addMenu(this._menu); + } + + this.emit('menu-state-changed', true); + + this.actor.set_hover(true); + this._menu.popup(); + this._menuManager.ignoreRelease(); + this.emit('sync-tooltip'); + + return false; + } +}); + + +/** + * A menu for the showAppsIcon + */ +var MyShowAppsIconMenu = class DashToDock_MyShowAppsIconMenu extends MyAppIconMenu { + _redisplay() { + this.removeAll(); + + /* Translators: %s is "Settings", which is automatically translated. You + can also translate the full message if this fits better your language. */ + let name = __('Dash to Dock %s').format(_('Settings')) + let item = this._appendMenuItem(name); + + item.connect('activate', function () { + Util.spawn(["gnome-shell-extension-prefs", Me.metadata.uuid]); + }); + } +}; + +/** + * This function is used for both extendShowAppsIcon and extendDashItemContainer + */ +function itemShowLabel() { + // Check if the label is still present at all. When switching workpaces, the + // item might have been destroyed in between. + if (!this._labelText || this.label.get_stage() == null) + return; + + this.label.set_text(this._labelText); + this.label.opacity = 0; + this.label.show(); + + let [stageX, stageY] = this.get_transformed_position(); + let node = this.label.get_theme_node(); + + let itemWidth = this.allocation.x2 - this.allocation.x1; + let itemHeight = this.allocation.y2 - this.allocation.y1; + + let labelWidth = this.label.get_width(); + let labelHeight = this.label.get_height(); + + let x, y, xOffset, yOffset; + + let position = Utils.getPosition(); + this._isHorizontal = ((position == St.Side.TOP) || (position == St.Side.BOTTOM)); + let labelOffset = node.get_length('-x-offset'); + + switch (position) { + case St.Side.LEFT: + yOffset = Math.floor((itemHeight - labelHeight) / 2); + y = stageY + yOffset; + xOffset = labelOffset; + x = stageX + this.get_width() + xOffset; + break; + case St.Side.RIGHT: + yOffset = Math.floor((itemHeight - labelHeight) / 2); + y = stageY + yOffset; + xOffset = labelOffset; + x = Math.round(stageX) - labelWidth - xOffset; + break; + case St.Side.TOP: + y = stageY + labelOffset + itemHeight; + xOffset = Math.floor((itemWidth - labelWidth) / 2); + x = stageX + xOffset; + break; + case St.Side.BOTTOM: + yOffset = labelOffset; + y = stageY - labelHeight - yOffset; + xOffset = Math.floor((itemWidth - labelWidth) / 2); + x = stageX + xOffset; + break; + } + + // keep the label inside the screen border + // Only needed fot the x coordinate. + + // Leave a few pixel gap + let gap = 5; + let monitor = Main.layoutManager.findMonitorForActor(this); + if (x - monitor.x < gap) + x += monitor.x - x + labelOffset; + else if (x + labelWidth > monitor.x + monitor.width - gap) + x -= x + labelWidth - (monitor.x + monitor.width) + gap; + + this.label.remove_all_transitions(); + this.label.set_position(x, y); + this.label.ease({ + opacity: 255, + duration: Dash.DASH_ITEM_LABEL_SHOW_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD + }); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/dash.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/dash.js new file mode 100644 index 00000000..cb245f8c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/dash.js @@ -0,0 +1,1202 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Clutter = imports.gi.Clutter; +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Gtk = imports.gi.Gtk; +const Signals = imports.signals; +const Meta = imports.gi.Meta; +const Shell = imports.gi.Shell; +const St = imports.gi.St; +const Mainloop = imports.mainloop; + +const AppDisplay = imports.ui.appDisplay; +const AppFavorites = imports.ui.appFavorites; +const Dash = imports.ui.dash; +const DND = imports.ui.dnd; +const IconGrid = imports.ui.iconGrid; +const Main = imports.ui.main; +const PopupMenu = imports.ui.popupMenu; +const Util = imports.misc.util; +const Workspace = imports.ui.workspace; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; +const Utils = Me.imports.utils; +const AppIcons = Me.imports.appIcons; +const Locations = Me.imports.locations; + +const DASH_ANIMATION_TIME = Dash.DASH_ANIMATION_TIME; +const DASH_ITEM_LABEL_HIDE_TIME = Dash.DASH_ITEM_LABEL_HIDE_TIME; +const DASH_ITEM_HOVER_TIMEOUT = Dash.DASH_ITEM_HOVER_TIMEOUT; + +/** + * Extend DashItemContainer + * + * - set label position based on dash orientation + * + */ +let MyDashItemContainer = GObject.registerClass( +class DashToDock_MyDashItemContainer extends Dash.DashItemContainer { + + showLabel() { + return AppIcons.itemShowLabel.call(this); + } +}); + +/** + * This class is a fork of the upstream DashActor class (ui.dash.js) + * + * Summary of changes: + * - modified chldBox calculations for when 'show-apps-at-top' option is checked + * - handle horizontal dash + */ +var MyDashActor = GObject.registerClass( +class DashToDock_MyDashActor extends St.Widget { + + _init() { + // a prefix is required to avoid conflicting with the parent class variable + this._rtl = (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL); + + this._position = Utils.getPosition(); + this._isHorizontal = ((this._position == St.Side.TOP) || + (this._position == St.Side.BOTTOM)); + + let layout = new Clutter.BoxLayout({ + orientation: this._isHorizontal ? Clutter.Orientation.HORIZONTAL : Clutter.Orientation.VERTICAL + }); + + super._init({ + name: 'dash', + layout_manager: layout, + clip_to_allocation: true + }); + + // Since we are usually visible but not usually changing, make sure + // most repaint requests don't actually require us to repaint anything. + // This saves significant CPU when repainting the screen. + this.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS); + } + + vfunc_allocate(box, flags) { + this.set_allocation(box, flags); + let contentBox = box; + let availWidth = contentBox.x2 - contentBox.x1; + let availHeight = contentBox.y2 - contentBox.y1; + + let [appIcons, showAppsButton] = this.get_children(); + let [showAppsMinHeight, showAppsNatHeight] = showAppsButton.get_preferred_height(availWidth); + let [showAppsMinWidth, showAppsNatWidth] = showAppsButton.get_preferred_width(availHeight); + + let offset_x = this._isHorizontal?showAppsNatWidth:0; + let offset_y = this._isHorizontal?0:showAppsNatHeight; + + let childBox = new Clutter.ActorBox(); + let settings = Docking.DockManager.settings; + if ((settings.get_boolean('show-apps-at-top') && !this._isHorizontal) + || (settings.get_boolean('show-apps-at-top') && !this._rtl) + || (!settings.get_boolean('show-apps-at-top') && this._isHorizontal && this._rtl)) { + childBox.x1 = contentBox.x1 + offset_x; + childBox.y1 = contentBox.y1 + offset_y; + childBox.x2 = contentBox.x2; + childBox.y2 = contentBox.y2; + appIcons.allocate(childBox, flags); + + childBox.y1 = contentBox.y1; + childBox.x1 = contentBox.x1; + childBox.x2 = contentBox.x1 + showAppsNatWidth; + childBox.y2 = contentBox.y1 + showAppsNatHeight; + showAppsButton.allocate(childBox, flags); + } + else { + childBox.x1 = contentBox.x1; + childBox.y1 = contentBox.y1; + childBox.x2 = contentBox.x2 - offset_x; + childBox.y2 = contentBox.y2 - offset_y; + appIcons.allocate(childBox, flags); + + childBox.x2 = contentBox.x2; + childBox.y2 = contentBox.y2; + childBox.x1 = contentBox.x2 - showAppsNatWidth; + childBox.y1 = contentBox.y2 - showAppsNatHeight; + showAppsButton.allocate(childBox, flags); + } + } + + vfunc_get_preferred_width(forHeight) { + // We want to request the natural height of all our children + // as our natural height, so we chain up to StWidget (which + // then calls BoxLayout), but we only request the showApps + // button as the minimum size + + let [, natWidth] = this.layout_manager.get_preferred_width(this, forHeight); + + let themeNode = this.get_theme_node(); + let [, showAppsButton] = this.get_children(); + let [minWidth, ] = showAppsButton.get_preferred_height(forHeight); + + return [minWidth, natWidth]; + } + + vfunc_get_preferred_height(forWidth) { + // We want to request the natural height of all our children + // as our natural height, so we chain up to StWidget (which + // then calls BoxLayout), but we only request the showApps + // button as the minimum size + + let [, natHeight] = this.layout_manager.get_preferred_height(this, forWidth); + + let themeNode = this.get_theme_node(); + let [, showAppsButton] = this.get_children(); + let [minHeight, ] = showAppsButton.get_preferred_height(forWidth); + + return [minHeight, natHeight]; + } +}); + +const baseIconSizes = [16, 22, 24, 32, 48, 64, 96, 128]; + +/** + * This class is a fork of the upstream dash class (ui.dash.js) + * + * Summary of changes: + * - disconnect global signals adding a destroy method; + * - play animations even when not in overview mode + * - set a maximum icon size + * - show running and/or favorite applications + * - hide showApps label when the custom menu is shown. + * - add scrollview + * ensure actor is visible on keyfocus inseid the scrollview + * - add 128px icon size, might be usefull for hidpi display + * - sync minimization application target position. + * - keep running apps ordered. + */ +var MyDash = GObject.registerClass({ + Signals: { + 'menu-closed': {}, + 'icon-size-changed': {}, + } +}, class DashToDock_MyDash extends St.Bin { + + _init(remoteModel, monitorIndex) { + // Initialize icon variables and size + this._maxHeight = -1; + this.iconSize = Docking.DockManager.settings.get_int('dash-max-icon-size'); + this._availableIconSizes = baseIconSizes; + this._shownInitially = false; + this._initializeIconSize(this.iconSize); + + this._remoteModel = remoteModel; + this._monitorIndex = monitorIndex; + this._position = Utils.getPosition(); + this._isHorizontal = ((this._position == St.Side.TOP) || + (this._position == St.Side.BOTTOM)); + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._dragPlaceholder = null; + this._dragPlaceholderPos = -1; + this._animatingPlaceholdersCount = 0; + this._showLabelTimeoutId = 0; + this._resetHoverTimeoutId = 0; + this._ensureAppIconVisibilityTimeoutId = 0; + this._labelShowing = false; + + this._container = new MyDashActor(); + this._scrollView = new St.ScrollView({ + name: 'dashtodockDashScrollview', + hscrollbar_policy: Gtk.PolicyType.NEVER, + vscrollbar_policy: Gtk.PolicyType.NEVER, + enable_mouse_scrolling: false + }); + + this._scrollView.connect('scroll-event', this._onScrollEvent.bind(this)); + + this._box = new St.BoxLayout({ + vertical: !this._isHorizontal, + clip_to_allocation: false, + x_align: Clutter.ActorAlign.START, + y_align: Clutter.ActorAlign.START + }); + this._box._delegate = this; + this._container.add_actor(this._scrollView); + this._scrollView.add_actor(this._box); + + // Create a wrapper around the real showAppsIcon in order to add a popupMenu. + this._showAppsIcon = new AppIcons.MyShowAppsIcon(); + this._showAppsIcon.show(); + this._showAppsIcon.icon.setIconSize(this.iconSize); + this._hookUpLabel(this._showAppsIcon); + this._showAppsIcon.connect('menu-state-changed', (_icon, opened) => { + this._itemMenuStateChanged(this._showAppsIcon, opened); + }); + + this._container.add_actor(this._showAppsIcon); + + let rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL; + super._init({ + child: this._container, + y_align: St.Align.START, + x_align: rtl ? St.Align.END : St.Align.START + }); + + if (this._isHorizontal) { + this.connect('notify::width', () => { + if (this._maxHeight != this.width) + this._queueRedisplay(); + this._maxHeight = this.width; + }); + } + else { + this.connect('notify::height', () => { + if (this._maxHeight != this.height) + this._queueRedisplay(); + this._maxHeight = this.height; + }); + } + + // Update minimization animation target position on allocation of the + // container and on scrollview change. + this._box.connect('notify::allocation', this._updateAppsIconGeometry.bind(this)); + let scrollViewAdjustment = this._isHorizontal ? this._scrollView.hscroll.adjustment : this._scrollView.vscroll.adjustment; + scrollViewAdjustment.connect('notify::value', this._updateAppsIconGeometry.bind(this)); + + this._workId = Main.initializeDeferredWork(this._box, this._redisplay.bind(this)); + + this._shellSettings = new Gio.Settings({ + schema_id: 'org.gnome.shell' + }); + + this._appSystem = Shell.AppSystem.get_default(); + + this._signalsHandler.add([ + this._appSystem, + 'installed-changed', + () => { + AppFavorites.getAppFavorites().reload(); + this._queueRedisplay(); + } + ], [ + AppFavorites.getAppFavorites(), + 'changed', + this._queueRedisplay.bind(this) + ], [ + this._appSystem, + 'app-state-changed', + this._queueRedisplay.bind(this) + ], [ + Main.overview, + 'item-drag-begin', + this._onDragBegin.bind(this) + ], [ + Main.overview, + 'item-drag-end', + this._onDragEnd.bind(this) + ], [ + Main.overview, + 'item-drag-cancelled', + this._onDragCancelled.bind(this) + ]); + + this.connect('destroy', this._onDestroy.bind(this)); + } + + _onDestroy() { + this._signalsHandler.destroy(); + } + + _onScrollEvent(actor, event) { + // If scroll is not used because the icon is resized, let the scroll event propagate. + if (!Docking.DockManager.settings.get_boolean('icon-size-fixed')) + return Clutter.EVENT_PROPAGATE; + + // reset timeout to avid conflicts with the mousehover event + if (this._ensureAppIconVisibilityTimeoutId > 0) { + Mainloop.source_remove(this._ensureAppIconVisibilityTimeoutId); + this._ensureAppIconVisibilityTimeoutId = 0; + } + + // Skip to avoid double events mouse + if (event.is_pointer_emulated()) + return Clutter.EVENT_STOP; + + let adjustment, delta; + + if (this._isHorizontal) + adjustment = this._scrollView.get_hscroll_bar().get_adjustment(); + else + adjustment = this._scrollView.get_vscroll_bar().get_adjustment(); + + let increment = adjustment.step_increment; + + switch (event.get_scroll_direction()) { + case Clutter.ScrollDirection.UP: + delta = -increment; + break; + case Clutter.ScrollDirection.DOWN: + delta = +increment; + break; + case Clutter.ScrollDirection.SMOOTH: + let [dx, dy] = event.get_scroll_delta(); + delta = dy * increment; + // Also consider horizontal component, for instance touchpad + if (this._isHorizontal) + delta += dx * increment; + break; + } + + adjustment.set_value(adjustment.get_value() + delta); + + return Clutter.EVENT_STOP; + } + + _onDragBegin() { + this._dragCancelled = false; + this._dragMonitor = { + dragMotion: this._onDragMotion.bind(this) + }; + DND.addDragMonitor(this._dragMonitor); + + if (this._box.get_n_children() == 0) { + this._emptyDropTarget = new Dash.EmptyDropTargetItem(); + this._box.insert_child_at_index(this._emptyDropTarget, 0); + this._emptyDropTarget.show(true); + } + } + + _onDragCancelled() { + this._dragCancelled = true; + this._endDrag(); + } + + _onDragEnd() { + if (this._dragCancelled) + return; + + this._endDrag(); + } + + _endDrag() { + this._clearDragPlaceholder(); + this._clearEmptyDropTarget(); + this._showAppsIcon.setDragApp(null); + DND.removeDragMonitor(this._dragMonitor); + } + + _onDragMotion(dragEvent) { + let app = Dash.getAppFromSource(dragEvent.source); + if (app == null) + return DND.DragMotionResult.CONTINUE; + + let showAppsHovered = this._showAppsIcon.contains(dragEvent.targetActor); + + if (!this._box.contains(dragEvent.targetActor) || showAppsHovered) + this._clearDragPlaceholder(); + + if (showAppsHovered) + this._showAppsIcon.setDragApp(app); + else + this._showAppsIcon.setDragApp(null); + + return DND.DragMotionResult.CONTINUE; + } + + _appIdListToHash(apps) { + let ids = {}; + for (let i = 0; i < apps.length; i++) + ids[apps[i].get_id()] = apps[i]; + return ids; + } + + _queueRedisplay() { + Main.queueDeferredWork(this._workId); + } + + _hookUpLabel(item, appIcon) { + item.child.connect('notify::hover', () => { + this._syncLabel(item, appIcon); + }); + + let id = Main.overview.connect('hiding', () => { + this._labelShowing = false; + item.hideLabel(); + }); + item.child.connect('destroy', function() { + Main.overview.disconnect(id); + }); + + if (appIcon) { + appIcon.connect('sync-tooltip', () => { + this._syncLabel(item, appIcon); + }); + } + } + + _createAppItem(app) { + let appIcon = new AppIcons.MyAppIcon(this._remoteModel, app, + this._monitorIndex, + { setSizeManually: true, + showLabel: false }); + + if (appIcon._draggable) { + appIcon._draggable.connect('drag-begin', () => { + appIcon.actor.opacity = 50; + }); + appIcon._draggable.connect('drag-end', () => { + appIcon.actor.opacity = 255; + }); + } + + appIcon.connect('menu-state-changed', (appIcon, opened) => { + this._itemMenuStateChanged(item, opened); + }); + + let item = new MyDashItemContainer(); + item.setChild(appIcon.actor); + + appIcon.actor.connect('notify::hover', () => { + if (appIcon.actor.hover) { + this._ensureAppIconVisibilityTimeoutId = Mainloop.timeout_add(100, () => { + ensureActorVisibleInScrollView(this._scrollView, appIcon.actor); + this._ensureAppIconVisibilityTimeoutId = 0; + return GLib.SOURCE_REMOVE; + }); + } + else { + if (this._ensureAppIconVisibilityTimeoutId > 0) { + Mainloop.source_remove(this._ensureAppIconVisibilityTimeoutId); + this._ensureAppIconVisibilityTimeoutId = 0; + } + } + }); + + appIcon.actor.connect('clicked', (actor) => { + ensureActorVisibleInScrollView(this._scrollView, actor); + }); + + appIcon.actor.connect('key-focus-in', (actor) => { + let [x_shift, y_shift] = ensureActorVisibleInScrollView(this._scrollView, actor); + + // This signal is triggered also by mouse click. The popup menu is opened at the original + // coordinates. Thus correct for the shift which is going to be applied to the scrollview. + if (appIcon._menu) { + appIcon._menu._boxPointer.xOffset = -x_shift; + appIcon._menu._boxPointer.yOffset = -y_shift; + } + }); + + // Override default AppIcon label_actor, now the + // accessible_name is set at DashItemContainer.setLabelText + appIcon.actor.label_actor = null; + item.setLabelText(app.get_name()); + + appIcon.icon.setIconSize(this.iconSize); + this._hookUpLabel(item, appIcon); + + return item; + } + + /** + * Return an array with the "proper" appIcons currently in the dash + */ + getAppIcons() { + // Only consider children which are "proper" + // icons (i.e. ignoring drag placeholders) and which are not + // animating out (which means they will be destroyed at the end of + // the animation) + let iconChildren = this._box.get_children().filter(function(actor) { + return actor.child && + actor.child._delegate && + actor.child._delegate.icon && + !actor.animatingOut; + }); + + let appIcons = iconChildren.map(function(actor) { + return actor.child._delegate; + }); + + return appIcons; + } + + _updateAppsIconGeometry() { + let appIcons = this.getAppIcons(); + appIcons.forEach(function(icon) { + icon.updateIconGeometry(); + }); + } + + _itemMenuStateChanged(item, opened) { + // When the menu closes, it calls sync_hover, which means + // that the notify::hover handler does everything we need to. + if (opened) { + if (this._showLabelTimeoutId > 0) { + Mainloop.source_remove(this._showLabelTimeoutId); + this._showLabelTimeoutId = 0; + } + + item.label.opacity = 0; + item.label.hide(); + } + else { + // I want to listen from outside when a menu is closed. I used to + // add a custom signal to the appIcon, since gnome 3.8 the signal + // calling this callback was added upstream. + this.emit('menu-closed'); + } + } + + _syncLabel(item, appIcon) { + let shouldShow = appIcon ? appIcon.shouldShowTooltip() : item.child.get_hover(); + + if (shouldShow) { + if (this._showLabelTimeoutId == 0) { + let timeout = this._labelShowing ? 0 : DASH_ITEM_HOVER_TIMEOUT; + this._showLabelTimeoutId = Mainloop.timeout_add(timeout, () => { + this._labelShowing = true; + item.showLabel(); + this._showLabelTimeoutId = 0; + return GLib.SOURCE_REMOVE; + }); + GLib.Source.set_name_by_id(this._showLabelTimeoutId, '[gnome-shell] item.showLabel'); + if (this._resetHoverTimeoutId > 0) { + Mainloop.source_remove(this._resetHoverTimeoutId); + this._resetHoverTimeoutId = 0; + } + } + } + else { + if (this._showLabelTimeoutId > 0) + Mainloop.source_remove(this._showLabelTimeoutId); + this._showLabelTimeoutId = 0; + item.hideLabel(); + if (this._labelShowing) { + this._resetHoverTimeoutId = Mainloop.timeout_add(DASH_ITEM_HOVER_TIMEOUT, () => { + this._labelShowing = false; + this._resetHoverTimeoutId = 0; + return GLib.SOURCE_REMOVE; + }); + GLib.Source.set_name_by_id(this._resetHoverTimeoutId, '[gnome-shell] this._labelShowing'); + } + } + } + + _adjustIconSize() { + // For the icon size, we only consider children which are "proper" + // icons (i.e. ignoring drag placeholders) and which are not + // animating out (which means they will be destroyed at the end of + // the animation) + let iconChildren = this._box.get_children().filter(function(actor) { + return actor.child && + actor.child._delegate && + actor.child._delegate.icon && + !actor.animatingOut; + }); + + iconChildren.push(this._showAppsIcon); + + if (this._maxHeight == -1) + return; + + // Check if the container is present in the stage. This avoids critical + // errors when unlocking the screen + if (!this._container.get_stage()) + return; + + let themeNode = this._container.get_theme_node(); + let maxAllocation = new Clutter.ActorBox({ + x1: 0, + y1: 0, + x2: this._isHorizontal ? this._maxHeight : 42 /* whatever */, + y2: this._isHorizontal ? 42 : this._maxHeight + }); + let maxContent = themeNode.get_content_box(maxAllocation); + let availHeight; + if (this._isHorizontal) + availHeight = maxContent.x2 - maxContent.x1; + else + availHeight = maxContent.y2 - maxContent.y1; + let spacing = themeNode.get_length('spacing'); + + let firstButton = iconChildren[0].child; + let firstIcon = firstButton._delegate.icon; + + let minHeight, natHeight, minWidth, natWidth; + + // Enforce the current icon size during the size request + firstIcon.setIconSize(this.iconSize); + [minHeight, natHeight] = firstButton.get_preferred_height(-1); + [minWidth, natWidth] = firstButton.get_preferred_width(-1); + + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + let iconSizes = this._availableIconSizes.map(function(s) { + return s * scaleFactor; + }); + + // Subtract icon padding and box spacing from the available height + if (this._isHorizontal) + availHeight -= iconChildren.length * (natWidth - this.iconSize * scaleFactor) + + (iconChildren.length - 1) * spacing; + else + availHeight -= iconChildren.length * (natHeight - this.iconSize * scaleFactor) + + (iconChildren.length - 1) * spacing; + + let availSize = availHeight / iconChildren.length; + + + let newIconSize = this._availableIconSizes[0]; + for (let i = 0; i < iconSizes.length; i++) { + if (iconSizes[i] < availSize) + newIconSize = this._availableIconSizes[i]; + } + + if (newIconSize == this.iconSize) + return; + + let oldIconSize = this.iconSize; + this.iconSize = newIconSize; + this.emit('icon-size-changed'); + + let scale = oldIconSize / newIconSize; + for (let i = 0; i < iconChildren.length; i++) { + let icon = iconChildren[i].child._delegate.icon; + + // Set the new size immediately, to keep the icons' sizes + // in sync with this.iconSize + icon.setIconSize(this.iconSize); + + // Don't animate the icon size change when the overview + // is transitioning, or when initially filling + // the dash + if (Main.overview.animationInProgress || + !this._shownInitially) + continue; + + let [targetWidth, targetHeight] = icon.icon.get_size(); + + // Scale the icon's texture to the previous size and + // tween to the new size + icon.icon.set_size(icon.icon.width * scale, + icon.icon.height * scale); + + icon.icon.remove_all_transitions(); + icon.icon.ease({ + width: targetWidth, + height: targetHeight, + time: DASH_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD + }); + } + } + + _redisplay() { + let favorites = AppFavorites.getAppFavorites().getFavoriteMap(); + + let running = this._appSystem.get_running(); + let settings = Docking.DockManager.settings; + + if (settings.get_boolean('isolate-workspaces') || + settings.get_boolean('isolate-monitors')) { + // When using isolation, we filter out apps that have no windows in + // the current workspace + let monitorIndex = this._monitorIndex; + running = running.filter(function(_app) { + return AppIcons.getInterestingWindows(_app, monitorIndex).length != 0; + }); + } + + let children = this._box.get_children().filter(function(actor) { + return actor.child && + actor.child._delegate && + actor.child._delegate.app; + }); + // Apps currently in the dash + let oldApps = children.map(function(actor) { + return actor.child._delegate.app; + }); + // Apps supposed to be in the dash + let newApps = []; + + if (settings.get_boolean('show-favorites')) { + for (let id in favorites) + newApps.push(favorites[id]); + } + + // We reorder the running apps so that they don't change position on the + // dash with every redisplay() call + if (settings.get_boolean('show-running')) { + // First: add the apps from the oldApps list that are still running + for (let i = 0; i < oldApps.length; i++) { + let index = running.indexOf(oldApps[i]); + if (index > -1) { + let app = running.splice(index, 1)[0]; + if (settings.get_boolean('show-favorites') && (app.get_id() in favorites)) + continue; + newApps.push(app); + } + } + // Second: add the new apps + for (let i = 0; i < running.length; i++) { + let app = running[i]; + if (settings.get_boolean('show-favorites') && (app.get_id() in favorites)) + continue; + newApps.push(app); + } + } + + if (settings.get_boolean('show-mounts')) { + if (!this._removables) { + this._removables = new Locations.Removables(); + this._signalsHandler.addWithLabel('show-mounts', + [ this._removables, + 'changed', + this._queueRedisplay.bind(this) ]); + } + Array.prototype.push.apply(newApps, this._removables.getApps()); + } else if (this._removables) { + this._signalsHandler.removeWithLabel('show-mounts'); + this._removables.destroy(); + this._removables = null; + } + + if (settings.get_boolean('show-trash')) { + if (!this._trash) { + this._trash = new Locations.Trash(); + this._signalsHandler.addWithLabel('show-trash', + [ this._trash, + 'changed', + this._queueRedisplay.bind(this) ]); + } + newApps.push(this._trash.getApp()); + } else if (this._trash) { + this._signalsHandler.removeWithLabel('show-trash'); + this._trash.destroy(); + this._trash = null; + } + + // Figure out the actual changes to the list of items; we iterate + // over both the list of items currently in the dash and the list + // of items expected there, and collect additions and removals. + // Moves are both an addition and a removal, where the order of + // the operations depends on whether we encounter the position + // where the item has been added first or the one from where it + // was removed. + // There is an assumption that only one item is moved at a given + // time; when moving several items at once, everything will still + // end up at the right position, but there might be additional + // additions/removals (e.g. it might remove all the launchers + // and add them back in the new order even if a smaller set of + // additions and removals is possible). + // If above assumptions turns out to be a problem, we might need + // to use a more sophisticated algorithm, e.g. Longest Common + // Subsequence as used by diff. + + let addedItems = []; + let removedActors = []; + + let newIndex = 0; + let oldIndex = 0; + while ((newIndex < newApps.length) || (oldIndex < oldApps.length)) { + // No change at oldIndex/newIndex + if (oldApps[oldIndex] && oldApps[oldIndex] == newApps[newIndex]) { + oldIndex++; + newIndex++; + continue; + } + + // App removed at oldIndex + if (oldApps[oldIndex] && (newApps.indexOf(oldApps[oldIndex]) == -1)) { + removedActors.push(children[oldIndex]); + oldIndex++; + continue; + } + + // App added at newIndex + if (newApps[newIndex] && (oldApps.indexOf(newApps[newIndex]) == -1)) { + let newItem = this._createAppItem(newApps[newIndex]); + addedItems.push({ app: newApps[newIndex], + item: newItem, + pos: newIndex }); + newIndex++; + continue; + } + + // App moved + let insertHere = newApps[newIndex + 1] && (newApps[newIndex + 1] == oldApps[oldIndex]); + let alreadyRemoved = removedActors.reduce(function(result, actor) { + let removedApp = actor.child._delegate.app; + return result || removedApp == newApps[newIndex]; + }, false); + + if (insertHere || alreadyRemoved) { + let newItem = this._createAppItem(newApps[newIndex]); + addedItems.push({ + app: newApps[newIndex], + item: newItem, + pos: newIndex + removedActors.length + }); + newIndex++; + } + else { + removedActors.push(children[oldIndex]); + oldIndex++; + } + } + + for (let i = 0; i < addedItems.length; i++) + this._box.insert_child_at_index(addedItems[i].item, + addedItems[i].pos); + + for (let i = 0; i < removedActors.length; i++) { + let item = removedActors[i]; + + // Don't animate item removal when the overview is transitioning + if (!Main.overview.animationInProgress) + item.animateOutAndDestroy(); + else + item.destroy(); + } + + this._adjustIconSize(); + + // Skip animations on first run when adding the initial set + // of items, to avoid all items zooming in at once + + let animate = this._shownInitially && + !Main.overview.animationInProgress; + + if (!this._shownInitially) + this._shownInitially = true; + + for (let i = 0; i < addedItems.length; i++) + addedItems[i].item.show(animate); + + // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=692744 + // Without it, StBoxLayout may use a stale size cache + this._box.queue_relayout(); + + // This is required for icon reordering when the scrollview is used. + this._updateAppsIconGeometry(); + + // This will update the size, and the corresponding number for each icon + this._updateNumberOverlay(); + } + + _updateNumberOverlay() { + let appIcons = this.getAppIcons(); + let counter = 1; + appIcons.forEach(function(icon) { + if (counter < 10){ + icon.setNumberOverlay(counter); + counter++; + } + else if (counter == 10) { + icon.setNumberOverlay(0); + counter++; + } + else { + // No overlay after 10 + icon.setNumberOverlay(-1); + } + icon.updateNumberOverlay(); + }); + + } + + toggleNumberOverlay(activate) { + let appIcons = this.getAppIcons(); + appIcons.forEach(function(icon) { + icon.toggleNumberOverlay(activate); + }); + } + + _initializeIconSize(max_size) { + let max_allowed = baseIconSizes[baseIconSizes.length-1]; + max_size = Math.min(max_size, max_allowed); + + if (Docking.DockManager.settings.get_boolean('icon-size-fixed')) + this._availableIconSizes = [max_size]; + else { + this._availableIconSizes = baseIconSizes.filter(function(val) { + return (val { + this._animatingPlaceholdersCount--; + }); + this._dragPlaceholder = null; + } + this._dragPlaceholderPos = -1; + } + + _clearEmptyDropTarget() { + if (this._emptyDropTarget) { + this._emptyDropTarget.animateOutAndDestroy(); + this._emptyDropTarget = null; + } + } + + handleDragOver(source, actor, x, y, time) { + let app = Dash.getAppFromSource(source); + + // Don't allow favoriting of transient apps + if (app == null || app.is_window_backed()) + return DND.DragMotionResult.NO_DROP; + + if (!this._shellSettings.is_writable('favorite-apps') || + !Docking.DockManager.settings.get_boolean('show-favorites')) + return DND.DragMotionResult.NO_DROP; + + let favorites = AppFavorites.getAppFavorites().getFavorites(); + let numFavorites = favorites.length; + + let favPos = favorites.indexOf(app); + + let children = this._box.get_children(); + let numChildren = children.length; + let boxHeight = 0; + for (let i = 0; i < numChildren; i++) + boxHeight += this._isHorizontal?children[i].width:children[i].height; + + // Keep the placeholder out of the index calculation; assuming that + // the remove target has the same size as "normal" items, we don't + // need to do the same adjustment there. + if (this._dragPlaceholder) { + boxHeight -= this._isHorizontal?this._dragPlaceholder.width:this._dragPlaceholder.height; + numChildren--; + } + + let pos; + if (!this._emptyDropTarget) { + pos = Math.floor((this._isHorizontal?x:y) * numChildren / boxHeight); + if (pos > numChildren) + pos = numChildren; + } + else + pos = 0; // always insert at the top when dash is empty + + // Take into account childredn position in rtl + if (this._isHorizontal && (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)) + pos = numChildren - pos; + + if ((pos != this._dragPlaceholderPos) && (pos <= numFavorites) && (this._animatingPlaceholdersCount == 0)) { + this._dragPlaceholderPos = pos; + + // Don't allow positioning before or after self + if ((favPos != -1) && (pos == favPos || pos == favPos + 1)) { + this._clearDragPlaceholder(); + return DND.DragMotionResult.CONTINUE; + } + + // If the placeholder already exists, we just move + // it, but if we are adding it, expand its size in + // an animation + let fadeIn; + if (this._dragPlaceholder) { + this._dragPlaceholder.destroy(); + fadeIn = false; + } + else + fadeIn = true; + + this._dragPlaceholder = new Dash.DragPlaceholderItem(); + this._dragPlaceholder.child.set_width (this.iconSize); + this._dragPlaceholder.child.set_height (this.iconSize / 2); + this._box.insert_child_at_index(this._dragPlaceholder, + this._dragPlaceholderPos); + this._dragPlaceholder.show(fadeIn); + // Ensure the next and previous icon are visible when moving the placeholder + // (I assume there's room for both of them) + if (this._dragPlaceholderPos > 1) + ensureActorVisibleInScrollView(this._scrollView, this._box.get_children()[this._dragPlaceholderPos-1]); + if (this._dragPlaceholderPos < this._box.get_children().length-1) + ensureActorVisibleInScrollView(this._scrollView, this._box.get_children()[this._dragPlaceholderPos+1]); + } + + // Remove the drag placeholder if we are not in the + // "favorites zone" + if (pos > numFavorites) + this._clearDragPlaceholder(); + + if (!this._dragPlaceholder) + return DND.DragMotionResult.NO_DROP; + + let srcIsFavorite = (favPos != -1); + + if (srcIsFavorite) + return DND.DragMotionResult.MOVE_DROP; + + return DND.DragMotionResult.COPY_DROP; + } + + /** + * Draggable target interface + */ + acceptDrop(source, actor, x, y, time) { + let app = Dash.getAppFromSource(source); + + // Don't allow favoriting of transient apps + if (app == null || app.is_window_backed()) + return false; + + if (!this._shellSettings.is_writable('favorite-apps') || + !Docking.DockManager.settings.get_boolean('show-favorites')) + return false; + + let id = app.get_id(); + + let favorites = AppFavorites.getAppFavorites().getFavoriteMap(); + + let srcIsFavorite = (id in favorites); + + let favPos = 0; + let children = this._box.get_children(); + for (let i = 0; i < this._dragPlaceholderPos; i++) { + if (this._dragPlaceholder && (children[i] == this._dragPlaceholder)) + continue; + + let childId = children[i].child._delegate.app.get_id(); + if (childId == id) + continue; + if (childId in favorites) + favPos++; + } + + // No drag placeholder means we don't wan't to favorite the app + // and we are dragging it to its original position + if (!this._dragPlaceholder) + return true; + + Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { + let appFavorites = AppFavorites.getAppFavorites(); + if (srcIsFavorite) + appFavorites.moveFavoriteToPos(id, favPos); + else + appFavorites.addFavoriteAtPos(id, favPos); + return false; + }); + + return true; + } + + get showAppsButton() { + return this._showAppsIcon.toggleButton; + } + + showShowAppsButton() { + this.showAppsButton.visible = true + this.showAppsButton.set_width(-1) + this.showAppsButton.set_height(-1) + } + + hideShowAppsButton() { + this.showAppsButton.hide() + this.showAppsButton.set_width(0) + this.showAppsButton.set_height(0) + } +}); + + +/** + * This is a copy of the same function in utils.js, but also adjust horizontal scrolling + * and perform few further cheks on the current value to avoid changing the values when + * it would be clamp to the current one in any case. + * Return the amount of shift applied + */ +function ensureActorVisibleInScrollView(scrollView, actor) { + let adjust_v = true; + let adjust_h = true; + + let vadjustment = scrollView.get_vscroll_bar().get_adjustment(); + let hadjustment = scrollView.get_hscroll_bar().get_adjustment(); + let [vvalue, vlower, vupper, vstepIncrement, vpageIncrement, vpageSize] = vadjustment.get_values(); + let [hvalue, hlower, hupper, hstepIncrement, hpageIncrement, hpageSize] = hadjustment.get_values(); + + let [hvalue0, vvalue0] = [hvalue, vvalue]; + + let voffset = 0; + let hoffset = 0; + let fade = scrollView.get_effect('fade'); + if (fade) { + voffset = fade.vfade_offset; + hoffset = fade.hfade_offset; + } + + let box = actor.get_allocation_box(); + let y1 = box.y1, y2 = box.y2, x1 = box.x1, x2 = box.x2; + + let parent = actor.get_parent(); + while (parent != scrollView) { + if (!parent) + throw new Error('Actor not in scroll view'); + + let box = parent.get_allocation_box(); + y1 += box.y1; + y2 += box.y1; + x1 += box.x1; + x2 += box.x1; + parent = parent.get_parent(); + } + + if (y1 < vvalue + voffset) + vvalue = Math.max(0, y1 - voffset); + else if (vvalue < vupper - vpageSize && y2 > vvalue + vpageSize - voffset) + vvalue = Math.min(vupper -vpageSize, y2 + voffset - vpageSize); + + if (x1 < hvalue + hoffset) + hvalue = Math.max(0, x1 - hoffset); + else if (hvalue < hupper - hpageSize && x2 > hvalue + hpageSize - hoffset) + hvalue = Math.min(hupper - hpageSize, x2 + hoffset - hpageSize); + + if (vvalue !== vvalue0) { + vadjustment.ease(vvalue, { + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + duration: Util.SCROLL_TIME + }); + } + + if (hvalue !== hvalue0) { + hadjustment.ease(hvalue, { + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + duration: Util.SCROLL_TIME + }); + } + + return [hvalue- hvalue0, vvalue - vvalue0]; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/docking.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/docking.js new file mode 100644 index 00000000..1b34cfa0 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/docking.js @@ -0,0 +1,1916 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Clutter = imports.gi.Clutter; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Gtk = imports.gi.Gtk; +const Meta = imports.gi.Meta; +const Shell = imports.gi.Shell; +const St = imports.gi.St; +const Mainloop = imports.mainloop; +const Params = imports.misc.params; + +const Main = imports.ui.main; +const Dash = imports.ui.dash; +const IconGrid = imports.ui.iconGrid; +const Overview = imports.ui.overview; +const OverviewControls = imports.ui.overviewControls; +const PointerWatcher = imports.ui.pointerWatcher; +const Signals = imports.signals; +const ViewSelector = imports.ui.viewSelector; +const WorkspaceSwitcherPopup= imports.ui.workspaceSwitcherPopup; +const Layout = imports.ui.layout; +const LayoutManager = imports.ui.main.layoutManager; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Utils = Me.imports.utils; +const Intellihide = Me.imports.intellihide; +const Theming = Me.imports.theming; +const MyDash = Me.imports.dash; +const LauncherAPI = Me.imports.launcherAPI; +const FileManager1API = Me.imports.fileManager1API; + +const DOCK_DWELL_CHECK_INTERVAL = 100; + +var State = { + HIDDEN: 0, + SHOWING: 1, + SHOWN: 2, + HIDING: 3 +}; + +const scrollAction = { + DO_NOTHING: 0, + CYCLE_WINDOWS: 1, + SWITCH_WORKSPACE: 2 +}; + +/** + * A simple St.Widget with one child whose allocation takes into account the + * slide out of its child via the _slidex parameter ([0:1]). + * + * Required since I want to track the input region of this container which is + * based on its allocation even if the child overlows the parent actor. By doing + * this the region of the dash that is slideout is not steling anymore the input + * regions making the extesion usable when the primary monitor is the right one. + * + * The slidex parameter can be used to directly animate the sliding. The parent + * must have a WEST (SOUTH) anchor_point to achieve the sliding to the RIGHT (BOTTOM) + * side. +*/ +var DashSlideContainer = GObject.registerClass({ + Properties: { + 'side': GObject.ParamSpec.enum( + 'side', 'side', 'side', + GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY, + St.Side, St.Side.LEFT), + 'slidex': GObject.ParamSpec.double( + 'slidex', 'slidex', 'slidex', + GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT, + 0, 1, 1), + } +}, class DashToDock_DashSlideContainer extends St.Widget { + + _init(params = {}) { + super._init(params); + this._child = null; + + // slide parameter: 1 = visible, 0 = hidden. + this._slidex = params.slidex || 1; + this._slideoutSize = 0; // minimum size when slided out + } + + vfunc_allocate(box, flags) { + this.set_allocation(box, flags); + + if (this._child == null) + return; + + let availWidth = box.x2 - box.x1; + let availHeight = box.y2 - box.y1; + let [, , natChildWidth, natChildHeight] = + this._child.get_preferred_size(); + + let childWidth = natChildWidth; + let childHeight = natChildHeight; + + let childBox = new Clutter.ActorBox(); + + let slideoutSize = this._slideoutSize; + + if (this.side == St.Side.LEFT) { + childBox.x1 = (this._slidex -1) * (childWidth - slideoutSize); + childBox.x2 = slideoutSize + this._slidex*(childWidth - slideoutSize); + childBox.y1 = 0; + childBox.y2 = childBox.y1 + childHeight; + } + else if ((this.side == St.Side.RIGHT) || (this.side == St.Side.BOTTOM)) { + childBox.x1 = 0; + childBox.x2 = childWidth; + childBox.y1 = 0; + childBox.y2 = childBox.y1 + childHeight; + } + else if (this.side == St.Side.TOP) { + childBox.x1 = 0; + childBox.x2 = childWidth; + childBox.y1 = (this._slidex -1) * (childHeight - slideoutSize); + childBox.y2 = slideoutSize + this._slidex * (childHeight - slideoutSize); + } + + this._child.allocate(childBox, flags); + this._child.set_clip(-childBox.x1, -childBox.y1, + -childBox.x1+availWidth, -childBox.y1 + availHeight); + } + + /** + * Just the child width but taking into account the slided out part + */ + vfunc_get_preferred_width(forHeight) { + let [minWidth, natWidth] = this._child.get_preferred_width(forHeight); + if ((this.side == St.Side.LEFT) || (this.side == St.Side.RIGHT)) { + minWidth = (minWidth - this._slideoutSize) * this._slidex + this._slideoutSize; + natWidth = (natWidth - this._slideoutSize) * this._slidex + this._slideoutSize; + } + return [minWidth, natWidth]; + } + + /** + * Just the child height but taking into account the slided out part + */ + vfunc_get_preferred_height(forWidth) { + let [minHeight, natHeight] = this._child.get_preferred_height(forWidth); + if ((this.side == St.Side.TOP) || (this.side == St.Side.BOTTOM)) { + minHeight = (minHeight - this._slideoutSize) * this._slidex + this._slideoutSize; + natHeight = (natHeight - this._slideoutSize) * this._slidex + this._slideoutSize; + } + return [minHeight, natHeight]; + } + + /** + * I was expecting it to be a virtual function... stil I don't understand + * how things work. + */ + add_child(actor) { + // I'm supposed to have only on child + if (this._child !== null) + this.remove_child(actor); + + this._child = actor; + super.add_child(actor); + } + + set slidex(value) { + if (value == this._slidex) + return; + + this._slidex = value; + this.notify('slidex'); + + if (this._child) + this._child.queue_relayout(); + } + + get slidex() { + return this._slidex; + } +}); + +var DockedDash = GObject.registerClass({ + Signals: { + 'showing': {}, + 'hiding': {}, + } +}, class DashToDock extends St.Bin { + + _init(remoteModel, monitorIndex) { + this._rtl = (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL); + + // Load settings + let settings = DockManager.settings; + this._remoteModel = remoteModel; + this._monitorIndex = monitorIndex; + // Connect global signals + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._bindSettingsChanges(); + + this._position = Utils.getPosition(); + this._isHorizontal = ((this._position == St.Side.TOP) || (this._position == St.Side.BOTTOM)); + + // Temporary ignore hover events linked to autohide for whatever reason + this._ignoreHover = false; + this._oldignoreHover = null; + // This variables are linked to the settings regardles of autohide or intellihide + // being temporary disable. Get set by _updateVisibilityMode; + this._autohideIsEnabled = null; + this._intellihideIsEnabled = null; + this._fixedIsEnabled = null; + + // Create intellihide object to monitor windows overlapping + this._intellihide = new Intellihide.Intellihide(this._monitorIndex); + + // initialize dock state + this._dockState = State.HIDDEN; + + // Put dock on the required monitor + this._monitor = Main.layoutManager.monitors[this._monitorIndex]; + + // this store size and the position where the dash is shown; + // used by intellihide module to check window overlap. + this.staticBox = new Clutter.ActorBox(); + + // Initialize pressure barrier variables + this._canUsePressure = false; + this._pressureBarrier = null; + this._barrier = null; + this._removeBarrierTimeoutId = 0; + + // Initialize dwelling system variables + this._dockDwelling = false; + this._dockWatch = null; + this._dockDwellUserTime = 0; + this._dockDwellTimeoutId = 0 + + // Create a new dash object + this.dash = new MyDash.MyDash(this._remoteModel, this._monitorIndex); + + if (!settings.get_boolean('show-show-apps-button')) + this.dash.hideShowAppsButton(); + + // Create the main actor and the containers for sliding in and out and + // centering, turn on track hover + + let positionStyleClass = ['top', 'right', 'bottom', 'left']; + // This is the centering actor + super._init({ + name: 'dashtodockContainer', + reactive: false, + style_class: positionStyleClass[this._position], + x_align: this._isHorizontal?St.Align.MIDDLE:St.Align.START, + y_align: this._isHorizontal?St.Align.START:St.Align.MIDDLE + }); + this._delegate = this; + + // This is the sliding actor whose allocation is to be tracked for input regions + this._slider = new DashSlideContainer({ + side: this._position, + slidex: 0 + }); + + // This is the actor whose hover status us tracked for autohide + this._box = new St.BoxLayout({ + name: 'dashtodockBox', + reactive: true, + track_hover: true + }); + this._box.connect('notify::hover', this._hoverChanged.bind(this)); + + // Create and apply height constraint to the dash. It's controlled by this.height + this.constrainSize = new Clutter.BindConstraint({ + source: this, + coordinate: this._isHorizontal?Clutter.BindCoordinate.WIDTH:Clutter.BindCoordinate.HEIGHT + }); + this.dash.add_constraint(this.constrainSize); + + this._signalsHandler.add([ + Main.overview, + 'item-drag-begin', + this._onDragStart.bind(this) + ], [ + Main.overview, + 'item-drag-end', + this._onDragEnd.bind(this) + ], [ + Main.overview, + 'item-drag-cancelled', + this._onDragEnd.bind(this) + ], [ + // update when workarea changes, for instance if other extensions modify the struts + //(like moving th panel at the bottom) + global.display, + 'workareas-changed', + this._resetPosition.bind(this) + ], [ + Main.overview, + 'showing', + this._onOverviewShowing.bind(this) + ], [ + Main.overview, + 'hiding', + this._onOverviewHiding.bind(this) + ], [ + // Hide on appview + Main.overview.viewSelector, + 'page-changed', + this._pageChanged.bind(this) + ], [ + Main.overview.viewSelector, + 'page-empty', + this._onPageEmpty.bind(this) + ], [ + // Ensure the ShowAppsButton status is kept in sync + Main.overview.viewSelector._showAppsButton, + 'notify::checked', + this._syncShowAppsButtonToggled.bind(this) + ], [ + global.display, + 'in-fullscreen-changed', + this._updateBarrier.bind(this) + ], [ + // Monitor windows overlapping + this._intellihide, + 'status-changed', + this._updateDashVisibility.bind(this) + ], [ + // Keep dragged icon consistent in size with this dash + this.dash, + 'icon-size-changed', + () => { Main.overview.dashIconSize = this.dash.iconSize; } + ], [ + // This duplicate the similar signal which is in owerview.js. + // Being connected and thus executed later this effectively + // overwrite any attempt to use the size of the default dash + //which given the customization is usually much smaller. + // I can't easily disconnect the original signal + Main.overview._controls.dash, + 'icon-size-changed', + () => { Main.overview.dashIconSize = this.dash.iconSize; } + ], [ + // sync hover after a popupmenu is closed + this.dash, + 'menu-closed', + () => { this._box.sync_hover() } + ]); + + this._injectionsHandler = new Utils.InjectionsHandler(); + this._themeManager = new Theming.ThemeManager(this); + + // Since the actor is not a topLevel child and its parent is now not added to the Chrome, + // the allocation change of the parent container (slide in and slideout) doesn't trigger + // anymore an update of the input regions. Force the update manually. + this.connect('notify::allocation', + Main.layoutManager._queueUpdateRegions.bind(Main.layoutManager)); + + this.dash._container.connect('allocation-changed', this._updateStaticBox.bind(this)); + this._slider.connect(this._isHorizontal ? 'notify::x' : 'notify::y', this._updateStaticBox.bind(this)); + + // Load optional features that need to be activated for one dock only + if (this._monitorIndex == settings.get_int('preferred-monitor')) + this._enableExtraFeatures(); + // Load optional features that need to be activated once per dock + this._optionalScrollWorkspaceSwitch(); + + // Delay operations that require the shell to be fully loaded and with + // user theme applied. + + this._paintId = this.connect('paint', this._initialize.bind(this)); + + // Manage the which is used to reserve space in the overview for the dock + // Add and additional dashSpacer positioned according to the dash positioning. + // It gets restored on extension unload. + this._dashSpacer = new OverviewControls.DashSpacer(); + this._dashSpacer.setDashActor(this._box); + + if (this._position == St.Side.LEFT) + Main.overview._controls._group.insert_child_at_index(this._dashSpacer, this._rtl ? -1 : 0); // insert on first + else if (this._position == St.Side.RIGHT) + Main.overview._controls._group.insert_child_at_index(this._dashSpacer, this._rtl ? 0 : -1); // insert on last + else if (this._position == St.Side.TOP) + Main.overview._overview.insert_child_at_index(this._dashSpacer, 0); + else if (this._position == St.Side.BOTTOM) + Main.overview._overview.insert_child_at_index(this._dashSpacer, -1); + + // Add dash container actor and the container to the Chrome. + this.set_child(this._slider); + this._slider.add_child(this._box); + this._box.add_actor(this.dash); + + // Add aligning container without tracking it for input region + Main.uiGroup.add_child(this); + + if (settings.get_boolean('dock-fixed')) { + // Note: tracking the fullscreen directly on the slider actor causes some hiccups when fullscreening + // windows of certain applications + Main.layoutManager._trackActor(this, {affectsInputRegion: false, trackFullscreen: true}); + Main.layoutManager._trackActor(this._slider, {affectsStruts: true}); + } + else + Main.layoutManager._trackActor(this._slider); + + // Set initial position + this._resetDepth(); + this._resetPosition(); + + this.connect('destroy', this._onDestroy.bind(this)); + } + + _initialize() { + if (this._paintId > 0) { + this.disconnect(this._paintId); + this._paintId=0; + } + + // Apply custome css class according to the settings + this._themeManager.updateCustomTheme(); + + // Since Gnome 3.8 dragging an app without having opened the overview before cause the attemp to + //animate a null target since some variables are not initialized when the viewSelector is created + if (Main.overview.viewSelector._activePage == null) + Main.overview.viewSelector._activePage = Main.overview.viewSelector._workspacesPage; + + this._updateVisibilityMode(); + + // In case we are already inside the overview when the extension is loaded, + // for instance on unlocking the screen if it was locked with the overview open. + if (Main.overview.visibleTarget) { + this._onOverviewShowing(); + this._pageChanged(); + } + + // Setup pressure barrier (GS38+ only) + this._updatePressureBarrier(); + this._updateBarrier(); + + // setup dwelling system if pressure barriers are not available + this._setupDockDwellIfNeeded(); + } + + _onDestroy() { + // Disconnect global signals + this._signalsHandler.destroy(); + // The dash, intellihide and themeManager have global signals as well internally + this.dash.destroy(); + this._intellihide.destroy(); + this._themeManager.destroy(); + + this._injectionsHandler.destroy(); + + // Remove barrier timeout + if (this._removeBarrierTimeoutId > 0) + Mainloop.source_remove(this._removeBarrierTimeoutId); + + // Remove existing barrier + this._removeBarrier(); + + // Remove pointer watcher + if (this._dockWatch) { + PointerWatcher.getPointerWatcher()._removeWatch(this._dockWatch); + this._dockWatch = null; + } + + // Remove the dashSpacer + this._dashSpacer.destroy(); + } + + _bindSettingsChanges() { + let settings = DockManager.settings; + this._signalsHandler.add([ + settings, + 'changed::scroll-action', + () => { this._optionalScrollWorkspaceSwitch(); } + ], [ + settings, + 'changed::dash-max-icon-size', + () => { this.dash.setIconSize(settings.get_int('dash-max-icon-size')); } + ], [ + settings, + 'changed::icon-size-fixed', + () => { this.dash.setIconSize(settings.get_int('dash-max-icon-size')); } + ], [ + settings, + 'changed::show-favorites', + () => { this.dash.resetAppIcons(); } + ], [ + settings, + 'changed::show-trash', + () => { this.dash.resetAppIcons(); }, + Utils.SignalsHandlerFlags.CONNECT_AFTER, + ], [ + settings, + 'changed::show-mounts', + () => { this.dash.resetAppIcons(); }, + Utils.SignalsHandlerFlags.CONNECT_AFTER + ], [ + settings, + 'changed::show-running', + () => { this.dash.resetAppIcons(); } + ], [ + settings, + 'changed::show-apps-at-top', + () => { this.dash.resetAppIcons(); } + ], [ + settings, + 'changed::show-show-apps-button', + () => { + if (settings.get_boolean('show-show-apps-button')) + this.dash.showShowAppsButton(); + else + this.dash.hideShowAppsButton(); + } + ], [ + settings, + 'changed::dock-fixed', + () => { + if (settings.get_boolean('dock-fixed')) { + Main.layoutManager._untrackActor(this); + Main.layoutManager._trackActor(this, {affectsInputRegion: false, trackFullscreen: true}); + Main.layoutManager._untrackActor(this._slider); + Main.layoutManager._trackActor(this._slider, {affectsStruts: true}); + } else { + Main.layoutManager._untrackActor(this); + Main.layoutManager._untrackActor(this._slider); + Main.layoutManager._trackActor(this._slider); + } + + this._resetPosition(); + + // Add or remove barrier depending on if dock-fixed + this._updateBarrier(); + + this._updateVisibilityMode(); + } + ], [ + settings, + 'changed::intellihide', + this._updateVisibilityMode.bind(this) + ], [ + settings, + 'changed::intellihide-mode', + () => { this._intellihide.forceUpdate(); } + ], [ + settings, + 'changed::autohide', + () => { + this._updateVisibilityMode(); + this._updateBarrier(); + } + ], [ + settings, + 'changed::autohide-in-fullscreen', + this._updateBarrier.bind(this) + ], + [ + settings, + 'changed::extend-height', + this._resetPosition.bind(this) + ], [ + settings, + 'changed::height-fraction', + this._resetPosition.bind(this) + ], [ + settings, + 'changed::require-pressure-to-show', + () => { + // Remove pointer watcher + if (this._dockWatch) { + PointerWatcher.getPointerWatcher()._removeWatch(this._dockWatch); + this._dockWatch = null; + } + this._setupDockDwellIfNeeded(); + this._updateBarrier(); + } + ], [ + settings, + 'changed::pressure-threshold', + () => { + this._updatePressureBarrier(); + this._updateBarrier(); + } + ]); + + } + + /** + * This is call when visibility settings change + */ + _updateVisibilityMode() { + let settings = DockManager.settings; + if (settings.get_boolean('dock-fixed')) { + this._fixedIsEnabled = true; + this._autohideIsEnabled = false; + this._intellihideIsEnabled = false; + } + else { + this._fixedIsEnabled = false; + this._autohideIsEnabled = settings.get_boolean('autohide') + this._intellihideIsEnabled = settings.get_boolean('intellihide') + } + + if (this._intellihideIsEnabled) + this._intellihide.enable(); + else + this._intellihide.disable(); + + this._updateDashVisibility(); + } + + /** + * Show/hide dash based on, in order of priority: + * overview visibility + * fixed mode + * intellihide + * autohide + * overview visibility + */ + _updateDashVisibility() { + if (Main.overview.visibleTarget) + return; + + let settings = DockManager.settings; + + if (this._fixedIsEnabled) { + this._removeAnimations(); + this._animateIn(settings.get_double('animation-time'), 0); + } + else if (this._intellihideIsEnabled) { + if (this._intellihide.getOverlapStatus()) { + this._ignoreHover = false; + // Do not hide if autohide is enabled and mouse is hover + if (!this._box.hover || !this._autohideIsEnabled) + this._animateOut(settings.get_double('animation-time'), 0); + } + else { + this._ignoreHover = true; + this._removeAnimations(); + this._animateIn(settings.get_double('animation-time'), 0); + } + } + else { + if (this._autohideIsEnabled) { + this._ignoreHover = false; + global.sync_pointer(); + + if (this._box.hover) + this._animateIn(settings.get_double('animation-time'), 0); + else + this._animateOut(settings.get_double('animation-time'), 0); + } + else + this._animateOut(settings.get_double('animation-time'), 0); + } + } + + _onOverviewShowing() { + this._ignoreHover = true; + this._intellihide.disable(); + this._removeAnimations(); + this._animateIn(DockManager.settings.get_double('animation-time'), 0); + } + + _onOverviewHiding() { + this._ignoreHover = false; + this._intellihide.enable(); + this._updateDashVisibility(); + } + + _hoverChanged() { + if (!this._ignoreHover) { + // Skip if dock is not in autohide mode for instance because it is shown + // by intellihide. + if (this._autohideIsEnabled) { + if (this._box.hover) + this._show(); + else + this._hide(); + } + } + } + + getDockState() { + return this._dockState; + } + + _show() { + if ((this._dockState == State.HIDDEN) || (this._dockState == State.HIDING)) { + if (this._dockState == State.HIDING) + // suppress all potential queued transitions - i.e. added but not started, + // always give priority to show + this._removeAnimations(); + + this.emit('showing'); + this._animateIn(DockManager.settings.get_double('animation-time'), 0); + } + } + + _hide() { + // If no hiding animation is running or queued + if ((this._dockState == State.SHOWN) || (this._dockState == State.SHOWING)) { + let settings = DockManager.settings; + let delay; + + if (this._dockState == State.SHOWING) + //if a show already started, let it finish; queue hide without removing the show. + // to obtain this I increase the delay to avoid the overlap and interference + // between the animations + delay = settings.get_double('hide-delay') + settings.get_double('animation-time'); + else + delay = settings.get_double('hide-delay'); + + this.emit('hiding'); + this._animateOut(settings.get_double('animation-time'), delay); + } + } + + _animateIn(time, delay) { + this._dockState = State.SHOWING; + + this._slider.ease_property('slidex', 1, { + duration: time * 1000, + delay: delay * 1000, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => { + this._dockState = State.SHOWN; + // Remove barrier so that mouse pointer is released and can access monitors on other side of dock + // NOTE: Delay needed to keep mouse from moving past dock and re-hiding dock immediately. This + // gives users an opportunity to hover over the dock + if (this._removeBarrierTimeoutId > 0) + Mainloop.source_remove(this._removeBarrierTimeoutId); + this._removeBarrierTimeoutId = Mainloop.timeout_add(100, this._removeBarrier.bind(this)); + } + }); + } + + _animateOut(time, delay) { + this._dockState = State.HIDING; + + this._slider.ease_property('slidex', 0, { + duration: time * 1000, + delay: delay * 1000, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => { + this._dockState = State.HIDDEN; + // Remove queued barried removal if any + if (this._removeBarrierTimeoutId > 0) + Mainloop.source_remove(this._removeBarrierTimeoutId); + this._updateBarrier(); + } + }); + } + + /** + * Dwelling system based on the GNOME Shell 3.14 messageTray code. + */ + _setupDockDwellIfNeeded() { + // If we don't have extended barrier features, then we need + // to support the old tray dwelling mechanism. + if (!global.display.supports_extended_barriers() || + !DockManager.settings.get_boolean('require-pressure-to-show')) { + let pointerWatcher = PointerWatcher.getPointerWatcher(); + this._dockWatch = pointerWatcher.addWatch(DOCK_DWELL_CHECK_INTERVAL, this._checkDockDwell.bind(this)); + this._dockDwelling = false; + this._dockDwellUserTime = 0; + } + } + + _checkDockDwell(x, y) { + + let workArea = Main.layoutManager.getWorkAreaForMonitor(this._monitor.index) + let shouldDwell; + // Check for the correct screen edge, extending the sensitive area to the whole workarea, + // minus 1 px to avoid conflicting with other active corners. + if (this._position == St.Side.LEFT) + shouldDwell = (x == this._monitor.x) && (y > workArea.y) && (y < workArea.y + workArea.height); + else if (this._position == St.Side.RIGHT) + shouldDwell = (x == this._monitor.x + this._monitor.width - 1) && (y > workArea.y) && (y < workArea.y + workArea.height); + else if (this._position == St.Side.TOP) + shouldDwell = (y == this._monitor.y) && (x > workArea.x) && (x < workArea.x + workArea.width); + else if (this._position == St.Side.BOTTOM) + shouldDwell = (y == this._monitor.y + this._monitor.height - 1) && (x > workArea.x) && (x < workArea.x + workArea.width); + + if (shouldDwell) { + // We only set up dwell timeout when the user is not hovering over the dock + // already (!this._box.hover). + // The _dockDwelling variable is used so that we only try to + // fire off one dock dwell - if it fails (because, say, the user has the mouse down), + // we don't try again until the user moves the mouse up and down again. + if (!this._dockDwelling && !this._box.hover && (this._dockDwellTimeoutId == 0)) { + // Save the interaction timestamp so we can detect user input + let focusWindow = global.display.focus_window; + this._dockDwellUserTime = focusWindow ? focusWindow.user_time : 0; + + this._dockDwellTimeoutId = Mainloop.timeout_add(DockManager.settings.get_double('show-delay') * 1000, + this._dockDwellTimeout.bind(this)); + GLib.Source.set_name_by_id(this._dockDwellTimeoutId, '[dash-to-dock] this._dockDwellTimeout'); + } + this._dockDwelling = true; + } + else { + this._cancelDockDwell(); + this._dockDwelling = false; + } + } + + _cancelDockDwell() { + if (this._dockDwellTimeoutId != 0) { + Mainloop.source_remove(this._dockDwellTimeoutId); + this._dockDwellTimeoutId = 0; + } + } + + _dockDwellTimeout() { + this._dockDwellTimeoutId = 0; + + if (!DockManager.settings.get_boolean('autohide-in-fullscreen') && + this._monitor.inFullscreen) + return GLib.SOURCE_REMOVE; + + // We don't want to open the tray when a modal dialog + // is up, so we check the modal count for that. When we are in the + // overview we have to take the overview's modal push into account + if (Main.modalCount > (Main.overview.visible ? 1 : 0)) + return GLib.SOURCE_REMOVE; + + // If the user interacted with the focus window since we started the tray + // dwell (by clicking or typing), don't activate the message tray + let focusWindow = global.display.focus_window; + let currentUserTime = focusWindow ? focusWindow.user_time : 0; + if (currentUserTime != this._dockDwellUserTime) + return GLib.SOURCE_REMOVE; + + // Reuse the pressure version function, the logic is the same + this._onPressureSensed(); + return GLib.SOURCE_REMOVE; + } + + _updatePressureBarrier() { + let settings = DockManager.settings; + this._canUsePressure = global.display.supports_extended_barriers(); + let pressureThreshold = settings.get_double('pressure-threshold'); + + // Remove existing pressure barrier + if (this._pressureBarrier) { + this._pressureBarrier.destroy(); + this._pressureBarrier = null; + } + + if (this._barrier) { + this._barrier.destroy(); + this._barrier = null; + } + + // Create new pressure barrier based on pressure threshold setting + if (this._canUsePressure) { + this._pressureBarrier = new Layout.PressureBarrier(pressureThreshold, settings.get_double('show-delay')*1000, + Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW); + this._pressureBarrier.connect('trigger', (barrier) => { + if (!settings.get_boolean('autohide-in-fullscreen') && this._monitor.inFullscreen) + return; + this._onPressureSensed(); + }); + } + } + + /** + * handler for mouse pressure sensed + */ + _onPressureSensed() { + if (Main.overview.visibleTarget) + return; + + // In case the mouse move away from the dock area before hovering it, in such case the leave event + // would never be triggered and the dock would stay visible forever. + let triggerTimeoutId = Mainloop.timeout_add(250, () => { + triggerTimeoutId = 0; + + let [x, y, mods] = global.get_pointer(); + let shouldHide = true; + switch (this._position) { + case St.Side.LEFT: + if (x <= this.staticBox.x2 && + x >= this._monitor.x && + y >= this._monitor.y && + y <= this._monitor.y + this._monitor.height) { + shouldHide = false; + } + break; + case St.Side.RIGHT: + if (x >= this.staticBox.x1 && + x <= this._monitor.x + this._monitor.width && + y >= this._monitor.y && + y <= this._monitor.y + this._monitor.height) { + shouldHide = false; + } + break; + case St.Side.TOP: + if (x >= this._monitor.x && + x <= this._monitor.x + this._monitor.width && + y <= this.staticBox.y2 && + y >= this._monitor.y) { + shouldHide = false; + } + break; + case St.Side.BOTTOM: + if (x >= this._monitor.x && + x <= this._monitor.x + this._monitor.width && + y >= this.staticBox.y1 && + y <= this._monitor.y + this._monitor.height) { + shouldHide = false; + } + } + if (shouldHide) { + this._hoverChanged(); + return GLib.SOURCE_REMOVE; + } + else { + return GLib.SOURCE_CONTINUE; + } + + }); + + this._show(); + } + + /** + * Remove pressure barrier + */ + _removeBarrier() { + if (this._barrier) { + if (this._pressureBarrier) + this._pressureBarrier.removeBarrier(this._barrier); + this._barrier.destroy(); + this._barrier = null; + } + this._removeBarrierTimeoutId = 0; + return false; + } + + /** + * Update pressure barrier size + */ + _updateBarrier() { + // Remove existing barrier + this._removeBarrier(); + + // The barrier needs to be removed in fullscreen with autohide disabled, otherwise the mouse can + // get trapped on monitor. + if (this._monitor.inFullscreen && + !DockManager.settings.get_boolean('autohide-in-fullscreen')) + return + + // Manually reset pressure barrier + // This is necessary because we remove the pressure barrier when it is triggered to show the dock + if (this._pressureBarrier) { + this._pressureBarrier._reset(); + this._pressureBarrier._isTriggered = false; + } + + // Create new barrier + // The barrier extends to the whole workarea, minus 1 px to avoid conflicting with other active corners + // Note: dash in fixed position doesn't use pressure barrier. + if (this._canUsePressure && this._autohideIsEnabled && + DockManager.settings.get_boolean('require-pressure-to-show')) { + let x1, x2, y1, y2, direction; + let workArea = Main.layoutManager.getWorkAreaForMonitor(this._monitor.index) + + if (this._position == St.Side.LEFT) { + x1 = this._monitor.x + 1; + x2 = x1; + y1 = workArea.y + 1; + y2 = workArea.y + workArea.height - 1; + direction = Meta.BarrierDirection.POSITIVE_X; + } + else if (this._position == St.Side.RIGHT) { + x1 = this._monitor.x + this._monitor.width - 1; + x2 = x1; + y1 = workArea.y + 1; + y2 = workArea.y + workArea.height - 1; + direction = Meta.BarrierDirection.NEGATIVE_X; + } + else if (this._position == St.Side.TOP) { + x1 = workArea.x + 1; + x2 = workArea.x + workArea.width - 1; + y1 = this._monitor.y; + y2 = y1; + direction = Meta.BarrierDirection.POSITIVE_Y; + } + else if (this._position == St.Side.BOTTOM) { + x1 = workArea.x + 1; + x2 = workArea.x + workArea.width - 1; + y1 = this._monitor.y + this._monitor.height; + y2 = y1; + direction = Meta.BarrierDirection.NEGATIVE_Y; + } + + this._barrier = new Meta.Barrier({ + display: global.display, + x1: x1, + x2: x2, + y1: y1, + y2: y2, + directions: direction + }); + if (this._pressureBarrier) + this._pressureBarrier.addBarrier(this._barrier); + } + } + + _isPrimaryMonitor() { + return (this._monitorIndex == Main.layoutManager.primaryIndex); + } + + _resetPosition() { + // Ensure variables linked to settings are updated. + this._updateVisibilityMode(); + + let extendHeight = DockManager.settings.get_boolean('extend-height'); + + // Note: do not use the workarea coordinates in the direction on which the dock is placed, + // to avoid a loop [position change -> workArea change -> position change] with + // fixed dock. + let workArea = Main.layoutManager.getWorkAreaForMonitor(this._monitorIndex); + + // Reserve space for the dash on the overview + // if the dock is on the primary monitor + if (this._isPrimaryMonitor()) + this._dashSpacer.show(); + else + // No space is required in the overview of the dash + this._dashSpacer.hide(); + + let fraction = DockManager.settings.get_double('height-fraction'); + + if (extendHeight) + fraction = 1; + else if ((fraction < 0) || (fraction > 1)) + fraction = 0.95; + + let anchor_point; + + if (this._isHorizontal) { + this.width = Math.round(fraction * workArea.width); + + let pos_y; + if (this._position == St.Side.BOTTOM) { + pos_y = this._monitor.y + this._monitor.height; + anchor_point = Clutter.Gravity.SOUTH_WEST; + } + else { + pos_y = this._monitor.y; + anchor_point = Clutter.Gravity.NORTH_WEST; + } + + this.move_anchor_point_from_gravity(anchor_point); + this.x = workArea.x + Math.round((1 - fraction) / 2 * workArea.width); + this.y = pos_y; + + if (extendHeight) { + this.dash._container.set_width(this.width); + this.add_style_class_name('extended'); + } + else { + this.dash._container.set_width(-1); + this.remove_style_class_name('extended'); + } + } + else { + this.height = Math.round(fraction * workArea.height); + + let pos_x; + if (this._position == St.Side.RIGHT) { + pos_x = this._monitor.x + this._monitor.width; + anchor_point = Clutter.Gravity.NORTH_EAST; + } + else { + pos_x = this._monitor.x; + anchor_point = Clutter.Gravity.NORTH_WEST; + } + + this.move_anchor_point_from_gravity(anchor_point); + this.x = pos_x; + this.y = workArea.y + Math.round((1 - fraction) / 2 * workArea.height); + + if (extendHeight) { + this.dash._container.set_height(this.height); + this.add_style_class_name('extended'); + } + else { + this.dash._container.set_height(-1); + this.remove_style_class_name('extended'); + } + } + + this._y0 = this.y; + } + + // Set the dash at the correct depth in z + _resetDepth() { + // Keep the dash below the modalDialogGroup + Main.layoutManager.uiGroup.set_child_below_sibling(this, Main.layoutManager.modalDialogGroup); + } + + _updateStaticBox() { + this.staticBox.init_rect( + this.x + this._slider.x - (this._position == St.Side.RIGHT ? this._box.width : 0), + this.y + this._slider.y - (this._position == St.Side.BOTTOM ? this._box.height : 0), + this._box.width, + this._box.height + ); + + this._intellihide.updateTargetBox(this.staticBox); + } + + _removeAnimations() { + this._slider.remove_all_transitions(); + } + + _onDragStart() { + // The dash need to be above the top_window_group, otherwise it doesn't + // accept dnd of app icons when not in overiew mode. + Main.layoutManager.uiGroup.set_child_above_sibling(this, global.top_window_group); + this._oldignoreHover = this._ignoreHover; + this._ignoreHover = true; + this._animateIn(DockManager.settings.get_double('animation-time'), 0); + } + + _onDragEnd() { + // Restore drag default dash stack order + this._resetDepth(); + if (this._oldignoreHover !== null) + this._ignoreHover = this._oldignoreHover; + this._oldignoreHover = null; + this._box.sync_hover(); + if (Main.overview._shown) + this._pageChanged(); + } + + _pageChanged() { + let activePage = Main.overview.viewSelector.getActivePage(); + let dashVisible = (activePage == ViewSelector.ViewPage.WINDOWS || + activePage == ViewSelector.ViewPage.APPS); + + if (dashVisible) + this._animateIn(DockManager.settings.get_double('animation-time'), 0); + else + this._animateOut(DockManager.settings.get_double('animation-time'), 0); + } + + _onPageEmpty() { + /* The dash spacer is required only in the WINDOWS view if in the default position. + * The 'page-empty' signal is emitted in between a change of view, + * signalling the spacer can be added and removed without visible effect, + * as it's done for the upstream dashSpacer. + * + * Moreover, hiding the spacer ensure the appGrid allocaton is triggered. + * This matter as the appview spring animation is triggered by to first reallocaton of the appGrid, + * (See appDisplay.js, line 202 on GNOME Shell 3.14: + * this._grid.actor.connect('notify::allocation', ...) + * which in turn seems to be triggered by changes in the other actors in the overview. + * Normally, as far as I could understand, either the dashSpacer being hidden or the workspacesThumbnails + * sliding out would trigger the allocation. However, with no stock dash + * and no thumbnails, which happen if the user configured only 1 and static workspace, + * the animation out of icons is not played. + */ + + let activePage = Main.overview.viewSelector.getActivePage(); + this._dashSpacer.visible = (this._isHorizontal || activePage == ViewSelector.ViewPage.WINDOWS); + } + + /** + * Show dock and give key focus to it + */ + _onAccessibilityFocus() { + this._box.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false); + this._animateIn(DockManager.settings.get_double('animation-time'), 0); + } + + /** + * Keep ShowAppsButton status in sync with the overview status + */ + _syncShowAppsButtonToggled() { + let status = Main.overview.viewSelector._showAppsButton.checked; + if (this.dash.showAppsButton.checked !== status) + this.dash.showAppsButton.checked = status; + } + + // Optional features to be enabled only for the main Dock + _enableExtraFeatures() { + // Restore dash accessibility + Main.ctrlAltTabManager.addGroup( + this.dash, _('Dash'), 'user-bookmarks-symbolic', + {focusCallback: this._onAccessibilityFocus.bind(this)}); + } + + /** + * Switch workspace by scrolling over the dock + */ + _optionalScrollWorkspaceSwitch() { + let label = 'optionalScrollWorkspaceSwitch'; + + function isEnabled() { + return DockManager.settings.get_enum('scroll-action') === scrollAction.SWITCH_WORKSPACE; + } + + DockManager.settings.connect('changed::scroll-action', () => { + if (isEnabled.bind(this)()) + enable.bind(this)(); + else + disable.bind(this)(); + }); + + if (isEnabled.bind(this)()) + enable.bind(this)(); + + function enable() { + this._signalsHandler.removeWithLabel(label); + + this._signalsHandler.addWithLabel(label, [ + this._box, + 'scroll-event', + onScrollEvent.bind(this) + ]); + } + + function disable() { + this._signalsHandler.removeWithLabel(label); + + if (this._optionalScrollWorkspaceSwitchDeadTimeId) { + Mainloop.source_remove(this._optionalScrollWorkspaceSwitchDeadTimeId); + this._optionalScrollWorkspaceSwitchDeadTimeId = 0; + } + } + + // This was inspired to desktop-scroller@obsidien.github.com + function onScrollEvent(actor, event) { + // When in overview change workscape only in windows view + if (Main.overview.visible && Main.overview.viewSelector.getActivePage() !== ViewSelector.ViewPage.WINDOWS) + return false; + + let activeWs = global.workspace_manager.get_active_workspace(); + let direction = null; + + switch (event.get_scroll_direction()) { + case Clutter.ScrollDirection.UP: + direction = Meta.MotionDirection.UP; + break; + case Clutter.ScrollDirection.DOWN: + direction = Meta.MotionDirection.DOWN; + break; + case Clutter.ScrollDirection.SMOOTH: + let [dx, dy] = event.get_scroll_delta(); + if (dy < 0) + direction = Meta.MotionDirection.UP; + else if (dy > 0) + direction = Meta.MotionDirection.DOWN; + break; + } + + if (direction !== null) { + // Prevent scroll events from triggering too many workspace switches + // by adding a 250ms deadtime between each scroll event. + // Usefull on laptops when using a touchpad. + + // During the deadtime do nothing + if (this._optionalScrollWorkspaceSwitchDeadTimeId) + return false; + else + this._optionalScrollWorkspaceSwitchDeadTimeId = Mainloop.timeout_add(250, () => { + this._optionalScrollWorkspaceSwitchDeadTimeId = 0; + }); + + let ws; + + ws = activeWs.get_neighbor(direction) + + if (Main.wm._workspaceSwitcherPopup == null) + Main.wm._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); + // Set the actor non reactive, so that it doesn't prevent the + // clicks events from reaching the dash actor. I can't see a reason + // why it should be reactive. + Main.wm._workspaceSwitcherPopup.actor.reactive = false; + Main.wm._workspaceSwitcherPopup.connect('destroy', function() { + Main.wm._workspaceSwitcherPopup = null; + }); + + // Do not show wokspaceSwithcer in overview + if (!Main.overview.visible) + Main.wm._workspaceSwitcherPopup.display(direction, ws.index()); + Main.wm.actionMoveWorkspace(ws); + + return true; + } + else + return false; + } + } + + _activateApp(appIndex) { + let children = this.dash._box.get_children().filter(function(actor) { + return actor.child && + actor.child._delegate && + actor.child._delegate.app; + }); + + // Apps currently in the dash + let apps = children.map(function(actor) { + return actor.child._delegate; + }); + + // Activate with button = 1, i.e. same as left click + let button = 1; + if (appIndex < apps.length) + apps[appIndex].activate(button); + } +}); + +/* + * Handle keybaord shortcuts + */ +const DashToDock_KeyboardShortcuts_NUM_HOTKEYS = 10; + +var KeyboardShortcuts = class DashToDock_KeyboardShortcuts { + + constructor(allDocks){ + this._allDocks = allDocks; + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._hotKeysEnabled = false; + if (DockManager.settings.get_boolean('hot-keys')) + this._enableHotKeys(); + + this._signalsHandler.add([ + DockManager.settings, + 'changed::hot-keys', + () => { + if (DockManager.settings.get_boolean('hot-keys')) + this._enableHotKeys.bind(this)(); + else + this._disableHotKeys.bind(this)(); + } + ]); + + this._optionalNumberOverlay(); + } + + destroy() { + // Remove keybindings + this._disableHotKeys(); + this._disableExtraShortcut(); + this._signalsHandler.destroy(); + } + + _enableHotKeys() { + if (this._hotKeysEnabled) + return; + + // Setup keyboard bindings for dash elements + let keys = ['app-hotkey-', 'app-shift-hotkey-', 'app-ctrl-hotkey-']; + keys.forEach( function(key) { + for (let i = 0; i < DashToDock_KeyboardShortcuts_NUM_HOTKEYS; i++) { + let appNum = i; + Main.wm.addKeybinding(key + (i + 1), DockManager.settings, + Meta.KeyBindingFlags.NONE, + Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, + () => { + this._allDocks[0]._activateApp(appNum); + this._showOverlay(); + }); + } + }, this); + + this._hotKeysEnabled = true; + } + + _disableHotKeys() { + if (!this._hotKeysEnabled) + return; + + let keys = ['app-hotkey-', 'app-shift-hotkey-', 'app-ctrl-hotkey-']; + keys.forEach( function(key) { + for (let i = 0; i < DashToDock_KeyboardShortcuts_NUM_HOTKEYS; i++) + Main.wm.removeKeybinding(key + (i + 1)); + }, this); + + this._hotKeysEnabled = false; + } + + _optionalNumberOverlay() { + let settings = DockManager.settings; + this._shortcutIsSet = false; + // Enable extra shortcut if either 'overlay' or 'show-dock' are true + if (settings.get_boolean('hot-keys') && + (settings.get_boolean('hotkeys-overlay') || settings.get_boolean('hotkeys-show-dock'))) + this._enableExtraShortcut(); + + this._signalsHandler.add([ + settings, + 'changed::hot-keys', + this._checkHotkeysOptions.bind(this) + ], [ + settings, + 'changed::hotkeys-overlay', + this._checkHotkeysOptions.bind(this) + ], [ + settings, + 'changed::hotkeys-show-dock', + this._checkHotkeysOptions.bind(this) + ]); + } + + _checkHotkeysOptions() { + let settings = DockManager.settings; + + if (settings.get_boolean('hot-keys') && + (settings.get_boolean('hotkeys-overlay') || settings.get_boolean('hotkeys-show-dock'))) + this._enableExtraShortcut(); + else + this._disableExtraShortcut(); + } + + _enableExtraShortcut() { + if (!this._shortcutIsSet) { + Main.wm.addKeybinding('shortcut', DockManager.settings, + Meta.KeyBindingFlags.NONE, + Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, + this._showOverlay.bind(this)); + this._shortcutIsSet = true; + } + } + + _disableExtraShortcut() { + if (this._shortcutIsSet) { + Main.wm.removeKeybinding('shortcut'); + this._shortcutIsSet = false; + } + } + + _showOverlay() { + for (let i = 0; i < this._allDocks.length; i++) { + let dock = this._allDocks[i]; + if (dock._settings.get_boolean('hotkeys-overlay')) + dock.dash.toggleNumberOverlay(true); + + // Restart the counting if the shortcut is pressed again + if (dock._numberOverlayTimeoutId) { + Mainloop.source_remove(dock._numberOverlayTimeoutId); + dock._numberOverlayTimeoutId = 0; + } + + // Hide the overlay/dock after the timeout + let timeout = dock._settings.get_double('shortcut-timeout') * 1000; + dock._numberOverlayTimeoutId = Mainloop.timeout_add(timeout, () => { + dock._numberOverlayTimeoutId = 0; + dock.dash.toggleNumberOverlay(false); + // Hide the dock again if necessary + dock._updateDashVisibility(); + }); + + // Show the dock if it is hidden + if (dock._settings.get_boolean('hotkeys-show-dock')) { + let showDock = (dock._intellihideIsEnabled || dock._autohideIsEnabled); + if (showDock) + dock._show(); + } + } + } +}; + +/** + * Isolate overview to open new windows for inactive apps + * Note: the future implementaion is not fully contained here. Some bits are around in other methods of other classes. + * This class just take care of enabling/disabling the option. + */ +var WorkspaceIsolation = class DashToDock_WorkspaceIsolation { + + constructor(allDocks) { + + let settings = DockManager.settings; + this._allDocks = allDocks; + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._injectionsHandler = new Utils.InjectionsHandler(); + + this._signalsHandler.add([ + settings, + 'changed::isolate-workspaces', + () => { + this._allDocks.forEach(function(dock) { + dock.dash.resetAppIcons(); + }); + if (settings.get_boolean('isolate-workspaces') || + settings.get_boolean('isolate-monitors')) + this._enable.bind(this)(); + else + this._disable.bind(this)(); + } + ],[ + settings, + 'changed::isolate-monitors', + () => { + this._allDocks.forEach(function(dock) { + dock.dash.resetAppIcons(); + }); + if (settings.get_boolean('isolate-workspaces') || + settings.get_boolean('isolate-monitors')) + this._enable.bind(this)(); + else + this._disable.bind(this)(); + } + ]); + + if (settings.get_boolean('isolate-workspaces') || + settings.get_boolean('isolate-monitors')) + this._enable(); + + } + + _enable() { + + // ensure I never double-register/inject + // although it should never happen + this._disable(); + + this._allDocks.forEach(function(dock) { + this._signalsHandler.addWithLabel('isolation', [ + global.display, + 'restacked', + dock.dash._queueRedisplay.bind(dock.dash) + ], [ + global.window_manager, + 'switch-workspace', + dock.dash._queueRedisplay.bind(dock.dash) + ]); + + // This last signal is only needed for monitor isolation, as windows + // might migrate from one monitor to another without triggering 'restacked' + if (DockManager.settings.get_boolean('isolate-monitors')) + this._signalsHandler.addWithLabel('isolation', [ + global.display, + 'window-entered-monitor', + dock.dash._queueRedisplay.bind(dock.dash) + ]); + + }, this); + + // here this is the Shell.App + function IsolatedOverview() { + // These lines take care of Nautilus for icons on Desktop + let windows = this.get_windows().filter(function(w) { + return w.get_workspace().index() == global.workspace_manager.get_active_workspace_index(); + }); + if (windows.length == 1) + if (windows[0].skip_taskbar) + return this.open_new_window(-1); + + if (this.is_on_workspace(global.workspace_manager.get_active_workspace())) + return Main.activateWindow(windows[0]); + return this.open_new_window(-1); + } + + this._injectionsHandler.addWithLabel('isolation', [ + Shell.App.prototype, + 'activate', + IsolatedOverview + ]); + } + + _disable () { + this._signalsHandler.removeWithLabel('isolation'); + this._injectionsHandler.removeWithLabel('isolation'); + } + + destroy() { + this._signalsHandler.destroy(); + this._injectionsHandler.destroy(); + } +}; + + +var DockManager = class DashToDock_DockManager { + + constructor() { + if (Me.imports.extension.dockManager) + throw new Error('DashToDock has been already initialized'); + + Me.imports.extension.dockManager = this; + + this._remoteModel = new LauncherAPI.LauncherEntryRemoteModel(); + this._settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.dash-to-dock'); + this._oldDash = Main.overview._dash; + this._ensureFileManagerClient(); + + /* Array of all the docks created */ + this._allDocks = []; + this._createDocks(); + + // status variable: true when the overview is shown through the dash + // applications button. + this._forcedOverview = false; + + // Connect relevant signals to the toggling function + this._bindSettingsChanges(); + } + + static getDefault() { + return Me.imports.extension.dockManager + } + + static get settings() { + return DockManager.getDefault()._settings; + } + + get fm1Client() { + return this._fm1Client; + } + + _ensureFileManagerClient() { + let supportsLocations = ['show-trash', 'show-mounts'].some((s) => { + return this._settings.get_boolean(s); + }); + + if (supportsLocations) { + if (!this._fm1Client) + this._fm1Client = new FileManager1API.FileManager1Client(); + } else if (this._fm1Client) { + this._fm1Client.destroy(); + this._fm1Client = null; + } + } + + _toggle() { + this._deleteDocks(); + this._createDocks(); + this.emit('toggled'); + } + + _bindSettingsChanges() { + // Connect relevant signals to the toggling function + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._signalsHandler.add([ + Meta.MonitorManager.get(), + 'monitors-changed', + this._toggle.bind(this) + ], [ + this._settings, + 'changed::multi-monitor', + this._toggle.bind(this) + ], [ + this._settings, + 'changed::preferred-monitor', + this._toggle.bind(this) + ], [ + this._settings, + 'changed::dock-position', + this._toggle.bind(this) + ], [ + this._settings, + 'changed::extend-height', + this._adjustPanelCorners.bind(this) + ], [ + this._settings, + 'changed::dock-fixed', + this._adjustPanelCorners.bind(this) + ], [ + this._settings, + 'changed::show-trash', + () => this._ensureFileManagerClient() + ], [ + this._settings, + 'changed::show-mounts', + () => this._ensureFileManagerClient() + ], ); + } + + _createDocks() { + + // If there are no monitors (headless configurations, but it can also happen temporary while disconnecting + // and reconnecting monitors), just do nothing. When a monitor will be connected we we'll be notified and + // and thus create the docks. This prevents pointing trying to access monitors throughout the code, were we + // are assuming that at least the primary monitor is present. + if (Main.layoutManager.monitors.length <= 0) { + return; + } + + this._preferredMonitorIndex = this._settings.get_int('preferred-monitor'); + // In case of multi-monitor, we consider the dock on the primary monitor to be the preferred (main) one + // regardless of the settings + // The dock goes on the primary monitor also if the settings are incosistent (e.g. desired monitor not connected). + if (this._settings.get_boolean('multi-monitor') || + this._preferredMonitorIndex < 0 || this._preferredMonitorIndex > Main.layoutManager.monitors.length - 1 + ) { + this._preferredMonitorIndex = Main.layoutManager.primaryIndex; + } else { + // Gdk and shell monitors numbering differ at least under wayland: + // While the primary monitor appears to be always index 0 in Gdk, + // the shell can assign a different number (Main.layoutManager.primaryMonitor) + // This ensure the indexing in the settings (Gdk) and in the shell are matched, + // i.e. that we start counting from the primaryMonitorIndex + this._preferredMonitorIndex = (Main.layoutManager.primaryIndex + this._preferredMonitorIndex) % Main.layoutManager.monitors.length ; + } + + // First we create the main Dock, to get the extra features to bind to this one + let dock = new DockedDash(this._remoteModel, this._preferredMonitorIndex); + this._allDocks.push(dock); + + // connect app icon into the view selector + dock.dash.showAppsButton.connect('notify::checked', this._onShowAppsButtonToggled.bind(this)); + + // Make the necessary changes to Main.overview._dash + this._prepareMainDash(); + + // Adjust corners if necessary + this._adjustPanelCorners(); + + if (this._settings.get_boolean('multi-monitor')) { + let nMon = Main.layoutManager.monitors.length; + for (let iMon = 0; iMon < nMon; iMon++) { + if (iMon == this._preferredMonitorIndex) + continue; + let dock = new DockedDash(this._remoteModel, iMon); + this._allDocks.push(dock); + // connect app icon into the view selector + dock.dash.showAppsButton.connect('notify::checked', this._onShowAppsButtonToggled.bind(this)); + } + } + + // Load optional features. We load *after* the docks are created, since + // we need to connect the signals to all dock instances. + this._workspaceIsolation = new WorkspaceIsolation(this._allDocks); + this._keyboardShortcuts = new KeyboardShortcuts(this._allDocks); + } + + _prepareMainDash() { + // Pretend I'm the dash: meant to make appgrd swarm animation come from the + // right position of the appShowButton. + Main.overview._dash = this._allDocks[0].dash; + + // set stored icon size to the new dash + Main.overview.dashIconSize = this._allDocks[0].dash.iconSize; + + // Hide usual Dash + Main.overview._controls.dash.actor.hide(); + + // Also set dash width to 1, so it's almost not taken into account by code + // calculaing the reserved space in the overview. The reason to keep it at 1 is + // to allow its visibility change to trigger an allocaion of the appGrid which + // in turn is triggergin the appsIcon spring animation, required when no other + // actors has this effect, i.e in horizontal mode and without the workspaceThumnails + // 1 static workspace only) + Main.overview._controls.dash.actor.set_width(1); + } + + _deleteDocks() { + // Remove extra features + this._workspaceIsolation.destroy(); + this._keyboardShortcuts.destroy(); + + // Delete all docks + let nDocks = this._allDocks.length; + for (let i = nDocks-1; i >= 0; i--) { + this._allDocks[i].destroy(); + this._allDocks.pop(); + } + } + + _restoreDash() { + Main.overview._controls.dash.actor.show(); + Main.overview._controls.dash.actor.set_width(-1); //reset default dash size + // This force the recalculation of the icon size + Main.overview._controls.dash._maxHeight = -1; + + // reset stored icon size to the default dash + Main.overview.dashIconSize = Main.overview._controls.dash.iconSize; + + Main.overview._dash = this._oldDash; + } + + _onShowAppsButtonToggled(button) { + // Sync the status of the default appButtons. Only if the two statuses are + // different, that means the user interacted with the extension provided + // application button, cutomize the behaviour. Otherwise the shell has changed the + // status (due to the _syncShowAppsButtonToggled function below) and it + // has already performed the desired action. + + let animate = this._settings.get_boolean('animate-show-apps'); + let selector = Main.overview.viewSelector; + + if (selector._showAppsButton.checked !== button.checked) { + // find visible view + let visibleView; + Main.overview.viewSelector.appDisplay._views.every(function(v, index) { + if (v.view.actor.visible) { + visibleView = index; + return false; + } + else + return true; + }); + + if (button.checked) { + // force spring animation triggering.By default the animation only + // runs if we are already inside the overview. + if (!Main.overview._shown) { + this._forcedOverview = true; + let view = Main.overview.viewSelector.appDisplay._views[visibleView].view; + let grid = view._grid; + if (animate) { + // Animate in the the appview, hide the appGrid to avoiud flashing + // Go to the appView before entering the overview, skipping the workspaces. + // Do this manually avoiding opacity in transitions so that the setting of the opacity + // to 0 doesn't get overwritten. + Main.overview.viewSelector._activePage.opacity = 0; + Main.overview.viewSelector._activePage.hide(); + Main.overview.viewSelector._activePage = Main.overview.viewSelector._appsPage; + Main.overview.viewSelector._activePage.show(); + grid.opacity = 0; + + // The animation has to be trigered manually because the AppDisplay.animate + // method is waiting for an allocation not happening, as we skip the workspace view + // and the appgrid could already be allocated from previous shown. + // It has to be triggered after the overview is shown as wrong coordinates are obtained + // otherwise. + let overviewShownId = Main.overview.connect('shown', () => { + Main.overview.disconnect(overviewShownId); + Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { + grid.opacity = 255; + grid.animateSpring(IconGrid.AnimationDirection.IN, this._allDocks[0].dash.showAppsButton); + }); + }); + } + else { + Main.overview.viewSelector._activePage = Main.overview.viewSelector._appsPage; + Main.overview.viewSelector._activePage.show(); + grid.opacity = 255; + } + + } + + // Finally show the overview + selector._showAppsButton.checked = true; + Main.overview.show(); + } + else { + if (this._forcedOverview) { + // force exiting overview if needed + + if (animate) { + // Manually trigger springout animation without activating the + // workspaceView to avoid the zoomout animation. Hide the appPage + // onComplete to avoid ugly flashing of original icons. + let view = Main.overview.viewSelector.appDisplay._views[visibleView].view; + view.animate(IconGrid.AnimationDirection.OUT, () => { + Main.overview.viewSelector._appsPage.hide(); + Main.overview.hide(); + selector._showAppsButton.checked = false; + this._forcedOverview = false; + }); + } + else { + Main.overview.hide(); + this._forcedOverview = false; + } + } + else { + selector._showAppsButton.checked = false; + this._forcedOverview = false; + } + } + } + + // whenever the button is unactivated even if not by the user still reset the + // forcedOverview flag + if (button.checked == false) + this._forcedOverview = false; + } + + destroy() { + this._signalsHandler.destroy(); + this._deleteDocks(); + this._revertPanelCorners(); + this._restoreDash(); + if (this._fm1Client) { + this._fm1Client.destroy(); + this._fm1Client = null; + } + this._remoteModel.destroy(); + this._settings.run_dispose(); + this._settings = null; + + Me.imports.extension.dockManager = null; + } + + /** + * Adjust Panel corners + */ + _adjustPanelCorners() { + let position = Utils.getPosition(); + let isHorizontal = ((position == St.Side.TOP) || (position == St.Side.BOTTOM)); + let extendHeight = this._settings.get_boolean('extend-height'); + let fixedIsEnabled = this._settings.get_boolean('dock-fixed'); + let dockOnPrimary = this._settings.get_boolean('multi-monitor') || + this._preferredMonitorIndex == Main.layoutManager.primaryIndex; + + if (!isHorizontal && dockOnPrimary && extendHeight && fixedIsEnabled) { + Main.panel._rightCorner.actor.hide(); + Main.panel._leftCorner.actor.hide(); + } + else + this._revertPanelCorners(); + } + + _revertPanelCorners() { + Main.panel._leftCorner.actor.show(); + Main.panel._rightCorner.actor.show(); + } +}; +Signals.addSignalMethods(DockManager.prototype); diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/extension.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/extension.js new file mode 100644 index 00000000..0b7b5c63 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/extension.js @@ -0,0 +1,21 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; + +// We declare this with var so it can be accessed by other extensions in +// GNOME Shell 3.26+ (mozjs52+). +var dockManager; + +function init() { + ExtensionUtils.initTranslations('dashtodock'); +} + +function enable() { + new Docking.DockManager(); +} + +function disable() { + dockManager.destroy(); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/fileManager1API.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/fileManager1API.js new file mode 100644 index 00000000..2b9bbe88 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/fileManager1API.js @@ -0,0 +1,217 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Gio = imports.gi.Gio; +const Signals = imports.signals; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Utils = Me.imports.utils; + +const FileManager1Iface = '\ + \ + \ + '; + +const FileManager1Proxy = Gio.DBusProxy.makeProxyWrapper(FileManager1Iface); + +/** + * This class implements a client for the org.freedesktop.FileManager1 dbus + * interface, and specifically for the OpenWindowsWithLocations property + * which is published by Nautilus, but is not an official part of the interface. + * + * The property is a map from window identifiers to a list of locations open in + * the window. + * + * While OpeWindowsWithLocations is part of upstream Nautilus, for many years + * prior, Ubuntu patched Nautilus to publish XUbuntuOpenLocationsXids, which is + * similar but uses Xids as the window identifiers instead of gtk window paths. + * + * When an old or unpatched Nautilus is running, we will observe the properties + * to always be empty arrays, but there will not be any correctness issues. + */ +var FileManager1Client = class DashToDock_FileManager1Client { + + constructor() { + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._locationMap = new Map(); + this._proxy = new FileManager1Proxy(Gio.DBus.session, + "org.freedesktop.FileManager1", + "/org/freedesktop/FileManager1", + (initable, error) => { + // Use async construction to avoid blocking on errors. + if (error) { + global.log(error); + } else { + this._updateLocationMap(); + } + }); + + this._signalsHandler.add([ + this._proxy, + 'g-properties-changed', + this._onPropertyChanged.bind(this) + ], [ + // We must additionally listen for Screen events to know when to + // rebuild our location map when the set of available windows changes. + global.workspace_manager, + 'workspace-switched', + this._updateLocationMap.bind(this) + ], [ + global.display, + 'window-entered-monitor', + this._updateLocationMap.bind(this) + ], [ + global.display, + 'window-left-monitor', + this._updateLocationMap.bind(this) + ]); + } + + destroy() { + this._signalsHandler.destroy(); + this._proxy.run_dispose(); + } + + /** + * Return an array of windows that are showing a location or + * sub-directories of that location. + */ + getWindows(location) { + let ret = new Set(); + for (let [k,v] of this._locationMap) { + if (k.startsWith(location)) { + for (let l of v) { + ret.add(l); + } + } + } + return Array.from(ret); + } + + _onPropertyChanged(proxy, changed, invalidated) { + let property = changed.unpack(); + if (property && + ('XUbuntuOpenLocationsXids' in property || + 'OpenWindowsWithLocations' in property)) { + this._updateLocationMap(); + } + } + + _updateLocationMap() { + let properties = this._proxy.get_cached_property_names(); + if (properties == null) { + // Nothing to check yet. + return; + } + + if (properties.includes('OpenWindowsWithLocations')) { + this._updateFromPaths(); + } else if (properties.includes('XUbuntuOpenLocationsXids')) { + this._updateFromXids(); + } + } + + _updateFromPaths() { + let pathToLocations = this._proxy.OpenWindowsWithLocations; + let pathToWindow = getPathToWindow(); + + let locationToWindow = new Map(); + for (let path in pathToLocations) { + let locations = pathToLocations[path]; + for (let i = 0; i < locations.length; i++) { + let l = locations[i]; + // Use a set to deduplicate when a window has a + // location open in multiple tabs. + if (!locationToWindow.has(l)) { + locationToWindow.set(l, new Set()); + } + let window = pathToWindow.get(path); + if (window != null) { + locationToWindow.get(l).add(window); + } + } + } + this._locationMap = locationToWindow; + this.emit('windows-changed'); + } + + _updateFromXids() { + let xidToLocations = this._proxy.XUbuntuOpenLocationsXids; + let xidToWindow = getXidToWindow(); + + let locationToWindow = new Map(); + for (let xid in xidToLocations) { + let locations = xidToLocations[xid]; + for (let i = 0; i < locations.length; i++) { + let l = locations[i]; + // Use a set to deduplicate when a window has a + // location open in multiple tabs. + if (!locationToWindow.has(l)) { + locationToWindow.set(l, new Set()); + } + let window = xidToWindow.get(parseInt(xid)); + if (window != null) { + locationToWindow.get(l).add(window); + } + } + } + this._locationMap = locationToWindow; + this.emit('windows-changed'); + } +} +Signals.addSignalMethods(FileManager1Client.prototype); + +/** + * Construct a map of gtk application window object paths to MetaWindows. + */ +function getPathToWindow() { + let pathToWindow = new Map(); + + for (let i = 0; i < global.workspace_manager.n_workspaces; i++) { + let ws = global.workspace_manager.get_workspace_by_index(i); + ws.list_windows().map(function(w) { + let path = w.get_gtk_window_object_path(); + if (path != null) { + pathToWindow.set(path, w); + } + }); + } + return pathToWindow; +} + +/** + * Construct a map of XIDs to MetaWindows. + * + * This is somewhat annoying as you cannot lookup a window by + * XID in any way, and must iterate through all of them looking + * for a match. + */ +function getXidToWindow() { + let xidToWindow = new Map(); + + for (let i = 0; i < global.workspace_manager.n_workspaces; i++) { + let ws = global.workspace_manager.get_workspace_by_index(i); + ws.list_windows().map(function(w) { + let xid = guessWindowXID(w); + if (xid != null) { + xidToWindow.set(parseInt(xid), w); + } + }); + } + return xidToWindow; +} + +/** + * Guesses the X ID of a window. + * + * This is the basic implementation that is sufficient for Nautilus + * windows. The pixel-saver extension has a much more complex + * implementation if we ever need it. + */ +function guessWindowXID(win) { + try { + return win.get_description().match(/0x[0-9a-f]+/)[0]; + } catch (err) { + return null; + } +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/intellihide.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/intellihide.js new file mode 100644 index 00000000..2fd700ba --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/intellihide.js @@ -0,0 +1,321 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const GLib = imports.gi.GLib; +const Mainloop = imports.mainloop; +const Meta = imports.gi.Meta; +const Shell = imports.gi.Shell; + +const Main = imports.ui.main; +const Signals = imports.signals; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; +const Utils = Me.imports.utils; + +// A good compromise between reactivity and efficiency; to be tuned. +const INTELLIHIDE_CHECK_INTERVAL = 100; + +const OverlapStatus = { + UNDEFINED: -1, + FALSE: 0, + TRUE: 1 +}; + +const IntellihideMode = { + ALL_WINDOWS: 0, + FOCUS_APPLICATION_WINDOWS: 1, + MAXIMIZED_WINDOWS : 2 +}; + +// List of windows type taken into account. Order is important (keep the original +// enum order). +const handledWindowTypes = [ + Meta.WindowType.NORMAL, + Meta.WindowType.DOCK, + Meta.WindowType.DIALOG, + Meta.WindowType.MODAL_DIALOG, + Meta.WindowType.TOOLBAR, + Meta.WindowType.MENU, + Meta.WindowType.UTILITY, + Meta.WindowType.SPLASHSCREEN +]; + +/** + * A rough and ugly implementation of the intellihide behaviour. + * Intallihide object: emit 'status-changed' signal when the overlap of windows + * with the provided targetBoxClutter.ActorBox changes; + */ +var Intellihide = class DashToDock_Intellihide { + + constructor(monitorIndex) { + // Load settings + this._monitorIndex = monitorIndex; + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._tracker = Shell.WindowTracker.get_default(); + this._focusApp = null; // The application whose window is focused. + this._topApp = null; // The application whose window is on top on the monitor with the dock. + + this._isEnabled = false; + this.status = OverlapStatus.UNDEFINED; + this._targetBox = null; + + this._checkOverlapTimeoutContinue = false; + this._checkOverlapTimeoutId = 0; + + this._trackedWindows = new Map(); + + // Connect global signals + this._signalsHandler.add([ + // Add signals on windows created from now on + global.display, + 'window-created', + this._windowCreated.bind(this) + ], [ + // triggered for instance when the window list order changes, + // included when the workspace is switched + global.display, + 'restacked', + this._checkOverlap.bind(this) + ], [ + // when windows are alwasy on top, the focus window can change + // without the windows being restacked. Thus monitor window focus change. + this._tracker, + 'notify::focus-app', + this._checkOverlap.bind(this) + ], [ + // update wne monitor changes, for instance in multimonitor when monitor are attached + Meta.MonitorManager.get(), + 'monitors-changed', + this._checkOverlap.bind(this) + ]); + } + + destroy() { + // Disconnect global signals + this._signalsHandler.destroy(); + + // Remove residual windows signals + this.disable(); + } + + enable() { + this._isEnabled = true; + this._status = OverlapStatus.UNDEFINED; + global.get_window_actors().forEach(function(wa) { + this._addWindowSignals(wa); + }, this); + this._doCheckOverlap(); + } + + disable() { + this._isEnabled = false; + + for (let wa of this._trackedWindows.keys()) { + this._removeWindowSignals(wa); + } + this._trackedWindows.clear(); + + if (this._checkOverlapTimeoutId > 0) { + Mainloop.source_remove(this._checkOverlapTimeoutId); + this._checkOverlapTimeoutId = 0; + } + } + + _windowCreated(display, metaWindow) { + this._addWindowSignals(metaWindow.get_compositor_private()); + } + + _addWindowSignals(wa) { + if (!this._handledWindow(wa)) + return; + let signalId = wa.connect('allocation-changed', this._checkOverlap.bind(this)); + this._trackedWindows.set(wa, signalId); + wa.connect('destroy', this._removeWindowSignals.bind(this)); + } + + _removeWindowSignals(wa) { + if (this._trackedWindows.get(wa)) { + wa.disconnect(this._trackedWindows.get(wa)); + this._trackedWindows.delete(wa); + } + + } + + updateTargetBox(box) { + this._targetBox = box; + this._checkOverlap(); + } + + forceUpdate() { + this._status = OverlapStatus.UNDEFINED; + this._doCheckOverlap(); + } + + getOverlapStatus() { + return (this._status == OverlapStatus.TRUE); + } + + _checkOverlap() { + if (!this._isEnabled || (this._targetBox == null)) + return; + + /* Limit the number of calls to the doCheckOverlap function */ + if (this._checkOverlapTimeoutId) { + this._checkOverlapTimeoutContinue = true; + return + } + + this._doCheckOverlap(); + + this._checkOverlapTimeoutId = Mainloop.timeout_add(INTELLIHIDE_CHECK_INTERVAL, () => { + this._doCheckOverlap(); + if (this._checkOverlapTimeoutContinue) { + this._checkOverlapTimeoutContinue = false; + return GLib.SOURCE_CONTINUE; + } else { + this._checkOverlapTimeoutId = 0; + return GLib.SOURCE_REMOVE; + } + }); + } + + _doCheckOverlap() { + + if (!this._isEnabled || (this._targetBox == null)) + return; + + let overlaps = OverlapStatus.FALSE; + let windows = global.get_window_actors(); + + if (windows.length > 0) { + /* + * Get the top window on the monitor where the dock is placed. + * The idea is that we dont want to overlap with the windows of the topmost application, + * event is it's not the focused app -- for instance because in multimonitor the user + * select a window in the secondary monitor. + */ + + let topWindow = null; + for (let i = windows.length - 1; i >= 0; i--) { + let meta_win = windows[i].get_meta_window(); + if (this._handledWindow(windows[i]) && (meta_win.get_monitor() == this._monitorIndex)) { + topWindow = meta_win; + break; + } + } + + if (topWindow !== null) { + this._topApp = this._tracker.get_window_app(topWindow); + // If there isn't a focused app, use that of the window on top + this._focusApp = this._tracker.focus_app || this._topApp + + windows = windows.filter(this._intellihideFilterInteresting, this); + + for (let i = 0; i < windows.length; i++) { + let win = windows[i].get_meta_window(); + + if (win) { + let rect = win.get_frame_rect(); + + let test = (rect.x < this._targetBox.x2) && + (rect.x + rect.width > this._targetBox.x1) && + (rect.y < this._targetBox.y2) && + (rect.y + rect.height > this._targetBox.y1); + + if (test) { + overlaps = OverlapStatus.TRUE; + break; + } + } + } + } + } + + if (this._status !== overlaps) { + this._status = overlaps; + this.emit('status-changed', this._status); + } + + } + + // Filter interesting windows to be considered for intellihide. + // Consider all windows visible on the current workspace. + // Optionally skip windows of other applications + _intellihideFilterInteresting(wa) { + let meta_win = wa.get_meta_window(); + if (!this._handledWindow(wa)) + return false; + + let currentWorkspace = global.workspace_manager.get_active_workspace_index(); + let wksp = meta_win.get_workspace(); + let wksp_index = wksp.index(); + + // Depending on the intellihide mode, exclude non-relevent windows + switch (Docking.DockManager.settings.get_enum('intellihide-mode')) { + case IntellihideMode.ALL_WINDOWS: + // Do nothing + break; + + case IntellihideMode.FOCUS_APPLICATION_WINDOWS: + // Skip windows of other apps + if (this._focusApp) { + // The DropDownTerminal extension is not an application per se + // so we match its window by wm class instead + if (meta_win.get_wm_class() == 'DropDownTerminalWindow') + return true; + + let currentApp = this._tracker.get_window_app(meta_win); + let focusWindow = global.display.get_focus_window() + + // Consider half maximized windows side by side + // and windows which are alwayson top + if((currentApp != this._focusApp) && (currentApp != this._topApp) + && !((focusWindow && focusWindow.maximized_vertically && !focusWindow.maximized_horizontally) + && (meta_win.maximized_vertically && !meta_win.maximized_horizontally) + && meta_win.get_monitor() == focusWindow.get_monitor()) + && !meta_win.is_above()) + return false; + } + break; + + case IntellihideMode.MAXIMIZED_WINDOWS: + // Skip unmaximized windows + if (!meta_win.maximized_vertically && !meta_win.maximized_horizontally) + return false; + break; + } + + if ( wksp_index == currentWorkspace && meta_win.showing_on_its_workspace() ) + return true; + else + return false; + + } + + // Filter windows by type + // inspired by Opacify@gnome-shell.localdomain.pl + _handledWindow(wa) { + let metaWindow = wa.get_meta_window(); + + if (!metaWindow) + return false; + + // The DropDownTerminal extension uses the POPUP_MENU window type hint + // so we match its window by wm class instead + if (metaWindow.get_wm_class() == 'DropDownTerminalWindow') + return true; + + let wtype = metaWindow.get_window_type(); + for (let i = 0; i < handledWindowTypes.length; i++) { + var hwtype = handledWindowTypes[i]; + if (hwtype == wtype) + return true; + else if (hwtype > wtype) + return false; + } + return false; + } +}; + +Signals.addSignalMethods(Intellihide.prototype); diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/launcherAPI.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/launcherAPI.js new file mode 100644 index 00000000..f0b61990 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/launcherAPI.js @@ -0,0 +1,239 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Gio = imports.gi.Gio; +const Signals = imports.signals; + +var LauncherEntryRemoteModel = class DashToDock_LauncherEntryRemoteModel { + + constructor() { + this._entriesByDBusName = {}; + + this._launcher_entry_dbus_signal_id = + Gio.DBus.session.signal_subscribe(null, // sender + 'com.canonical.Unity.LauncherEntry', // iface + null, // member + null, // path + null, // arg0 + Gio.DBusSignalFlags.NONE, + this._onEntrySignalReceived.bind(this)); + + this._dbus_name_owner_changed_signal_id = + Gio.DBus.session.signal_subscribe('org.freedesktop.DBus', // sender + 'org.freedesktop.DBus', // interface + 'NameOwnerChanged', // member + '/org/freedesktop/DBus', // path + null, // arg0 + Gio.DBusSignalFlags.NONE, + this._onDBusNameOwnerChanged.bind(this)); + + this._acquireUnityDBus(); + } + + destroy() { + if (this._launcher_entry_dbus_signal_id) { + Gio.DBus.session.signal_unsubscribe(this._launcher_entry_dbus_signal_id); + } + + if (this._dbus_name_owner_changed_signal_id) { + Gio.DBus.session.signal_unsubscribe(this._dbus_name_owner_changed_signal_id); + } + + this._releaseUnityDBus(); + } + + size() { + return Object.keys(this._entriesByDBusName).length; + } + + lookupByDBusName(dbusName) { + return this._entriesByDBusName.hasOwnProperty(dbusName) ? this._entriesByDBusName[dbusName] : null; + } + + lookupById(appId) { + let ret = []; + for (let dbusName in this._entriesByDBusName) { + let entry = this._entriesByDBusName[dbusName]; + if (entry && entry.appId() == appId) { + ret.push(entry); + } + } + + return ret; + } + + addEntry(entry) { + let existingEntry = this.lookupByDBusName(entry.dbusName()); + if (existingEntry) { + existingEntry.update(entry); + } else { + this._entriesByDBusName[entry.dbusName()] = entry; + this.emit('entry-added', entry); + } + } + + removeEntry(entry) { + delete this._entriesByDBusName[entry.dbusName()] + this.emit('entry-removed', entry); + } + + _acquireUnityDBus() { + if (!this._unity_bus_id) { + Gio.DBus.session.own_name('com.canonical.Unity', + Gio.BusNameOwnerFlags.ALLOW_REPLACEMENT, null, null); + } + } + + _releaseUnityDBus() { + if (this._unity_bus_id) { + Gio.DBus.session.unown_name(this._unity_bus_id); + this._unity_bus_id = 0; + } + } + + _onEntrySignalReceived(connection, sender_name, object_path, + interface_name, signal_name, parameters, user_data) { + if (!parameters || !signal_name) + return; + + if (signal_name == 'Update') { + if (!sender_name) { + return; + } + + this._handleUpdateRequest(sender_name, parameters); + } + } + + _onDBusNameOwnerChanged(connection, sender_name, object_path, + interface_name, signal_name, parameters, user_data) { + if (!parameters || !this.size()) + return; + + let [name, before, after] = parameters.deep_unpack(); + + if (!after) { + if (this._entriesByDBusName.hasOwnProperty(before)) { + this.removeEntry(this._entriesByDBusName[before]); + } + } + } + + _handleUpdateRequest(senderName, parameters) { + if (!senderName || !parameters) { + return; + } + + let [appUri, properties] = parameters.deep_unpack(); + let appId = appUri.replace(/(^\w+:|^)\/\//, ''); + let entry = this.lookupByDBusName(senderName); + + if (entry) { + entry.setDBusName(senderName); + entry.update(properties); + } else { + let entry = new LauncherEntryRemote(senderName, appId, properties); + this.addEntry(entry); + } + } +}; +Signals.addSignalMethods(LauncherEntryRemoteModel.prototype); + +var LauncherEntryRemote = class DashToDock_LauncherEntryRemote { + + constructor(dbusName, appId, properties) { + this._dbusName = dbusName; + this._appId = appId; + this._count = 0; + this._countVisible = false; + this._progress = 0.0; + this._progressVisible = false; + this.update(properties); + } + + appId() { + return this._appId; + } + + dbusName() { + return this._dbusName; + } + + count() { + return this._count; + } + + setCount(count) { + if (this._count != count) { + this._count = count; + this.emit('count-changed', this._count); + } + } + + countVisible() { + return this._countVisible; + } + + setCountVisible(countVisible) { + if (this._countVisible != countVisible) { + this._countVisible = countVisible; + this.emit('count-visible-changed', this._countVisible); + } + } + + progress() { + return this._progress; + } + + setProgress(progress) { + if (this._progress != progress) { + this._progress = progress; + this.emit('progress-changed', this._progress); + } + } + + progressVisible() { + return this._progressVisible; + } + + setProgressVisible(progressVisible) { + if (this._progressVisible != progressVisible) { + this._progressVisible = progressVisible; + this.emit('progress-visible-changed', this._progressVisible); + } + } + + setDBusName(dbusName) { + if (this._dbusName != dbusName) { + let oldName = this._dbusName; + this._dbusName = dbusName; + this.emit('dbus-name-changed', oldName); + } + } + + update(other) { + if (other instanceof LauncherEntryRemote) { + this.setDBusName(other.dbusName()) + this.setCount(other.count()); + this.setCountVisible(other.countVisible()); + this.setProgress(other.progress()); + this.setProgressVisible(other.progressVisible()) + } else { + for (let property in other) { + if (other.hasOwnProperty(property)) { + if (property == 'count') { + this.setCount(other[property].get_int64()); + } else if (property == 'count-visible') { + this.setCountVisible(other[property].get_boolean()); + } if (property == 'progress') { + this.setProgress(other[property].get_double()); + } else if (property == 'progress-visible') { + this.setProgressVisible(other[property].get_boolean()); + } else { + // Not implemented yet + } + } + } + } + } +}; +Signals.addSignalMethods(LauncherEntryRemote.prototype); diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ar/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ar/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..15b1360f Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ar/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/cs/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/cs/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..e5ac24b3 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/cs/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/de/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/de/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..f7b2ed5d Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/de/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/el/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/el/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..40ff36f2 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/el/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/es/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/es/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..7438734e Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/es/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/fr/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/fr/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..2bed007e Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/fr/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/gl/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/gl/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..b89c1027 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/gl/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/hu/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/hu/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..610c61a4 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/hu/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/id/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/id/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..638596c3 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/id/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/it/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/it/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..dc3ccb95 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/it/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ja/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ja/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..2a5666f3 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ja/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nb/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nb/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..cb24fb31 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nb/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nl/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nl/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..9b39fb14 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nl/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pl/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pl/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..7255a297 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pl/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..acd27b17 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt_BR/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt_BR/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..87fbd19e Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt_BR/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ru/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ru/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..757906bd Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ru/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sk/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sk/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..2457462d Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sk/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..f35be7c3 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr@latin/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr@latin/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..a4a06627 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr@latin/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sv/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sv/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..58f5c728 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sv/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/tr/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/tr/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..49fb0f16 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/tr/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/uk_UA/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/uk_UA/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..a475c96e Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/uk_UA/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_CN/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_CN/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..5511cf8d Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_CN/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_TW/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_TW/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..54137095 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_TW/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locations.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locations.js new file mode 100644 index 00000000..25524ae4 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locations.js @@ -0,0 +1,268 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const Gtk = imports.gi.Gtk; +const Shell = imports.gi.Shell; +const Signals = imports.signals; + +// Use __ () and N__() for the extension gettext domain, and reuse +// the shell domain with the default _() and N_() +const Gettext = imports.gettext.domain('dashtodock'); +const __ = Gettext.gettext; +const N__ = function(e) { return e }; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Utils = Me.imports.utils; + +/** + * This class maintains a Shell.App representing the Trash and keeps it + * up-to-date as the trash fills and is emptied over time. + */ +var Trash = class DashToDock_Trash { + + constructor() { + this._file = Gio.file_new_for_uri('trash://'); + try { + this._monitor = this._file.monitor_directory(0, null); + this._signalId = this._monitor.connect( + 'changed', + this._onTrashChange.bind(this) + ); + } catch (e) { + log(`Impossible to monitor trash: ${e}`) + } + this._lastEmpty = true; + this._empty = true; + this._onTrashChange(); + } + + destroy() { + if (this._monitor) { + this._monitor.disconnect(this._signalId); + this._monitor.run_dispose(); + } + this._file.run_dispose(); + } + + _onTrashChange() { + try { + let children = this._file.enumerate_children('*', 0, null); + this._empty = children.next_file(null) == null; + children.close(null); + } catch (e) { + log(`Impossible to enumerate trash children: ${e}`) + return; + } + + this._ensureApp(); + } + + _ensureApp() { + if (this._trashApp == null || + this._lastEmpty != this._empty) { + let trashKeys = new GLib.KeyFile(); + trashKeys.set_string('Desktop Entry', 'Name', __('Trash')); + trashKeys.set_string('Desktop Entry', 'Icon', + this._empty ? 'user-trash' : 'user-trash-full'); + trashKeys.set_string('Desktop Entry', 'Type', 'Application'); + trashKeys.set_string('Desktop Entry', 'Exec', 'gio open trash:///'); + trashKeys.set_string('Desktop Entry', 'StartupNotify', 'false'); + trashKeys.set_string('Desktop Entry', 'XdtdUri', 'trash:///'); + if (!this._empty) { + trashKeys.set_string('Desktop Entry', 'Actions', 'empty-trash;'); + trashKeys.set_string('Desktop Action empty-trash', 'Name', __('Empty Trash')); + trashKeys.set_string('Desktop Action empty-trash', 'Exec', + 'dbus-send --print-reply --dest=org.gnome.Nautilus /org/gnome/Nautilus org.gnome.Nautilus.FileOperations.EmptyTrash'); + } + + let trashAppInfo = Gio.DesktopAppInfo.new_from_keyfile(trashKeys); + this._trashApp = new Shell.App({appInfo: trashAppInfo}); + this._lastEmpty = this._empty; + + this.emit('changed'); + } + } + + getApp() { + this._ensureApp(); + return this._trashApp; + } +} +Signals.addSignalMethods(Trash.prototype); + +/** + * This class maintains Shell.App representations for removable devices + * plugged into the system, and keeps the list of Apps up-to-date as + * devices come and go and are mounted and unmounted. + */ +var Removables = class DashToDock_Removables { + + constructor() { + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._monitor = Gio.VolumeMonitor.get(); + this._volumeApps = [] + this._mountApps = [] + + this._monitor.get_volumes().forEach( + (volume) => { + this._onVolumeAdded(this._monitor, volume); + } + ); + + this._monitor.get_mounts().forEach( + (mount) => { + this._onMountAdded(this._monitor, mount); + } + ); + + this._signalsHandler.add([ + this._monitor, + 'mount-added', + this._onMountAdded.bind(this) + ], [ + this._monitor, + 'mount-removed', + this._onMountRemoved.bind(this) + ], [ + this._monitor, + 'volume-added', + this._onVolumeAdded.bind(this) + ], [ + this._monitor, + 'volume-removed', + this._onVolumeRemoved.bind(this) + ]); + } + + destroy() { + this._signalsHandler.destroy(); + this._monitor.run_dispose(); + } + + _getWorkingIconName(icon) { + if (icon instanceof Gio.ThemedIcon) { + let iconTheme = Gtk.IconTheme.get_default(); + let names = icon.get_names(); + for (let i = 0; i < names.length; i++) { + let iconName = names[i]; + if (iconTheme.has_icon(iconName)) { + return iconName; + } + } + return ''; + } else { + return icon.to_string(); + } + } + + _onVolumeAdded(monitor, volume) { + if (!volume.can_mount()) { + return; + } + + let activationRoot = volume.get_activation_root(); + if (!activationRoot) { + // Can't offer to mount a device if we don't know + // where to mount it. + // These devices are usually ejectable so you + // don't normally unmount them anyway. + return; + } + let uri = GLib.uri_unescape_string(activationRoot.get_uri(), null); + + let volumeKeys = new GLib.KeyFile(); + volumeKeys.set_string('Desktop Entry', 'Name', volume.get_name()); + volumeKeys.set_string('Desktop Entry', 'Icon', this._getWorkingIconName(volume.get_icon())); + volumeKeys.set_string('Desktop Entry', 'Type', 'Application'); + volumeKeys.set_string('Desktop Entry', 'Exec', 'nautilus "' + uri + '"'); + volumeKeys.set_string('Desktop Entry', 'StartupNotify', 'false'); + volumeKeys.set_string('Desktop Entry', 'Actions', 'mount;'); + volumeKeys.set_string('Desktop Action mount', 'Name', __('Mount')); + volumeKeys.set_string('Desktop Action mount', 'Exec', 'gio mount "' + uri + '"'); + let volumeAppInfo = Gio.DesktopAppInfo.new_from_keyfile(volumeKeys); + let volumeApp = new Shell.App({appInfo: volumeAppInfo}); + this._volumeApps.push(volumeApp); + this.emit('changed'); + } + + _onVolumeRemoved(monitor, volume) { + for (let i = 0; i < this._volumeApps.length; i++) { + let app = this._volumeApps[i]; + if (app.get_name() == volume.get_name()) { + this._volumeApps.splice(i, 1); + } + } + this.emit('changed'); + } + + _onMountAdded(monitor, mount) { + // Filter out uninteresting mounts + if (!mount.can_eject() && !mount.can_unmount()) + return; + if (mount.is_shadowed()) + return; + + let volume = mount.get_volume(); + if (!volume || volume.get_identifier('class') == 'network') { + return; + } + + let escapedUri = mount.get_root().get_uri() + let uri = GLib.uri_unescape_string(escapedUri, null); + + let mountKeys = new GLib.KeyFile(); + mountKeys.set_string('Desktop Entry', 'Name', mount.get_name()); + mountKeys.set_string('Desktop Entry', 'Icon', + this._getWorkingIconName(volume.get_icon())); + mountKeys.set_string('Desktop Entry', 'Type', 'Application'); + mountKeys.set_string('Desktop Entry', 'Exec', 'gio open "' + uri + '"'); + mountKeys.set_string('Desktop Entry', 'StartupNotify', 'false'); + mountKeys.set_string('Desktop Entry', 'XdtdUri', escapedUri); + mountKeys.set_string('Desktop Entry', 'Actions', 'unmount;'); + if (mount.can_eject()) { + mountKeys.set_string('Desktop Action unmount', 'Name', __('Eject')); + mountKeys.set_string('Desktop Action unmount', 'Exec', + 'gio mount -e "' + uri + '"'); + } else { + mountKeys.set_string('Desktop Entry', 'Actions', 'unmount;'); + mountKeys.set_string('Desktop Action unmount', 'Name', __('Unmount')); + mountKeys.set_string('Desktop Action unmount', 'Exec', + 'gio mount -u "' + uri + '"'); + } + let mountAppInfo = Gio.DesktopAppInfo.new_from_keyfile(mountKeys); + let mountApp = new Shell.App({appInfo: mountAppInfo}); + this._mountApps.push(mountApp); + this.emit('changed'); + } + + _onMountRemoved(monitor, mount) { + for (let i = 0; i < this._mountApps.length; i++) { + let app = this._mountApps[i]; + if (app.get_name() == mount.get_name()) { + this._mountApps.splice(i, 1); + } + } + this.emit('changed'); + } + + getApps() { + // When we have both a volume app and a mount app, we prefer + // the mount app. + let apps = new Map(); + this._volumeApps.map(function(app) { + apps.set(app.get_name(), app); + }); + this._mountApps.map(function(app) { + apps.set(app.get_name(), app); + }); + + let ret = []; + for (let app of apps.values()) { + ret.push(app); + } + return ret; + } +} +Signals.addSignalMethods(Removables.prototype); diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/glossy.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/glossy.svg new file mode 100644 index 00000000..55b71baa --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/glossy.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg.svg new file mode 100644 index 00000000..19be5a9d --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg.svg @@ -0,0 +1,82 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg_h.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg_h.svg new file mode 100644 index 00000000..eeaa8691 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg_h.svg @@ -0,0 +1,82 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/logo.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/logo.svg new file mode 100644 index 00000000..eebd0b1d --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/logo.svg @@ -0,0 +1,528 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dash to Dock + Michele + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/metadata.json b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/metadata.json new file mode 100644 index 00000000..a58baa03 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/metadata.json @@ -0,0 +1,13 @@ +{ + "_generated": "Generated by SweetTooth, do not edit", + "description": "A dock for the Gnome Shell. This extension moves the dash out of the overview transforming it in a dock for an easier launching of applications and a faster switching between windows and desktops. Side and bottom placement options are available.", + "gettext-domain": "dashtodock", + "name": "Dash to Dock", + "original-author": "micxgx@gmail.com", + "shell-version": [ + "3.34" + ], + "url": "https://micheleg.github.io/dash-to-dock/", + "uuid": "dash-to-dock@micxgx.gmail.com", + "version": 67 +} \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/prefs.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/prefs.js new file mode 100644 index 00000000..55230298 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/prefs.js @@ -0,0 +1,869 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Gtk = imports.gi.Gtk; +const Gdk = imports.gi.Gdk; +const Mainloop = imports.mainloop; + +// Use __ () and N__() for the extension gettext domain, and reuse +// the shell domain with the default _() and N_() +const Gettext = imports.gettext.domain('dashtodock'); +const __ = Gettext.gettext; +const N__ = function(e) { return e }; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const SCALE_UPDATE_TIMEOUT = 500; +const DEFAULT_ICONS_SIZES = [ 128, 96, 64, 48, 32, 24, 16 ]; + +const TransparencyMode = { + DEFAULT: 0, + FIXED: 1, + DYNAMIC: 3 +}; + +const RunningIndicatorStyle = { + DEFAULT: 0, + DOTS: 1, + SQUARES: 2, + DASHES: 3, + SEGMENTED: 4, + SOLID: 5, + CILIORA: 6, + METRO: 7 +}; + +/** + * This function was copied from the activities-config extension + * https://github.com/nls1729/acme-code/tree/master/activities-config + * by Norman L. Smith. + */ +function cssHexString(css) { + let rrggbb = '#'; + let start; + for (let loop = 0; loop < 3; loop++) { + let end = 0; + let xx = ''; + for (let loop = 0; loop < 2; loop++) { + while (true) { + let x = css.slice(end, end + 1); + if ((x == '(') || (x == ',') || (x == ')')) + break; + end++; + } + if (loop == 0) { + end++; + start = end; + } + } + xx = parseInt(css.slice(start, end)).toString(16); + if (xx.length == 1) + xx = '0' + xx; + rrggbb += xx; + css = css.slice(end); + } + return rrggbb; +} + +function setShortcut(settings) { + let shortcut_text = settings.get_string('shortcut-text'); + let [key, mods] = Gtk.accelerator_parse(shortcut_text); + + if (Gtk.accelerator_valid(key, mods)) { + let shortcut = Gtk.accelerator_name(key, mods); + settings.set_strv('shortcut', [shortcut]); + } + else { + settings.set_strv('shortcut', []); + } +} + +var Settings = class DashToDock_Settings { + + constructor() { + this._settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.dash-to-dock'); + + this._rtl = (Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL); + + this._builder = new Gtk.Builder(); + this._builder.set_translation_domain(Me.metadata['gettext-domain']); + this._builder.add_from_file(Me.path + '/Settings.ui'); + + this.widget = new Gtk.ScrolledWindow({ hscrollbar_policy: Gtk.PolicyType.NEVER }); + this._notebook = this._builder.get_object('settings_notebook'); + this.widget.add(this._notebook); + + // Set a reasonable initial window height + this.widget.connect('realize', () => { + let window = this.widget.get_toplevel(); + let [default_width, default_height] = window.get_default_size(); + window.resize(default_width, 650); + }); + + // Timeout to delay the update of the settings + this._dock_size_timeout = 0; + this._icon_size_timeout = 0; + this._opacity_timeout = 0; + + this._bindSettings(); + + this._builder.connect_signals_full(this._connector.bind(this)); + } + + /** + * Connect signals + */ + _connector(builder, object, signal, handler) { + /**init + * Object containing all signals defined in the glade file + */ + const SignalHandler = { + dock_display_combo_changed_cb(combo) { + this._settings.set_int('preferred-monitor', this._monitors[combo.get_active()]); + }, + + position_top_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('dock-position', 0); + }, + + position_right_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('dock-position', 1); + }, + + position_bottom_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('dock-position', 2); + }, + + position_left_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('dock-position', 3); + }, + + icon_size_combo_changed_cb(combo) { + this._settings.set_int('dash-max-icon-size', this._allIconSizes[combo.get_active()]); + }, + + dock_size_scale_format_value_cb(scale, value) { + return Math.round(value * 100) + ' %'; + }, + + dock_size_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._dock_size_timeout > 0) + Mainloop.source_remove(this._dock_size_timeout); + + this._dock_size_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => { + this._settings.set_double('height-fraction', scale.get_value()); + this._dock_size_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + }, + + icon_size_scale_format_value_cb(scale, value) { + return value + ' px'; + }, + + icon_size_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._icon_size_timeout > 0) + Mainloop.source_remove(this._icon_size_timeout); + + this._icon_size_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => { + this._settings.set_int('dash-max-icon-size', scale.get_value()); + this._icon_size_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + }, + + custom_opacity_scale_value_changed_cb(scale) { + // Avoid settings the opacity consinuosly as it's change is animated + if (this._opacity_timeout > 0) + Mainloop.source_remove(this._opacity_timeout); + + this._opacity_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => { + this._settings.set_double('background-opacity', scale.get_value()); + this._opacity_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + }, + + min_opacity_scale_value_changed_cb(scale) { + // Avoid settings the opacity consinuosly as it's change is animated + if (this._opacity_timeout > 0) + Mainloop.source_remove(this._opacity_timeout); + + this._opacity_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => { + this._settings.set_double('min-alpha', scale.get_value()); + this._opacity_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + }, + + max_opacity_scale_value_changed_cb(scale) { + // Avoid settings the opacity consinuosly as it's change is animated + if (this._opacity_timeout > 0) + Mainloop.source_remove(this._opacity_timeout); + + this._opacity_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => { + this._settings.set_double('max-alpha', scale.get_value()); + this._opacity_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + }, + + custom_opacity_scale_format_value_cb(scale, value) { + return Math.round(value * 100) + ' %'; + }, + + min_opacity_scale_format_value_cb(scale, value) { + return Math.round(value * 100) + ' %'; + }, + + max_opacity_scale_format_value_cb(scale, value) { + return Math.round(value * 100) + ' %'; + }, + + all_windows_radio_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('intellihide-mode', 0); + }, + + focus_application_windows_radio_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('intellihide-mode', 1); + }, + + maximized_windows_radio_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('intellihide-mode', 2); + } + } + + object.connect(signal, SignalHandler[handler].bind(this)); + } + + _bindSettings() { + // Position and size panel + + // Monitor options + + this._monitors = []; + // Build options based on the number of monitors and the current settings. + let n_monitors = Gdk.Screen.get_default().get_n_monitors(); + let primary_monitor = Gdk.Screen.get_default().get_primary_monitor(); + + let monitor = this._settings.get_int('preferred-monitor'); + + // Add primary monitor with index 0, because in GNOME Shell the primary monitor is always 0 + this._builder.get_object('dock_monitor_combo').append_text(__('Primary monitor')); + this._monitors.push(0); + + // Add connected monitors + let ctr = 0; + for (let i = 0; i < n_monitors; i++) { + if (i !== primary_monitor) { + ctr++; + this._monitors.push(ctr); + this._builder.get_object('dock_monitor_combo').append_text(__('Secondary monitor ') + ctr); + } + } + + // If one of the external monitor is set as preferred, show it even if not attached + if ((monitor >= n_monitors) && (monitor !== primary_monitor)) { + this._monitors.push(monitor) + this._builder.get_object('dock_monitor_combo').append_text(__('Secondary monitor ') + ++ctr); + } + + this._builder.get_object('dock_monitor_combo').set_active(this._monitors.indexOf(monitor)); + + // Position option + let position = this._settings.get_enum('dock-position'); + + switch (position) { + case 0: + this._builder.get_object('position_top_button').set_active(true); + break; + case 1: + this._builder.get_object('position_right_button').set_active(true); + break; + case 2: + this._builder.get_object('position_bottom_button').set_active(true); + break; + case 3: + this._builder.get_object('position_left_button').set_active(true); + break; + } + + if (this._rtl) { + /* Left is Right in rtl as a setting */ + this._builder.get_object('position_left_button').set_label(__('Right')); + this._builder.get_object('position_right_button').set_label(__('Left')); + } + + // Intelligent autohide options + this._settings.bind('dock-fixed', + this._builder.get_object('intelligent_autohide_switch'), + 'active', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + this._settings.bind('dock-fixed', + this._builder.get_object('intelligent_autohide_button'), + 'sensitive', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + this._settings.bind('autohide', + this._builder.get_object('autohide_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('autohide-in-fullscreen', + this._builder.get_object('autohide_enable_in_fullscreen_checkbutton'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('require-pressure-to-show', + this._builder.get_object('require_pressure_checkbutton'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('intellihide', + this._builder.get_object('intellihide_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('animation-time', + this._builder.get_object('animation_duration_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('hide-delay', + this._builder.get_object('hide_timeout_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-delay', + this._builder.get_object('show_timeout_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('pressure-threshold', + this._builder.get_object('pressure_threshold_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + + //this._builder.get_object('animation_duration_spinbutton').set_value(this._settings.get_double('animation-time')); + + // Create dialog for intelligent autohide advanced settings + this._builder.get_object('intelligent_autohide_button').connect('clicked', () => { + + let dialog = new Gtk.Dialog({ title: __('Intelligent autohide customization'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + // GTK+ leaves positive values for application-defined response ids. + // Use +1 for the reset action + dialog.add_button(__('Reset to defaults'), 1); + + let box = this._builder.get_object('intelligent_autohide_advanced_settings_box'); + dialog.get_content_area().add(box); + + this._settings.bind('intellihide', + this._builder.get_object('intellihide_mode_box'), + 'sensitive', + Gio.SettingsBindFlags.GET); + + // intellihide mode + + let intellihideModeRadioButtons = [ + this._builder.get_object('all_windows_radio_button'), + this._builder.get_object('focus_application_windows_radio_button'), + this._builder.get_object('maximized_windows_radio_button') + ]; + + intellihideModeRadioButtons[this._settings.get_enum('intellihide-mode')].set_active(true); + + this._settings.bind('autohide', + this._builder.get_object('require_pressure_checkbutton'), + 'sensitive', + Gio.SettingsBindFlags.GET); + + this._settings.bind('autohide', + this._builder.get_object('autohide_enable_in_fullscreen_checkbutton'), + 'sensitive', + Gio.SettingsBindFlags.GET); + + this._settings.bind('require-pressure-to-show', + this._builder.get_object('show_timeout_spinbutton'), + 'sensitive', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + this._settings.bind('require-pressure-to-show', + this._builder.get_object('show_timeout_label'), + 'sensitive', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + this._settings.bind('require-pressure-to-show', + this._builder.get_object('pressure_threshold_spinbutton'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('require-pressure-to-show', + this._builder.get_object('pressure_threshold_label'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + dialog.connect('response', (dialog, id) => { + if (id == 1) { + // restore default settings for the relevant keys + let keys = ['intellihide', 'autohide', 'intellihide-mode', 'autohide-in-fullscreen', 'require-pressure-to-show', + 'animation-time', 'show-delay', 'hide-delay', 'pressure-threshold']; + keys.forEach(function(val) { + this._settings.set_value(val, this._settings.get_default_value(val)); + }, this); + intellihideModeRadioButtons[this._settings.get_enum('intellihide-mode')].set_active(true); + } else { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + } + return; + }); + + dialog.show_all(); + + }); + + // size options + this._builder.get_object('dock_size_scale').set_value(this._settings.get_double('height-fraction')); + this._builder.get_object('dock_size_scale').add_mark(0.9, Gtk.PositionType.TOP, null); + let icon_size_scale = this._builder.get_object('icon_size_scale'); + icon_size_scale.set_range(8, DEFAULT_ICONS_SIZES[0]); + icon_size_scale.set_value(this._settings.get_int('dash-max-icon-size')); + DEFAULT_ICONS_SIZES.forEach(function(val) { + icon_size_scale.add_mark(val, Gtk.PositionType.TOP, val.toString()); + }); + + // Corrent for rtl languages + if (this._rtl) { + // Flip value position: this is not done automatically + this._builder.get_object('dock_size_scale').set_value_pos(Gtk.PositionType.LEFT); + icon_size_scale.set_value_pos(Gtk.PositionType.LEFT); + // I suppose due to a bug, having a more than one mark and one above a value of 100 + // makes the rendering of the marks wrong in rtl. This doesn't happen setting the scale as not flippable + // and then manually inverting it + icon_size_scale.set_flippable(false); + icon_size_scale.set_inverted(true); + } + + this._settings.bind('icon-size-fixed', this._builder.get_object('icon_size_fixed_checkbutton'), 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('extend-height', this._builder.get_object('dock_size_extend_checkbutton'), 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('extend-height', this._builder.get_object('dock_size_scale'), 'sensitive', Gio.SettingsBindFlags.INVERT_BOOLEAN); + + + // Apps panel + + this._settings.bind('show-running', + this._builder.get_object('show_running_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('isolate-workspaces', + this._builder.get_object('application_button_isolation_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('isolate-monitors', + this._builder.get_object('application_button_monitor_isolation_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-windows-preview', + this._builder.get_object('windows_preview_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('multi-monitor', + this._builder.get_object('multi_monitor_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-favorites', + this._builder.get_object('show_favorite_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-trash', + this._builder.get_object('show_trash_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-mounts', + this._builder.get_object('show_mounts_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-show-apps-button', + this._builder.get_object('show_applications_button_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-apps-at-top', + this._builder.get_object('application_button_first_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-show-apps-button', + this._builder.get_object('application_button_first_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('animate-show-apps', + this._builder.get_object('application_button_animation_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-show-apps-button', + this._builder.get_object('application_button_animation_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + + // Behavior panel + + this._settings.bind('hot-keys', + this._builder.get_object('hot_keys_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('hot-keys', + this._builder.get_object('overlay_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('click_action_combo').set_active(this._settings.get_enum('click-action')); + this._builder.get_object('click_action_combo').connect('changed', (widget) => { + this._settings.set_enum('click-action', widget.get_active()); + }); + + this._builder.get_object('scroll_action_combo').set_active(this._settings.get_enum('scroll-action')); + this._builder.get_object('scroll_action_combo').connect('changed', (widget) => { + this._settings.set_enum('scroll-action', widget.get_active()); + }); + + this._builder.get_object('shift_click_action_combo').connect('changed', (widget) => { + this._settings.set_enum('shift-click-action', widget.get_active()); + }); + + this._builder.get_object('middle_click_action_combo').connect('changed', (widget) => { + this._settings.set_enum('middle-click-action', widget.get_active()); + }); + this._builder.get_object('shift_middle_click_action_combo').connect('changed', (widget) => { + this._settings.set_enum('shift-middle-click-action', widget.get_active()); + }); + + // Create dialog for number overlay options + this._builder.get_object('overlay_button').connect('clicked', () => { + + let dialog = new Gtk.Dialog({ title: __('Show dock and application numbers'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + // GTK+ leaves positive values for application-defined response ids. + // Use +1 for the reset action + dialog.add_button(__('Reset to defaults'), 1); + + let box = this._builder.get_object('box_overlay_shortcut'); + dialog.get_content_area().add(box); + + this._builder.get_object('overlay_switch').set_active(this._settings.get_boolean('hotkeys-overlay')); + this._builder.get_object('show_dock_switch').set_active(this._settings.get_boolean('hotkeys-show-dock')); + + // We need to update the shortcut 'strv' when the text is modified + this._settings.connect('changed::shortcut-text', () => {setShortcut(this._settings);}); + this._settings.bind('shortcut-text', + this._builder.get_object('shortcut_entry'), + 'text', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('hotkeys-overlay', + this._builder.get_object('overlay_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('hotkeys-show-dock', + this._builder.get_object('show_dock_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('shortcut-timeout', + this._builder.get_object('timeout_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + + dialog.connect('response', (dialog, id) => { + if (id == 1) { + // restore default settings for the relevant keys + let keys = ['shortcut-text', 'hotkeys-overlay', 'hotkeys-show-dock', 'shortcut-timeout']; + keys.forEach(function(val) { + this._settings.set_value(val, this._settings.get_default_value(val)); + }, this); + } else { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + } + return; + }); + + dialog.show_all(); + }); + + // Create dialog for middle-click options + this._builder.get_object('middle_click_options_button').connect('clicked', () => { + + let dialog = new Gtk.Dialog({ title: __('Customize middle-click behavior'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + // GTK+ leaves positive values for application-defined response ids. + // Use +1 for the reset action + dialog.add_button(__('Reset to defaults'), 1); + + let box = this._builder.get_object('box_middle_click_options'); + dialog.get_content_area().add(box); + + this._builder.get_object('shift_click_action_combo').set_active(this._settings.get_enum('shift-click-action')); + + this._builder.get_object('middle_click_action_combo').set_active(this._settings.get_enum('middle-click-action')); + + this._builder.get_object('shift_middle_click_action_combo').set_active(this._settings.get_enum('shift-middle-click-action')); + + this._settings.bind('shift-click-action', + this._builder.get_object('shift_click_action_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('middle-click-action', + this._builder.get_object('middle_click_action_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('shift-middle-click-action', + this._builder.get_object('shift_middle_click_action_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + + dialog.connect('response', (dialog, id) => { + if (id == 1) { + // restore default settings for the relevant keys + let keys = ['shift-click-action', 'middle-click-action', 'shift-middle-click-action']; + keys.forEach(function(val) { + this._settings.set_value(val, this._settings.get_default_value(val)); + }, this); + this._builder.get_object('shift_click_action_combo').set_active(this._settings.get_enum('shift-click-action')); + this._builder.get_object('middle_click_action_combo').set_active(this._settings.get_enum('middle-click-action')); + this._builder.get_object('shift_middle_click_action_combo').set_active(this._settings.get_enum('shift-middle-click-action')); + } else { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + } + return; + }); + + dialog.show_all(); + + }); + + // Appearance Panel + + this._settings.bind('apply-custom-theme', this._builder.get_object('customize_theme'), 'sensitive', Gio.SettingsBindFlags.INVERT_BOOLEAN | Gio.SettingsBindFlags.GET); + this._settings.bind('apply-custom-theme', this._builder.get_object('builtin_theme_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('custom-theme-shrink', this._builder.get_object('shrink_dash_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); + + // Running indicators + this._builder.get_object('running_indicators_combo').set_active( + this._settings.get_enum('running-indicator-style') + ); + this._builder.get_object('running_indicators_combo').connect( + 'changed', + (widget) => { + this._settings.set_enum('running-indicator-style', widget.get_active()); + } + ); + + if (this._settings.get_enum('running-indicator-style') == RunningIndicatorStyle.DEFAULT) + this._builder.get_object('running_indicators_advance_settings_button').set_sensitive(false); + + this._settings.connect('changed::running-indicator-style', () => { + if (this._settings.get_enum('running-indicator-style') == RunningIndicatorStyle.DEFAULT) + this._builder.get_object('running_indicators_advance_settings_button').set_sensitive(false); + else + this._builder.get_object('running_indicators_advance_settings_button').set_sensitive(true); + }); + + // Create dialog for running indicators advanced settings + this._builder.get_object('running_indicators_advance_settings_button').connect('clicked', () => { + + let dialog = new Gtk.Dialog({ title: __('Customize running indicators'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + let box = this._builder.get_object('running_dots_advance_settings_box'); + dialog.get_content_area().add(box); + + this._settings.bind('running-indicator-dominant-color', + this._builder.get_object('dominant_color_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('custom-theme-customize-running-dots', + this._builder.get_object('dot_style_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('custom-theme-customize-running-dots', + this._builder.get_object('dot_style_settings_box'), + 'sensitive', Gio.SettingsBindFlags.DEFAULT); + + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('custom-theme-running-dots-color')); + this._builder.get_object('dot_color_colorbutton').set_rgba(rgba); + + this._builder.get_object('dot_color_colorbutton').connect('notify::color', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('custom-theme-running-dots-color', hexString); + }); + + rgba.parse(this._settings.get_string('custom-theme-running-dots-border-color')); + this._builder.get_object('dot_border_color_colorbutton').set_rgba(rgba); + + this._builder.get_object('dot_border_color_colorbutton').connect('notify::color', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('custom-theme-running-dots-border-color', hexString); + }); + + this._settings.bind('custom-theme-running-dots-border-width', + this._builder.get_object('dot_border_width_spin_button'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + + + dialog.connect('response', (dialog, id) => { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + return; + }); + + dialog.show_all(); + + }); + + this._settings.bind('custom-background-color', this._builder.get_object('custom_background_color_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('custom-background-color', this._builder.get_object('custom_background_color'), 'sensitive', Gio.SettingsBindFlags.DEFAULT); + + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('background-color')); + this._builder.get_object('custom_background_color').set_rgba(rgba); + + this._builder.get_object('custom_background_color').connect('notify::color', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('background-color', hexString); + }); + + // Opacity + this._builder.get_object('customize_opacity_combo').set_active_id( + this._settings.get_enum('transparency-mode').toString() + ); + this._builder.get_object('customize_opacity_combo').connect( + 'changed', + (widget) => { + this._settings.set_enum('transparency-mode', parseInt(widget.get_active_id())); + } + ); + + this._builder.get_object('custom_opacity_scale').set_value(this._settings.get_double('background-opacity')); + + if (this._settings.get_enum('transparency-mode') !== TransparencyMode.FIXED) + this._builder.get_object('custom_opacity_scale').set_sensitive(false); + + this._settings.connect('changed::transparency-mode', () => { + if (this._settings.get_enum('transparency-mode') !== TransparencyMode.FIXED) + this._builder.get_object('custom_opacity_scale').set_sensitive(false); + else + this._builder.get_object('custom_opacity_scale').set_sensitive(true); + }); + + if (this._settings.get_enum('transparency-mode') !== TransparencyMode.DYNAMIC) { + this._builder.get_object('dynamic_opacity_button').set_sensitive(false); + } + + this._settings.connect('changed::transparency-mode', () => { + if (this._settings.get_enum('transparency-mode') !== TransparencyMode.DYNAMIC) { + this._builder.get_object('dynamic_opacity_button').set_sensitive(false); + } + else { + this._builder.get_object('dynamic_opacity_button').set_sensitive(true); + } + }); + + // Create dialog for transparency advanced settings + this._builder.get_object('dynamic_opacity_button').connect('clicked', () => { + + let dialog = new Gtk.Dialog({ title: __('Cutomize opacity'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + let box = this._builder.get_object('advanced_transparency_dialog'); + dialog.get_content_area().add(box); + + this._settings.bind( + 'customize-alphas', + this._builder.get_object('customize_alphas_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT + ); + this._settings.bind( + 'customize-alphas', + this._builder.get_object('min_alpha_scale'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT + ); + this._settings.bind( + 'customize-alphas', + this._builder.get_object('max_alpha_scale'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT + ); + + this._builder.get_object('min_alpha_scale').set_value( + this._settings.get_double('min-alpha') + ); + this._builder.get_object('max_alpha_scale').set_value( + this._settings.get_double('max-alpha') + ); + + dialog.connect('response', (dialog, id) => { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + return; + }); + + dialog.show_all(); + }); + + + this._settings.bind('unity-backlit-items', + this._builder.get_object('unity_backlit_items_switch'), + 'active', Gio.SettingsBindFlags.DEFAULT + ); + + this._settings.bind('force-straight-corner', + this._builder.get_object('force_straight_corner_switch'), + 'active', Gio.SettingsBindFlags.DEFAULT); + + // About Panel + + this._builder.get_object('extension_version').set_label(Me.metadata.version.toString()); + } +}; + +function init() { + ExtensionUtils.initTranslations(); +} + +function buildPrefsWidget() { + let settings = new Settings(); + let widget = settings.widget; + widget.show_all(); + return widget; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/gschemas.compiled b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/gschemas.compiled new file mode 100644 index 00000000..4dcbc356 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/gschemas.compiled differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml new file mode 100644 index 00000000..65a0c10f --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml @@ -0,0 +1,550 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'LEFT' + Dock position + Dock is shown on the Left, Right, Top or Bottom side of the screen. + + + 0.2 + Animation time + Sets the time duration of the autohide effect. + + + 0.25 + Show delay + Sets the delay after the mouse reaches the screen border before showing the dock. + + + 0.20 + Show delay + Sets the delay after the mouse left the dock before hiding it. + + + false + Set a custom dash background background color + Sets the color for the dash background. + + + "#ffffff" + Dash background color. + Customize the background color of the dash. + + + 'DEFAULT' + Transparency mode for the dock + FIXED: constant transparency. DYNAMIC: dock takes the opaque style only when windows are close to it. + + + 'DEFAULT' + ... + DEFAULT: .... DOTS: .... + + + false + Use application icon dominant color for the indicator color + + + + false + Manually set the min and max opacity + For the dynamic mode, the min/max opacity values will be given by 'min-alpha' and 'max-alpha'. + + + 0.2 + Opacity of the dash background when free-floating + Sets the opacity of the dash background when no windows are close. + + + 0.8 + Opacity of the dash background when windows are close. + Sets the opacity of the dash background when windows are close. + + + 0.8 + Opacity of the dash background + Sets the opacity of the dash background when in autohide mode. + + + true + Dock dodges windows + Enable or disable intellihide mode + + + 'FOCUS_APPLICATION_WINDOWS' + Define which windows are considered for intellihide. + + + + true + Dock shown on mouse over + Enable or disable autohide mode + + + true + Require pressure to show dash + Enable or disable requiring pressure to show the dash + + + 100 + Pressure threshold + Sets how much pressure is needed to show the dash. + + + false + Enable autohide in fullscreen mode. + Enable autohide in fullscreen mode. + + + false + Dock always visible + Dock is always visible + + + true + Switch workspace by scrolling over the dock + Add the possibility to switch workspace by mouse scrolling over the dock. + + + 48 + Maximum dash icon size + Set the allowed maximum dash icon size. Allowed range: 16..64. + + + false + Fixed icon size + Keep the icon size fived by scrolling the dock. + + + false + Apply custom theme + Apply customization to the dash appearance + + + false + TODO + TODO + + + false + Customize the style of the running application indicators. + Customize the style of the running application indicators. + + + "#ffffff" + Running application indicators color + Customize the color of the running application indicators. + + + "#ffffff" + Running application indicators border color. + Customize the border color of the running application indicators. + + + 0 + Running application indicators border width. + Customize the border width of the running application indicators. + + + true + Show running apps + Show or hide running appplications icons in the dash + + + false + Provide workspace isolation + Dash shows only windows from the currentworkspace + + + false + Provide monitor isolation + Dash shows only windows from the monitor + + + true + Show preview of the open windows + Replace open windows list with windows previews + + + true + Show favorites apps + Show or hide favorite appplications icons in the dash + + + true + Show trash can + Show or hide the trash can icon in the dash + + + true + Show mounted volumes and devices + Show or hide mounted volume and device icons in the dash + + + true + Show applications button + Show appplications button in the dash + + + false + Show application button at top + Show appplication button at top of the dash + + + true + Animate Show Applications from the desktop + Animate Show Applications from the desktop + + + true + Basic compatibility with bolt extensions + Make the extension work properly when bolt extensions is enabled + + + 0.90 + Dock max height (fraction of available space) + + + false + Extend the dock container to all the available height + + + -1 + Monitor on which putting the dock + Set on which monitor to put the dock, use -1 for the primary one + + + false + Enable multi-monitor docks + Show a dock on every monitor + + + true + Minimize on shift+click + + + true + Activate only one window + + + 'cycle-windows' + Action when clicking on a running app + Set the action that is executed when clicking on the icon of a running application + + + 'do-nothing' + Action when scrolling app + Set the action that is executed when scrolling on the application icon + + + 'minimize' + Action when shift+clicking on a running app + Set the action that is executed when shift+clicking on the icon of a running application + + + 'launch' + Action when clicking on a running app + Set the action that is executed when middle-clicking on the icon of a running application + + + 'launch' + Action when clicking on a running app + Set the action that is executed when shift+middle-clicking on the icon of a running application + + + true + Super Hot-Keys + Launch and switch between dash items using Super+(0-9) + + + true + Show the dock when using the hotkeys + The dock will be quickly shown so that the number-overlay is visible and app activation is easier + + + "<Super>q" + Keybinding to show the dock and the number overlay. + Behavior depends on hotkeys-show-dock and hotkeys-overlay. + + + q']]]> + Keybinding to show the dock and the number overlay. + Behavior depends on hotkeys-show-dock and hotkeys-overlay. + + + 2 + Timeout to hide the dock + Sets the time duration before the dock is hidden again. + + + true + Show the dock when using the hotkeys + The dock will be quickly shown so that the number-overlay is visible and app activation is easier + + + 1']]]> + Keybinding to launch 1st dash app + + Keybinding to launch 1st app. + + + + 2']]]> + Keybinding to launch 2nd dash app + + Keybinding to launch 2nd app. + + + + 3']]]> + Keybinding to launch 3rd dash app + + Keybinding to launch 3rd app. + + + + 4']]]> + Keybinding to launch 4th dash app + + Keybinding to launch 4th app. + + + + 5']]]> + Keybinding to launch 5th dash app + + Keybinding to launch 5th app. + + + + 6']]]> + Keybinding to launch 6th dash app + + Keybinding to launch 6th app. + + + + 7']]]> + Keybinding to launch 7th dash app + + Keybinding to launch 7th app. + + + + 8']]]> + Keybinding to launch 8th dash app + + Keybinding to launch 8th app. + + + + 9']]]> + Keybinding to launch 9th dash app + + Keybinding to launch 9th app. + + + + 0']]]> + Keybinding to launch 10th dash app + + Keybinding to launch 10th app. + + + + 1']]]> + Keybinding to trigger 1st dash app with shift behavior + + Keybinding to trigger 1st app with shift behavior. + + + + 2']]]> + Keybinding to trigger 2nd dash app with shift behavior + + Keybinding to trigger 2nd app with shift behavior. + + + + 3']]]> + Keybinding to trigger 3rd dash app with shift behavior + + Keybinding to trigger 3rd app with shift behavior. + + + + 4']]]> + Keybinding to trigger 4th dash app with shift behavior + + Keybinding to trigger 4th app with shift behavior. + + + + 5']]]> + Keybinding to trigger 5th dash app with shift behavior + + Keybinding to trigger 5th app with shift behavior. + + + + 6']]]> + Keybinding to trigger 6th dash app with shift behavior + + Keybinding to trigger 6th app with shift behavior. + + + + 7']]]> + Keybinding to trigger 7th dash app with shift behavior + + Keybinding to trigger 7th app with shift behavior. + + + + 8']]]> + Keybinding to trigger 8th dash app with shift behavior + + Keybinding to trigger 8th app with shift behavior. + + + + 9']]]> + Keybinding to trigger 9th dash app with shift behavior + + Keybinding to trigger 9th app with shift behavior. + + + + 0']]]> + Keybinding to trigger 10th dash app with shift behavior + + Keybinding to trigger 10th app with shift behavior. + + + + 1']]]> + Keybinding to trigger 1st dash app + + Keybinding to either show or launch the 1st application in the dash. + + + + 2']]]> + Keybinding to trigger 2nd dash app + + Keybinding to either show or launch the 2nd application in the dash. + + + + 3']]]> + Keybinding to trigger 3rd dash app + + Keybinding to either show or launch the 3rd application in the dash. + + + + 4']]]> + Keybinding to trigger 4th dash app + + Keybinding to either show or launch the 4th application in the dash. + + + + 5']]]> + Keybinding to trigger 5th dash app + + Keybinding to either show or launch the 5th application in the dash. + + + + 6']]]> + Keybinding to trigger 6th dash app + + Keybinding to either show or launch the 6th application in the dash. + + + + 7']]]> + Keybinding to trigger 7th dash app + + Keybinding to either show or launch the 7th application in the dash. + + + + 8']]]> + Keybinding to trigger 8th dash app + + Keybinding to either show or launch the 8th application in the dash. + + + + 9']]]> + Keybinding to trigger 9th dash app + + Keybinding to either show or launch the 9th application in the dash. + + + + 0']]]> + Keybinding to trigger 10th dash app + + Keybinding to either show or launch the 10th application in the dash. + + + + false + Force straight corners in dash + Make the borders in the dash non rounded + + + false + Enable unity7 like glossy backlit items + Emulate the unity7 backlit glossy items behaviour + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/stylesheet.css new file mode 100644 index 00000000..90c448cf --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/stylesheet.css @@ -0,0 +1,178 @@ +/* Shrink the dash by reducing padding and border radius */ +#dashtodockContainer.shrink #dash, +#dashtodockContainer.dashtodock #dash { + border:1px; + padding:0px; +} + +#dashtodockContainer.shrink.left #dash, +#dashtodockContainer.dashtodock.left #dash { + border-left: 0px; +} + + +#dashtodockContainer.shrink.right #dash, +#dashtodockContainer.dashtodock.right #dash { + border-right: 0px; +} + + +#dashtodockContainer.shrink.top #dash, +#dashtodockContainer.dashtodock.top #dash { + border-top: 0px; +} + +#dashtodockContainer.shrink.bottom #dash, +#dashtodockContainer.dashtodock.bottom #dash { + border-bottom: 0px; +} + +#dashtodockContainer.straight-corner #dash, +#dashtodockContainer.shrink.straight-corner #dash { + border-radius: 0px; +} + +/* Scrollview style */ +.bottom #dashtodockDashScrollview, +.top #dashtodockDashScrollview { + -st-hfade-offset: 24px; +} + +.left #dashtodockDashScrollview, +.right #dashtodockDashScrollview { + -st-vfade-offset: 24px; +} + +#dashtodockContainer.running-dots .dash-item-container > StButton, +#dashtodockContainer.dashtodock .dash-item-container > StButton { + transition-duration: 250; + background-size: contain; +} + +#dashtodockContainer.shrink .dash-item-container > StButton, +#dashtodockContainer.dashtodock .dash-item-container > StButton { + padding: 1px 2px; +} + +/* Dash height extended to the whole available vertical space */ +#dashtodockContainer.extended.top #dash, +#dashtodockContainer.extended.right #dash, +#dashtodockContainer.extended.bottom #dash, +#dashtodockContainer.extended.left #dash { + border-radius: 0; +} + +#dashtodockContainer.extended.top #dash, +#dashtodockContainer.extended.bottom #dash { + border-left:0px; + border-right:0px; +} + +#dashtodockContainer.extended.right #dash, +#dashtodockContainer.extended.left #dash { + border-top:0px; + border-bottom:0px; +} + +/* Running and focused application style */ + +#dashtodockContainer.running-dots .app-well-app.running > .overview-icon, +#dashtodockContainer.dashtodock .app-well-app.running > .overview-icon { + background-image:none; +} + + +#dashtodockContainer.running-dots .app-well-app.focused .overview-icon, +#dashtodockContainer.dashtodock .app-well-app.focused .overview-icon { + background-color: rgba(238, 238, 236, 0.2); +} + +#dashtodockContainer.dashtodock #dash { + background: #2e3436; +} + +#dashtodockContainer.dashtodock .progress-bar { + /* Customization of the progress bar style, e.g.: + -progress-bar-background: rgba(0.8, 0.8, 0.8, 1); + -progress-bar-border: rgba(0.9, 0.9, 0.9, 1); + */ +} + +/* + * This is applied to a dummy actor. Only the alpha value for the background and border color + * and the transition-duration are used + */ +#dashtodockContainer.dummy-opaque { + background-color: rgba(0, 0, 0, 0.8); + border-color: rgba(0, 0, 0, 0.4); + transition-duration: 300ms; +} + +/* + * This is applied to a dummy actor. Only the alpha value for the background and border color + * and the transition-duration are used + */ +#dashtodockContainer.dummy-transparent { + background-color: rgba(0, 0, 0, 0.2); + border-color: rgba(0, 0, 0, 0.1); + transition-duration: 500ms; +} + +#dashtodockContainer.opaque { +} + +#dashtodockContainer.transparent { +} + +#dashtodockContainer .number-overlay { + color: rgba(255,255,255,1); + background-color: rgba(0,0,0,0.8); + text-align: center; +} + +#dashtodockContainer .notification-badge { + color: rgba(255,255,255,1); + background-color: rgba(255,0,0,1.0); + padding: 0.2em 0.5em; + border-radius: 1em; + font-weight: bold; + text-align: center; + margin: 2px; +} + +#dashtodockPreviewSeparator.popup-separator-menu-item-horizontal { + width: 1px; + height: auto; + border-right-width: 1px; + margin: 32px 0px; +} + +.dashtodock-app-well-preview-menu-item { + padding: 1em 1em 0.5em 1em; +} + +#dashtodockContainer .metro .overview-icon{ + border-radius: 0px; +} + +#dashtodockContainer.bottom .metro.running2.focused, +#dashtodockContainer.bottom .metro.running3.focused, +#dashtodockContainer.bottom .metro.running4.focused, +#dashtodockContainer.top .metro.running2.focused, +#dashtodockContainer.top .metro.running3.focused, +#dashtodockContainer.top .metro.running4.focused { + background-image: url('./media/highlight_stacked_bg.svg'); + background-position: 0px 0px; + background-size: contain; +} + +#dashtodockContainer.left .metro.running2.focused, +#dashtodockContainer.left .metro.running3.focused, +#dashtodockContainer.left .metro.running4.focused, +#dashtodockContainer.right .metro.running2.focused, +#dashtodockContainer.right .metro.running3.focused, +#dashtodockContainer.right .metro.running4.focused { + background-image: url('./media/highlight_stacked_bg_h.svg'); + background-position: 0px 0px; + background-size: contain; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/theming.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/theming.js new file mode 100644 index 00000000..5ed4cd71 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/theming.js @@ -0,0 +1,572 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Clutter = imports.gi.Clutter; +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const Gtk = imports.gi.Gtk; +const Signals = imports.signals; +const Meta = imports.gi.Meta; +const Shell = imports.gi.Shell; +const St = imports.gi.St; +const Mainloop = imports.mainloop; + +const AppDisplay = imports.ui.appDisplay; +const AppFavorites = imports.ui.appFavorites; +const Dash = imports.ui.dash; +const DND = imports.ui.dnd; +const IconGrid = imports.ui.iconGrid; +const Main = imports.ui.main; +const PopupMenu = imports.ui.popupMenu; +const Util = imports.misc.util; +const Workspace = imports.ui.workspace; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; +const Utils = Me.imports.utils; + +/* + * DEFAULT: transparency given by theme + * FIXED: constant transparency chosen by user + * DYNAMIC: apply 'transparent' style when no windows are close to the dock + * */ +const TransparencyMode = { + DEFAULT: 0, + FIXED: 1, + DYNAMIC: 3 +}; + +/** + * Manage theme customization and custom theme support + */ +var ThemeManager = class DashToDock_ThemeManager { + + constructor(dock) { + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._bindSettingsChanges(); + this._actor = dock; + this._dash = dock.dash; + + // initialize colors with generic values + this._customizedBackground = {red: 0, green: 0, blue: 0, alpha: 0}; + this._customizedBorder = {red: 0, green: 0, blue: 0, alpha: 0}; + this._transparency = new Transparency(dock); + + this._signalsHandler.add([ + // When theme changes re-obtain default background color + St.ThemeContext.get_for_stage (global.stage), + 'changed', + this.updateCustomTheme.bind(this) + ], [ + // update :overview pseudoclass + Main.overview, + 'showing', + this._onOverviewShowing.bind(this) + ], [ + Main.overview, + 'hiding', + this._onOverviewHiding.bind(this) + ]); + + this._updateCustomStyleClasses(); + + // destroy themeManager when the managed actor is destroyed (e.g. extension unload) + // in order to disconnect signals + this._actor.connect('destroy', this.destroy.bind(this)); + + } + + destroy() { + this._signalsHandler.destroy(); + this._transparency.destroy(); + } + + _onOverviewShowing() { + this._actor.add_style_pseudo_class('overview'); + } + + _onOverviewHiding() { + this._actor.remove_style_pseudo_class('overview'); + } + + _updateDashOpacity() { + let newAlpha = Docking.DockManager.settings.get_double('background-opacity'); + + let [backgroundColor, borderColor] = this._getDefaultColors(); + + if (backgroundColor==null) + return; + + // Get the background and border alphas. We check the background alpha + // for a minimum of .001 to prevent division by 0 errors + let backgroundAlpha = Math.max(Math.round(backgroundColor.alpha/2.55)/100, .001); + let borderAlpha = Math.round(borderColor.alpha/2.55)/100; + + // The border and background alphas should remain in sync + // We also limit the borderAlpha to a maximum of 1 (full opacity) + borderAlpha = Math.min((borderAlpha/backgroundAlpha)*newAlpha, 1); + + this._customizedBackground = 'rgba(' + + backgroundColor.red + ',' + + backgroundColor.green + ',' + + backgroundColor.blue + ',' + + newAlpha + ')'; + + this._customizedBorder = 'rgba(' + + borderColor.red + ',' + + borderColor.green + ',' + + borderColor.blue + ',' + + borderAlpha + ')'; + + } + + _getDefaultColors() { + // Prevent shell crash if the actor is not on the stage. + // It happens enabling/disabling repeatedly the extension + if (!this._dash._container.get_stage()) + return [null, null]; + + // Remove custom style + let oldStyle = this._dash._container.get_style(); + this._dash._container.set_style(null); + + let themeNode = this._dash._container.get_theme_node(); + this._dash._container.set_style(oldStyle); + + let backgroundColor = themeNode.get_background_color(); + + // Just in case the theme has different border colors .. + // We want to find the inside border-color of the dock because it is + // the side most visible to the user. We do this by finding the side + // opposite the position + let position = Utils.getPosition(); + let side = position + 2; + if (side > 3) + side = Math.abs(side - 4); + + let borderColor = themeNode.get_border_color(side); + + return [backgroundColor, borderColor]; + } + + _updateDashColor() { + // Retrieve the color. If needed we will adjust it before passing it to + // this._transparency. + let [backgroundColor, borderColor] = this._getDefaultColors(); + + if (backgroundColor==null) + return; + + let settings = Docking.DockManager.settings; + + if (settings.get_boolean('custom-background-color')) { + // When applying a custom color, we need to check the alpha value, + // if not the opacity will always be overridden by the color below. + // Note that if using 'dynamic' transparency modes, + // the opacity will be set by the opaque/transparent styles anyway. + let newAlpha = Math.round(backgroundColor.alpha/2.55)/100; + if (settings.get_enum('transparency-mode') == TransparencyMode.FIXED) + newAlpha = settings.get_double('background-opacity'); + + backgroundColor = Clutter.color_from_string(settings.get_string('background-color'))[1]; + this._customizedBackground = 'rgba(' + + backgroundColor.red + ',' + + backgroundColor.green + ',' + + backgroundColor.blue + ',' + + newAlpha + ')'; + + this._customizedBorder = this._customizedBackground; + } + this._transparency.setColor(backgroundColor); + } + + _updateCustomStyleClasses() { + let settings = Docking.DockManager.settings; + + if (settings.get_boolean('apply-custom-theme')) + this._actor.add_style_class_name('dashtodock'); + else + this._actor.remove_style_class_name('dashtodock'); + + if (settings.get_boolean('custom-theme-shrink')) + this._actor.add_style_class_name('shrink'); + else + this._actor.remove_style_class_name('shrink'); + + if (settings.get_enum('running-indicator-style') !== 0) + this._actor.add_style_class_name('running-dots'); + else + this._actor.remove_style_class_name('running-dots'); + + // If not the built-in theme option is not selected + if (!settings.get_boolean('apply-custom-theme')) { + if (settings.get_boolean('force-straight-corner')) + this._actor.add_style_class_name('straight-corner'); + else + this._actor.remove_style_class_name('straight-corner'); + } else { + this._actor.remove_style_class_name('straight-corner'); + } + } + + updateCustomTheme() { + this._updateCustomStyleClasses(); + this._updateDashOpacity(); + this._updateDashColor(); + this._adjustTheme(); + this._dash._redisplay(); + } + + /** + * Reimported back and adapted from atomdock + */ + _adjustTheme() { + // Prevent shell crash if the actor is not on the stage. + // It happens enabling/disabling repeatedly the extension + if (!this._dash._container.get_stage()) + return; + + let settings = Docking.DockManager.settings; + + // Remove prior style edits + this._dash._container.set_style(null); + this._transparency.disable(); + + // If built-in theme is enabled do nothing else + if (settings.get_boolean('apply-custom-theme')) + return; + + let newStyle = ''; + let position = Utils.getPosition(settings); + + // obtain theme border settings + let themeNode = this._dash._container.get_theme_node(); + let borderColor = themeNode.get_border_color(St.Side.TOP); + let borderWidth = themeNode.get_border_width(St.Side.TOP); + let borderRadius = themeNode.get_border_radius(St.Corner.TOPRIGHT); + + // We're copying border and corner styles to left border and top-left + // corner, also removing bottom border and bottom-right corner styles + let borderInner = ''; + let borderRadiusValue = ''; + let borderMissingStyle = ''; + + if (this._rtl && (position != St.Side.RIGHT)) + borderMissingStyle = 'border-right: ' + borderWidth + 'px solid ' + + borderColor.to_string() + ';'; + else if (!this._rtl && (position != St.Side.LEFT)) + borderMissingStyle = 'border-left: ' + borderWidth + 'px solid ' + + borderColor.to_string() + ';'; + + switch (position) { + case St.Side.LEFT: + borderInner = 'border-left'; + borderRadiusValue = '0 ' + borderRadius + 'px ' + borderRadius + 'px 0;'; + break; + case St.Side.RIGHT: + borderInner = 'border-right'; + borderRadiusValue = borderRadius + 'px 0 0 ' + borderRadius + 'px;'; + break; + case St.Side.TOP: + borderInner = 'border-top'; + borderRadiusValue = '0 0 ' + borderRadius + 'px ' + borderRadius + 'px;'; + break; + case St.Side.BOTTOM: + borderInner = 'border-bottom'; + borderRadiusValue = borderRadius + 'px ' + borderRadius + 'px 0 0;'; + break; + } + + newStyle = borderInner + ': none;' + + 'border-radius: ' + borderRadiusValue + + borderMissingStyle; + + // I do call set_style possibly twice so that only the background gets the transition. + // The transition-property css rules seems to be unsupported + this._dash._container.set_style(newStyle); + + // Customize background + let fixedTransparency = settings.get_enum('transparency-mode') == TransparencyMode.FIXED; + let defaultTransparency = settings.get_enum('transparency-mode') == TransparencyMode.DEFAULT; + if (!defaultTransparency && !fixedTransparency) { + this._transparency.enable(); + } + else if (!defaultTransparency || settings.get_boolean('custom-background-color')) { + newStyle = newStyle + 'background-color:'+ this._customizedBackground + '; ' + + 'border-color:'+ this._customizedBorder + '; ' + + 'transition-delay: 0s; transition-duration: 0.250s;'; + this._dash._container.set_style(newStyle); + } + } + + _bindSettingsChanges() { + let keys = ['transparency-mode', + 'customize-alphas', + 'min-alpha', + 'max-alpha', + 'background-opacity', + 'custom-background-color', + 'background-color', + 'apply-custom-theme', + 'custom-theme-shrink', + 'custom-theme-running-dots', + 'extend-height', + 'force-straight-corner']; + + keys.forEach(function(key) { + this._signalsHandler.add([ + Docking.DockManager.settings, + 'changed::' + key, + this.updateCustomTheme.bind(this) + ]); + }, this); + } +}; + +/** + * The following class is based on the following upstream commit: + * https://git.gnome.org/browse/gnome-shell/commit/?id=447bf55e45b00426ed908b1b1035f472c2466956 + * Transparency when free-floating + */ +var Transparency = class DashToDock_Transparency { + + constructor(dock) { + this._dash = dock.dash; + this._actor = this._dash._container; + this._dockActor = dock; + this._dock = dock; + this._panel = Main.panel; + this._position = Utils.getPosition(); + + // All these properties are replaced with the ones in the .dummy-opaque and .dummy-transparent css classes + this._backgroundColor = '0,0,0'; + this._transparentAlpha = '0.2'; + this._opaqueAlpha = '1'; + this._transparentAlphaBorder = '0.1'; + this._opaqueAlphaBorder = '0.5'; + this._transparentTransition = '0ms'; + this._opaqueTransition = '0ms'; + this._base_actor_style = ""; + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._injectionsHandler = new Utils.InjectionsHandler(); + this._trackedWindows = new Map(); + } + + enable() { + // ensure I never double-register/inject + // although it should never happen + this.disable(); + + this._base_actor_style = this._actor.get_style(); + if (this._base_actor_style == null) { + this._base_actor_style = ""; + } + + this._signalsHandler.addWithLabel('transparency', [ + global.window_group, + 'actor-added', + this._onWindowActorAdded.bind(this) + ], [ + global.window_group, + 'actor-removed', + this._onWindowActorRemoved.bind(this) + ], [ + global.window_manager, + 'switch-workspace', + this._updateSolidStyle.bind(this) + ], [ + Main.overview, + 'hiding', + this._updateSolidStyle.bind(this) + ], [ + Main.overview, + 'showing', + this._updateSolidStyle.bind(this) + ]); + + // Window signals + global.window_group.get_children().filter(function(child) { + // An irrelevant window actor ('Gnome-shell') produces an error when the signals are + // disconnected, therefore do not add signals to it. + return child instanceof Meta.WindowActor && + child.get_meta_window().get_wm_class() !== 'Gnome-shell'; + }).forEach(function(win) { + this._onWindowActorAdded(null, win); + }, this); + + if (this._actor.get_stage()) + this._updateSolidStyle(); + + this._updateStyles(); + this._updateSolidStyle(); + + this.emit('transparency-enabled'); + } + + disable() { + // ensure I never double-register/inject + // although it should never happen + this._signalsHandler.removeWithLabel('transparency'); + + for (let key of this._trackedWindows.keys()) + this._trackedWindows.get(key).forEach(id => { + key.disconnect(id); + }); + this._trackedWindows.clear(); + + this.emit('transparency-disabled'); + } + + destroy() { + this.disable(); + this._signalsHandler.destroy(); + this._injectionsHandler.destroy(); + } + + _onWindowActorAdded(container, metaWindowActor) { + let signalIds = []; + ['allocation-changed', 'notify::visible'].forEach(s => { + signalIds.push(metaWindowActor.connect(s, this._updateSolidStyle.bind(this))); + }); + this._trackedWindows.set(metaWindowActor, signalIds); + } + + _onWindowActorRemoved(container, metaWindowActor) { + if (!this._trackedWindows.get(metaWindowActor)) + return; + + this._trackedWindows.get(metaWindowActor).forEach(id => { + metaWindowActor.disconnect(id); + }); + this._trackedWindows.delete(metaWindowActor); + this._updateSolidStyle(); + } + + _updateSolidStyle() { + let isNear = this._dockIsNear(); + if (isNear) { + this._actor.set_style(this._opaque_style); + this._dockActor.remove_style_class_name('transparent'); + this._dockActor.add_style_class_name('opaque'); + } + else { + this._actor.set_style(this._transparent_style); + this._dockActor.remove_style_class_name('opaque'); + this._dockActor.add_style_class_name('transparent'); + } + + this.emit('solid-style-updated', isNear); + } + + _dockIsNear() { + if (this._dockActor.has_style_pseudo_class('overview')) + return false; + /* Get all the windows in the active workspace that are in the primary monitor and visible */ + let activeWorkspace = global.workspace_manager.get_active_workspace(); + let dash = this._dash; + let windows = activeWorkspace.list_windows().filter(function(metaWindow) { + return metaWindow.get_monitor() === dash._monitorIndex && + metaWindow.showing_on_its_workspace() && + metaWindow.get_window_type() != Meta.WindowType.DESKTOP; + }); + + /* Check if at least one window is near enough to the panel. + * If the dock is hidden, we need to account for the space it would take + * up when it slides out. This is avoid an ugly transition. + * */ + let factor = 0; + if (!Docking.DockManager.settings.get_boolean('dock-fixed') && + this._dock.getDockState() == Docking.State.HIDDEN) + factor = 1; + let [leftCoord, topCoord] = this._actor.get_transformed_position(); + let threshold; + if (this._position === St.Side.LEFT) + threshold = leftCoord + this._actor.get_width() * (factor + 1); + else if (this._position === St.Side.RIGHT) + threshold = leftCoord - this._actor.get_width() * factor; + else if (this._position === St.Side.TOP) + threshold = topCoord + this._actor.get_height() * (factor + 1); + else + threshold = topCoord - this._actor.get_height() * factor; + + let scale = St.ThemeContext.get_for_stage(global.stage).scale_factor; + let isNearEnough = windows.some((metaWindow) => { + let coord; + if (this._position === St.Side.LEFT) { + coord = metaWindow.get_frame_rect().x; + return coord < threshold + 5 * scale; + } + else if (this._position === St.Side.RIGHT) { + coord = metaWindow.get_frame_rect().x + metaWindow.get_frame_rect().width; + return coord > threshold - 5 * scale; + } + else if (this._position === St.Side.TOP) { + coord = metaWindow.get_frame_rect().y; + return coord < threshold + 5 * scale; + } + else { + coord = metaWindow.get_frame_rect().y + metaWindow.get_frame_rect().height; + return coord > threshold - 5 * scale; + } + }); + + return isNearEnough; + } + + _updateStyles() { + this._getAlphas(); + + this._transparent_style = this._base_actor_style + + 'background-color: rgba(' + + this._backgroundColor + ', ' + this._transparentAlpha + ');' + + 'border-color: rgba(' + + this._backgroundColor + ', ' + this._transparentAlphaBorder + ');' + + 'transition-duration: ' + this._transparentTransition + 'ms;'; + + this._opaque_style = this._base_actor_style + + 'background-color: rgba(' + + this._backgroundColor + ', ' + this._opaqueAlpha + ');' + + 'border-color: rgba(' + + this._backgroundColor + ',' + this._opaqueAlphaBorder + ');' + + 'transition-duration: ' + this._opaqueTransition + 'ms;'; + + this.emit('styles-updated'); + } + + setColor(color) { + this._backgroundColor = color.red + ',' + color.green + ',' + color.blue; + this._updateStyles(); + } + + _getAlphas() { + // Create dummy object and add to the uiGroup to get it to the stage + let dummyObject = new St.Bin({ + name: 'dashtodockContainer', + }); + Main.uiGroup.add_child(dummyObject); + + dummyObject.add_style_class_name('dummy-opaque'); + let themeNode = dummyObject.get_theme_node(); + this._opaqueAlpha = themeNode.get_background_color().alpha / 255; + this._opaqueAlphaBorder = themeNode.get_border_color(0).alpha / 255; + this._opaqueTransition = themeNode.get_transition_duration(); + + dummyObject.add_style_class_name('dummy-transparent'); + themeNode = dummyObject.get_theme_node(); + this._transparentAlpha = themeNode.get_background_color().alpha / 255; + this._transparentAlphaBorder = themeNode.get_border_color(0).alpha / 255; + this._transparentTransition = themeNode.get_transition_duration(); + + Main.uiGroup.remove_child(dummyObject); + + let settings = Docking.DockManager.settings; + + if (settings.get_boolean('customize-alphas')) { + this._opaqueAlpha = settings.get_double('max-alpha'); + this._opaqueAlphaBorder = this._opaqueAlpha / 2; + this._transparentAlpha = settings.get_double('min-alpha'); + this._transparentAlphaBorder = this._transparentAlpha / 2; + } + } +}; +Signals.addSignalMethods(Transparency.prototype); diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/utils.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/utils.js new file mode 100644 index 00000000..e0281347 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/utils.js @@ -0,0 +1,284 @@ +const Clutter = imports.gi.Clutter; +const Meta = imports.gi.Meta; +const St = imports.gi.St; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; + +var SignalsHandlerFlags = { + NONE: 0, + CONNECT_AFTER: 1 +}; + +/** + * Simplify global signals and function injections handling + * abstract class + */ +const BasicHandler = class DashToDock_BasicHandler { + + constructor() { + this._storage = new Object(); + } + + add(/* unlimited 3-long array arguments */) { + // Convert arguments object to array, concatenate with generic + let args = Array.concat('generic', Array.slice(arguments)); + // Call addWithLabel with ags as if they were passed arguments + this.addWithLabel.apply(this, args); + } + + destroy() { + for( let label in this._storage ) + this.removeWithLabel(label); + } + + addWithLabel(label /* plus unlimited 3-long array arguments*/) { + if (this._storage[label] == undefined) + this._storage[label] = new Array(); + + // Skip first element of the arguments + for (let i = 1; i < arguments.length; i++) { + let item = this._storage[label]; + try { + item.push(this._create(arguments[i])); + } catch (e) { + logError(e); + } + } + } + + removeWithLabel(label) { + if (this._storage[label]) { + for (let i = 0; i < this._storage[label].length; i++) + this._remove(this._storage[label][i]); + + delete this._storage[label]; + } + } + + // Virtual methods to be implemented by subclass + + /** + * Create single element to be stored in the storage structure + */ + _create(item) { + throw new GObject.NotImplementedError(`_create in ${this.constructor.name}`); + } + + /** + * Correctly delete single element + */ + _remove(item) { + throw new GObject.NotImplementedError(`_remove in ${this.constructor.name}`); + } +}; + +/** + * Manage global signals + */ +var GlobalSignalsHandler = class DashToDock_GlobalSignalHandler extends BasicHandler { + + _create(item) { + let object = item[0]; + let event = item[1]; + let callback = item[2] + let flags = item.length > 3 ? item[3] : SignalsHandlerFlags.NONE; + + if (!object) + throw new Error('Impossible to connect to an invalid object'); + + let after = flags == SignalsHandlerFlags.CONNECT_AFTER; + let connector = after ? object.connect_after : object.connect; + + if (!connector) { + throw new Error(`Requested to connect to signal '${event}', ` + + `but no implementation for 'connect${after ? '_after' : ''}' `+ + `found in ${object.constructor.name}`); + } + + let id = connector.call(object, event, callback); + + return [object, id]; + } + + _remove(item) { + item[0].disconnect(item[1]); + } +}; + +/** + * Color manipulation utilities + */ +var ColorUtils = class DashToDock_ColorUtils { + + // Darken or brigthen color by a fraction dlum + // Each rgb value is modified by the same fraction. + // Return "#rrggbb" string + static ColorLuminance(r, g, b, dlum) { + let rgbString = '#'; + + rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(r*(1+dlum), 0), 255)), 2); + rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(g*(1+dlum), 0), 255)), 2); + rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(b*(1+dlum), 0), 255)), 2); + + return rgbString; + } + + // Convert decimal to an hexadecimal string adding the desired padding + static _decimalToHex(d, padding) { + let hex = d.toString(16); + while (hex.length < padding) + hex = '0'+ hex; + return hex; + } + + // Convert hsv ([0-1, 0-1, 0-1]) to rgb ([0-255, 0-255, 0-255]). + // Following algorithm in https://en.wikipedia.org/wiki/HSL_and_HSV + // here with h = [0,1] instead of [0, 360] + // Accept either (h,s,v) independently or {h:h, s:s, v:v} object. + // Return {r:r, g:g, b:b} object. + static HSVtoRGB(h, s, v) { + if (arguments.length === 1) { + s = h.s; + v = h.v; + h = h.h; + } + + let r,g,b; + let c = v*s; + let h1 = h*6; + let x = c*(1 - Math.abs(h1 % 2 - 1)); + let m = v - c; + + if (h1 <=1) + r = c + m, g = x + m, b = m; + else if (h1 <=2) + r = x + m, g = c + m, b = m; + else if (h1 <=3) + r = m, g = c + m, b = x + m; + else if (h1 <=4) + r = m, g = x + m, b = c + m; + else if (h1 <=5) + r = x + m, g = m, b = c + m; + else + r = c + m, g = m, b = x + m; + + return { + r: Math.round(r * 255), + g: Math.round(g * 255), + b: Math.round(b * 255) + }; + } + + // Convert rgb ([0-255, 0-255, 0-255]) to hsv ([0-1, 0-1, 0-1]). + // Following algorithm in https://en.wikipedia.org/wiki/HSL_and_HSV + // here with h = [0,1] instead of [0, 360] + // Accept either (r,g,b) independently or {r:r, g:g, b:b} object. + // Return {h:h, s:s, v:v} object. + static RGBtoHSV(r, g, b) { + if (arguments.length === 1) { + r = r.r; + g = r.g; + b = r.b; + } + + let h,s,v; + + let M = Math.max(r, g, b); + let m = Math.min(r, g, b); + let c = M - m; + + if (c == 0) + h = 0; + else if (M == r) + h = ((g-b)/c) % 6; + else if (M == g) + h = (b-r)/c + 2; + else + h = (r-g)/c + 4; + + h = h/6; + v = M/255; + if (M !== 0) + s = c/M; + else + s = 0; + + return { + h: h, + s: s, + v: v + }; + } +}; + +/** + * Manage function injection: both instances and prototype can be overridden + * and restored + */ +var InjectionsHandler = class DashToDock_InjectionsHandler extends BasicHandler { + + _create(item) { + let object = item[0]; + let name = item[1]; + let injectedFunction = item[2]; + let original = object[name]; + + object[name] = injectedFunction; + return [object, name, injectedFunction, original]; + } + + _remove(item) { + let object = item[0]; + let name = item[1]; + let original = item[3]; + object[name] = original; + } +}; + +/** + * Return the actual position reverseing left and right in rtl + */ +function getPosition() { + let position = Docking.DockManager.settings.get_enum('dock-position'); + if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) { + if (position == St.Side.LEFT) + position = St.Side.RIGHT; + else if (position == St.Side.RIGHT) + position = St.Side.LEFT; + } + return position; +} + +function drawRoundedLine(cr, x, y, width, height, isRoundLeft, isRoundRight, stroke, fill) { + if (height > width) { + y += Math.floor((height - width) / 2.0); + height = width; + } + + height = 2.0 * Math.floor(height / 2.0); + + var leftRadius = isRoundLeft ? height / 2.0 : 0.0; + var rightRadius = isRoundRight ? height / 2.0 : 0.0; + + cr.moveTo(x + width - rightRadius, y); + cr.lineTo(x + leftRadius, y); + if (isRoundLeft) + cr.arcNegative(x + leftRadius, y + leftRadius, leftRadius, -Math.PI/2, Math.PI/2); + else + cr.lineTo(x, y + height); + cr.lineTo(x + width - rightRadius, y + height); + if (isRoundRight) + cr.arcNegative(x + width - rightRadius, y + rightRadius, rightRadius, Math.PI/2, -Math.PI/2); + else + cr.lineTo(x + width, y); + cr.closePath(); + + if (fill != null) { + cr.setSource(fill); + cr.fillPreserve(); + } + if (stroke != null) + cr.setSource(stroke); + cr.stroke(); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/windowPreview.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/windowPreview.js new file mode 100644 index 00000000..a34cb080 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/windowPreview.js @@ -0,0 +1,586 @@ +/* + * Credits: + * This file is based on code from the Dash to Panel extension by Jason DeRose + * and code from the Taskbar extension by Zorin OS + * Some code was also adapted from the upstream Gnome Shell source code. + */ +const Clutter = imports.gi.Clutter; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const St = imports.gi.St; +const Mainloop = imports.mainloop; +const Main = imports.ui.main; +const Gtk = imports.gi.Gtk; + +const Params = imports.misc.params; +const PopupMenu = imports.ui.popupMenu; +const Workspace = imports.ui.workspace; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Utils = Me.imports.utils; + +const PREVIEW_MAX_WIDTH = 250; +const PREVIEW_MAX_HEIGHT = 150; + +const PREVIEW_ANIMATION_DURATION = 250; + +var WindowPreviewMenu = class DashToDock_WindowPreviewMenu extends PopupMenu.PopupMenu { + + constructor(source) { + let side = Utils.getPosition(); + super(source.actor, 0.5, side); + + // We want to keep the item hovered while the menu is up + this.blockSourceEvents = true; + + this._source = source; + this._app = this._source.app; + let monitorIndex = this._source.monitorIndex; + + this.actor.add_style_class_name('app-well-menu'); + this.actor.set_style('max-width: ' + (Main.layoutManager.monitors[monitorIndex].width - 22) + 'px; ' + + 'max-height: ' + (Main.layoutManager.monitors[monitorIndex].height - 22) + 'px;'); + this.actor.hide(); + + // Chain our visibility and lifecycle to that of the source + this._mappedId = this._source.actor.connect('notify::mapped', () => { + if (!this._source.actor.mapped) + this.close(); + }); + this._destroyId = this._source.actor.connect('destroy', this.destroy.bind(this)); + + Main.uiGroup.add_actor(this.actor); + + // Change the initialized side where required. + this._arrowSide = side; + this._boxPointer._arrowSide = side; + this._boxPointer._userArrowSide = side; + + this.connect('destroy', this._onDestroy.bind(this)); + } + + _redisplay() { + if (this._previewBox) + this._previewBox.destroy(); + this._previewBox = new WindowPreviewList(this._source); + this.addMenuItem(this._previewBox); + this._previewBox._redisplay(); + } + + popup() { + let windows = this._source.getInterestingWindows(); + if (windows.length > 0) { + this._redisplay(); + this.open(); + this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false); + this._source.emit('sync-tooltip'); + } + } + + _onDestroy() { + if (this._mappedId) + this._source.actor.disconnect(this._mappedId); + + if (this._destroyId) + this._source.actor.disconnect(this._destroyId); + } +}; + +var WindowPreviewList = class DashToDock_WindowPreviewList extends PopupMenu.PopupMenuSection { + + constructor(source) { + super(); + this.actor = new St.ScrollView({ name: 'dashtodockWindowScrollview', + hscrollbar_policy: Gtk.PolicyType.NEVER, + vscrollbar_policy: Gtk.PolicyType.NEVER, + enable_mouse_scrolling: true }); + + this.actor.connect('scroll-event', this._onScrollEvent.bind(this)); + + let position = Utils.getPosition(); + this.isHorizontal = position == St.Side.BOTTOM || position == St.Side.TOP; + this.box.set_vertical(!this.isHorizontal); + this.box.set_name('dashtodockWindowList'); + this.actor.add_actor(this.box); + this.actor._delegate = this; + + this._shownInitially = false; + + this._source = source; + this.app = source.app; + + this._redisplayId = Main.initializeDeferredWork(this.actor, this._redisplay.bind(this)); + + this.actor.connect('destroy', this._onDestroy.bind(this)); + this._stateChangedId = this.app.connect('windows-changed', + this._queueRedisplay.bind(this)); + } + + _queueRedisplay () { + Main.queueDeferredWork(this._redisplayId); + } + + _onScrollEvent(actor, event) { + // Event coordinates are relative to the stage but can be transformed + // as the actor will only receive events within his bounds. + let stage_x, stage_y, ok, event_x, event_y, actor_w, actor_h; + [stage_x, stage_y] = event.get_coords(); + [ok, event_x, event_y] = actor.transform_stage_point(stage_x, stage_y); + [actor_w, actor_h] = actor.get_size(); + + // If the scroll event is within a 1px margin from + // the relevant edge of the actor, let the event propagate. + if (event_y >= actor_h - 2) + return Clutter.EVENT_PROPAGATE; + + // Skip to avoid double events mouse + if (event.is_pointer_emulated()) + return Clutter.EVENT_STOP; + + let adjustment, delta; + + if (this.isHorizontal) + adjustment = this.actor.get_hscroll_bar().get_adjustment(); + else + adjustment = this.actor.get_vscroll_bar().get_adjustment(); + + let increment = adjustment.step_increment; + + switch ( event.get_scroll_direction() ) { + case Clutter.ScrollDirection.UP: + delta = -increment; + break; + case Clutter.ScrollDirection.DOWN: + delta = +increment; + break; + case Clutter.ScrollDirection.SMOOTH: + let [dx, dy] = event.get_scroll_delta(); + delta = dy*increment; + delta += dx*increment; + break; + + } + + adjustment.set_value(adjustment.get_value() + delta); + + return Clutter.EVENT_STOP; + } + + _onDestroy() { + this.app.disconnect(this._stateChangedId); + this._stateChangedId = 0; + } + + _createPreviewItem(window) { + let preview = new WindowPreviewMenuItem(window); + return preview; + } + + _redisplay () { + let children = this._getMenuItems().filter(function(actor) { + return actor._window; + }); + + // Windows currently on the menu + let oldWin = children.map(function(actor) { + return actor._window; + }); + + // All app windows with a static order + let newWin = this._source.getInterestingWindows().sort(function(a, b) { + return a.get_stable_sequence() > b.get_stable_sequence(); + }); + + let addedItems = []; + let removedActors = []; + + let newIndex = 0; + let oldIndex = 0; + + while (newIndex < newWin.length || oldIndex < oldWin.length) { + // No change at oldIndex/newIndex + if (oldWin[oldIndex] && + oldWin[oldIndex] == newWin[newIndex]) { + oldIndex++; + newIndex++; + continue; + } + + // Window removed at oldIndex + if (oldWin[oldIndex] && + newWin.indexOf(oldWin[oldIndex]) == -1) { + removedActors.push(children[oldIndex]); + oldIndex++; + continue; + } + + // Window added at newIndex + if (newWin[newIndex] && + oldWin.indexOf(newWin[newIndex]) == -1) { + addedItems.push({ item: this._createPreviewItem(newWin[newIndex]), + pos: newIndex }); + newIndex++; + continue; + } + + // Window moved + let insertHere = newWin[newIndex + 1] && + newWin[newIndex + 1] == oldWin[oldIndex]; + let alreadyRemoved = removedActors.reduce(function(result, actor) { + let removedWin = actor._window; + return result || removedWin == newWin[newIndex]; + }, false); + + if (insertHere || alreadyRemoved) { + addedItems.push({ item: this._createPreviewItem(newWin[newIndex]), + pos: newIndex + removedActors.length }); + newIndex++; + } else { + removedActors.push(children[oldIndex]); + oldIndex++; + } + } + + for (let i = 0; i < addedItems.length; i++) + this.addMenuItem(addedItems[i].item, + addedItems[i].pos); + + for (let i = 0; i < removedActors.length; i++) { + let item = removedActors[i]; + if (this._shownInitially) + item._animateOutAndDestroy(); + else + item.actor.destroy(); + } + + // Skip animations on first run when adding the initial set + // of items, to avoid all items zooming in at once + let animate = this._shownInitially; + + if (!this._shownInitially) + this._shownInitially = true; + + for (let i = 0; i < addedItems.length; i++) + addedItems[i].item.show(animate); + + // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=692744 + // Without it, StBoxLayout may use a stale size cache + this.box.queue_relayout(); + + if (newWin.length < 1) + this._getTopMenu().close(~0); + + // As for upstream: + // St.ScrollView always requests space horizontally for a possible vertical + // scrollbar if in AUTOMATIC mode. Doing better would require implementation + // of width-for-height in St.BoxLayout and St.ScrollView. This looks bad + // when we *don't* need it, so turn off the scrollbar when that's true. + // Dynamic changes in whether we need it aren't handled properly. + let needsScrollbar = this._needsScrollbar(); + let scrollbar_policy = needsScrollbar ? Gtk.PolicyType.AUTOMATIC : Gtk.PolicyType.NEVER; + if (this.isHorizontal) + this.actor.hscrollbar_policy = scrollbar_policy; + else + this.actor.vscrollbar_policy = scrollbar_policy; + + if (needsScrollbar) + this.actor.add_style_pseudo_class('scrolled'); + else + this.actor.remove_style_pseudo_class('scrolled'); + } + + _needsScrollbar() { + let topMenu = this._getTopMenu(); + let topThemeNode = topMenu.actor.get_theme_node(); + if (this.isHorizontal) { + let [topMinWidth, topNaturalWidth] = topMenu.actor.get_preferred_width(-1); + let topMaxWidth = topThemeNode.get_max_width(); + return topMaxWidth >= 0 && topNaturalWidth >= topMaxWidth; + } else { + let [topMinHeight, topNaturalHeight] = topMenu.actor.get_preferred_height(-1); + let topMaxHeight = topThemeNode.get_max_height(); + return topMaxHeight >= 0 && topNaturalHeight >= topMaxHeight; + } + + } + + isAnimatingOut() { + return this.actor.get_children().reduce(function(result, actor) { + return result || actor.animatingOut; + }, false); + } +}; + +var WindowPreviewMenuItem = GObject.registerClass( +class DashToDock_WindowPreviewMenuItem extends PopupMenu.PopupBaseMenuItem { + _init(window, params) { + super._init(params); + + this._window = window; + this._destroyId = 0; + this._windowAddedId = 0; + + // We don't want this: it adds spacing on the left of the item. + this.remove_child(this._ornamentLabel); + this.add_style_class_name('dashtodock-app-well-preview-menu-item'); + + this._cloneBin = new St.Bin(); + this._cloneBin.set_size(PREVIEW_MAX_WIDTH, PREVIEW_MAX_HEIGHT); + + // TODO: improve the way the closebutton is layout. Just use some padding + // for the moment. + this._cloneBin.set_style('padding-bottom: 0.5em'); + + this.closeButton = new St.Button({ style_class: 'window-close', + x_expand: true, + y_expand: true}); + this.closeButton.add_actor(new St.Icon({ icon_name: 'window-close-symbolic' })); + this.closeButton.set_x_align(Clutter.ActorAlign.END); + this.closeButton.set_y_align(Clutter.ActorAlign.START); + + + this.closeButton.opacity = 0; + this.closeButton.connect('clicked', this._closeWindow.bind(this)); + + let overlayGroup = new Clutter.Actor({layout_manager: new Clutter.BinLayout() }); + + overlayGroup.add_actor(this._cloneBin); + overlayGroup.add_actor(this.closeButton); + + let label = new St.Label({ text: window.get_title()}); + label.set_style('max-width: '+PREVIEW_MAX_WIDTH +'px'); + let labelBin = new St.Bin({ child: label, + x_align: St.Align.MIDDLE}); + + this._windowTitleId = this._window.connect('notify::title', () => { + label.set_text(this._window.get_title()); + }); + + let box = new St.BoxLayout({ vertical: true, + reactive:true, + x_expand:true }); + box.add(overlayGroup); + box.add(labelBin); + this.add_actor(box); + + this.connect('enter-event', this._onEnter.bind(this)); + this.connect('leave-event', this._onLeave.bind(this)); + this.connect('key-focus-in', this._onEnter.bind(this)); + this.connect('key-focus-out', this._onLeave.bind(this)); + + this._cloneTexture(window); + + } + + _cloneTexture(metaWin){ + + let mutterWindow = metaWin.get_compositor_private(); + + // Newly-created windows are added to a workspace before + // the compositor finds out about them... + // Moreover sometimes they return an empty texture, thus as a workarounf also check for it size + if (!mutterWindow || !mutterWindow.get_texture() || !mutterWindow.get_size()[0]) { + this._cloneTextureId = Mainloop.idle_add(() => { + // Check if there's still a point in getting the texture, + // otherwise this could go on indefinitely + if (metaWin.get_workspace()) + this._cloneTexture(metaWin); + this._cloneTextureId = 0; + return GLib.SOURCE_REMOVE; + }); + GLib.Source.set_name_by_id(this._cloneTextureId, '[dash-to-dock] this._cloneTexture'); + return; + } + + let [width, height] = mutterWindow.get_size(); + let scale = Math.min(1.0, PREVIEW_MAX_WIDTH/width, PREVIEW_MAX_HEIGHT/height); + let clone = new Clutter.Clone ({ source: mutterWindow, + reactive: true, + width: width * scale, + height: height * scale }); + + // when the source actor is destroyed, i.e. the window closed, first destroy the clone + // and then destroy the menu item (do this animating out) + this._destroyId = mutterWindow.connect('destroy', () => { + clone.destroy(); + this._destroyId = 0; // avoid to try to disconnect this signal from mutterWindow in _onDestroy(), + // as the object was just destroyed + this._animateOutAndDestroy(); + }); + + this._clone = clone; + this._mutterWindow = mutterWindow; + this._cloneBin.set_child(this._clone); + + this._clone.connect('destroy', () => { + if (this._destroyId) { + mutterWindow.disconnect(this._destroyId); + this._destroyId = 0; + } + this._clone = null; + }) + } + + _windowCanClose() { + return this._window.can_close() && + !this._hasAttachedDialogs(); + } + + _closeWindow(actor) { + this._workspace = this._window.get_workspace(); + + // This mechanism is copied from the workspace.js upstream code + // It forces window activation if the windows don't get closed, + // for instance because asking user confirmation, by monitoring the opening of + // such additional confirmation window + this._windowAddedId = this._workspace.connect('window-added', + this._onWindowAdded.bind(this)); + + this.deleteAllWindows(); + } + + deleteAllWindows() { + // Delete all windows, starting from the bottom-most (most-modal) one + //let windows = this._window.get_compositor_private().get_children(); + let windows = this._clone.get_children(); + for (let i = windows.length - 1; i >= 1; i--) { + let realWindow = windows[i].source; + let metaWindow = realWindow.meta_window; + + metaWindow.delete(global.get_current_time()); + } + + this._window.delete(global.get_current_time()); + } + + _onWindowAdded(workspace, win) { + let metaWindow = this._window; + + if (win.get_transient_for() == metaWindow) { + workspace.disconnect(this._windowAddedId); + this._windowAddedId = 0; + + // use an idle handler to avoid mapping problems - + // see comment in Workspace._windowAdded + let activationEvent = Clutter.get_current_event(); + let id = Mainloop.idle_add(() => { + this.emit('activate', activationEvent); + return GLib.SOURCE_REMOVE; + }); + GLib.Source.set_name_by_id(id, '[dash-to-dock] this.emit'); + } + } + + _hasAttachedDialogs() { + // count trasient windows + let n=0; + this._window.foreach_transient(function(){n++;}); + return n>0; + } + + _onEnter() { + this._showCloseButton(); + return Clutter.EVENT_PROPAGATE; + } + + _onLeave() { + if (!this._cloneBin.has_pointer && + !this.closeButton.has_pointer) + this._hideCloseButton(); + + return Clutter.EVENT_PROPAGATE; + } + + _idleToggleCloseButton() { + this._idleToggleCloseId = 0; + + if (!this._cloneBin.has_pointer && + !this.closeButton.has_pointer) + this._hideCloseButton(); + + return GLib.SOURCE_REMOVE; + } + + _showCloseButton() { + + if (this._windowCanClose()) { + this.closeButton.show(); + this.closeButton.remove_all_transitions(); + this.closeButton.ease({ + opacity: 255, + duration: Workspace.WINDOW_OVERLAY_FADE_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD + }); + } + } + + _hideCloseButton() { + this.closeButton.remove_all_transitions(); + this.closeButton.ease({ + opacity: 0, + duration: Workspace.WINDOW_OVERLAY_FADE_TIME, + mode: Clutter.AnimationMode.EASE_IN_QUAD + }); + } + + show(animate) { + let fullWidth = this.get_width(); + + this.opacity = 0; + this.set_width(0); + + let time = animate ? PREVIEW_ANIMATION_DURATION : 0; + this.remove_all_transitions(); + this.ease({ + opacity: 255, + width: fullWidth, + duration: time, + mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD, + }); + } + + _animateOutAndDestroy() { + this.remove_all_transitions(); + this.ease({ + opacity: 0, + duration: PREVIEW_ANIMATION_DURATION, + }); + + this.ease({ + width: 0, + height: 0, + duration: PREVIEW_ANIMATION_DURATION, + delay: PREVIEW_ANIMATION_DURATION, + onComplete: () => this.destroy() + }); + } + + activate() { + this._getTopMenu().close(); + Main.activateWindow(this._window); + } + + _onDestroy() { + super._onDestroy(); + + if (this._cloneTextureId) { + GLib.source_remove(this._cloneTextureId); + this._cloneTextureId = 0; + } + + if (this._windowAddedId > 0) { + this._workspace.disconnect(this._windowAddedId); + this._windowAddedId = 0; + } + + if (this._destroyId > 0) { + this._mutterWindow.disconnect(this._destroyId); + this._destroyId = 0; + } + + if (this._windowTitleId > 0) { + this._window.disconnect(this._windowTitleId); + this._windowTitleId = 0; + } + } +}); diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/extension.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/extension.js new file mode 100644 index 00000000..1de4977c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/extension.js @@ -0,0 +1,35 @@ +'use strict'; + +// User Menu and Volume Indicator +const AggregateMenu = imports.ui.main.panel.statusArea.aggregateMenu; +const VolumeIndicator = AggregateMenu._volume; + +// Scroll Signal Id +var _onScrollEventId = null; + + +function init() { +} + + +function enable() { + // Make the User Menu indicator box reactive so it emits ::scroll-event + AggregateMenu._indicators.reactive = true; + + // Connect the same handler from the volume indicator to ::scroll-event + _onScrollEventId = AggregateMenu._indicators.connect( + 'scroll-event', + VolumeIndicator._onScrollEvent.bind(VolumeIndicator) + ); +} + + +function disable() { + // Undo the above + if (_onScrollEventId) { + AggregateMenu._indicators.reactive = false; + AggregateMenu._indicators.disconnect(_onScrollEventId); + _onScrollEventId = null; + } +} + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/metadata.json b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/metadata.json new file mode 100644 index 00000000..93457e9b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/metadata.json @@ -0,0 +1,13 @@ +{ + "_generated": "Generated by SweetTooth, do not edit", + "description": "Change the volume by scrolling anywhere on the System Tray.\n\nWith this extension, you can scroll over Night Light, WiFi, Volume, Battery or any other icon in the system status tray to change the volume, instead of just the Volume icon.", + "extension-id": "scrovol", + "name": "Scrovol", + "shell-version": [ + "3.28", + "3.30" + ], + "url": "https://github.com/andyholmes/gnome-shell-extension-scrovol/", + "uuid": "scrovol@andyholmes.github.io", + "version": 1 +} \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js new file mode 100644 index 00000000..6d0ec5d8 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js @@ -0,0 +1,484 @@ +/******************************************************************************* + * 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 . + * ***************************************************************************** + * Original Author: Gopi Sankar Karmegam + ******************************************************************************/ +/* jshint moz:true */ + +const Main = imports.ui.main; +const PopupMenu = imports.ui.popupMenu; +const VolumeMenu = imports.ui.status.volume; +const {Atk, St, GObject, GLib} = imports.gi; + +const Gvc = imports.gi.Gvc; +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Lib = Me.imports.convenience; +const Prefs = Me.imports.prefs; +const SignalManager = Lib.SignalManager; + + +var SoundDeviceChooserBase = class SoundDeviceChooserBase{ + + constructor(deviceType) { + Lib.log("SDC: init"); + this.menuItem = new PopupMenu.PopupSubMenuMenuItem ('Extension initialising...', true); + this.deviceType = deviceType; + this._devices = {}; + this._availableDevicesIds = {}; + this._control = VolumeMenu.getMixerControl(); + this._settings = Lib.getSettings(Prefs.SETTINGS_SCHEMA); + Lib.log("Constructor" + deviceType); + + this._setLog(); + this._signalManager = new SignalManager(); + this._signalManager.addSignal(this._settings,"changed::" + Prefs.ENABLE_LOG, this._setLog.bind(this)); + + if(this._control.get_state() == Gvc.MixerControlState.READY) { + this._onControlStateChanged(); + } + else { + this._controlStateChangeSignal = this._signalManager.addSignal(this._control, "state-changed", this._onControlStateChanged.bind(this)); + } + } + + _setLog(){ Lib.setLog(this._settings.get_boolean(Prefs.ENABLE_LOG));} + + _onControlStateChanged() { + if(this._control.get_state() == Gvc.MixerControlState.READY) { + if(!this._initialised) { + this._initialised = true; + + this._signalManager.addSignal(this._control, this.deviceType + "-added", this._deviceAdded.bind(this)); + this._signalManager.addSignal(this._control, this.deviceType + "-removed", this._deviceRemoved.bind(this)); + this._signalManager.addSignal(this._control, "active-" + this.deviceType + "-update", this._deviceActivated.bind(this)); + + this._signalManager.addSignal(this._settings,"changed::" + Prefs.HIDE_ON_SINGLE_DEVICE,this._setChooserVisibility.bind(this) ); + this._signalManager.addSignal(this._settings,"changed::" + Prefs.SHOW_PROFILES , this._setProfileVisibility.bind(this)); + this._signalManager.addSignal(this._settings,"changed::" + Prefs.ICON_THEME , this._setIcons.bind(this)); + this._signalManager.addSignal(this._settings,"changed::" + Prefs.HIDE_MENU_ICONS , this._setIcons.bind(this)); + this._signalManager.addSignal(this._settings,"changed::" + Prefs.PORT_SETTINGS , this._resetDevices.bind(this)); + + this._show_device_signal = Prefs["SHOW_" + this.deviceType.toUpperCase() + "_DEVICES"]; + + this._signalManager.addSignal(this._settings,"changed::" + this._show_device_signal, this._setVisibility.bind(this)); + + this._portsSettings = JSON.parse(this._settings.get_string(Prefs.PORT_SETTINGS)); + + /** + * There is no direct way to get all the UI devices from + * mixercontrol. When enabled after shell loads, the signals + * will not be emitted, a simple hack to look for ids, until any + * uidevice is not found. The UI devices are always serialed + * from from 1 to n + */ + + let id = 0; + let maxId = -1; + let dummyDevice = new Gvc.MixerUIDevice(); + maxId = dummyDevice.get_id(); + Lib.log("Max Id:" + maxId); + + let defaultDevice = this.getDefaultDevice(); + while(++id < maxId) { + let uidevice = this._deviceAdded(this._control, id); + if(uidevice) { + let stream = this._control.get_stream_from_device(uidevice); + if(stream) { + let stream_port = stream.get_port(); + let uidevice_port = uidevice.get_port(); + + if(((!stream_port && !uidevice_port) || + (stream_port && stream_port.port === uidevice_port)) && + stream == defaultDevice) { + this._deviceActivated(this._control, id); + } + } + } + } + + this.activeProfileTimeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, + this._setActiveProfile.bind(this)); + + if(this._controlStateChangeSignal) { + this._controlStateChangeSignal.disconnect(); + delete this._controlStateChangeSignal; + } + this._setVisibility(); + } + } + } + + _deviceAdded(control, id, dontcheck) { + let obj = this._devices[id]; + let uidevice = null; + + if(!obj) { + uidevice = this.lookupDeviceById(id); + if(!uidevice) { + return null; + } + obj = new Object(); + obj.uidevice = uidevice; + obj.text = uidevice.description; + if(uidevice.origin != "") + obj.text += " (" + uidevice.origin + ")"; + + /* + * obj.item = this.menu.addAction( obj.text, function() { + * this.changeDevice(uidevice); }.bind(this)); let icon = + * uidevice.get_icon_name(); if(icon == null || icon.trim() == "") + * icon = this.getDefaultIcon(); obj.item._icon = new St.Icon({ + * style_class: 'popup-menu-icon', icon_name: this._getIcon(icon)}); + * obj.item.actor.insert_child_at_index(obj.item._icon,1); + */ + + let icon = uidevice.get_icon_name(); + if(icon == null || icon.trim() == "") + icon = this.getDefaultIcon(); + let icon_name = this._getIcon(icon); + + obj.item = this.menuItem.menu.addAction( obj.text, function() { + this.changeDevice(uidevice); + }.bind(this), icon_name); + + if(!obj.profiles) { + obj.profiles = Lib.getProfiles(control, uidevice); + } + + if(!obj.profilesitems) { + obj.profilesitems = []; + } + this._devices[id] = obj; + } + else { + uidevice = obj.uidevice; + } + + Lib.log(obj.text); + + if (obj.profiles) { + for (let profile of obj.profiles) { + Lib.log(profile.name) + } + } + + if(obj.active) { + return uidevice; + } + + Lib.log("Added: " + id + ":" + uidevice.description + ":" + uidevice.port_name); + if(!this._availableDevicesIds[id]){ + this._availableDevicesIds[id] = 0; + } + this._availableDevicesIds[id] ++; + + obj.active = true; + obj.activeProfile = uidevice.get_active_profile(); + let showProfiles = this._settings.get_boolean(Prefs.SHOW_PROFILES); + if (obj.profiles) { + for (let profile of obj.profiles) { + let profileItem = obj.profilesitems[profile.name]; + if(!profileItem) { + let profileName = profile.name; + profileItem = this.menuItem.menu.addAction( "Profile: " + profile.human_name, function() { + Lib.log("i am setting profile, " + profile.human_name + ":" + uidevice.description + ":" + uidevice.port_name); + if(this._activeDevice && this._activeDevice.uidevice !== uidevice) { + Lib.log("Changing active device to " + uidevice.description + ":" + uidevice.port_name); + this.changeDevice(uidevice); + } + this._control.change_profile_on_selected_device(uidevice, profileName); + this._setDeviceActiveProfile(obj); + }.bind(this)); + + obj.profilesitems[profileName] = profileItem; + profileItem.setProfileActive = function(active) { + if(active) { + // this._ornamentLabel.text = "\u2727"; + this._ornamentLabel.text = "\t\u266A"; + if(this.add_style_pseudo_class) { + this.add_style_pseudo_class('checked'); + this.remove_style_pseudo_class('insensitive'); + } + else { + this.actor.add_style_pseudo_class('checked'); + this.actor.remove_style_pseudo_class('insensitive'); + } + } + else { + this._ornamentLabel.text = "\t"; + if(this.add_style_pseudo_class) { + this.remove_style_pseudo_class('checked'); + this.add_style_pseudo_class('insensitive'); + } + else { + this.actor.remove_style_pseudo_class('checked'); + this.actor.add_style_pseudo_class('insensitive'); + } + } + }; + // profileItem._ornamentLabel.width = "500em"; + profileItem._ornamentLabel.set_style("min-width: 3em;"); + } + profileItem.setProfileActive(obj.activeProfile == profile.name); + } + } + if (!dontcheck && !this._canShowDevice(uidevice, uidevice.port_available)) { + this._deviceRemoved(control, id, true); + } + this._setChooserVisibility(); + this._setVisibility(); + return uidevice; + } + + _deviceRemoved(control, id, dontcheck) { + let obj = this._devices[id]; + if(obj && obj.active) { + Lib.log("Removed: " + id); + if(!dontcheck && this._canShowDevice(obj.uidevice, false)) { + Lib.log('Device removed, but not hiding as its set to be shown always'); + return; + } + delete this._availableDevicesIds[id] ; + obj.item.actor.visible = false; + obj.active = false; + if (obj.profiles) { + for (let profile of obj.profiles) { + let profileItem = obj.profilesitems[profile.name]; + if(profileItem) { + profileItem.actor.visible = false; + } + } + } + + if(this.deviceRemovedTimout) { + GLib.source_remove(this.deviceRemovedTimout); + this.deviceRemovedTimout = null; + } + /** + * If the active uidevice is removed, then need to activate the + * first available uidevice. However for some cases like Headphones, + * when the uidevice is removed, Speakers are automatically + * activated. So, lets wait for sometime before activating. + */ + this.deviceRemovedTimout = GLib.timeout_add(GLib.PRIORITY_DEFAULT,1500, function() { + if (obj === this._activeDevice) { + for ( let id in this._devices) { + let device = this._devices[id]; + if(device.active == true) { + this.changeDevice(device.uidevice); + break; + } + } + } + this.deviceRemovedTimout = null; + return false; + }.bind(this)); + this._setChooserVisibility(); + this._setVisibility(); + } + } + + _deviceActivated(control, id) { + let obj = this._devices[id]; + if(obj && obj !== this._activeDevice) { + Lib.log("Activated: " + id); + if(this._activeDevice) { + this._activeDevice.item.setOrnament(PopupMenu.Ornament.NONE); + if(this._activeDevice.item.remove_style_pseudo_class) { + this._activeDevice.item.remove_style_pseudo_class('checked'); + } + else { + this._activeDevice.item.actor.remove_style_pseudo_class('checked'); + } + } + this._activeDevice = obj; + obj.item.setOrnament(PopupMenu.Ornament.CHECK); + if(obj.item.add_style_pseudo_class) { + obj.item.add_style_pseudo_class('checked'); + } + else { + obj.item.actor.add_style_pseudo_class('checked'); + } + + obj.item._ornamentLabel.text = '\u266B'; + this.menuItem.label.text = obj.text; + + if (!this._settings.get_boolean(Prefs.HIDE_MENU_ICONS)) { + let icon = obj.uidevice.get_icon_name(); + if(icon == null || icon.trim() == "") + icon = this.getDefaultIcon(); + this.menuItem.icon.icon_name = this._getIcon(icon); + } else { + this.menuItem.icon.icon_name = "blank"; + } + } + } + + _setActiveProfile() { + for (let id in this._devices) { + let device = this._devices[id]; + if(device.active) { + this._setDeviceActiveProfile(device); + } + } + return true; + } + + _setDeviceActiveProfile(device) { + if (!device.uidevice.port_name) { + return; + } + let activeProfile = device.uidevice.get_active_profile(); + if(activeProfile && device.activeProfile != activeProfile) { + device.activeProfile = activeProfile; + for (let profile of device.profiles) { + device.profilesitems[profile.name].setProfileActive(profile.name == device.activeProfile); + } + } + } + + _getDeviceVisibility() { + let hideChooser = this._settings.get_boolean(Prefs.HIDE_ON_SINGLE_DEVICE); + if (hideChooser) { + return (Object.keys(this._availableDevicesIds).length > 1); + } + else { + return true; + } + } + + _setChooserVisibility() { + let visibility = this._getDeviceVisibility(); + for (let id in this._availableDevicesIds) { + this._devices[id].item.actor.visible = visibility; + } + this.menuItem._triangleBin.visible = visibility; + this._setProfileVisibility(); + } + + _setProfileVisibility() { + let visibility = this._settings.get_boolean(Prefs.SHOW_PROFILES); + for (let id in this._availableDevicesIds) { + let device = this._devices[id]; + if ( device.profiles ) { + for (let profile of device.profiles) { + device.profilesitems[profile.name].actor.visible = + (visibility && device.item.actor.visible && Object.keys(device.profilesitems).length > 1); + } + } + } + } + + _getIcon(name) { + let iconsType = this._settings.get_string(Prefs.ICON_THEME); + switch (iconsType) { + case Prefs.ICON_THEME_COLORED: + return name; + case Prefs.ICON_THEME_MONOCHROME: + return name + "-symbolic"; + default: + return "none"; + } + } + + _setIcons() { + // Set the icons in the selection list + for (let id in this._devices) { + let device = this._devices[id]; + let icon = device.uidevice.get_icon_name(); + if(icon == null || icon.trim() == "") + icon = this.getDefaultIcon(); + // device.item._icon.icon_name = this._getIcon(icon); + device.item.setIcon(this._getIcon(icon)); + } + + // These indicate the active device, which is displayed directly in the + // Gnome menu, not in the list. + if (!this._settings.get_boolean(Prefs.HIDE_MENU_ICONS)) { + let icon = this._activeDevice.uidevice.get_icon_name(); + if(icon == null || icon.trim() == "") + icon = this.getDefaultIcon(); + + this.menuItem.icon.icon_name = this._getIcon(icon); + } else { + this.menuItem.icon.icon_name = "blank"; + } + } + + + _canShowDevice(uidevice, defaultValue) { + if(!uidevice || !this._portsSettings || uidevice.port_name == null || uidevice.description == null) { + return defaultValue; + } + + for (let port of this._portsSettings) { + if(port && port.name == uidevice.port_name && port.human_name == uidevice.description) { + switch(port.display_option) { + case 1: + return true; + + case 2: + return false; + + default: + return defaultValue; + } + } + } + return defaultValue; + } + + _resetDevices() { + this._portsSettings = JSON.parse(this._settings.get_string(Prefs.PORT_SETTINGS)); + for (let id in this._devices) { + let device = this._devices[id]; + let uidevice = device.uidevice; + if(uidevice.port_name == null || uidevice.description == null) { + continue; + } + switch(this._canShowDevice(uidevice, uidevice.port_available)) { + case true: + this._deviceAdded(this._control, uidevice.get_id(), true); + break; + case false: + this._deviceRemoved(this._control, uidevice.get_id(), true); + break; + } + } + } + + _setVisibility () { + if (!this._settings.get_boolean(this._show_device_signal)) + this.menuItem.actor.visible = false; + else + // if setting says to show device, check for any device, otherwise + // hide the "actor" + this.menuItem.actor.visible = (Object.keys(this._availableDevicesIds).length > 0); + } + + destroy() { + this._signalManager.disconnectAll(); + if(this.deviceRemovedTimout) { + GLib.source_remove(this.deviceRemovedTimout); + this.deviceRemovedTimout = null; + } + if(this.activeProfileTimeout) { + GLib.source_remove(this.activeProfileTimeout); + this.activeProfileTimeout = null; + } + this.menuItem.destroy(); + } +}; + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js new file mode 100644 index 00000000..aa34f397 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js @@ -0,0 +1,292 @@ +/******************************************************************************* + * 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 . + * ***************************************************************************** + * Original Author: Gopi Sankar Karmegam + ******************************************************************************/ +/* jshint moz:true */ + +const ByteArray = imports.byteArray; +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const ExtensionUtils = imports.misc.extensionUtils; + +const Me = ExtensionUtils.getCurrentExtension(); +const Prefs = Me.imports.prefs; + +var DEBUG = false; + +/** + * getSettings: + * + * @schema: (optional): the GSettings schema id Builds and return a GSettings + * schema for + * @schema, using schema files in extensions dir/schemas. If + * @schema is not provided, it is taken from metadata['settings-schema']. + */ +function getSettings(schema) { + let extension = ExtensionUtils.getCurrentExtension(); + + schema = schema || extension.metadata['settings-schema']; + + const GioSSS = Gio.SettingsSchemaSource; + + // check if this extension was built with "make zip-file", and thus + // has the schema files in a sub-folder + // otherwise assume that extension has been installed in the + // same prefix as gnome-shell (and therefore schemas are available + // in the standard folders) + let schemaDir = extension.dir.get_child('schemas'); + let schemaSource; + if (schemaDir.query_exists(null)) + schemaSource = GioSSS.new_from_directory(schemaDir.get_path(),GioSSS.get_default(),false); + else + schemaSource = GioSSS.get_default(); + + let schemaObj = schemaSource.lookup(schema, true); + if (!schemaObj) + throw new Error('Schema ' + schema + ' could not be found for extension ' + + extension.metadata.uuid + '. Please check your installation.'); + + let _settings = new Gio.Settings({ settings_schema: schemaObj }); + return _settings; +} + +let cards; +function getProfiles(control, uidevice) +{ + let stream = control.lookup_stream_id(uidevice.get_stream_id()); + if(stream) { + if(!cards || Object.keys(cards).length == 0 || !cards[stream.card_index]) { + refreshCards(); + } + + if(cards && cards[stream.card_index]) { + log("Getting profile form stream id " + uidevice.port_name ); + return getProfilesForPort(uidevice.port_name, cards[stream.card_index]); + } + } + else + { + /* Device is not active device, lets try match with port name */ + refreshCards(); + for (let id in cards) { + let profiles; + log("Getting profile from cards " + uidevice.port_name + " for card id " + id); + if((profiles = getProfilesForPort(uidevice.port_name, cards[id]))) + { + return profiles; + } + } + } + + return null; +} + +let ports; +function getPorts(refresh) { + if(!ports || ports.length == 0 || refresh) { + refreshCards(); + } + return ports; +} + +function refreshCards() { + cards = {}; + ports = []; + // if(_settings == null) {getSettings(Prefs.SETTINGS_SCHEMA);} + let _settings = getSettings(Prefs.SETTINGS_SCHEMA); + let error = false; + if(_settings.get_boolean(Prefs.NEW_PROFILE_ID)) { + log("New logic"); + let pyLocation = Me.dir.get_child('utils/pa_helper.py').get_path(); + try { + let [result, out, err, exit_code] = GLib.spawn_command_line_sync('python ' + pyLocation); + // log("result" + result +" out"+out + " exit_code" + exit_code + " + // err" +err); + if(result && !exit_code) { + if (out instanceof Uint8Array) { + out = ByteArray.toString(out); + } + let obj = JSON.parse(out); + cards = obj['cards']; + ports = obj['ports']; + } + } + catch(e) { + error = true; + log('ERROR: Python execution failed. fallback to default mode'); + _settings.set_boolean(Prefs.NEW_PROFILE_ID, false); + Gio.Settings.sync(); + } + } + + if(!_settings.get_boolean(Prefs.NEW_PROFILE_ID) || error){ + try { + let [result, out, err, exit_code] = GLib.spawn_command_line_sync('pactl list cards'); + if(result && !exit_code) { + parseOutput(out); + } + } + catch(e) { + log('ERROR: pactl execution failed. No ports/profiles will be displayed'); + } + } +// log(JSON.stringify(cards)); +// log(JSON.stringify(ports)); + +} + +function parseOutput(out) { + let lines; + if (out instanceof Uint8Array) { + lines = ByteArray.toString(out).split('\n'); + } else { + lines = out.toString().split('\n'); + } + + let cardIndex; + let parseSection = "CARDS"; + let port; + let matches; + // log("Unmatched line:" + out); + while(lines.length > 0) { + let line = lines.shift(); + + if( (matches = /^Card\s#(\d+)$/.exec(line) )) { + cardIndex = matches[1]; + if(!cards[cardIndex]) { + cards[cardIndex] = {'index':cardIndex,'profiles':[], 'ports':[]}; + } + } + else if (line.match(/^\t*Profiles:$/) ) { + parseSection = "PROFILES"; + } + else if (line.match(/^\t*Ports:$/)) { + parseSection = "PORTS"; + } + else if(cards[cardIndex]) { + switch(parseSection) { + case "PROFILES": + if((matches = /.*?((?:output|input)[^+]*?):\s(.*?)\s\(sinks:/.exec(line))) { + cards[cardIndex].profiles.push({'name': matches[1], 'human_name': matches[2]}); + } + break; + case "PORTS": + if((matches = /\t*(.*?):\s(.*?)\s\(priority:/.exec(line))) { + port = {'name' : matches[1], 'human_name' : matches[2]}; + cards[cardIndex].ports.push(port); + ports.push({'name' : matches[1], 'human_name' : matches[2]}); + } + else if( port && (matches = /\t*Part of profile\(s\):\s(.*)/.exec(line))) { + let profileStr = matches[1]; + port.profiles = profileStr.split(', '); + port = null; + } + break; + } + } + } +} + +var Signal = class Signal { + + constructor(signalSource, signalName, callback) { + this._signalSource = signalSource; + this._signalName = signalName; + this._signalCallback = callback; + } + + connect() { + this._signalId = this._signalSource.connect(this._signalName, this._signalCallback); + } + + disconnect() { + if(this._signalId) { + this._signalSource.disconnect(this._signalId); + this._signalId = null; + } + } +} + +var SignalManager = class SignalManager { + constructor() { + this._signals = []; + this._signalsBySource = {}; + } + + addSignal(signalSource, signalName, callback) { + let obj = null; + if(signalSource && signalName && callback) { + obj = new Signal(signalSource, signalName, callback); + obj.connect(); + this._signals.push(obj); + let sourceSignals = this._signalsBySource[signalSource] + if(!sourceSignals) { + sourceSignals = []; + this._signalsBySource[signalSource] = sourceSignals; + } + // this._signalsBySource[signalSource].push(obj) + sourceSignals.push(obj); + } + return obj; + } + + disconnectAll() { + for (let signal of this._signals){ + signal.disconnect(); + } + } + + disconnectBySource(signalSource) { + if(this._signalsBySource[signalSource]) { + for (let signal of this._signalsBySource[signalSource]) { + signal.disconnect(); + } + } + } +} + + +function getProfilesForPort(portName, card) { + if(card.ports) { + for (let port of card.ports) { + if(portName === port.name) { + let profiles = []; + if (port.profiles) { + for (let profile of port.profiles) { + if(profile.indexOf('+input:') == -1) { + for (let cardProfile of card.profiles) { + if(profile === cardProfile.name) { + profiles.push(cardProfile); + } + } + } + } + } + return profiles; + } + } + } + return null; +} + +function setLog(value) { + DEBUG = value; +} + +function log(msg) { + if ( DEBUG == true ) { + global.log("SDC Debug: " + msg); + } +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js new file mode 100644 index 00000000..30f69151 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js @@ -0,0 +1,170 @@ +/******************************************************************************* + * 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 . + * ***************************************************************************** + * Original Author: Gopi Sankar Karmegam + ******************************************************************************/ +/* jshint moz:true */ + +const {GObject} = imports.gi; +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Base = Me.imports.base; +const Lib = Me.imports.convenience; +const SignalManager = Lib.SignalManager; +const Prefs = Me.imports.prefs; +const Main = imports.ui.main; + +var SoundOutputDeviceChooser = class SoundOutputDeviceChooser +extends Base.SoundDeviceChooserBase { + constructor() { + super("output"); + } + lookupDeviceById(id) { + return this._control.lookup_output_id(id); + } + changeDevice(uidevice) { + this._control.change_output(uidevice); + } + getDefaultDevice() { + return this._control.get_default_sink(); + } + getDefaultIcon() { + return "audio-card"; + } +}; + +var SoundInputDeviceChooser = class SoundInputDeviceChooser +extends Base.SoundDeviceChooserBase { + constructor() { + super("input"); + } + lookupDeviceById(id) { + return this._control.lookup_input_id(id); + } + changeDevice(uidevice) { + this._control.change_input(uidevice); + } + getDefaultDevice() { + return this._control.get_default_source(); + } + getDefaultIcon() { + return "audio-input-microphone"; + } +}; + +var InputSliderInstance = class InputSliderInstance { + constructor(volumeMenu, settings ) { + this._input = volumeMenu._input; + this._settings = settings; + this._signalManager = new SignalManager(); + this._signalManager.addSignal(this._settings, "changed::" + + Prefs.SHOW_INPUT_SLIDER, this._setSliderVisiblity.bind(this)); + this._overrideFunction(); + this._setSliderVisiblity(); + } + _overrideFunction() { + this._input._shouldBeVisibleOriginal = this._input._shouldBeVisible; + this._input._shouldBeVisibleCustom = function() { + return this._stream != null; + }; + } + _setSliderVisiblity() { + if (this._settings.get_boolean(Prefs.SHOW_INPUT_SLIDER)) { + this._input._shouldBeVisible = this._input._shouldBeVisibleCustom; + } else { + this._input._shouldBeVisible = this._input._shouldBeVisibleOriginal; + } + this._input._maybeShowInput(); + } + destroy() { + this._signalManager.disconnectAll(); + this._input._shouldBeVisible = this._input._shouldBeVisibleOriginal; + this._input._maybeShowInput(); + delete this._input['_shouldBeVisibleOriginal']; + delete this._input['_shouldBeVisibleCustom']; + } +}; + +var SDCInstance = class SDCInstance { + constructor(){ + this._settings = Lib.getSettings(Prefs.SETTINGS_SCHEMA); + this._aggregateMenu = Main.panel.statusArea.aggregateMenu; + this._volumeMenu = this._aggregateMenu._volume._volumeMenu; + this._aggregateLayout = this._aggregateMenu.menu.box.get_layout_manager(); + } + + enable(){ + if (this._outputInstance == null) { + this._outputInstance = new SoundOutputDeviceChooser(); + } + if (this._inputInstance == null) { + this._inputInstance = new SoundInputDeviceChooser(); + } + + if (this._inputSliderInstance == null) { + this._inputSliderInstance = new InputSliderInstance(this._volumeMenu, this._settings); + } + + this._addMenuItem(this._volumeMenu, this._volumeMenu._output.item, this._outputInstance.menuItem); + this._addMenuItem(this._volumeMenu, this._volumeMenu._input.item, this._inputInstance.menuItem); + + this._expSignalId = this._settings.connect("changed::" + Prefs.EXPAND_VOL_MENU, this._expandVolMenu.bind(this)); + + this._expandVolMenu(); + } + + _addMenuItem(_volumeMenu, checkItem, menuItem){ + let menuItems = _volumeMenu._getMenuItems(); + let i = 0; + for (; i < menuItems.length; i++) { + if (menuItems[i] === checkItem) { + break; + } + } + _volumeMenu.addMenuItem(menuItem, ++i); + } + + _expandVolMenu() { + if (this._settings.get_boolean(Prefs.EXPAND_VOL_MENU)) { + this._aggregateLayout.addSizeChild(this._volumeMenu.actor); + } else { + this._revertVolMenuChanges(); + } + } + + _revertVolMenuChanges() { + this._aggregateLayout._sizeChildren = this._aggregateLayout._sizeChildren.filter(item => item !== this._volumeMenu.actor); + this._aggregateLayout.layout_changed(); + } + + disable(){ + this._revertVolMenuChanges(); + this._outputInstance.destroy(); + this._outputInstance = null; + this._inputInstance.destroy(); + this._inputInstance = null; + this._inputSliderInstance.destroy(); + this._inputSliderInstance = null; + if(this._expSignalId) { + this._settings.disconnect(this._expSignalId); + this._expSignalId = null; + } + } +}; + +function init(extensionMeta) { + let theme = imports.gi.Gtk.IconTheme.get_default(); + theme.append_search_path(extensionMeta.path + "/icons"); + return new SDCInstance(); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/icons/blank.png b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/icons/blank.png new file mode 100644 index 00000000..23568c66 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/icons/blank.png differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/license b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/license new file mode 100644 index 00000000..94a9ed02 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/license @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/metadata.json b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/metadata.json new file mode 100644 index 00000000..39f42916 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/metadata.json @@ -0,0 +1,13 @@ +{ + "_generated": "Generated by SweetTooth, do not edit", + "description": "Shows a list of sound output and input devices (similar to gnome sound settings) in the status menu below the volume slider. Various active ports like HDMI , Speakers etc. of the same device are also displayed for selection. V20+ needs python as dependency. If you want to continue with the old method without Python, use options to switch off New Port identification. But it works with only English", + "name": "Sound Input & Output Device Chooser", + "original-author": "GopI", + "shell-version": [ + "3.34", + "3.32" + ], + "url": "https://github.com/kgshank/gse-sound-output-device-chooser", + "uuid": "sound-output-device-chooser@kgshank.net", + "version": 25 +} \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/prefs.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/prefs.js new file mode 100644 index 00000000..d5d131da --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/prefs.js @@ -0,0 +1,224 @@ +/******************************************************************************* + * 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 . + * + * Original Author: Gopi Sankar Karmegam + ******************************************************************************/ +/* jshint moz:true */ + +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Gio = imports.gi.Gio; +const Gtk = imports.gi.Gtk; +// const Lang = imports.lang; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Lib = Me.imports.convenience; +const SignalManager = Lib.SignalManager; + +var SETTINGS_SCHEMA = "org.gnome.shell.extensions.sound-output-device-chooser"; +var HIDE_ON_SINGLE_DEVICE = "hide-on-single-device"; +var HIDE_MENU_ICONS = "hide-menu-icons"; +var SHOW_PROFILES = "show-profiles"; +var PORT_SETTINGS = "ports-settings"; +var SHOW_INPUT_SLIDER = "show-input-slider"; +var SHOW_INPUT_DEVICES = "show-input-devices"; +var SHOW_OUTPUT_DEVICES = "show-output-devices"; +var ENABLE_LOG = "enable-log"; +var NEW_PROFILE_ID = "new-profile-indentification"; +var EXPAND_VOL_MENU = "expand-volume-menu"; + +var ICON_THEME = "icon-theme"; +var ICON_THEME_COLORED = "colored"; +var ICON_THEME_MONOCHROME = "monochrome"; +var ICON_THEME_NONE = "none"; + +function init(){} + + +const SDCSettingsWidget = new GObject.Class({ + Name: 'SDC.Prefs.Widget', + GTypeName: 'SDCSettingsWidget', + Extends: Gtk.Box, + + _init: function(params) { + this.parent(params); + this.orientation = Gtk.Orientation.VERTICAL; + this.spacing = 0; + + // creates the settings + this._settings = Lib.getSettings(SETTINGS_SCHEMA); + + Lib.setLog(this._settings.get_boolean(ENABLE_LOG)); + + // creates the ui builder and add the main resource file + let uiFilePath = Me.path + "/ui/prefs-dialog.gtkbuilder"; + let builder = new Gtk.Builder(); + + if (builder.add_from_file(uiFilePath) == 0) { + Lib.log("JS LOG: could not load the ui file: %s".format(uiFilePath)); + + let label = new Gtk.Label({ + label: _("Could not load the preferences UI file"), + vexpand: true + }); + + this.pack_start(label, true, true, 0); + } else { + Lib.log('JS LOG:_UI file receive and load: '+uiFilePath); + + let mainContainer = builder.get_object("main-container"); + + this.pack_start(mainContainer, true, true, 0); + + this._signalManager = new SignalManager(); + + let showProfileSwitch = builder.get_object("show-profile"); + let volMenuSwitch = builder.get_object(EXPAND_VOL_MENU); + let singleDeviceSwitch = builder.get_object("single-device"); + let showInputSliderSwitch = builder.get_object("show-input-slider"); + let showInputDevicesSwitch = builder.get_object("show-input-devices"); + let showOutputDevicesSwitch = builder.get_object("show-output-devices"); + let hideMenuIconsSwitch = builder.get_object("hide-menu-icons"); + let iconThemeCombo = builder.get_object("icon-theme"); + let logSwitch = builder.get_object("enable-log"); + let newProfileIdSwitch = builder.get_object("new-profile-identification"); + + this._settings.bind(HIDE_ON_SINGLE_DEVICE, singleDeviceSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(SHOW_PROFILES, showProfileSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(EXPAND_VOL_MENU, volMenuSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(SHOW_INPUT_SLIDER, showInputSliderSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(SHOW_INPUT_DEVICES, showInputDevicesSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(SHOW_OUTPUT_DEVICES, showOutputDevicesSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(HIDE_MENU_ICONS, hideMenuIconsSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(ENABLE_LOG, logSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(NEW_PROFILE_ID, newProfileIdSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(ICON_THEME, iconThemeCombo, "active-id", Gio.SettingsBindFlags.DEFAULT); + + + let showAlwaysToggleRender = builder.get_object("ShowAlwaysToggleRender"); + let hideAlwaysToggleRender = builder.get_object("HideAlwaysToggleRender"); + let showActiveToggleRender = builder.get_object("ShowActiveToggleRender"); + + this._signalManager.addSignal(showAlwaysToggleRender, "toggled", this._showAlwaysToggleRenderCallback.bind(this)); + this._signalManager.addSignal(hideAlwaysToggleRender, "toggled", this._hideAlwaysToggleRenderCallback.bind(this)); + this._signalManager.addSignal(showActiveToggleRender, "toggled", this._showActiveToggleRenderCallback.bind(this)); + + this._portsStore = builder.get_object("ports-store"); + + this._populatePorts(); + this._restorePortsFromSettings(); + } + }, + + _populatePorts: function (){ + let ports = Lib.getPorts(true); + for (let port of ports) + { + this._portsStore.set(this._portsStore.append(),[0,1,2,3,4,5],[port.human_name, false, false, true, port.name,3]); + } + }, + + _showAlwaysToggleRenderCallback: function(widget, path) { + this._toggleCallback(widget, path, 1, [2, 3]); + }, + + _hideAlwaysToggleRenderCallback: function(widget, path) { + this._toggleCallback(widget, path, 2, [1, 3]); + }, + + _showActiveToggleRenderCallback: function(widget, path) { + this._toggleCallback(widget, path, 3, [1, 2]); + }, + + _toggleCallback: function(widget, path, activeCol, inactiveCols) { + let active = !widget.active; + if(!active) + { + return; + } + let [success, iter] = this._portsStore.get_iter_from_string(path); + if (!success) { + return; + } + this._portsStore.set_value(iter, activeCol, active); + this._portsStore.set_value(iter, 5, activeCol); + for (let col of inactiveCols) + { + this._portsStore.set_value(iter, col, !active); + } + this._commitSettings(); + }, + + _commitSettings: function() { + let ports = []; + let [success, iter] = this._portsStore.get_iter_first(); + + while (iter && success) { + if(!this._portsStore.get_value(iter,3)) { + ports.push({ + human_name: this._portsStore.get_value(iter, 0), + name: this._portsStore.get_value(iter, 4), + display_option: this._portsStore.get_value(iter, 5) + }); + } + success = this._portsStore.iter_next(iter); + } + + this._settings.set_string(PORT_SETTINGS, JSON.stringify(ports)); + }, + + _restorePortsFromSettings: function() { + let ports = JSON.parse(this._settings.get_string(PORT_SETTINGS)); + + let found; + for (let port of ports) { + found = false; + if (!port || !port.human_name || !port.name) { + continue; + } + + let [success, iter] = this._portsStore.get_iter_first(); + + while (iter && success) { + let human_name = this._portsStore.get_value(iter, 0); + let name = this._portsStore.get_value(iter, 4); + + if(port.name == name && port.human_name == human_name) { + this._portsStore.set_value(iter, 3, false); + this._portsStore.set_value(iter, port.display_option, true); + this._portsStore.set_value(iter, 5, port.display_option); + found = true; + break; + } + success = this._portsStore.iter_next(iter); + } + + if(!found){ + iter = this._portsStore.append(); + this._portsStore.set(iter, [0,1,2,3,4,5], + [port.human_name, false, false, false, port.name,port.display_option]); + this._portsStore.set_value(iter, port.display_option, true); + } + } + } +}); + + +function buildPrefsWidget() { + let _settingsWidget = new SDCSettingsWidget(); + _settingsWidget.show_all(); + + return _settingsWidget; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/gschemas.compiled b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/gschemas.compiled new file mode 100644 index 00000000..a76d3bec Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/gschemas.compiled differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/org.gnome.shell.extensions.sound-output-device-chooser.gschema.xml b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/org.gnome.shell.extensions.sound-output-device-chooser.gschema.xml new file mode 100644 index 00000000..37e5a426 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/org.gnome.shell.extensions.sound-output-device-chooser.gschema.xml @@ -0,0 +1,78 @@ + + + + + + false + Preference to show the chooser when only one device is available + Value set to false hides the device chooser when only one device is available + + + + true + Preference to show the available profiles for all devices + Value set to true displays the individual available profiles for each device + + + + true + Preference to expand volume menu to fit the name of the sound devices + Value set to true expands the volume menu to fit the names of sound devices displayed in the selector + + + + true + Preference to use monochrome icons instead of default icons + Value set to true uses monochrome icons + + + + true + Preference to show input slider always + Value set to true displays the slider control for input device volume + + + + true + Preference to show input device chooser + Value set to true displays the device chooser for input devices + + + + true + Preference to show output device chooser + Value set to true displays the device chooser for output devices + + + + "[]" + Preference to hide/show different ports always + + + + + "monochrome" + Preference indicating the type of icons used by the extension + Value can be "colored", "monochrome", "none", etc. + + + + false + Preference indicating whether the icons are hidden in the drop-down menu (but are visible in the expanded list). + + + + + false + Preference indicating log messages should be written to console + + + + + true + Preference to enable new logic to identify port profiles + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.gtkbuilder b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.gtkbuilder new file mode 100644 index 00000000..5dc2f8e1 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.gtkbuilder @@ -0,0 +1,829 @@ + + + + + + + + + + + + + + monochrome + Monochrome + + + colored + Colored + + + none + None + + + + + + + + + + + + + + + + + + + + + False + 6 + 6 + 6 + 6 + vertical + 2 + + + True + False + True + True + True + + + True + False + 12 + 6 + 12 + 12 + vertical + 12 + + + True + False + 0 + out + + + True + False + + + True + False + none + + + 100 + True + True + + + True + False + 6 + 6 + + + True + False + start + 5 + Hide selector if there's only one device + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + 100 + True + True + + + True + False + 6 + 6 + + + True + False + start + 5 + Display audio profiles for selection + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + 100 + True + True + + + True + False + 6 + 6 + + + True + False + start + 5 + 20 + Extend Volume Menu to fit device names + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + + + + + True + False + General Settings + + + + + + + + False + True + 0 + + + + + True + False + 0 + out + + + True + False + + + True + False + + + 100 + True + True + + + True + False + center + 6 + 6 + + + True + False + start + 5 + Show output devices + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + + + + + True + False + Output Devices + + + + + + + + False + True + 1 + + + + + True + False + 0 + out + + + True + False + + + True + False + none + + + 100 + True + True + True + + + True + False + center + 6 + 6 + + + True + False + start + 5 + Show input devices + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + 100 + True + True + center + + + True + False + 6 + 6 + + + True + False + start + 5 + Show volume control for default device + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + + + + + True + False + Input Devices + + + + + + + + False + True + 2 + + + + + True + False + 0 + in + + + True + False + + + True + False + none + + + 100 + True + True + + + 6 + True + False + 6 + 6 + + + True + False + start + 5 + Icon Theme + + + True + True + 0 + + + + + 100 + True + False + 5 + icon-theme-store + 0 + + + + 1 + + + + + False + True + 1 + + + + + + + + + 100 + True + True + + + True + False + 6 + 6 + + + True + False + start + 5 + Display icons only in selection list + + + True + True + 0 + + + + + True + True + 5 + + + False + True + 1 + + + + + + + + + + + + + True + False + Icons + + + + + + + + False + True + 3 + + + + + True + False + 0 + in + + + True + False + + + True + False + none + + + 100 + True + True + + + 6 + True + False + 6 + 6 + + + True + False + start + 5 + Enable Log messages + + + True + True + 0 + + + + + True + True + + + False + True + 1 + + + + + + + + + 100 + True + True + + + True + False + 6 + 6 + + + True + False + start + 5 + Enable new profile identification + + + True + True + 0 + + + + + True + True + True + + + False + True + 1 + + + + + + + + + + + + + True + False + Miscellaneous + + + + + + + + False + True + 4 + + + + + False + True + 0 + + + + + True + False + 6 + 12 + 12 + 12 + vertical + + + True + False + True + 0 + out + + + True + False + 4 + 4 + 4 + True + vertical + + + True + True + 0.99999999865889544 + True + True + queue + in + + + True + True + True + ports-store + + + + + + True + autosize + 100 + Name + True + descending + + + + 0 + + + + + + + autosize + Show + + + True + + + 1 + + + + + + + autosize + Hide + + + True + + + 2 + + + + + + + autosize + Default + + + True + + + 3 + + + + + + + + + False + True + 1 + + + + + + + True + False + Port Settings + + + + + + + + False + True + 0 + + + + + False + True + 1 + + + + + False + True + 1 + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py new file mode 100644 index 00000000..e8a614de --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py @@ -0,0 +1,531 @@ +# This file is generated using clang2py script. The following files are used +# '/usr/include/pulse/introspect.h' '/usr/include/pulse/mainloop.h' '/usr/include/pulse/context.h' +# Refer additional licensing requirements for the files included +# sample commands used +# python3 /usr/local/bin/clang2py --clang-args="-I/usr/include/clang/6.0/include -I/usr/include/pulse" -l /usr/lib/x86_64-linux-gnu/libpulse.so '/usr/include/pulse/introspect.h' '/usr/include/pulse/mainloop.h' +# python3 /usr/local/bin/clang2py --clang-args="-I/usr/include/clang/6.0/include -I/usr/include/pulse" -l /usr/lib/x86_64-linux-gnu/libpulse.so '/usr/include/pulse/context.h' +################################################################################ +# # 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 . +# # +# # Original Author: Gopi Sankar Karmegam +# ############################################################################## +# -#- coding: utf-8 -#- +# +# TARGET arch is: ['-I/usr/include/clang/6.0/include', '-I/usr/include/pulse'] +# WORD_SIZE is: 8 +# POINTER_SIZE is: 8 +# LONGDOUBLE_SIZE is: 16 +# + +# Updated to determine libpulse.so location +import ctypes + + + + + + +c_int128 = ctypes.c_ubyte*16 +c_uint128 = c_int128 +void = None +if ctypes.sizeof(ctypes.c_longdouble) == 16: + c_long_double_t = ctypes.c_longdouble +else: + c_long_double_t = ctypes.c_ubyte*16 + +# if local wordsize is same as target, keep ctypes pointer function. +if ctypes.sizeof(ctypes.c_void_p) == 8: + POINTER_T = ctypes.POINTER +else: + # required to access _ctypes + import _ctypes + # Emulate a pointer class using the approriate c_int32/c_int64 type + # The new class should have : + # ['__module__', 'from_param', '_type_', '__dict__', '__weakref__', '__doc__'] + # but the class should be submitted to a unique instance for each base type + # to that if A == B, POINTER_T(A) == POINTER_T(B) + ctypes._pointer_t_type_cache = {} + def POINTER_T(pointee): + # a pointer should have the same length as LONG + fake_ptr_base_type = ctypes.c_uint64 + # specific case for c_void_p + if pointee is None: # VOID pointer type. c_void_p. + pointee = type(None) # ctypes.c_void_p # ctypes.c_ulong + clsname = 'c_void' + else: + clsname = pointee.__name__ + if clsname in ctypes._pointer_t_type_cache: + return ctypes._pointer_t_type_cache[clsname] + # make template + class _T(_ctypes._SimpleCData,): + _type_ = 'L' + _subtype_ = pointee + def _sub_addr_(self): + return self.value + def __repr__(self): + return '%s(%d)'%(clsname, self.value) + def contents(self): + raise TypeError('This is not a ctypes pointer.') + def __init__(self, **args): + raise TypeError('This is not a ctypes pointer. It is not instanciable.') + _class = type('LP_%d_%s'%(8, clsname), (_T,),{}) + ctypes._pointer_t_type_cache[clsname] = _class + return _class + +_libraries = {} +import os.path +if os.path.isfile('/usr/lib/x86_64-linux-gnu/libpulse.so'): + _libraries['libpulse.so'] = ctypes.CDLL('/usr/lib/x86_64-linux-gnu/libpulse.so') +else: + _libraries['libpulse.so'] = ctypes.CDLL('/usr/lib/libpulse.so') + +uint32_t = ctypes.c_uint32 + +size_t = ctypes.c_uint64 +class struct_pa_context(ctypes.Structure): + pass + +pa_context = struct_pa_context +pa_context_notify_cb_t = ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_context), POINTER_T(None)) +pa_context_success_cb_t = POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_context), ctypes.c_int32, POINTER_T(None))) + +class struct_pa_proplist(ctypes.Structure): + pass + +pa_context_event_cb_t = POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_context), ctypes.c_char_p, POINTER_T(struct_pa_proplist), POINTER_T(None))) +class struct_pa_mainloop_api(ctypes.Structure): + pass + +pa_context_new = _libraries['libpulse.so'] .pa_context_new +pa_context_new.restype = POINTER_T(struct_pa_context) +pa_context_new.argtypes = [POINTER_T(struct_pa_mainloop_api), ctypes.c_char_p] + +# pa_context_new_with_proplist = _libraries['libpulse.so'] .pa_context_new_with_proplist +# pa_context_new_with_proplist.restype = POINTER_T(struct_pa_context) +# pa_context_new_with_proplist.argtypes = [POINTER_T(struct_pa_mainloop_api), ctypes.c_char_p, POINTER_T(struct_pa_proplist)] + +pa_context_unref = _libraries['libpulse.so'] .pa_context_unref +pa_context_unref.restype = None +pa_context_unref.argtypes = [POINTER_T(struct_pa_context)] + +# pa_context_ref = _libraries['libpulse.so'] .pa_context_ref +# pa_context_ref.restype = POINTER_T(struct_pa_context) +# pa_context_ref.argtypes = [POINTER_T(struct_pa_context)] + +pa_context_set_state_callback = _libraries['libpulse.so'] .pa_context_set_state_callback +pa_context_set_state_callback.restype = None +pa_context_set_state_callback.argtypes = [POINTER_T(struct_pa_context), pa_context_notify_cb_t, POINTER_T(None)] +# +# pa_context_set_event_callback = _libraries['libpulse.so'] .pa_context_set_event_callback +# pa_context_set_event_callback.restype = None +# pa_context_set_event_callback.argtypes = [POINTER_T(struct_pa_context), pa_context_event_cb_t, POINTER_T(None)] +# +# pa_context_errno = _libraries['libpulse.so'] .pa_context_errno +# pa_context_errno.restype = ctypes.c_int32 +# pa_context_errno.argtypes = [POINTER_T(struct_pa_context)] +# +# pa_context_is_pending = _libraries['libpulse.so'] .pa_context_is_pending +# pa_context_is_pending.restype = ctypes.c_int32 +# pa_context_is_pending.argtypes = [POINTER_T(struct_pa_context)] + + + +# values for enumeration 'pa_context_state' +pa_context_state__enumvalues = { + 0: 'PA_CONTEXT_UNCONNECTED', + 1: 'PA_CONTEXT_CONNECTING', + 2: 'PA_CONTEXT_AUTHORIZING', + 3: 'PA_CONTEXT_SETTING_NAME', + 4: 'PA_CONTEXT_READY', + 5: 'PA_CONTEXT_FAILED', + 6: 'PA_CONTEXT_TERMINATED', +} + +PA_CONTEXT_UNCONNECTED = 0 +PA_CONTEXT_CONNECTING = 1 +PA_CONTEXT_AUTHORIZING = 2 +PA_CONTEXT_SETTING_NAME = 3 +PA_CONTEXT_READY = 4 +PA_CONTEXT_FAILED = 5 +PA_CONTEXT_TERMINATED = 6 + +pa_context_state = ctypes.c_int # enum +pa_context_state_t = pa_context_state +pa_context_state_t__enumvalues = pa_context_state__enumvalues + +pa_context_get_state = _libraries['libpulse.so'] .pa_context_get_state +pa_context_get_state.restype = pa_context_state_t +pa_context_get_state.argtypes = [POINTER_T(struct_pa_context)] + +# values for enumeration 'pa_context_flags' +pa_context_flags__enumvalues = { + 0: 'PA_CONTEXT_NOFLAGS', + 1: 'PA_CONTEXT_NOAUTOSPAWN', + 2: 'PA_CONTEXT_NOFAIL', +} +PA_CONTEXT_NOFLAGS = 0 +PA_CONTEXT_NOAUTOSPAWN = 1 +PA_CONTEXT_NOFAIL = 2 +pa_context_flags = ctypes.c_int # enum +pa_context_flags_t = pa_context_flags +pa_context_flags_t__enumvalues = pa_context_flags__enumvalues +class struct_pa_spawn_api(ctypes.Structure): + pass + +pa_context_connect = _libraries['libpulse.so'] .pa_context_connect +pa_context_connect.restype = ctypes.c_int32 +pa_context_connect.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p, pa_context_flags_t, POINTER_T(struct_pa_spawn_api)] +pa_context_disconnect = _libraries['libpulse.so'] .pa_context_disconnect +pa_context_disconnect.restype = None +pa_context_disconnect.argtypes = [POINTER_T(struct_pa_context)] + +class struct_pa_operation(ctypes.Structure): + pass + +# pa_context_drain = _libraries['libpulse.so'] .pa_context_drain +# pa_context_drain.restype = POINTER_T(struct_pa_operation) +# pa_context_drain.argtypes = [POINTER_T(struct_pa_context), pa_context_notify_cb_t, POINTER_T(None)] +# pa_context_exit_daemon = _libraries['libpulse.so'] .pa_context_exit_daemon +# pa_context_exit_daemon.restype = POINTER_T(struct_pa_operation) +# pa_context_exit_daemon.argtypes = [POINTER_T(struct_pa_context), pa_context_success_cb_t, POINTER_T(None)] +# pa_context_set_default_sink = _libraries['libpulse.so'] .pa_context_set_default_sink +# pa_context_set_default_sink.restype = POINTER_T(struct_pa_operation) +# pa_context_set_default_sink.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p, pa_context_success_cb_t, POINTER_T(None)] +# pa_context_set_default_source = _libraries['libpulse.so'] .pa_context_set_default_source +# pa_context_set_default_source.restype = POINTER_T(struct_pa_operation) +# pa_context_set_default_source.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p, pa_context_success_cb_t, POINTER_T(None)] +# pa_context_is_local = _libraries['libpulse.so'] .pa_context_is_local +# pa_context_is_local.restype = ctypes.c_int32 +# pa_context_is_local.argtypes = [POINTER_T(struct_pa_context)] +# pa_context_set_name = _libraries['libpulse.so'] .pa_context_set_name +# pa_context_set_name.restype = POINTER_T(struct_pa_operation) +# pa_context_set_name.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p, pa_context_success_cb_t, POINTER_T(None)] +# pa_context_get_server = _libraries['libpulse.so'] .pa_context_get_server +# pa_context_get_server.restype = ctypes.c_char_p +# pa_context_get_server.argtypes = [POINTER_T(struct_pa_context)] + +# pa_context_get_protocol_version = _libraries['libpulse.so'] .pa_context_get_protocol_version +# pa_context_get_protocol_version.restype = uint32_t +# pa_context_get_protocol_version.argtypes = [POINTER_T(struct_pa_context)] +# pa_context_get_server_protocol_version = _libraries['libpulse.so'] .pa_context_get_server_protocol_version +# pa_context_get_server_protocol_version.restype = uint32_t +# pa_context_get_server_protocol_version.argtypes = [POINTER_T(struct_pa_context)] +class struct_pa_card_profile_info(ctypes.Structure): + _pack_ = True # source:False + _fields_ = [ + ('name', ctypes.c_char_p), + ('description', ctypes.c_char_p), + ('n_sinks', ctypes.c_uint32), + ('n_sources', ctypes.c_uint32), + ('priority', ctypes.c_uint32), + ('PADDING_0', ctypes.c_ubyte * 4), + ] + +pa_card_profile_info = struct_pa_card_profile_info +class struct_pa_card_profile_info2(ctypes.Structure): + _pack_ = True # source:False + _fields_ = [ + ('name', ctypes.c_char_p), + ('description', ctypes.c_char_p), + ('n_sinks', ctypes.c_uint32), + ('n_sources', ctypes.c_uint32), + ('priority', ctypes.c_uint32), + ('available', ctypes.c_int32), + ] + +pa_card_profile_info2 = struct_pa_card_profile_info2 +class struct_pa_card_port_info(ctypes.Structure): + _pack_ = True # source:False + _fields_ = [ + ('name', ctypes.c_char_p), + ('description', ctypes.c_char_p), + ('priority', ctypes.c_uint32), + ('available', ctypes.c_int32), + ('direction', ctypes.c_int32), + ('n_profiles', ctypes.c_uint32), + ('profiles', POINTER_T(POINTER_T(struct_pa_card_profile_info))), + ('proplist', POINTER_T(struct_pa_proplist)), + ('latency_offset', ctypes.c_int64), + ('profiles2', POINTER_T(POINTER_T(struct_pa_card_profile_info2))), + ] + +pa_card_port_info = struct_pa_card_port_info +class struct_pa_card_info(ctypes.Structure): + _pack_ = True # source:False + _fields_ = [ + ('index', ctypes.c_uint32), + ('PADDING_0', ctypes.c_ubyte * 4), + ('name', ctypes.c_char_p), + ('owner_module', ctypes.c_uint32), + ('PADDING_1', ctypes.c_ubyte * 4), + ('driver', ctypes.c_char_p), + ('n_profiles', ctypes.c_uint32), + ('PADDING_2', ctypes.c_ubyte * 4), + ('profiles', POINTER_T(struct_pa_card_profile_info)), + ('active_profile', POINTER_T(struct_pa_card_profile_info)), + ('proplist', POINTER_T(struct_pa_proplist)), + ('n_ports', ctypes.c_uint32), + ('PADDING_3', ctypes.c_ubyte * 4), + ('ports', POINTER_T(POINTER_T(struct_pa_card_port_info))), + ('profiles2', POINTER_T(POINTER_T(struct_pa_card_profile_info2))), + ('active_profile2', POINTER_T(struct_pa_card_profile_info2)), + ] + +pa_card_info = struct_pa_card_info +pa_card_info_cb_t = ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_context), POINTER_T(struct_pa_card_info), ctypes.c_int32, POINTER_T(None)) +pa_context_get_card_info_by_index = _libraries['libpulse.so'].pa_context_get_card_info_by_index +pa_context_get_card_info_by_index.restype = POINTER_T(struct_pa_operation) +pa_context_get_card_info_by_index.argtypes = [POINTER_T(struct_pa_context), uint32_t, pa_card_info_cb_t, POINTER_T(None)] + + +pa_context_get_card_info_list = _libraries['libpulse.so'].pa_context_get_card_info_list +pa_context_get_card_info_list.restype = POINTER_T(struct_pa_operation) +pa_context_get_card_info_list.argtypes = [POINTER_T(struct_pa_context), pa_card_info_cb_t, POINTER_T(None)] + + +# values for enumeration 'pa_update_mode' +# pa_update_mode__enumvalues = { +# 0: 'PA_UPDATE_SET', +# 1: 'PA_UPDATE_MERGE', +# 2: 'PA_UPDATE_REPLACE', +# } +# PA_UPDATE_SET = 0 +# PA_UPDATE_MERGE = 1 +# PA_UPDATE_REPLACE = 2 +# pa_update_mode = ctypes.c_int # enum +# pa_update_mode_t = pa_update_mode +# pa_update_mode_t__enumvalues = pa_update_mode__enumvalues +# pa_context_proplist_update = _libraries['libpulse.so'] .pa_context_proplist_update +# pa_context_proplist_update.restype = POINTER_T(struct_pa_operation) +# pa_context_proplist_update.argtypes = [POINTER_T(struct_pa_context), pa_update_mode_t, POINTER_T(struct_pa_proplist), pa_context_success_cb_t, POINTER_T(None)] +# pa_context_proplist_remove = _libraries['libpulse.so'] .pa_context_proplist_remove +# pa_context_proplist_remove.restype = POINTER_T(struct_pa_operation) +# pa_context_proplist_remove.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p * 0, pa_context_success_cb_t, POINTER_T(None)] +# pa_context_get_index = _libraries['libpulse.so'] .pa_context_get_index +# pa_context_get_index.restype = uint32_t +# pa_context_get_index.argtypes = [POINTER_T(struct_pa_context)] +class struct_pa_time_event(ctypes.Structure): + pass + +# pa_usec_t = ctypes.c_uint64 +class struct_timeval(ctypes.Structure): + pass +# +# pa_time_event_cb_t = POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_time_event), POINTER_T(struct_timeval), POINTER_T(None))) +# pa_context_rttime_new = _libraries['libpulse.so'] .pa_context_rttime_new +# pa_context_rttime_new.restype = POINTER_T(struct_pa_time_event) +# pa_context_rttime_new.argtypes = [POINTER_T(struct_pa_context), pa_usec_t, pa_time_event_cb_t, POINTER_T(None)] +# pa_context_rttime_restart = _libraries['libpulse.so'] .pa_context_rttime_restart +# pa_context_rttime_restart.restype = None +# pa_context_rttime_restart.argtypes = [POINTER_T(struct_pa_context), POINTER_T(struct_pa_time_event), pa_usec_t] +class struct_pa_sample_spec(ctypes.Structure): + pass + +# pa_context_get_tile_size = _libraries['libpulse.so'] .pa_context_get_tile_size +# pa_context_get_tile_size.restype = size_t +# pa_context_get_tile_size.argtypes = [POINTER_T(struct_pa_context), POINTER_T(struct_pa_sample_spec)] +# pa_context_load_cookie_from_file = _libraries['libpulse.so'] .pa_context_load_cookie_from_file +# pa_context_load_cookie_from_file.restype = ctypes.c_int32 +# pa_context_load_cookie_from_file.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p] +# struct_pa_spawn_api._pack_ = True # source:False +# struct_pa_spawn_api._fields_ = [ +# ('prefork', POINTER_T(ctypes.CFUNCTYPE(None))), +# ('postfork', POINTER_T(ctypes.CFUNCTYPE(None))), +# ('atfork', POINTER_T(ctypes.CFUNCTYPE(None))), +# ] +# + +# values for enumeration 'pa_io_event_flags' +pa_io_event_flags__enumvalues = { + 0: 'PA_IO_EVENT_NULL', + 1: 'PA_IO_EVENT_INPUT', + 2: 'PA_IO_EVENT_OUTPUT', + 4: 'PA_IO_EVENT_HANGUP', + 8: 'PA_IO_EVENT_ERROR', +} +PA_IO_EVENT_NULL = 0 +PA_IO_EVENT_INPUT = 1 +PA_IO_EVENT_OUTPUT = 2 +PA_IO_EVENT_HANGUP = 4 +PA_IO_EVENT_ERROR = 8 +pa_io_event_flags = ctypes.c_int # enum +class struct_pa_io_event(ctypes.Structure): + pass + +class struct_pa_defer_event(ctypes.Structure): + pass + +struct_pa_mainloop_api._pack_ = True # source:False +struct_pa_mainloop_api._fields_ = [ + ('userdata', POINTER_T(None)), + ('io_new', POINTER_T(ctypes.CFUNCTYPE(POINTER_T(struct_pa_io_event), POINTER_T(struct_pa_mainloop_api), ctypes.c_int32, pa_io_event_flags, POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_io_event), ctypes.c_int32, pa_io_event_flags, POINTER_T(None))), POINTER_T(None)))), + ('io_enable', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_io_event), pa_io_event_flags))), + ('io_free', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_io_event)))), + ('io_set_destroy', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_io_event), POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_io_event), POINTER_T(None)))))), + ('time_new', POINTER_T(ctypes.CFUNCTYPE(POINTER_T(struct_pa_time_event), POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_timeval), POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_time_event), POINTER_T(struct_timeval), POINTER_T(None))), POINTER_T(None)))), + ('time_restart', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_time_event), POINTER_T(struct_timeval)))), + ('time_free', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_time_event)))), + ('time_set_destroy', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_time_event), POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_time_event), POINTER_T(None)))))), + ('defer_new', POINTER_T(ctypes.CFUNCTYPE(POINTER_T(struct_pa_defer_event), POINTER_T(struct_pa_mainloop_api), POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_defer_event), POINTER_T(None))), POINTER_T(None)))), + ('defer_enable', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_defer_event), ctypes.c_int32))), + ('defer_free', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_defer_event)))), + ('defer_set_destroy', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_defer_event), POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_defer_event), POINTER_T(None)))))), + ('quit', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), ctypes.c_int32))), +] + +class struct_pollfd(ctypes.Structure): + pass + +class struct_pa_mainloop(ctypes.Structure): + pass + +pa_mainloop = struct_pa_mainloop +pa_mainloop_new = _libraries['libpulse.so'] .pa_mainloop_new +pa_mainloop_new.restype = POINTER_T(struct_pa_mainloop) +pa_mainloop_new.argtypes = [] +pa_mainloop_free = _libraries['libpulse.so'] .pa_mainloop_free +pa_mainloop_free.restype = None +pa_mainloop_free.argtypes = [POINTER_T(struct_pa_mainloop)] + +# pa_mainloop_prepare = _libraries['libpulse.so'] .pa_mainloop_prepare +# pa_mainloop_prepare.restype = ctypes.c_int32 +# pa_mainloop_prepare.argtypes = [POINTER_T(struct_pa_mainloop), ctypes.c_int32] +# pa_mainloop_poll = _libraries['libpulse.so'] .pa_mainloop_poll +# pa_mainloop_poll.restype = ctypes.c_int32 +# pa_mainloop_poll.argtypes = [POINTER_T(struct_pa_mainloop)] +# pa_mainloop_dispatch = _libraries['libpulse.so'] .pa_mainloop_dispatch +# pa_mainloop_dispatch.restype = ctypes.c_int32 +# pa_mainloop_dispatch.argtypes = [POINTER_T(struct_pa_mainloop)] +# pa_mainloop_get_retval = _libraries['libpulse.so'] .pa_mainloop_get_retval +# pa_mainloop_get_retval.restype = ctypes.c_int32 +# pa_mainloop_get_retval.argtypes = [POINTER_T(struct_pa_mainloop)] + +pa_mainloop_iterate = _libraries['libpulse.so'] .pa_mainloop_iterate +pa_mainloop_iterate.restype = ctypes.c_int32 +pa_mainloop_iterate.argtypes = [POINTER_T(struct_pa_mainloop), ctypes.c_int32, POINTER_T(ctypes.c_int32)] + +# pa_mainloop_run = _libraries['libpulse.so'] .pa_mainloop_run +# pa_mainloop_run.restype = ctypes.c_int32 +# pa_mainloop_run.argtypes = [POINTER_T(struct_pa_mainloop), POINTER_T(ctypes.c_int32)] +pa_mainloop_get_api = _libraries['libpulse.so'] .pa_mainloop_get_api +pa_mainloop_get_api.restype = POINTER_T(struct_pa_mainloop_api) +pa_mainloop_get_api.argtypes = [POINTER_T(struct_pa_mainloop)] +# pa_mainloop_quit = _libraries['libpulse.so'] .pa_mainloop_quit +# pa_mainloop_quit.restype = None +# pa_mainloop_quit.argtypes = [POINTER_T(struct_pa_mainloop), ctypes.c_int32] +# pa_mainloop_wakeup = _libraries['libpulse.so'] .pa_mainloop_wakeup +# pa_mainloop_wakeup.restype = None +# pa_mainloop_wakeup.argtypes = [POINTER_T(struct_pa_mainloop)] +# pa_poll_func = POINTER_T(ctypes.CFUNCTYPE(ctypes.c_int32, POINTER_T(struct_pollfd), ctypes.c_uint64, ctypes.c_int32, POINTER_T(None))) +# pa_mainloop_set_poll_func = _libraries['libpulse.so'] .pa_mainloop_set_poll_func +# pa_mainloop_set_poll_func.restype = None +# pa_mainloop_set_poll_func.argtypes = [POINTER_T(struct_pa_mainloop), pa_poll_func, POINTER_T(None)] + +pa_operation_unref = _libraries['libpulse.so'] .pa_operation_unref +pa_operation_unref.restype = None +pa_operation_unref.argtypes = [POINTER_T(struct_pa_operation)] + +# values for enumeration 'pa_sample_format' +# pa_sample_format__enumvalues = { +# 0: 'PA_SAMPLE_U8', +# 1: 'PA_SAMPLE_ALAW', +# 2: 'PA_SAMPLE_ULAW', +# 3: 'PA_SAMPLE_S16LE', +# 4: 'PA_SAMPLE_S16BE', +# 5: 'PA_SAMPLE_FLOAT32LE', +# 6: 'PA_SAMPLE_FLOAT32BE', +# 7: 'PA_SAMPLE_S32LE', +# 8: 'PA_SAMPLE_S32BE', +# 9: 'PA_SAMPLE_S24LE', +# 10: 'PA_SAMPLE_S24BE', +# 11: 'PA_SAMPLE_S24_32LE', +# 12: 'PA_SAMPLE_S24_32BE', +# 13: 'PA_SAMPLE_MAX', +# -1: 'PA_SAMPLE_INVALID', +# } +# PA_SAMPLE_U8 = 0 +# PA_SAMPLE_ALAW = 1 +# PA_SAMPLE_ULAW = 2 +# PA_SAMPLE_S16LE = 3 +# PA_SAMPLE_S16BE = 4 +# PA_SAMPLE_FLOAT32LE = 5 +# PA_SAMPLE_FLOAT32BE = 6 +# PA_SAMPLE_S32LE = 7 +# PA_SAMPLE_S32BE = 8 +# PA_SAMPLE_S24LE = 9 +# PA_SAMPLE_S24BE = 10 +# PA_SAMPLE_S24_32LE = 11 +# PA_SAMPLE_S24_32BE = 12 +# PA_SAMPLE_MAX = 13 +# PA_SAMPLE_INVALID = -1 +# pa_sample_format = ctypes.c_int # enum +# struct_pa_sample_spec._pack_ = True # source:False +# struct_pa_sample_spec._fields_ = [ +# ('format', pa_sample_format), +# ('rate', ctypes.c_uint32), +# ('channels', ctypes.c_ubyte), +# ('PADDING_0', ctypes.c_ubyte * 3), +# ] +# +# struct_timeval._pack_ = True # source:False +# struct_timeval._fields_ = [ +# ('tv_sec', ctypes.c_int64), +# ('tv_usec', ctypes.c_int64), +# ] + +__all__ = \ + ['PA_CONTEXT_AUTHORIZING', 'PA_CONTEXT_CONNECTING', + 'PA_CONTEXT_FAILED', 'PA_CONTEXT_NOAUTOSPAWN', + 'PA_CONTEXT_NOFAIL', 'PA_CONTEXT_NOFLAGS', 'PA_CONTEXT_READY', + 'PA_CONTEXT_SETTING_NAME', 'PA_CONTEXT_TERMINATED', + 'PA_CONTEXT_UNCONNECTED', 'PA_IO_EVENT_ERROR', + 'PA_IO_EVENT_HANGUP', 'PA_IO_EVENT_INPUT', 'PA_IO_EVENT_NULL', + 'PA_IO_EVENT_OUTPUT', 'PA_SAMPLE_ALAW', 'PA_SAMPLE_FLOAT32BE', + 'PA_SAMPLE_FLOAT32LE', 'PA_SAMPLE_INVALID', 'PA_SAMPLE_MAX', + 'PA_SAMPLE_S16BE', 'PA_SAMPLE_S16LE', 'PA_SAMPLE_S24BE', + 'PA_SAMPLE_S24LE', 'PA_SAMPLE_S24_32BE', 'PA_SAMPLE_S24_32LE', + 'PA_SAMPLE_S32BE', 'PA_SAMPLE_S32LE', 'PA_SAMPLE_U8', + 'PA_SAMPLE_ULAW', 'PA_UPDATE_MERGE', 'PA_UPDATE_REPLACE', + 'PA_UPDATE_SET', 'pa_context', 'pa_context_connect', + 'pa_context_disconnect', 'pa_context_drain', 'pa_context_errno', + 'pa_context_event_cb_t', 'pa_context_exit_daemon', + 'pa_context_flags', 'pa_context_flags_t', + 'pa_context_flags_t__enumvalues', 'pa_context_get_index', + 'pa_context_get_protocol_version', 'pa_context_get_server', + 'pa_context_get_server_protocol_version', 'pa_context_get_state', + 'pa_context_get_tile_size', 'pa_context_is_local', + 'pa_context_is_pending', 'pa_context_load_cookie_from_file', + 'pa_context_new', 'pa_context_new_with_proplist', + 'pa_context_notify_cb_t', 'pa_context_proplist_remove', + 'pa_context_proplist_update', 'pa_context_ref', + 'pa_context_rttime_new', 'pa_context_rttime_restart', + 'pa_context_set_default_sink', 'pa_context_set_default_source', + 'pa_context_set_event_callback', 'pa_context_set_name', + 'pa_context_set_state_callback', 'pa_context_state', + 'pa_context_state_t', 'pa_context_state_t__enumvalues', + 'pa_context_success_cb_t', 'pa_context_unref', + 'pa_io_event_flags', 'pa_mainloop', 'pa_mainloop_dispatch', + 'pa_mainloop_free', 'pa_mainloop_get_api', + 'pa_mainloop_get_retval', 'pa_mainloop_iterate', + 'pa_mainloop_new', 'pa_mainloop_poll', 'pa_mainloop_prepare', + 'pa_mainloop_quit', 'pa_mainloop_run', + 'pa_mainloop_set_poll_func', 'pa_mainloop_wakeup', 'pa_poll_func', + 'pa_sample_format', 'pa_time_event_cb_t', 'pa_update_mode', + 'pa_update_mode_t', 'pa_update_mode_t__enumvalues', 'pa_usec_t', + 'size_t', 'struct_pa_context', 'struct_pa_defer_event', + 'struct_pa_io_event', 'struct_pa_mainloop', + 'struct_pa_mainloop_api', 'struct_pa_operation', + 'struct_pa_proplist', 'struct_pa_sample_spec', + 'struct_pa_spawn_api', 'struct_pa_time_event', 'struct_pollfd', + 'struct_timeval', 'uint32_t'] \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/pa_helper.py b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/pa_helper.py new file mode 100644 index 00000000..d1291860 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/pa_helper.py @@ -0,0 +1,134 @@ +#!/usr/bin/python +############################################################################### + # 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 . + # + # Original Author: Gopi Sankar Karmegam + ############################################################################## + +import libpulse_introspect as pa +import sys +from ctypes import c_int,byref +import time +from json import dumps + +class PAHelper(): + + _error = { + 'success': False, + 'error': None, + } + _card_op_done = None + _pa_state = pa.PA_CONTEXT_UNCONNECTED + + + def __init__(self): + self._ports = [] + self._cards = {} + self.mainloop = pa.pa_mainloop_new() + self._context = pa.pa_context_new( pa.pa_mainloop_get_api(self.mainloop), b'PAHelper') + self._pa_context_notify_cb_t = pa.pa_context_notify_cb_t(self.pa_context_notify_cb_t) + pa.pa_context_set_state_callback(self._context, self._pa_context_notify_cb_t , None) + pa.pa_context_connect(self._context, None, 0, None) + self._opn_completed = False + + def print_card_info(self, index = None): + operation = None + retVal = c_int() + counter = 0 + + while counter < 10000 and self._opn_completed == False: + counter += 1 + if self._pa_state == pa.PA_CONTEXT_READY and operation == None: + self._pa_card_info_cb_t = pa.pa_card_info_cb_t(self.pa_card_info_cb) +# operation = pa.pa_context_get_card_info_by_index(self._context, +# index, self._pa_card_info_cb_t , None) + operation = pa.pa_context_get_card_info_list(self._context, + self._pa_card_info_cb_t , None) + + pa.pa_mainloop_iterate(self.mainloop, 0, byref(retVal)) + +# print(dumps(self._ports, indent = 5)) + print(dumps({'cards': self._cards, 'ports':self._ports}, indent = 5)) + + try: + if operation: + pa.pa_operation_unref(operation) + + pa.pa_context_disconnect(self._context) + pa.pa_context_unref(self._context) + pa.pa_mainloop_free(self.mainloop) + except: + pass + + def pa_card_info_cb(self, context, card_info, eol, whatever): + + if not card_info or not card_info[0]: + return + + card = card_info[0] + #print (card.index) + card_obj = {} + card_obj['index'] = str(card.index) + self._cards[card.index] = card_obj + card_obj['profiles'] = [] + for k in range(0, card.n_profiles): + if(card.profiles2[k]): + profile = card.profiles2[k].contents + pobj = {} + pobj['name'] = profile.name.decode('utf8') if profile.name else '' + pobj['human_name'] = profile.description.decode('utf8') if profile.description else '' + pobj['available'] = profile.available + card_obj['profiles'].append(pobj) + + card_obj['ports'] = [] + for i in range(0, card.n_ports): + port = card.ports[i].contents +# print ("Port name "+ str(port.name)) + obj = {} + obj['name'] = port.name.decode('utf8') if port.name else '' + obj['human_name'] = port.description.decode('utf8') if port.description else '' + obj['direction'] = port.direction + obj['available'] = port.available + obj['n_profiles'] = port.n_profiles + obj['profiles'] = [] + for j in range(0, port.n_profiles): + if(port.profiles2[j]): + profile = port.profiles2[j].contents +# pobj = {} +# pobj['name'] = profile.name.decode('utf8') if profile.name else '' +# pobj['human_name'] = profile.description.decode('utf8') if profile.description else '' +# pobj['available'] = profile.available +# obj['profiles'].append(pobj) + if profile.name: + obj['profiles'].append(profile.name.decode('utf8')) + + self._ports.append(obj) + card_obj['ports'].append(obj) + + + + self._opn_completed = True + + + def pa_context_notify_cb_t(self, context, userdata): + try: + self._pa_state = pa.pa_context_get_state(context) + + except Exception: + self._pa_state = pa.PA_CONTEXT_FAILED + + +PAHelper().print_card_info() + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/buttons.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/buttons.js new file mode 100644 index 00000000..16332bc9 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/buttons.js @@ -0,0 +1,126 @@ +const GObject = imports.gi.GObject +const St = imports.gi.St +const Clutter = imports.gi.Clutter +const Main = imports.ui.main +const AppMenu = Main.panel.statusArea.appMenu +const PanelMenu = imports.ui.panelMenu + +var DesktopLabel = GObject.registerClass( + class UniteDesktopLabel extends PanelMenu.Button { + _init(text) { + super._init(0.0, null, true) + + this._label = new St.Label({ y_align: Clutter.ActorAlign.CENTER }) + this.add_actor(this._label) + + this.reactive = false + this.label_actor = this._label + + this.setText(text || 'Desktop') + } + + setText(text) { + this._label.set_text(text) + } + + setVisible(visible) { + this.container.visible = visible + AppMenu.container.visible = !visible + } + } +) + +var TrayIndicator = GObject.registerClass( + class UniteTrayIndicator extends PanelMenu.Button { + _init(size) { + this._size = size || 20 + this._icons = [] + + super._init(0.0, null, true) + + this._indicators = new St.BoxLayout({ style_class: 'panel-status-indicators-box' }) + this.add_child(this._indicators) + + this._sync() + } + + get size() { + const context = St.ThemeContext.get_for_stage(global.stage) + return this._size * context.scale_factor + } + + _sync() { + this.visible = this._icons.length + } + + addIcon(icon) { + this._icons.push(icon) + + const mask = St.ButtonMask.ONE | St.ButtonMask.TWO | St.ButtonMask.THREE + const ibtn = new St.Button({ child: icon, button_mask: mask }) + + this._indicators.add_child(ibtn) + + icon.connect('destroy', () => { ibtn.destroy() }) + ibtn.connect('button-release-event', (actor, event) => { icon.click(event) }) + + icon.set_reactive(true) + icon.set_size(this.size, this.size) + + this._sync() + } + + removeIcon(icon) { + const actor = icon.get_parent() || icon + actor.destroy() + + const index = this._icons.indexOf(icon) + this._icons.splice(index, 1) + + this._sync() + } + + forEach(callback) { + this._icons.forEach(icon => { callback.call(null, icon) }) + } + } +) + +var WindowControls = GObject.registerClass( + class UniteWindowControls extends PanelMenu.Button { + _init() { + super._init(0.0, null, true) + + this._controls = new St.BoxLayout({ style_class: 'window-controls-box' }) + this.add_child(this._controls) + + this.add_style_class_name('window-controls') + } + + _addButton(action) { + const bin = new St.Bin({ style_class: 'icon' }) + const btn = new St.Button({ track_hover: true }) + + btn.add_style_class_name(`window-button ${action}`) + btn.add_actor(bin) + + btn.connect('clicked', () => { + const target = global.unite.focusWindow + const method = target && target[action] + + method && method.call(target) + }) + + this._controls.add_child(btn) + } + + addButtons(buttons) { + this._controls.destroy_all_children() + buttons.forEach(this._addButton.bind(this)) + } + + setVisible(visible) { + this.container.visible = visible + } + } +) diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/convenience.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/convenience.js new file mode 100644 index 00000000..9e701c83 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/convenience.js @@ -0,0 +1,124 @@ +const Gettext = imports.gettext +const GObject = imports.gi.GObject +const Gio = imports.gi.Gio +const Config = imports.misc.config +const Unite = imports.misc.extensionUtils.getCurrentExtension() + +var SettingsManager = GObject.registerClass( + class UniteSettings extends Gio.Settings { + get DEFAULT_BINDING() { + return Gio.SettingsBindFlags.DEFAULT + } + + get _types() { + return { + 'autofocus-windows': 'boolean', + 'hide-activities-button': 'enum', + 'show-window-title': 'enum', + 'show-desktop-name': 'boolean', + 'desktop-name-text': 'string', + 'extend-left-box': 'boolean', + 'notifications-position': 'enum', + 'use-system-fonts': 'boolean', + 'show-legacy-tray': 'boolean', + 'greyscale-tray-icons': 'boolean', + 'show-window-buttons': 'enum', + 'window-buttons-theme': 'enum', + 'hide-window-titlebars': 'enum', + 'window-buttons-placement': 'select', + 'hide-dropdown-arrows': 'boolean', + 'hide-aggregate-menu-arrow': 'boolean', + 'hide-app-menu-arrow': 'boolean', + 'hide-app-menu-icon': 'boolean', + 'reduce-panel-spacing': 'boolean', + 'restrict-to-primary-screen': 'boolean' + } + } + + exists(key) { + return Object.keys(this._types).includes(key) + } + + getSettingType(key) { + return this._types[key] || 'invalid' + } + + getTypeSettings(type) { + return Object.keys(this._types).filter(key => this._types[key] == type) + } + + getSetting(key) { + if (!this.exists(key)) return + + let boolean = this.getSettingType(key) == 'boolean' + return boolean ? this.get_boolean(key) : this.get_string(key) + } + } +) + +var PreferencesManager = GObject.registerClass( + class UnitePreferences extends Gio.Settings { + get window_buttons_position() { + let setting = this.get_string('button-layout') + return /(close|minimize|maximize).*:/.test(setting) ? 'left' : 'right' + } + + get window_buttons_layout() { + let setting = this.get_string('button-layout') + return setting.match(/(close|minimize|maximize)/g) + } + + exists(key) { + let fun = key.replace(/-/g, '_') + return (fun in this) || this.list_keys().includes(key) + } + + getSetting(key) { + let fun = key.replace(/-/g, '_') + + if (this.exists(fun)) return this[fun] + if (this.exists(key)) return this.get_string(key) + } + } +) + +function initTranslations(domain) { + let textDomain = domain || Unite.metadata['gettext-domain'] + let localeDir = Unite.dir.get_child('locale') + + if (localeDir.query_exists(null)) + localeDir = localeDir.get_path() + else + localeDir = Config.LOCALEDIR + + Gettext.bindtextdomain(textDomain, localeDir) +} + +function getSettings(schema) { + schema = schema || Unite.metadata['settings-schema'] + + let gioSSS = Gio.SettingsSchemaSource + let schemaDir = Unite.dir.get_child('schemas') + let schemaSource = gioSSS.get_default() + + if (schemaDir.query_exists(null)) { + schemaDir = schemaDir.get_path() + schemaSource = gioSSS.new_from_directory(schemaDir, schemaSource, false) + } + + let schemaObj = schemaSource.lookup(schema, true) + + if (!schemaObj) { + let metaId = Unite.metadata.uuid + let message = `Schema ${schema} could not be found for extension ${metaId}.` + + throw new Error(`${message} Please check your installation.`) + } + + return new SettingsManager({ settings_schema: schemaObj }) +} + +function getPreferences() { + let schemaId = 'org.gnome.desktop.wm.preferences' + return new PreferencesManager({ schema_id: schemaId }) +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/extension.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/extension.js new file mode 100644 index 00000000..5d2b4883 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/extension.js @@ -0,0 +1,46 @@ +const GObject = imports.gi.GObject +const Main = imports.ui.main +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const PanelManager = Unite.imports.panel.PanelManager +const LayoutManager = Unite.imports.layout.LayoutManager +const WindowManager = Unite.imports.window.WindowManager + +var UniteExtension = GObject.registerClass( + class UniteExtension extends GObject.Object { + _init() { + this.panelManager = new PanelManager() + this.layoutManager = new LayoutManager() + this.windowManager = new WindowManager() + } + + get focusWindow() { + return this.windowManager.focusWindow + } + + activate() { + this.panelManager.activate() + this.layoutManager.activate() + this.windowManager.activate() + + Main.panel._addStyleClassName('unite-shell') + } + + destroy() { + this.panelManager.destroy() + this.layoutManager.destroy() + this.windowManager.destroy() + + Main.panel._removeStyleClassName('unite-shell') + } + } +) + +function enable() { + global.unite = new UniteExtension() + global.unite.activate() +} + +function disable() { + global.unite.destroy() + global.unite = null +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/handlers.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/handlers.js new file mode 100644 index 00000000..c61f6def --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/handlers.js @@ -0,0 +1,230 @@ +const Bytes = imports.byteArray +const Gio = imports.gi.Gio +const GLib = imports.gi.GLib +const St = imports.gi.St +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const Convenience = Unite.imports.convenience + +const SETTINGS = Convenience.getSettings() +const WM_PREFS = Convenience.getPreferences() + +const USER_CONFIG = GLib.get_user_config_dir() +const USER_STYLES = `${USER_CONFIG}/gtk-3.0/gtk.css` + +function fileExists(path) { + return GLib.file_test(path, GLib.FileTest.EXISTS) +} + +function getGioFile(path) { + const absPath = GLib.build_filenamev([Unite.path, path]) + + if (fileExists(absPath)) { + return Gio.file_new_for_path(absPath) + } +} + +function getFileContents(path) { + if (fileExists(path)) { + const contents = GLib.file_get_contents(path) + return Bytes.toString(contents[1]) + } else { + return '' + } +} + +function setFileContents(path, contents) { + GLib.file_set_contents(path, contents) +} + +function resetGtkStyles() { + let style = getFileContents(USER_STYLES) + + style = style.replace(/\/\* UNITE ([\s\S]*?) UNITE \*\/\n/g, '') + style = style.replace(/@import.*unite@hardpixel\.eu.*css['"]\);\n/g, '') + + setFileContents(USER_STYLES, style) +} + +var Signals = class Signals { + constructor() { + this.signals = new Map() + } + + registerHandler(object, name, callback) { + const key = `${object}[${name}]` + + if (!this.hasSignal(key)) { + this.signals.set(key, { + object: object, + signalId: object.connect(name, callback) + }) + } + + return key + } + + hasSignal(key) { + return this.signals.has(key) + } + + connect(object, name, callback) { + return this.registerHandler(object, name, callback) + } + + disconnect(key) { + if (this.hasSignal(key)) { + const data = this.signals.get(key) + data.object.disconnect(data.signalId) + + this.signals.delete(key) + } + } + + disconnectMany(keys) { + keys.forEach(this.disconnect.bind(this)) + } + + disconnectAll() { + for (const key of this.signals.keys()) { + this.disconnect(key) + } + } +} + +var Settings = class Settings extends Signals { + getSettingObject(key) { + if (SETTINGS.exists(key)) { + return SETTINGS + } else { + return WM_PREFS + } + } + + connect(name, callback) { + const object = this.getSettingObject(name) + return this.registerHandler(object, `changed::${name}`, callback) + } + + get(key) { + const object = this.getSettingObject(key) + return object.getSetting(key) + } +} + +var ShellStyle = class ShellStyle { + constructor(path) { + this.file = getGioFile(path) + } + + get context() { + return St.ThemeContext.get_for_stage(global.stage) + } + + get theme() { + return this.context.get_theme() + } + + load() { + this.theme.load_stylesheet(this.file) + } + + unload() { + this.theme.unload_stylesheet(this.file) + } +} + +var WidgetStyle = class WidgetStyle { + constructor(widget, style) { + this.widget = widget + this.style = style + } + + get existing() { + return this.widget.get_style() || '' + } + + load() { + const style = this.existing + this.style + this.widget.set_style(style) + } + + unload() { + const style = this.existing.replace(this.style, '') + this.widget.set_style(style) + } +} + +var GtkStyle = class GtkStyle { + constructor(name, contents) { + this.contents = `/* UNITE ${name} */\n${contents}\n/* ${name} UNITE */\n` + } + + get existing() { + return getFileContents(USER_STYLES) + } + + load() { + const style = this.contents + this.existing + setFileContents(USER_STYLES, style) + } + + unload() { + const style = this.existing.replace(this.contents, '') + setFileContents(USER_STYLES, style) + } +} + +var Styles = class Styles { + constructor() { + this.styles = new Map() + } + + hasStyle(name) { + return name && this.styles.has(name) + } + + getStyle(name) { + return name && this.styles.get(name) + } + + setStyle(name, object, ...args) { + if (!this.hasStyle(name)) { + const style = new object(...args) + style.load() + + this.styles.set(name, style) + } + } + + deleteStyle(name) { + if (this.hasStyle(name)) { + const style = this.getStyle(name) + style.unload() + + this.styles.delete(name) + } + } + + addShellStyle(name, path) { + this.deleteStyle(name) + this.setStyle(name, ShellStyle, path) + } + + addWidgetStyle(name, widget, styles) { + this.deleteStyle(name) + this.setStyle(name, WidgetStyle, widget, styles) + } + + addGtkStyle(name, contents) { + this.deleteStyle(name) + this.setStyle(name, GtkStyle, name, contents) + } + + removeAll() { + for (const key of this.styles.keys()) { + this.deleteStyle(key) + } + } +} + +resetGtkStyles() diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/layout.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/layout.js new file mode 100644 index 00000000..d6dba0ec --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/layout.js @@ -0,0 +1,253 @@ +const GObject = imports.gi.GObject +const St = imports.gi.St +const Clutter = imports.gi.Clutter +const GtkSettings = imports.gi.Gtk.Settings.get_default() +const Main = imports.ui.main +const Config = imports.misc.config +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const AppMenu = Main.panel.statusArea.appMenu +const AggMenu = Main.panel.statusArea.aggregateMenu +const Handlers = Unite.imports.handlers + +const VERSION = parseInt(Config.PACKAGE_VERSION.split('.')[1]) + +function actorHasClass(actor, name) { + return actor.has_style_class_name && actor.has_style_class_name(name) +} + +function getWidgetArrow(widget) { + let arrow = widget._arrow + + if (!arrow) { + const last = widget.get_n_children() - 1 + const actor = widget.get_children()[last] + + if (actor) { + if (actorHasClass(actor, 'popup-menu-arrow')) { + arrow = actor + } else { + arrow = getWidgetArrow(actor) + } + } + } + + if (arrow && !widget.hasOwnProperty('_arrow')) { + widget._arrow = arrow + } + + return arrow +} + +function toggleWidgetArrow(widget, hide) { + const arrow = widget && getWidgetArrow(widget) + + if (arrow) { + if (hide && !widget._arrowHandled) { + arrow.visible = false + widget._arrowHandled = true + } + + if (!hide && widget._arrowHandled) { + arrow.visible = true + delete widget._arrowHandled + } + } +} + +var LayoutManager = GObject.registerClass( + class UniteLayoutManager extends GObject.Object { + _init() { + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + this.styles = new Handlers.Styles() + + this.signals.connect( + Main.panel._leftBox, 'actor_added', this._onHideDropdownArrows.bind(this) + ) + + this.signals.connect( + Main.panel._centerBox, 'actor_added', this._onHideDropdownArrows.bind(this) + ) + + this.signals.connect( + Main.panel._rightBox, 'actor_added', this._onHideDropdownArrows.bind(this) + ) + + this.signals.connect( + GtkSettings, 'notify::gtk-font-name', this._onChangeStyles.bind(this) + ) + + this.settings.connect( + 'notifications-position', this._onNotificationsChange.bind(this) + ) + + this.settings.connect( + 'hide-app-menu-icon', this._onHideAppMenuIcon.bind(this) + ) + + this.settings.connect( + 'hide-app-menu-arrow', this._onHideAppMenuArrow.bind(this) + ) + + this.settings.connect( + 'hide-aggregate-menu-arrow', this._onHideAggMenuArrow.bind(this) + ) + + this.settings.connect( + 'hide-dropdown-arrows', this._onHideDropdownArrows.bind(this) + ) + + this.settings.connect( + 'use-system-fonts', this._onChangeStyles.bind(this) + ) + + this.settings.connect( + 'reduce-panel-spacing', this._onChangeStyles.bind(this) + ) + } + + _onNotificationsChange() { + const setting = this.settings.get('notifications-position') + + if (setting != 'center') { + const context = St.ThemeContext.get_for_stage(global.stage) + const banner = Main.messageTray._bannerBin + const mappings = { left: 'START', right: 'END' } + const position = mappings[setting] + + banner.set_x_align(Clutter.ActorAlign[position]) + banner.set_width(390 * context.scale_factor) + } else { + this._resetNotifications() + } + } + + _onHideAppMenuIcon() { + const setting = this.settings.get('hide-app-menu-icon') + + if (setting) { + AppMenu._iconBox.hide() + } else { + this._resetAppMenuIcon() + } + } + + _onHideAppMenuArrow() { + const setting = this.settings.get('hide-app-menu-arrow') + + if (setting) { + toggleWidgetArrow(AppMenu, true) + } else { + this._resetAppMenuArrow() + } + } + + _onHideAggMenuArrow() { + const setting = this.settings.get('hide-aggregate-menu-arrow') + + if (setting) { + toggleWidgetArrow(AggMenu, true) + } else { + this._resetAggMenuArrow() + } + } + + _onHideDropdownArrows() { + const setting = this.settings.get('hide-dropdown-arrows') + + if (setting) { + for (const [name, widget] of Object.entries(Main.panel.statusArea)) { + if (name != 'aggregateMenu' && name != 'appMenu') { + toggleWidgetArrow(widget, true) + } + } + } else { + this._resetDropdownArrows() + } + } + + _onChangeStyles() { + const fonts = this.settings.get('use-system-fonts') + const space = this.settings.get('reduce-panel-spacing') + + this._resetStyles() + + if (fonts) { + const font = GtkSettings.gtk_font_name.replace(/\s\d+$/, '') + this.styles.addWidgetStyle('uiGroup', Main.uiGroup, `font-family: ${font};`) + + Main.panel._addStyleClassName('system-fonts') + } + + if (space) { + Main.panel._addStyleClassName('small-spacing') + } + + if (VERSION < 34) { + Main.panel._addStyleClassName('extra-spacing') + } + + if (fonts || space) { + this.styles.addWidgetStyle('panel', Main.panel, 'font-size: 11.25pt;') + } + } + + _resetNotifications() { + const banner = Main.messageTray._bannerBin + + banner.set_x_align(Clutter.ActorAlign.CENTER) + banner.set_width(-1) + } + + _resetAppMenuIcon() { + AppMenu._iconBox.show() + } + + _resetAppMenuArrow() { + toggleWidgetArrow(AppMenu, false) + } + + _resetAggMenuArrow() { + toggleWidgetArrow(AggMenu, false) + } + + _resetDropdownArrows() { + for (const [name, widget] of Object.entries(Main.panel.statusArea)) { + if (name != 'aggregateMenu' && name != 'appMenu') { + toggleWidgetArrow(widget, false) + } + } + } + + _resetStyles() { + Main.panel._removeStyleClassName('system-fonts') + Main.panel._removeStyleClassName('small-spacing') + Main.panel._removeStyleClassName('extra-spacing') + + this.styles.deleteStyle('uiGroup') + this.styles.deleteStyle('panel') + } + + activate() { + this._onNotificationsChange() + this._onHideAppMenuIcon() + this._onHideAppMenuArrow() + this._onHideAggMenuArrow() + this._onHideDropdownArrows() + this._onChangeStyles() + } + + destroy() { + this._resetNotifications() + this._resetAppMenuIcon() + this._resetAppMenuArrow() + this._resetAggMenuArrow() + this._resetDropdownArrows() + this._resetStyles() + + this.signals.disconnectAll() + this.settings.disconnectAll() + this.styles.removeAll() + } + } +) diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/metadata.json b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/metadata.json new file mode 100644 index 00000000..c6e97892 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/metadata.json @@ -0,0 +1,14 @@ +{ + "_generated": "Generated by SweetTooth, do not edit", + "description": "Unite is a GNOME Shell extension which makes a few layout tweaks to the top panel and removes window decorations to make it look like Ubuntu Unity Shell.\n\n- Adds window buttons to the top panel for maximized windows.\n- Shows current window title in the app menu for maximized windows.\n- Removes titlebars on maximized windows.\n- Hides window controls on maximized windows with headerbars.\n- Moves the date to the right, reduces panel spacing and removes dropdown arrows.\n- Moves legacy tray icons to the top panel.\n- Moves notifications to the right.\n- Hides activities button.\n- Adds desktop name to the top panel.\n\nThis extension depends on some Xorg utilities. To install them:\n- Debian/Ubuntu: apt install x11-utils\n- Fedora/RHEL: dnf install xorg-x11-utils\n- Arch: pacman -S xorg-xprop\n\n*Settings are provided to enable/disable or customize the available tweaks.\n* Since version 2 applications on wayland with client side decorations are supported using CSS.", + "gettext-domain": "unite", + "name": "Unite", + "settings-schema": "org.gnome.shell.extensions.unite", + "shell-version": [ + "3.34", + "3.32" + ], + "url": "https://github.com/hardpixel/unite-shell", + "uuid": "unite@hardpixel.eu", + "version": 36 +} \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/panel.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/panel.js new file mode 100644 index 00000000..a8321432 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/panel.js @@ -0,0 +1,507 @@ +const Gi = imports._gi +const System = imports.system +const GObject = imports.gi.GObject +const Clutter = imports.gi.Clutter +const Shell = imports.gi.Shell +const AppSystem = imports.gi.Shell.AppSystem.get_default() +const WinTracker = imports.gi.Shell.WindowTracker.get_default() +const Main = imports.ui.main +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const AppMenu = Main.panel.statusArea.appMenu +const Activities = Main.panel.statusArea.activities +const Buttons = Unite.imports.buttons +const Handlers = Unite.imports.handlers + +var PanelExtension = class PanelExtension { + constructor(settings, key, callback) { + this.activated = false + + const isActive = () => { + return callback.call(null, settings.get(key)) + } + + const onChange = () => { + const active = isActive() + + if (active && !this.activated) { + this.activated = true + return this._init() + } + + if (!active && this.activated) { + this.activated = false + return this._destroy() + } + } + + this.activate = () => { + settings.connect(key, onChange.bind(this)) + onChange() + } + + this.destroy = () => { + if (this.activated) { + this._destroy() + this.activated = false + } + } + } +} + +var WindowButtons = class WindowButtons extends PanelExtension { + constructor({ settings }) { + const active = val => val != 'never' + super(settings, 'show-window-buttons', active) + } + + _init() { + this.theme = 'default-dark' + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + this.styles = new Handlers.Styles() + this.controls = new Buttons.WindowControls() + + this.signals.connect( + Main.overview, 'showing', this._onOverviewShowing.bind(this) + ) + + this.signals.connect( + Main.overview, 'hiding', this._onOverviewHiding.bind(this) + ) + + this.signals.connect( + WinTracker, 'notify::focus-app', this._onFocusAppChange.bind(this) + ) + + this.settings.connect( + 'window-buttons-layout', this._onLayoutChange.bind(this) + ) + + this.settings.connect( + 'window-buttons-position', this._onPositionChange.bind(this) + ) + + this.settings.connect( + 'window-buttons-placement', this._onPositionChange.bind(this) + ) + + this.settings.connect( + 'window-buttons-theme', this._onThemeChange.bind(this) + ) + + Main.panel.addToStatusArea( + 'uniteWindowControls', this.controls, this.index, this.side + ) + + this.controls.setVisible(false) + + this._onLayoutChange() + this._onPositionChange() + this._onThemeChange() + } + + get position() { + return this.settings.get('window-buttons-position') + } + + get placement() { + return this.settings.get('window-buttons-placement') + } + + get side() { + const sides = { first: 'left', last: 'right', auto: this.position } + return sides[this.placement] || this.placement + } + + get index() { + if (this.placement == 'first') return 0 + if (this.placement == 'last') return -1 + + return null + } + + get sibling() { + if (this.side == 'left') { + return Main.panel.statusArea.appMenu.get_parent() + } else { + return Main.panel.statusArea.aggregateMenu.get_parent() + } + } + + get container() { + if (this.side == 'left') { + return Main.panel._leftBox + } else { + return Main.panel._rightBox + } + } + + _onOverviewShowing() { + this.controls.setVisible(false) + } + + _onOverviewHiding() { + const focused = global.unite.focusWindow + this.controls.setVisible(focused && focused.showButtons) + } + + _onFocusAppChange() { + const focused = AppMenu._targetApp + + if (focused == null || focused.state != Shell.AppState.RUNNING) { + this.controls.setVisible(false) + } + } + + _onLayoutChange() { + const buttons = this.settings.get('window-buttons-layout') + + if (this.side == 'right' && this.position == 'left') { + buttons.reverse() + } + + this.controls.addButtons(buttons) + } + + _onPositionChange() { + const controls = this.controls.container + controls.reparent(this.container) + + if (this.index != null) { + this.container.set_child_at_index(controls, this.index) + } else { + this.container.set_child_below_sibling(controls, this.sibling) + } + + this._onLayoutChange() + } + + _onThemeChange() { + this.controls.remove_style_class_name(this.theme) + + this.theme = this.settings.get('window-buttons-theme') + const path = `themes/${this.theme}/stylesheet.css` + + this.styles.addShellStyle('windowButtons', path) + this.controls.add_style_class_name(this.theme) + } + + _destroy() { + this.controls.destroy() + + this.signals.disconnectAll() + this.settings.disconnectAll() + this.styles.removeAll() + } +} + +var ExtendLeftBox = class ExtendLeftBox extends PanelExtension { + constructor({ settings }) { + const active = val => val == true + super(settings, 'extend-left-box', active) + } + + _init() { + this._default = Main.panel.__proto__.vfunc_allocate + + Main.panel.__proto__[Gi.hook_up_vfunc_symbol]('allocate', (box, flags) => { + Main.panel.vfunc_allocate.call(Main.panel, box, flags) + this._allocate(Main.panel, box, flags) + }) + + Main.panel.queue_relayout() + } + + _allocate(actor, box, flags) { + let leftBox = Main.panel._leftBox + let centerBox = Main.panel._centerBox + let rightBox = Main.panel._rightBox + + let allocWidth = box.x2 - box.x1 + let allocHeight = box.y2 - box.y1 + + let [leftMinWidth, leftNaturalWidth] = leftBox.get_preferred_width(-1) + let [centerMinWidth, centerNaturalWidth] = centerBox.get_preferred_width(-1) + let [rightMinWidth, rightNaturalWidth] = rightBox.get_preferred_width(-1) + + let sideWidth = allocWidth - rightNaturalWidth - centerNaturalWidth + let childBox = new Clutter.ActorBox() + + childBox.y1 = 0 + childBox.y2 = allocHeight + + if (actor.get_text_direction() == Clutter.TextDirection.RTL) { + childBox.x1 = allocWidth - Math.min(Math.floor(sideWidth), leftNaturalWidth) + childBox.x2 = allocWidth + } else { + childBox.x1 = 0 + childBox.x2 = Math.min(Math.floor(sideWidth), leftNaturalWidth) + } + + leftBox.allocate(childBox, flags) + + childBox.y1 = 0 + childBox.y2 = allocHeight + + if (actor.get_text_direction() == Clutter.TextDirection.RTL) { + childBox.x1 = rightNaturalWidth + childBox.x2 = childBox.x1 + centerNaturalWidth + } else { + childBox.x1 = allocWidth - centerNaturalWidth - rightNaturalWidth + childBox.x2 = childBox.x1 + centerNaturalWidth + } + + centerBox.allocate(childBox, flags) + + childBox.y1 = 0 + childBox.y2 = allocHeight + + if (actor.get_text_direction() == Clutter.TextDirection.RTL) { + childBox.x1 = 0 + childBox.x2 = rightNaturalWidth + } else { + childBox.x1 = allocWidth - rightNaturalWidth + childBox.x2 = allocWidth + } + + rightBox.allocate(childBox, flags) + } + + _destroy() { + Main.panel.__proto__[Gi.hook_up_vfunc_symbol]('allocate', this._default) + this._default = null + + Main.panel.queue_relayout() + } +} + +var ActivitiesButton = class ActivitiesButton extends PanelExtension { + constructor({ settings }) { + const active = val => val != 'never' + super(settings, 'hide-activities-button', active) + } + + _init() { + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + + this.signals.connect( + Main.overview, 'showing', this._syncVisible.bind(this) + ) + + this.signals.connect( + Main.overview, 'hiding', this._syncVisible.bind(this) + ) + + this.signals.connect( + AppSystem, 'app-state-changed', this._syncVisible.bind(this) + ) + + this.signals.connect( + WinTracker, 'notify::focus-app', this._syncVisible.bind(this) + ) + + this.settings.connect( + 'show-desktop-name', this._syncVisible.bind(this) + ) + + this._syncVisible() + } + + get hideButton() { + return this.settings.get('hide-activities-button') + } + + get showDesktop() { + return this.settings.get('show-desktop-name') + } + + _syncVisible() { + const button = Activities.container + const overview = Main.overview.visibleTarget + + if (this.hideButton == 'always') { + return button.hide() + } + + if (this.showDesktop) { + button.visible = overview + } else { + button.visible = overview || AppMenu._targetApp == null + } + } + + _destroy() { + Activities.container.show() + + this.signals.disconnectAll() + this.settings.disconnectAll() + } +} + +var DesktopName = class DesktopName extends PanelExtension { + constructor({ settings }) { + const active = val => val == true + super(settings, 'show-desktop-name', active) + } + + _init() { + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + this.label = new Buttons.DesktopLabel() + + this.signals.connect( + Main.overview, 'showing', this._syncVisible.bind(this) + ) + + this.signals.connect( + Main.overview, 'hiding', this._syncVisible.bind(this) + ) + + this.signals.connect( + AppSystem, 'app-state-changed', this._syncVisible.bind(this) + ) + + this.signals.connect( + WinTracker, 'notify::focus-app', this._syncVisible.bind(this) + ) + + this.settings.connect( + 'desktop-name-text', this._onTextChanged.bind(this) + ) + + Main.panel.addToStatusArea( + 'uniteDesktopLabel', this.label, 1, 'left' + ) + + this._onTextChanged() + this._syncVisible() + } + + get visibleWindows() { + const actors = global.get_window_actors() + + return actors.some(({ metaWindow }) => { + const visible = metaWindow.showing_on_its_workspace() + return visible && !metaWindow.skip_taskbar + }) + } + + _syncVisible() { + const overview = Main.overview.visibleTarget + const visible = !overview && AppMenu._targetApp == null + + this.label.setVisible(visible && !this.visibleWindows) + } + + _onTextChanged() { + const text = this.settings.get('desktop-name-text') + this.label.setText(text) + } + + _destroy() { + this.label.destroy() + + this.signals.disconnectAll() + this.settings.disconnectAll() + } +} + +var TrayIcons = class TrayIcons extends PanelExtension { + constructor({ settings }) { + const active = val => val == true + super(settings, 'show-legacy-tray', active) + } + + _init() { + this.tray = new Shell.TrayManager() + this.settings = new Handlers.Settings() + this.indicators = new Buttons.TrayIndicator() + + this.tray.connect( + 'tray-icon-added', this._onIconAdded.bind(this) + ) + + this.tray.connect( + 'tray-icon-removed', this._onIconRemoved.bind(this) + ) + + this.settings.connect( + 'greyscale-tray-icons', this._onGreyscaleChange.bind(this) + ) + + Main.panel.addToStatusArea( + 'uniteTrayIndicator', this.indicators, 0, 'right' + ) + + this.tray.manage_screen(Main.panel) + } + + _desaturateIcon(icon) { + const greyscale = this.settings.get('greyscale-tray-icons') + icon.clear_effects() + + if (greyscale) { + const desEffect = new Clutter.DesaturateEffect({ factor : 1.0 }) + const briEffect = new Clutter.BrightnessContrastEffect({}) + + briEffect.set_brightness(0.2) + briEffect.set_contrast(0.3) + + icon.add_effect_with_name('desaturate', desEffect) + icon.add_effect_with_name('brightness-contrast', briEffect) + } + } + + _onIconAdded(trayManager, icon) { + this.indicators.addIcon(icon) + this._desaturateIcon(icon) + } + + _onIconRemoved(trayManager, icon) { + this.indicators.removeIcon(icon) + } + + _onGreyscaleChange() { + this.indicators.forEach(this._desaturateIcon.bind(this)) + } + + _destroy() { + this.tray = null + System.gc() + + this.indicators.destroy() + this.settings.disconnectAll() + } +} + +var PanelManager = GObject.registerClass( + class UnitePanelManager extends GObject.Object { + _init() { + this.settings = new Handlers.Settings() + this.buttons = new WindowButtons(this) + this.extender = new ExtendLeftBox(this) + this.activities = new ActivitiesButton(this) + this.desktop = new DesktopName(this) + this.tray = new TrayIcons(this) + } + + activate() { + this.buttons.activate() + this.extender.activate() + this.activities.activate() + this.desktop.activate() + this.tray.activate() + } + + destroy() { + this.buttons.destroy() + this.extender.destroy() + this.activities.destroy() + this.desktop.destroy() + this.tray.destroy() + + this.settings.disconnectAll() + } + } +) diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/prefs.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/prefs.js new file mode 100644 index 00000000..6b8ebb11 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/prefs.js @@ -0,0 +1,74 @@ +const GObject = imports.gi.GObject +const Gtk = imports.gi.Gtk +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const Convenience = Unite.imports.convenience + +var PrefsWidget = GObject.registerClass( + class UnitePrefsWidget extends Gtk.Box { + _init(params) { + this._settings = Convenience.getSettings() + super._init(params) + + this._buildable = new Gtk.Builder() + this._buildable.add_from_file(`${Unite.path}/settings.ui`) + + this._container = this._getWidget('prefs_widget') + this.add(this._container) + + this._bindStrings() + this._bindSelects() + this._bindBooleans() + this._bindEnumerations() + } + + _getWidget(name) { + let widgetName = name.replace(/-/g, '_') + return this._buildable.get_object(widgetName) + } + + _bindInput(setting, prop) { + let widget = this._getWidget(setting) + this._settings.bind(setting, widget, prop, this._settings.DEFAULT_BINDING) + } + + _bindEnum(setting) { + let widget = this._getWidget(setting) + widget.set_active(this._settings.get_enum(setting)) + + widget.connect('changed', (combobox) => { + this._settings.set_enum(setting, combobox.get_active()) + }) + } + + _bindStrings() { + let settings = this._settings.getTypeSettings('string') + settings.forEach(setting => { this._bindInput(setting, 'text') }) + } + + _bindSelects() { + let settings = this._settings.getTypeSettings('select') + settings.forEach(setting => { this._bindInput(setting, 'active-id') }) + } + + _bindBooleans() { + let settings = this._settings.getTypeSettings('boolean') + settings.forEach(setting => { this._bindInput(setting, 'active') }) + } + + _bindEnumerations() { + let settings = this._settings.getTypeSettings('enum') + settings.forEach(setting => { this._bindEnum(setting) }) + } + } +) + +function init() { + Convenience.initTranslations() +} + +function buildPrefsWidget() { + let widget = new PrefsWidget() + widget.show_all() + + return widget +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/gschemas.compiled b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/gschemas.compiled new file mode 100644 index 00000000..0fbb1f02 Binary files /dev/null and b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/gschemas.compiled differ diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/org.gnome.shell.extensions.unite.gschema.xml b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/org.gnome.shell.extensions.unite.gschema.xml new file mode 100644 index 00000000..6b8d5f46 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/org.gnome.shell.extensions.unite.gschema.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + Apply system fonts to shell interface. + + + + true + Extend top bar left box. + + + + true + Legacy tray icons in top bar. + + + + false + Convert legacy tray icons to greyscale. + + + + true + Autofocus windows that demand attention. + + + + true + Show desktop name in top bar. + + + + "GNOME Desktop" + Set the top bar desktop name text. + + + + true + Restrict functionalities to the primary screen. + + + + true + Hide top bar dropdown arrows. + + + + false + Hide aggregate menu dropdown arrow. + + + + true + Hide app menu dropdown arrow. + + + + true + Hide app menu application icon. + + + + true + Reduce top bar items spacing. + + + + "auto" + Top bar window buttons position. + + + + "maximized" + Use window title to replace the app-menu label. + + + + "maximized" + Active window bottons in top bar. + + + + "default-dark" + Top bar window buttons theme. + + + + "maximized" + Select windows state to hide titlebars. + + + + "right" + Select notification messages position. + + + + "auto" + Hide top bar activities button. + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/settings.ui b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/settings.ui new file mode 100644 index 00000000..914000f7 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/settings.ui @@ -0,0 +1,907 @@ + + + + + + True + True + True + False + True + + + True + False + start + 20 + 20 + 20 + 20 + vertical + 15 + True + + + True + False + 50 + + + True + False + center + Extend top bar left box + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + False + 50 + + + True + False + center + Auto focus new windows + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 2 + + + + + True + False + 50 + + + True + False + center + Show system tray in top bar + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 3 + + + + + True + False + 50 + + + True + False + center + Show desktop name in top bar + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 5 + + + + + True + False + 50 + + + True + False + center + Restrict functionalities to the primary screen + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 6 + + + + + True + False + 50 + + + True + False + center + Hide activities button + + + False + True + 0 + + + + + 170 + True + False + 1 + + Never + Auto + Always + + + + False + True + end + 1 + + + + + False + True + 8 + + + + + True + False + 50 + + + True + False + center + Hide window titlebars + + + False + True + 0 + + + + + 170 + True + False + 2 + + Never + Tiled + Maximized + Both + Always + + + + False + True + end + 1 + + + + + False + True + 9 + + + + + True + False + 50 + + + True + False + center + Show window title in app menu + + + False + True + 0 + + + + + 170 + True + False + 2 + + Never + Tiled + Maximized + Both + Always + + + + False + True + end + 1 + + + + + False + True + 10 + + + + + True + False + 50 + + + True + False + center + Show window buttons in top bar + + + False + True + 0 + + + + + 170 + True + False + 2 + + Never + Tiled + Maximized + Both + Always + + + + False + True + end + 1 + + + + + False + True + 11 + + + + + True + False + 50 + + + True + False + center + Notification messages position + + + False + True + 0 + + + + + 170 + True + False + 2 + + Center + Left + Right + + + + False + True + end + 1 + + + + + False + True + 13 + + + + + True + + + + + True + False + General + + + False + + + + + True + False + start + 20 + 20 + 20 + 20 + vertical + 15 + True + + + True + False + 50 + + + True + False + center + Apply system fonts to shell theme + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 0 + + + + + True + False + 50 + + + True + False + center + Convert tray icons to greyscale + + + False + True + 0 + + + + + True + True + center + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + False + 50 + + + True + False + center + Hide top bar dropdown arrows + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 2 + + + + + True + False + 50 + + + True + False + center + Hide aggregate menu dropdown arrow + + + False + True + 0 + + + + + True + True + center + + + False + True + end + 1 + + + + + False + True + 3 + + + + + True + False + 50 + + + True + False + center + Hide app menu dropdown arrow + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 4 + + + + + True + False + 50 + + + True + False + center + Hide app menu application icon + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 5 + + + + + True + False + 50 + + + True + False + center + Reduce top bar items spacing + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 6 + + + + + True + False + 50 + + + True + False + center + Top bar desktop name text + + + False + True + 0 + + + + + 170 + True + True + GNOME Desktop + + + False + True + end + 1 + + + + + False + True + 7 + + + + + True + False + True + 50 + + + True + False + center + Top bar window buttons position + + + False + True + 0 + + + + + 170 + True + False + auto + + Auto + Left + Right + First + Last + + + + False + True + end + 1 + + + + + False + True + 8 + + + + + True + False + True + 50 + + + True + False + center + Top bar window buttons theme + + + False + True + 0 + + + + + 170 + True + False + 0 + + Default Dark + Default Light + Ambiance + Radiance + Arc Dark + Arc Light + United Dark + United Light + Materia Dark + Materia Light + OSX Arc + Vertex + Pop Dark + Pop Light + Vimix + Yaru + Arrongin + Telinkrin + Breeze + + + + False + True + end + 1 + + + + + False + True + 9 + + + + + 1 + True + + + + + True + False + Appearance + + + 1 + False + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/always.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/always.css new file mode 100644 index 00000000..c6a1ef5a --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/always.css @@ -0,0 +1,22 @@ +window headerbar, +window .titlebar { + padding-left: 0; +} + +window headerbar ~ headerbar, +window headerbar ~ .titlebar, +window .titlebar ~ .titlebar, +window .titlebar ~ headerbar { + padding-left: 6px; +} + +window headerbar > box.left, +window .titlebar > box.left { + margin: 0 0 0 -200px; + opacity: 0; +} + +window .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/both.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/both.css new file mode 100644 index 00000000..dd8f5ffc --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/both.css @@ -0,0 +1,2 @@ +@import "maximized.css"; +@import "tiled.css"; diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/maximized.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/maximized.css new file mode 100644 index 00000000..a57eb17b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/maximized.css @@ -0,0 +1,22 @@ +.maximized headerbar, +.maximized .titlebar { + padding-left: 0; +} + +.maximized headerbar ~ headerbar, +.maximized headerbar ~ .titlebar, +.maximized .titlebar ~ .titlebar, +.maximized .titlebar ~ headerbar { + padding-left: 6px; +} + +.maximized headerbar > box.left, +.maximized .titlebar > box.left { + margin: 0 0 0 -200px; + opacity: 0; +} + +.maximized .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/tiled.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/tiled.css new file mode 100644 index 00000000..703cca12 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/tiled.css @@ -0,0 +1,22 @@ +.tiled headerbar, +.tiled .titlebar { + padding-left: 0; +} + +.tiled headerbar ~ headerbar, +.tiled headerbar ~ .titlebar, +.tiled .titlebar ~ .titlebar, +.tiled .titlebar ~ headerbar { + padding-left: 6px; +} + +.tiled headerbar > box.left, +.tiled .titlebar > box.left { + margin: 0 0 0 -200px; + opacity: 0; +} + +.tiled .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/always.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/always.css new file mode 100644 index 00000000..801de7b4 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/always.css @@ -0,0 +1,20 @@ +window > headerbar, +window > .titlebar, +window > headerbar > headerbar, +window > .titlebar > .titlebar, +window > .titlebar > stack > headerbar, +window headerbar:last-child, +window .titlebar:last-child { + padding-right: 0; +} + +window headerbar > box.right, +window .titlebar > box.right { + margin: 0 -200px 0 0; + opacity: 0; +} + +window .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/both.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/both.css new file mode 100644 index 00000000..dd8f5ffc --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/both.css @@ -0,0 +1,2 @@ +@import "maximized.css"; +@import "tiled.css"; diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/maximized.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/maximized.css new file mode 100644 index 00000000..20b20a29 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/maximized.css @@ -0,0 +1,20 @@ +.maximized > headerbar, +.maximized > .titlebar, +.maximized > headerbar > headerbar, +.maximized > .titlebar > .titlebar, +.maximized > .titlebar > stack > headerbar, +.maximized headerbar:last-child, +.maximized .titlebar:last-child { + padding-right: 0; +} + +.maximized headerbar > box.right, +.maximized .titlebar > box.right { + margin: 0 -200px 0 0; + opacity: 0; +} + +.maximized .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/tiled.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/tiled.css new file mode 100644 index 00000000..fff4fecb --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/tiled.css @@ -0,0 +1,20 @@ +.tiled > headerbar, +.tiled > .titlebar, +.tiled > headerbar > headerbar, +.tiled > .titlebar > .titlebar, +.tiled > .titlebar > stack > headerbar, +.tiled headerbar:last-child, +.tiled .titlebar:last-child { + padding-right: 0; +} + +.tiled headerbar > box.right, +.tiled .titlebar > box.right { + margin: 0 -200px 0 0; + opacity: 0; +} + +.tiled .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/stylesheet.css new file mode 100644 index 00000000..c78b855c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/stylesheet.css @@ -0,0 +1,48 @@ +#panel.small-spacing .panel-button { + -natural-hpadding: 8px; + -minimum-hpadding: 6px; +} + +#panel.small-spacing .panel-button .system-status-icon { + padding: 0; +} + +#panel.small-spacing .panel-button .panel-status-indicators-box { + spacing: 12px; +} + +#panel.small-spacing.extra-spacing .panel-button .panel-status-indicators-box { + spacing: 10px; +} + +#panel.small-spacing.extra-spacing #appMenu { + margin: 0 8px; +} + +#panel .panel-button.window-controls { + -natural-hpadding: 0px; + -minimum-hpadding: 0px; +} + +#panel .window-controls-box { + spacing: 2px; +} + +#panel .window-controls-box .window-button { + width: 22px; +} + +#panelLeft .window-controls-box:first-child .window-button:first-child { + padding-left: 3px; +} + +#panelRight .window-controls-box:last-child .window-button:last-child { + padding-right: 3px; +} + +#panel .window-controls-box .icon { + background-color: transparent; + border-radius: 0; + box-shadow: none; + border: 0; +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-active.svg new file mode 100644 index 00000000..6670047c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-active.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-hover.svg new file mode 100644 index 00000000..91ab1631 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-hover.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close.svg new file mode 100644 index 00000000..5a6c3a75 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-active.svg new file mode 100644 index 00000000..32b0a4fb --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-active.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-hover.svg new file mode 100644 index 00000000..3c15c364 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-hover.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize.svg new file mode 100644 index 00000000..668ee389 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-active.svg new file mode 100644 index 00000000..cee4dcb8 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-active.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-hover.svg new file mode 100644 index 00000000..6932125b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-hover.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize.svg new file mode 100644 index 00000000..06bb6a3c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/stylesheet.css new file mode 100644 index 00000000..91029162 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 19px; + height: 19px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-active.svg new file mode 100644 index 00000000..2c33f879 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-hover.svg new file mode 100644 index 00000000..1f3a7af6 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close.svg new file mode 100644 index 00000000..3d8ab614 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-active.svg new file mode 100644 index 00000000..2c2ac30e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-active.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-hover.svg new file mode 100644 index 00000000..0ca87567 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize.svg new file mode 100644 index 00000000..c629fa13 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-active.svg new file mode 100644 index 00000000..30308a83 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-hover.svg new file mode 100644 index 00000000..c0ca7f43 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize.svg new file mode 100644 index 00000000..d7bb715f --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-active.svg new file mode 100644 index 00000000..65f0d56e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-hover.svg new file mode 100644 index 00000000..62fb143b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close.svg new file mode 100644 index 00000000..fb56677f --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-active.svg new file mode 100644 index 00000000..2c2ac30e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-active.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-hover.svg new file mode 100644 index 00000000..1e4b5742 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize.svg new file mode 100644 index 00000000..0a40905c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-active.svg new file mode 100644 index 00000000..30308a83 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-hover.svg new file mode 100644 index 00000000..c3f1cb6e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize.svg new file mode 100644 index 00000000..3a347b9d --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-active.svg new file mode 100644 index 00000000..326b7d62 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-hover.svg new file mode 100644 index 00000000..dca791d5 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close.svg new file mode 100644 index 00000000..8eaf4b1e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-active.svg new file mode 100644 index 00000000..e2dff2e8 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-hover.svg new file mode 100644 index 00000000..77272234 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize.svg new file mode 100644 index 00000000..10f45d52 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-active.svg new file mode 100644 index 00000000..0a73dcd1 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-hover.svg new file mode 100644 index 00000000..380e42d7 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize.svg new file mode 100644 index 00000000..24ddca09 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/stylesheet.css new file mode 100644 index 00000000..0f044fc0 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 14px; + height: 14px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-active.svg new file mode 100644 index 00000000..1daf9ae1 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-hover.svg new file mode 100644 index 00000000..72d90ecc --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close.svg new file mode 100644 index 00000000..4fd95295 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-active.svg new file mode 100644 index 00000000..b485458c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-hover.svg new file mode 100644 index 00000000..63887f71 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize.svg new file mode 100644 index 00000000..245cd48d --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-active.svg new file mode 100644 index 00000000..9b0905fe --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-hover.svg new file mode 100644 index 00000000..8c1ea6cb --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize.svg new file mode 100644 index 00000000..b50ea6b3 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-active.svg new file mode 100644 index 00000000..66bf354b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-hover.svg new file mode 100644 index 00000000..dba468e4 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close.svg new file mode 100644 index 00000000..592ee7ac --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-active.svg new file mode 100644 index 00000000..dfac382c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-hover.svg new file mode 100644 index 00000000..b8e8704d --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize.svg new file mode 100644 index 00000000..95351854 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-active.svg new file mode 100644 index 00000000..8dde54f4 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-hover.svg new file mode 100644 index 00000000..5a30c9ab --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize.svg new file mode 100644 index 00000000..7c8f96e7 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/stylesheet.css new file mode 100644 index 00000000..5fd65cb9 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 16px; + height: 16px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-active.svg new file mode 100644 index 00000000..66bf354b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-hover.svg new file mode 100644 index 00000000..dba468e4 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close.svg new file mode 100644 index 00000000..592ee7ac --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-active.svg new file mode 100644 index 00000000..3e6accab --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-hover.svg new file mode 100644 index 00000000..fd61fd7c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize.svg new file mode 100644 index 00000000..68c0a29d --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-active.svg new file mode 100644 index 00000000..681e3ebb --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-hover.svg new file mode 100644 index 00000000..6766f8fa --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize.svg new file mode 100644 index 00000000..176b6a7a --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/stylesheet.css new file mode 100644 index 00000000..5fd65cb9 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 16px; + height: 16px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-active.svg new file mode 100644 index 00000000..58d8cd0e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-hover.svg new file mode 100644 index 00000000..3b011079 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close.svg new file mode 100644 index 00000000..798cedd9 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-active.svg new file mode 100644 index 00000000..2fe78a41 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-hover.svg new file mode 100644 index 00000000..45eafca3 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize.svg new file mode 100644 index 00000000..66f1da4a --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-active.svg new file mode 100644 index 00000000..fda56049 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-hover.svg new file mode 100644 index 00000000..2e469471 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize.svg new file mode 100644 index 00000000..d61619ad --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-active.svg new file mode 100644 index 00000000..fed664d4 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-hover.svg new file mode 100644 index 00000000..92b1e466 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close.svg new file mode 100644 index 00000000..16670425 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-active.svg new file mode 100644 index 00000000..606428f7 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-hover.svg new file mode 100644 index 00000000..4242e449 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize.svg new file mode 100644 index 00000000..fe75189c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-active.svg new file mode 100644 index 00000000..5a22979b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-hover.svg new file mode 100644 index 00000000..da834aed --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize.svg new file mode 100644 index 00000000..73f7204f --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-active.svg new file mode 100755 index 00000000..633cc5b9 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-active.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-hover.svg new file mode 100755 index 00000000..633cc5b9 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close.svg new file mode 100755 index 00000000..be494f39 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-active.svg new file mode 100755 index 00000000..e577176e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-active.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-hover.svg new file mode 100755 index 00000000..e577176e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize.svg new file mode 100755 index 00000000..65f1a51a --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-active.svg new file mode 100755 index 00000000..003be10a --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-active.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-hover.svg new file mode 100755 index 00000000..003be10a --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize.svg new file mode 100755 index 00000000..689321d7 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-active.svg new file mode 100644 index 00000000..f19c9724 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-hover.svg new file mode 100644 index 00000000..cf63936b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close.svg new file mode 100644 index 00000000..a123cfda --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-active.svg new file mode 100644 index 00000000..018dfbe7 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-hover.svg new file mode 100644 index 00000000..305b1d64 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize.svg new file mode 100644 index 00000000..96cbd94b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-active.svg new file mode 100644 index 00000000..5189da72 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-hover.svg new file mode 100644 index 00000000..fb871054 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize.svg new file mode 100644 index 00000000..7553792d --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-active.svg new file mode 100644 index 00000000..b20fd451 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-hover.svg new file mode 100644 index 00000000..6924f6c7 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close.svg new file mode 100644 index 00000000..fc848ab4 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-active.svg new file mode 100644 index 00000000..69d1231f --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-hover.svg new file mode 100644 index 00000000..4222a3b9 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize.svg new file mode 100644 index 00000000..6ad68e6a --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-active.svg new file mode 100644 index 00000000..795bbd1d --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-hover.svg new file mode 100644 index 00000000..4bb5ecbf --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize.svg new file mode 100644 index 00000000..21664706 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-active.svg new file mode 100644 index 00000000..1d979834 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-active.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-hover.svg new file mode 100644 index 00000000..91fbc708 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-hover.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close.svg new file mode 100644 index 00000000..14a9bba9 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-active.svg new file mode 100644 index 00000000..0d162cdd --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-active.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-hover.svg new file mode 100644 index 00000000..74d804ad --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-hover.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize.svg new file mode 100644 index 00000000..d8ac07a4 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-active.svg new file mode 100644 index 00000000..3f827fd0 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-active.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-hover.svg new file mode 100644 index 00000000..fd24aa74 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-hover.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize.svg new file mode 100644 index 00000000..6cb1ba4f --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/stylesheet.css new file mode 100644 index 00000000..91029162 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 19px; + height: 19px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-active.svg new file mode 100644 index 00000000..0dba5dda --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-hover.svg new file mode 100644 index 00000000..d16d52f3 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close.svg new file mode 100644 index 00000000..de8bdd12 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-active.svg new file mode 100644 index 00000000..de8bdd12 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-hover.svg new file mode 100644 index 00000000..bc7d02db --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize.svg new file mode 100644 index 00000000..b037440e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-active.svg new file mode 100644 index 00000000..b037440e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-hover.svg new file mode 100644 index 00000000..105f51a3 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize.svg new file mode 100644 index 00000000..d32aa7da --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/stylesheet.css new file mode 100644 index 00000000..0f044fc0 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 14px; + height: 14px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-active.svg new file mode 100644 index 00000000..53435178 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-hover.svg new file mode 100644 index 00000000..cd439133 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close.svg new file mode 100644 index 00000000..81fe1496 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-active.svg new file mode 100644 index 00000000..8eb88633 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-hover.svg new file mode 100644 index 00000000..475bf31e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize.svg new file mode 100644 index 00000000..ee76d257 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-active.svg new file mode 100644 index 00000000..fb543b3e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-hover.svg new file mode 100644 index 00000000..f4f26c14 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize.svg new file mode 100644 index 00000000..1f76de1c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/stylesheet.css new file mode 100644 index 00000000..44ac511b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 18px; + height: 18px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-active.svg new file mode 100644 index 00000000..53435178 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-hover.svg new file mode 100644 index 00000000..cd439133 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close.svg new file mode 100644 index 00000000..5b29d328 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-active.svg new file mode 100644 index 00000000..8eb88633 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-hover.svg new file mode 100644 index 00000000..475bf31e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize.svg new file mode 100644 index 00000000..db27b667 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-active.svg new file mode 100644 index 00000000..fb543b3e --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-hover.svg new file mode 100644 index 00000000..f4f26c14 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize.svg new file mode 100644 index 00000000..3b68e665 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/stylesheet.css new file mode 100644 index 00000000..44ac511b --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 18px; + height: 18px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-active.svg new file mode 100644 index 00000000..4aa69050 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-active.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-hover.svg new file mode 100644 index 00000000..3463e8a6 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-hover.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close.svg new file mode 100644 index 00000000..a759cbc0 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-active.svg new file mode 100644 index 00000000..cf1c85df --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-active.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-hover.svg new file mode 100644 index 00000000..a5aacef3 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-hover.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize.svg new file mode 100644 index 00000000..a759cbc0 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-active.svg new file mode 100644 index 00000000..aecacc46 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-active.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-hover.svg new file mode 100644 index 00000000..dd298c5a --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-hover.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize.svg new file mode 100644 index 00000000..a759cbc0 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-active.svg new file mode 100644 index 00000000..dbd8e769 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-hover.svg new file mode 100644 index 00000000..236281fd --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close.svg new file mode 100644 index 00000000..d3489c9d --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-active.svg new file mode 100644 index 00000000..c204f983 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-hover.svg new file mode 100644 index 00000000..e4b86e52 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize.svg new file mode 100644 index 00000000..7967be11 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-active.svg new file mode 100644 index 00000000..2b6d0aa5 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-hover.svg new file mode 100644 index 00000000..d9537558 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize.svg new file mode 100644 index 00000000..a9d10d1c --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-active.svg new file mode 100644 index 00000000..8262e591 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-hover.svg new file mode 100644 index 00000000..37c7dff5 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close.svg new file mode 100644 index 00000000..b6d42fc0 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-active.svg new file mode 100644 index 00000000..c0fc0483 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-hover.svg new file mode 100644 index 00000000..26f22e09 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize.svg new file mode 100644 index 00000000..4f120c44 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-active.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-active.svg new file mode 100644 index 00000000..ab881907 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-hover.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-hover.svg new file mode 100644 index 00000000..ef5e8450 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize.svg b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize.svg new file mode 100644 index 00000000..bb20c27d --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/stylesheet.css b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/window.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/window.js new file mode 100644 index 00000000..b7603a03 --- /dev/null +++ b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/window.js @@ -0,0 +1,444 @@ +const Bytes = imports.byteArray +const GLib = imports.gi.GLib +const GObject = imports.gi.GObject +const Meta = imports.gi.Meta +const Main = imports.ui.main +const Util = imports.misc.util +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const AppMenu = Main.panel.statusArea.appMenu +const Handlers = Unite.imports.handlers + +const VALID_TYPES = [ + Meta.WindowType.NORMAL, + Meta.WindowType.DIALOG, + Meta.WindowType.MODAL_DIALOG, + Meta.WindowType.UTILITY +] + +const UNITE_HINTS = '_UNITE_ORIGINAL_STATE' +const MOTIF_HINTS = '_MOTIF_WM_HINTS' + +const _SHOW_FLAGS = ['0x2', '0x0', '0x1', '0x0', '0x0'] +const _HIDE_FLAGS = ['0x2', '0x0', '0x2', '0x0', '0x0'] + +function isValid(win) { + return win && VALID_TYPES.includes(win.window_type) +} + +function getXid(win) { + const desc = win.get_description() + const match = desc && desc.match(/0x[0-9a-f]+/) + + return match && match[0] +} + +function getHint(xid, name, fallback) { + const result = GLib.spawn_command_line_sync(`xprop -id ${xid} ${name}`) + const string = Bytes.toString(result[1]) + + if (!string.match(/=/)) { + return fallback + } + + return string.split('=')[1].trim().split(',').map(part => { + part = part.trim() + return part.match(/\dx/) ? part : `0x${part}` + }) +} + +function setHint(xid, hint, value) { + value = value.join(', ') + Util.spawn(['xprop', '-id', xid, '-f', hint, '32c', '-set', hint, value]) +} + +function getHints(xid) { + let value = getHint(xid, UNITE_HINTS) + + if (!value) { + value = getHint(xid, MOTIF_HINTS, _SHOW_FLAGS) + setHint(xid, UNITE_HINTS, value) + } + + return value +} + +function isDecorated(hints) { + return hints[2] != '0x2' && hints[2] != '0x0' +} + +var ClientDecorations = class ClientDecorations { + constructor(xid) { + this.xid = xid + } + + show() { + return false + } + + hide() { + return false + } + + reset() { + return false + } +} + +var ServerDecorations = class ServerDecorations { + constructor(xid) { + this.xid = xid + this.initial = getHints(xid) + this.current = this.initial + } + + get decorated() { + return isDecorated(this.current) + } + + get handle() { + return isDecorated(this.initial) + } + + show() { + if (this.handle && !this.decorated) { + this.current = _SHOW_FLAGS + setHint(this.xid, MOTIF_HINTS, _SHOW_FLAGS) + } + } + + hide() { + if (this.handle && this.decorated) { + this.current = _HIDE_FLAGS + setHint(this.xid, MOTIF_HINTS, _HIDE_FLAGS) + } + } + + reset() { + if (this.handle) { + setHint(this.xid, MOTIF_HINTS, this.initial) + } + } +} + +var MetaWindow = GObject.registerClass( + class UniteMetaWindow extends GObject.Object { + _init(win) { + win._uniteShellManaged = true + + this.win = win + this.xid = getXid(win) + + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + + if (this.xid && !this.clientDecorated) { + this.decorations = new ServerDecorations(this.xid) + } else { + this.decorations = new ClientDecorations(this.xid) + } + + this.signals.connect( + win, 'size-changed', this._onStateChanged.bind(this) + ) + + this.signals.connect( + win, 'notify::title', this._onTitleChanged.bind(this) + ) + + this.settings.connect( + 'restrict-to-primary-screen', this.syncComponents.bind(this) + ) + + this.settings.connect( + 'hide-window-titlebars', this.syncDecorations.bind(this) + ) + + this.settings.connect( + 'show-window-buttons', this.syncControls.bind(this) + ) + + this.settings.connect( + 'show-window-title', this.syncAppmenu.bind(this) + ) + + this.syncComponents() + } + + get hasFocus() { + return this.win.has_focus() + } + + get title() { + if (this.showTitle) { + return this.win.get_title() + } else { + return AppMenu._targetApp.get_name() + } + } + + get clientDecorated() { + return this.win.is_client_decorated() + } + + get primaryScreen() { + return this.win.is_on_primary_monitor() + } + + get minimized() { + return this.win.minimized + } + + get maximized() { + return this.win.maximized_horizontally && this.win.maximized_vertically + } + + get tiled() { + if (this.maximized) { + return false + } else { + return this.win.maximized_horizontally || this.win.maximized_vertically + } + } + + get bothMaximized() { + return this.maximized || this.tiled + } + + get restrictToPrimary() { + return this.settings.get('restrict-to-primary-screen') + } + + get handleScreen() { + return this.primaryScreen || !this.restrictToPrimary + } + + get showTitle() { + return this._parseEnumSetting('show-window-title') + } + + get showButtons() { + return this._parseEnumSetting('show-window-buttons') + } + + get hideTitlebars() { + return this._parseEnumSetting('hide-window-titlebars') + } + + minimize() { + if (this.minimized) { + this.win.unminimize() + } else { + this.win.minimize() + } + } + + maximize() { + if (this.maximized) { + this.win.unmaximize(Meta.MaximizeFlags.BOTH) + } else { + this.win.maximize(Meta.MaximizeFlags.BOTH) + } + } + + close() { + const time = global.get_current_time() + time && this.win.delete(time) + } + + syncDecorations() { + if (this.hideTitlebars) { + this.decorations.hide() + } else { + this.decorations.show() + } + } + + syncControls() { + if (this.hasFocus) { + const controls = Main.panel.statusArea.uniteWindowControls + controls && controls.setVisible(this.showButtons) + } + } + + syncAppmenu() { + if (this.hasFocus) { + const current = AppMenu._label.get_text() + current != this.title && AppMenu._label.set_text(this.title) + } + } + + syncComponents() { + this.syncDecorations() + this.syncControls() + this.syncAppmenu() + } + + _parseEnumSetting(name) { + switch (this.settings.get(name)) { + case 'always': return true + case 'never': return false + case 'tiled': return this.handleScreen && this.tiled + case 'maximized': return this.handleScreen && this.maximized + case 'both': return this.handleScreen && this.bothMaximized + } + } + + _onStateChanged() { + this.syncComponents() + } + + _onTitleChanged() { + this.syncAppmenu() + } + + destroy() { + this.decorations.reset() + + this.signals.disconnectAll() + this.settings.disconnectAll() + + this.win._uniteShellManaged = false + } + } +) + +var WindowManager = GObject.registerClass( + class UniteWindowManager extends GObject.Object { + _init() { + this.windows = new Map() + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + this.styles = new Handlers.Styles() + + this.signals.connect( + global.window_manager, 'map', this._onMapWindow.bind(this) + ) + + this.signals.connect( + global.window_manager, 'destroy', this._onDestroyWindow.bind(this) + ) + + this.signals.connect( + global.display, 'notify::focus-window', this._onFocusWindow.bind(this) + ) + + this.signals.connect( + global.display, 'window-demands-attention', this._onAttention.bind(this) + ) + + this.signals.connect( + AppMenu._label, 'notify::text', this._onAppmenuChanged.bind(this) + ) + + this.settings.connect( + 'hide-window-titlebars', this._onStylesChange.bind(this) + ) + + this.settings.connect( + 'window-buttons-position', this._onStylesChange.bind(this) + ) + } + + get focusWindow() { + const win = global.display.get_focus_window() + return this.getWindow(win) + } + + get hideTitlebars() { + return this.settings.get('hide-window-titlebars') + } + + hasWindow(win) { + return win && this.windows.has(`${win}`) + } + + getWindow(win) { + return win && this.windows.get(`${win}`) + } + + setWindow(win) { + if (!this.hasWindow(win)) { + const meta = new MetaWindow(win) + this.windows.set(`${win}`, meta) + } + } + + deleteWindow(win) { + if (this.hasWindow(win)) { + const meta = this.getWindow(win) + meta.destroy() + + this.windows.delete(`${win}`) + } + } + + clearWindows() { + for (const key of this.windows.keys()) { + this.deleteWindow(key) + } + } + + _onMapWindow(shellwm, { meta_window }) { + if (isValid(meta_window)) { + this.setWindow(meta_window) + } + } + + _onDestroyWindow(shellwm, { meta_window }) { + if (isValid(meta_window)) { + this.deleteWindow(meta_window) + } + } + + _onFocusWindow(display) { + if (this.focusWindow) { + this.focusWindow.syncComponents() + } + } + + _onAppmenuChanged() { + const focused = this.focusWindow + const current = AppMenu._label.get_text() + + if (focused && current != focused.title) { + AppMenu._label.set_text(focused.title) + } + } + + _onAttention(actor, win) { + const auto = this.settings.get('autofocus-windows') + const time = global.get_current_time() + + auto && Main.activateWindow(win, time) + } + + _onStylesChange() { + if (this.hideTitlebars != 'never') { + const variant = this.settings.get('window-buttons-position') + const folder = `${Unite.path}/styles/buttons-${variant}` + const content = `@import url('${folder}/${this.hideTitlebars}.css');` + + this.styles.addGtkStyle('windowDecorations', content) + } else { + this.styles.deleteStyle('windowDecorations') + } + } + + activate() { + GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { + const actors = global.get_window_actors() + actors.forEach(actor => this._onMapWindow(null, actor)) + }) + + this._onStylesChange() + } + + destroy() { + this.clearWindows() + + this.signals.disconnectAll() + this.settings.disconnectAll() + this.styles.removeAll() + } + } +) diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/extension.js b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/extension.js deleted file mode 100644 index 83073f48..00000000 --- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/extension.js +++ /dev/null @@ -1,101 +0,0 @@ -const Main = imports.ui.main; -const Clutter = imports.gi.Clutter; -const Volume = imports.ui.status.volume; -const Gio = imports.gi.Gio; - -const VOL_ICONS = [ - 'audio-volume-muted-symbolic', - 'audio-volume-low-symbolic', - 'audio-volume-medium-symbolic', - 'audio-volume-high-symbolic' -]; - -let panel, - panelBinding, - volumeControl, - volumeStep; - -function init() { - volumeControl = Volume.getMixerControl(); - volumeStep = 500; - - panel = Main.panel; - panelBinding = null; -} - -function enable() { - panel.reactive = true; - if (panelBinding) { - disable(); - } - panelBinding = panel.actor.connect('scroll-event',_onScroll); -} - -function disable() { - if (panelBinding) { - panel.actor.disconnect(panelBinding); - panelBinding = null; - } -} - -/** - * Returns the max volume. - */ -function _getVolumeMax() { - return volumeControl.get_vol_max_norm(); - //return volumeControl.get_vol_max_amplified(); // boost volume (150%) -} - -/** - * Handles panel mouse scroll event. - */ -function _onScroll(actor, event) { - let volume = volumeControl.get_default_sink().volume; - - switch(event.get_scroll_direction()) { - case Clutter.ScrollDirection.UP: - volume += volumeStep; - break; - case Clutter.ScrollDirection.DOWN: - volume -= volumeStep; - break; - default: - return Clutter.EVENT_PROPAGATE; - } - - if (volume > _getVolumeMax()) { - volume = _getVolumeMax(); - } - else if (volume < volumeStep) { - volume = 0; - } - - volumeControl.get_default_sink().volume = volume; - volumeControl.get_default_sink().push_volume(); - - _showVolumeOsd(volume, volume/_getVolumeMax() * 100); - - return Clutter.EVENT_STOP; -} - -/** - * Shows the current volume on OSD. - * - * @see gsd-media-keys-manager.c - */ -function _showVolumeOsd (level, percent) { - let monitor = -1; - let n; - - if (level === 0) { - n = 0; - } else { - n = parseInt(3 * percent / 100 + 1); - n = Math.max(1, n); - n = Math.min(3, n); - } - - let icon = Gio.Icon.new_for_string(VOL_ICONS[n]); - - Main.osdWindowManager.show(monitor, icon, null, percent); -} \ No newline at end of file diff --git a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/metadata.json b/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/metadata.json deleted file mode 100644 index 6799d58f..00000000 --- a/tromjaro/gnome/desktop-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "_generated": "Generated by SweetTooth, do not edit", - "description": "Scroll anywhere in the top panel to change the audio volume.", - "name": "Volume Scroll", - "shell-version": [ - "3.22.3" - ], - "url": "https://github.com/krizajb/gnome-shell-volume-scroll", - "uuid": "volume_scroll@qord.si", - "version": 1 -} \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/COPYING b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/COPYING new file mode 100644 index 00000000..8d61b15e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/COPYING @@ -0,0 +1,341 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. + + 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 +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This 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 Library General +Public License instead of this License. + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/README.md b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/README.md new file mode 100644 index 00000000..e2a1b8c3 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/README.md @@ -0,0 +1,28 @@ +# Dash to Dock +![screenshot](https://github.com/micheleg/dash-to-dock/raw/master/media/screenshot.jpg) + +## A dock for the GNOME Shell +This extension enhances the dash moving it out of the overview and transforming it in a dock for an easier launching of applications and a faster switching between windows and desktops without having to leave the desktop view. + +[](https://extensions.gnome.org/extension/307/dash-to-dock) + +For additional installation instructions and more information visit [https://micheleg.github.io/dash-to-dock/](https://micheleg.github.io/dash-to-dock/). + +## Installation from source + +The extension can be installed directly from source, either for the convenience of using git or to test the latest development version. Clone the desired branch with git + +
git clone https://github.com/micheleg/dash-to-dock.git
+or download the branch from github. A simple Makefile is included. Then run +
make
+make install
+
+to install the extension in your home directory. A Shell reload is required Alt+F2 r Enter and the extension has to be enabled with *gnome-tweak-tool* or with *dconf*. + +## Bug Reporting + +Bugs should be reported to the Github bug tracker [https://github.com/micheleg/dash-to-dock/issues](https://github.com/micheleg/dash-to-dock/issues). + +## License +Dash to Dock Gnome Shell extension is distributed under the terms of the GNU General Public License, +version 2 or later. See the COPYING file for details. diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/Settings.ui b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/Settings.ui new file mode 100644 index 00000000..240c2f44 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/Settings.ui @@ -0,0 +1,3419 @@ + + + + + + 1 + 0.050000000000000003 + 0.25 + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + When set to minimize, double clicking minimizes all the windows of the application. + True + 40 + 0 + + + + 0 + 1 + + + + + True + False + True + Shift+Click action + 0 + + + 0 + 0 + + + + + True + False + center + + Raise window + Minimize window + Launch new instance + Cycle through windows + Minimize or overview + Show window previews + Minimize or show previews + Focus or show previews + Quit + + + + 1 + 0 + 2 + + + + + + + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behavior for Middle-Click. + True + 40 + 0 + + + + 0 + 1 + + + + + True + False + True + Middle-Click action + 0 + + + 0 + 0 + + + + + True + False + center + + Raise window + Minimize window + Launch new instance + Cycle through windows + Minimize or overview + Show window previews + Minimize or show previews + Focus or show previews + Quit + + + + 1 + 0 + 2 + + + + + + + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behavior for Shift+Middle-Click. + True + 40 + 0 + + + + 0 + 1 + + + + + True + False + True + Shift+Middle-Click action + 0 + + + 0 + 0 + + + + + True + False + center + + Raise window + Minimize window + Launch new instance + Cycle through windows + Minimize or overview + Show window previews + Minimize or show previews + Focus or show previews + Quit + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 0 + + + + + 1 + 0.01 + 0.10000000000000001 + + + 0.33000000000000002 + 1 + 0.01 + 0.10000000000000001 + + + 10 + 1 + 5 + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + vertical + 12 + + + True + False + 32 + + + True + False + center + Enable Unity7 like glossy backlit items + 0 + + + True + True + 0 + + + + + True + True + center + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + + + True + False + start + Use dominant color + + + True + True + 0 + + + + + True + True + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + 32 + + + True + True + + + 1 + 0 + + + + + True + False + True + Customize indicator style + fill + 0 + + + 0 + 0 + + + + + False + True + 2 + + + + + True + False + 1 + vertical + 12 + + + True + False + 32 + + + True + False + Color + 0 + + + True + True + 0 + + + + + True + True + True + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + 32 + + + True + False + Border color + 0 + + + True + True + 0 + + + + + True + True + True + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + 32 + + + True + False + Border width + 0 + + + True + True + 0 + + + + + True + True + dot_border_width_adjustment + + + False + True + 1 + + + + + False + True + 2 + + + + + False + True + 3 + + + + + + + + + + + + + + False + True + 0 + + + + + 1 + 0.050000000000000003 + 0.25 + + + 16 + 128 + 1 + 10 + + + True + True + 6 + 6 + 6 + 6 + + + True + False + 24 + 24 + 24 + 24 + vertical + 24 + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Show the dock on + 0 + + + 0 + 0 + + + + + True + False + center + + + + 1 + 0 + + + + + Show on all monitors. + True + True + False + 12 + 0 + True + + + 0 + 2 + 2 + + + + + + + + + + + + + + + 100 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Position on screen + 0 + + + False + True + 0 + + + + + True + False + 32 + + + Left + True + True + False + end + center + 0 + True + + + + False + True + 0 + + + + + Bottom + True + True + False + center + 0 + True + position_left_button + + + + False + True + 1 + + + + + Top + True + True + False + center + 0 + bottom + True + position_left_button + + + + False + True + 2 + + + + + Right + True + True + False + center + 0 + True + position_left_button + + + + False + True + 3 + + + + + False + True + 1 + + + + + + + + + + + + + + False + True + 0 + + + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Hide the dock when it obstructs a window of the current application. More refined settings are available. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Intelligent autohide + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + center + 0.46000000834465027 + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + True + end + center + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 1 + + + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Dock size limit + 0 + + + 0 + 0 + + + + + True + True + baseline + True + dock_size_adjustment + 0 + 2 + right + + + + + 1 + 0 + + + + + Panel mode: extend to the screen edge + True + True + False + 12 + 0 + True + + + 0 + 1 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Icon size limit + 0 + + + 0 + 0 + + + + + True + True + baseline + True + icon_size_adjustment + 1 + 0 + right + + + + + 1 + 0 + + + + + Fixed icon size: scroll to reveal other icons + True + True + False + 12 + 0 + True + + + 0 + 1 + 2 + + + + + + + + + + + + + + False + True + 2 + + + + + + + True + False + Position and size + + + False + + + + + True + False + 24 + 24 + 24 + 24 + vertical + 24 + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + + + + + True + False + True + Show favorite applications + 0 + + + 0 + 0 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + + + + + True + False + True + Show running applications + 0 + + + 0 + 0 + + + + + Isolate workspaces. + True + True + False + 12 + 0 + True + + + 0 + 2 + 2 + + + + + Isolate monitors. + True + True + False + 12 + 0 + True + + + 0 + 3 + 2 + + + + + True + True + False + 3 + 0 + True + + + True + False + Show open windows previews. + True + + + + + 0 + 1 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + True + If disabled, these settings are accessible from gnome-tweak-tool or the extension website. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Show <i>Applications</i> icon + True + 0 + + + 0 + 0 + + + + + Move the applications button at the beginning of the dock. + True + True + False + 12 + 0 + True + + + 0 + 2 + 2 + + + + + True + True + False + 3 + 0 + 0.43000000715255737 + True + + + True + False + Animate <i>Show Applications</i>. + True + + + + + 0 + 3 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + + + + + True + False + True + Show trash can + 0 + + + 0 + 0 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + + + + + True + False + True + Show mounted volumes and devices + 0 + + + 0 + 0 + + + + + + + + + + + + + + False + True + 0 + + + + + 1 + + + + + True + False + Launchers + + + 1 + False + + + + + True + False + 24 + 24 + 24 + 24 + vertical + 24 + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Enable Super+(0-9) as shortcuts to activate apps. It can also be used together with Shift and Ctrl. + True + True + 0 + + + + 0 + 1 + + + + + True + False + True + Use keyboard shortcuts to activate apps + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + center + 0.46000000834465027 + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + True + end + center + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 1 + + + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behaviour when clicking on the icon of a running application. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Click action + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + False + center + + Raise window + Minimize + Launch new instance + Cycle through windows + Minimize or overview + Show window previews + Minimize or show previews + Focus or show previews + + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 2 + + + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Behaviour when scrolling on the icon of an application. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Scroll action + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + False + center + + Do nothing + Cycle through windows + Switch workspace + + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 3 + + + + + 2 + + + + + True + False + Behavior + + + 2 + False + + + + + True + False + 24 + 24 + 24 + 24 + vertical + 24 + + + True + False + 0 + in + + + True + True + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Few customizations meant to integrate the dock with the default GNOME theme. Alternatively, specific options can be enabled below. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Use built-in theme + 0 + + + 0 + 0 + + + + + True + True + end + center + + + 1 + 0 + 2 + + + + + + + + + + + + + + False + True + 0 + + + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + True + Save space reducing padding and border radius. + 0 + + + + 0 + 1 + + + + + True + False + True + Shrink the dash + 0 + + + 0 + 0 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Customize windows counter indicators + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + center + 0.46000000834465027 + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + False + + Default + Dots + Squares + Dashes + Segmented + Solid + Ciliora + Metro + + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Set the background color for the dash. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Customize the dash color + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + center + 0.46000000834465027 + + + False + True + 1 + + + + + True + True + end + center + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + + + + + True + True + + + True + False + vertical + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Tune the dash background opacity. + 0 + + + + 0 + 1 + + + + + True + False + True + Customize opacity + 0 + + + 0 + 0 + + + + + True + False + 6 + + + True + True + True + center + center + + + True + False + emblem-system-symbolic + + + + + + False + True + 0 + + + + + True + False + center + + Default + Fixed + Dynamic + + + + False + True + 1 + + + + + 1 + 0 + 2 + + + + + False + True + 0 + + + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Opacity + + + False + True + 0 + + + + + True + True + custom_opacity_adjustement + on + False + 0 + 0 + 2 + right + + + + + True + True + 1 + + + + + False + True + 1 + + + + + + + + + 100 + 80 + True + True + + + True + False + 32 + + + True + False + center + 12 + Force straight corner + + 0 + + + True + True + 0 + + + + + True + True + center + 3 + + + False + True + 12 + 1 + + + + + + + + + + + + + + False + True + 1 + + + + + 3 + + + + + True + False + Appearance + + + 3 + False + + + + + False + 24 + 24 + True + True + vertical + 5 + + + + False + True + 10 + 0 + + + + + True + False + <b>Dash to Dock</b> + True + + + False + True + 1 + + + + + True + False + center + + + True + False + end + version: + + + False + True + 0 + + + + + True + False + start + ... + + + False + True + 1 + + + + + False + True + 2 + + + + + True + False + Moves the dash out of the overview transforming it in a dock + center + True + + + False + True + 3 + + + + + True + False + center + 5 + + + True + False + Created by + + + False + True + 0 + + + + + True + True + Michele (<a href="mailto:micxgx@gmail.com">micxgx@gmail.com</a>) + True + + + False + True + 1 + + + + + False + True + 4 + + + + + Webpage + True + True + True + + center + none + https://micheleg.github.io/dash-to-dock/ + + + False + True + 5 + + + + + True + True + end + <span size="small">This program comes with ABSOLUTELY NO WARRANTY. +See the <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, version 2 or later</a> for details.</span> + True + center + True + + + True + True + 6 + + + + + 4 + + + + + True + False + About + + + 4 + False + + + + + 1 + 0.01 + 0.10000000000000001 + + + 1 + 0.01 + 0.10000000000000001 + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + vertical + 12 + + + True + False + 32 + + + True + True + + + 1 + 0 + + + + + True + False + True + Customize minimum and maximum opacity values + fill + 0 + + + 0 + 0 + + + + + False + True + 0 + + + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Minimum opacity + + + False + True + 0 + + + + + True + True + min_opacity_adjustement + on + False + 0 + 0 + 2 + right + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + Maximum opacity + + + False + True + 0 + + + + + True + True + max_opacity_adjustement + on + False + 0 + 0 + 2 + right + + + + + True + True + 1 + + + + + False + True + 1 + + + + + + + + + + + + + + False + True + 0 + + + + + 1000 + 50 + 250 + + + 10 + 0.25 + 1 + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + True + Number overlay + 0 + + + 0 + 0 + + + + + True + False + Temporarily show the application numbers over the icons, corresponding to the shortcut. + True + 40 + 0 + + + + 0 + 1 + + + + + + + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + True + Show the dock if it is hidden + 0 + + + 0 + 0 + + + + + True + False + If using autohide, the dock will appear for a short time when triggering the shortcut. + True + 40 + 0 + + + + 0 + 1 + + + + + + + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + center + 12 + + + 1 + 0 + + + + + True + False + True + Shortcut for the options above + 0 + + + 0 + 0 + + + + + True + False + Syntax: <Shift>, <Ctrl>, <Alt>, <Super> + True + 40 + 0 + + + + 0 + 1 + + + + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + True + 6 + 32 + + + True + True + end + shortcut_time_adjustment + 3 + + + 1 + 0 + + + + + True + False + True + Hide timeout (s) + 0 + + + 0 + 0 + + + + + + + + + + + + + + False + True + 0 + + + + + 1 + 0.050000000000000003 + 0.25 + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + 0 + in + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Show the dock by mouse hover on the screen edge. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Autohide + 0 + + + 0 + 0 + + + + + True + True + end + center + + + 1 + 0 + 2 + + + + + Push to show: require pressure to show the dock + True + True + False + 0 + True + + + 0 + 3 + 2 + + + + + Enable in fullscreen mode + True + True + False + 12 + 0 + True + + + 0 + 2 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Show the dock when it doesn't obstruct application windows. + True + 0 + + + + 0 + 1 + + + + + True + False + True + Dodge windows + 0 + + + 0 + 0 + + + + + True + True + end + center + + + 1 + 0 + 2 + + + + + True + False + vertical + + + All windows + True + True + False + 12 + 0 + True + True + + + + False + True + 0 + + + + + Only focused application's windows + True + True + False + 0 + True + True + all_windows_radio_button + + + + False + True + 1 + + + + + Only maximized windows + True + True + False + 0 + True + True + all_windows_radio_button + + + + False + True + 2 + + + + + 0 + 2 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + True + 6 + 32 + + + True + True + end + animation_time_adjustment + 3 + + + 1 + 0 + + + + + True + False + True + Animation duration (s) + 0 + + + 0 + 0 + + + + + True + True + end + hide_timeout_adjustment + 3 + + + 1 + 1 + + + + + True + True + end + show_timeout_adjustment + 3 + + + 1 + 2 + + + + + True + True + 0.000 + pressure_threshold_adjustment + + + 1 + 3 + + + + + True + False + True + Hide timeout (s) + 0 + + + 0 + 1 + + + + + True + False + True + Show timeout (s) + 0 + + + 0 + 2 + + + + + True + False + True + Pressure threshold + 0 + + + 0 + 3 + + + + + + + + + + + + + + False + True + 0 + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIconIndicators.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIconIndicators.js new file mode 100644 index 00000000..ff9d9813 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIconIndicators.js @@ -0,0 +1,1130 @@ +const Cogl = imports.gi.Cogl; +const Cairo = imports.cairo; +const Clutter = imports.gi.Clutter; +const GdkPixbuf = imports.gi.GdkPixbuf +const Gio = imports.gi.Gio; +const Gtk = imports.gi.Gtk; +const Pango = imports.gi.Pango; +const Shell = imports.gi.Shell; +const St = imports.gi.St; + +const Util = imports.misc.util; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; +const Utils = Me.imports.utils; + +let tracker = Shell.WindowTracker.get_default(); + +const RunningIndicatorStyle = { + DEFAULT: 0, + DOTS: 1, + SQUARES: 2, + DASHES: 3, + SEGMENTED: 4, + SOLID: 5, + CILIORA: 6, + METRO: 7 +}; + +const MAX_WINDOWS_CLASSES = 4; + + +/* + * This is the main indicator class to be used. The desired bahviour is + * obtained by composing the desired classes below based on the settings. + * + */ +var AppIconIndicator = class DashToDock_AppIconIndicator { + + constructor(source) { + this._indicators = []; + + // Unity indicators always enabled for now + let unityIndicator = new UnityIndicator(source); + this._indicators.push(unityIndicator); + + // Choose the style for the running indicators + let runningIndicator = null; + let runningIndicatorStyle; + + let settings = Docking.DockManager.settings; + if (settings.get_boolean('apply-custom-theme' )) { + runningIndicatorStyle = RunningIndicatorStyle.DOTS; + } else { + runningIndicatorStyle = settings.get_enum('running-indicator-style'); + } + + switch (runningIndicatorStyle) { + case RunningIndicatorStyle.DEFAULT: + runningIndicator = new RunningIndicatorDefault(source); + break; + + case RunningIndicatorStyle.DOTS: + runningIndicator = new RunningIndicatorDots(source); + break; + + case RunningIndicatorStyle.SQUARES: + runningIndicator = new RunningIndicatorSquares(source); + break; + + case RunningIndicatorStyle.DASHES: + runningIndicator = new RunningIndicatorDashes(source); + break; + + case RunningIndicatorStyle.SEGMENTED: + runningIndicator = new RunningIndicatorSegmented(source); + break; + + case RunningIndicatorStyle.SOLID: + runningIndicator = new RunningIndicatorSolid(source); + break; + + case RunningIndicatorStyle.CILIORA: + runningIndicator = new RunningIndicatorCiliora(source); + break; + + case RunningIndicatorStyle.METRO: + runningIndicator = new RunningIndicatorMetro(source); + break; + + default: + runningIndicator = new RunningIndicatorBase(source); + } + + this._indicators.push(runningIndicator); + } + + update() { + for (let i=0; i { + this._signalsHandler.destroy(); + }); + } + + update() { + } + + destroy() { + this._source.actor.disconnect(this._sourceDestroyId); + this._signalsHandler.destroy(); + } +}; + +/* + * A base indicator class for running style, from which all other EunningIndicators should derive, + * providing some basic methods, variables definitions and their update, css style classes handling. + * + */ +var RunningIndicatorBase = class DashToDock_RunningIndicatorBase extends IndicatorBase { + + constructor(source) { + super(source) + + this._side = Utils.getPosition(); + this._nWindows = 0; + + this._dominantColorExtractor = new DominantColorExtractor(this._source.app); + + // These statuses take into account the workspace/monitor isolation + this._isFocused = false; + this._isRunning = false; + } + + update() { + // Limit to 1 to MAX_WINDOWS_CLASSES windows classes + this._nWindows = Math.min(this._source.getInterestingWindows().length, MAX_WINDOWS_CLASSES); + + // We need to check the number of windows, as the focus might be + // happening on another monitor if using isolation + if (tracker.focus_app == this._source.app && this._nWindows > 0) + this._isFocused = true; + else + this._isFocused = false; + + // In the case of workspace isolation, we need to hide the dots of apps with + // no windows in the current workspace + if ((this._source.app.state != Shell.AppState.STOPPED || this._source.isLocation()) && this._nWindows > 0) + this._isRunning = true; + else + this._isRunning = false; + + this._updateCounterClass(); + this._updateFocusClass(); + this._updateDefaultDot(); + } + + _updateCounterClass() { + for (let i = 1; i <= MAX_WINDOWS_CLASSES; i++) { + let className = 'running' + i; + if (i != this._nWindows) + this._source.actor.remove_style_class_name(className); + else + this._source.actor.add_style_class_name(className); + } + } + + _updateFocusClass() { + if (this._isFocused) + this._source.actor.add_style_class_name('focused'); + else + this._source.actor.remove_style_class_name('focused'); + } + + _updateDefaultDot() { + if (this._isRunning) + this._source._dot.show(); + else + this._source._dot.hide(); + } + + _hideDefaultDot() { + // I use opacity to hide the default dot because the show/hide function + // are used by the parent class. + this._source._dot.opacity = 0; + } + + _restoreDefaultDot() { + this._source._dot.opacity = 255; + } + + _enableBacklight() { + + let colorPalette = this._dominantColorExtractor._getColorPalette(); + + // Fallback + if (colorPalette === null) { + this._source._iconContainer.set_style( + 'border-radius: 5px;' + + 'background-gradient-direction: vertical;' + + 'background-gradient-start: #e0e0e0;' + + 'background-gradient-end: darkgray;' + ); + + return; + } + + this._source._iconContainer.set_style( + 'border-radius: 5px;' + + 'background-gradient-direction: vertical;' + + 'background-gradient-start: ' + colorPalette.original + ';' + + 'background-gradient-end: ' + colorPalette.darker + ';' + ); + + } + + _disableBacklight() { + this._source._iconContainer.set_style(null); + } + + destroy() { + this._disableBacklight(); + // Remove glossy background if the children still exists + if (this._source._iconContainer.get_children().length > 1) + this._source._iconContainer.get_children()[1].set_style(null); + this._restoreDefaultDot(); + + super.destroy(); + } +}; + +// We add a css class so third parties themes can limit their indicaor customization +// to the case we do nothing +var RunningIndicatorDefault = class DashToDock_RunningIndicatorDefault extends RunningIndicatorBase { + + constructor(source) { + super(source); + this._source.actor.add_style_class_name('default'); + } + + destory() { + this._source.actor.remove_style_class_name('default'); + super.destroy(); + } +}; + +var RunningIndicatorDots = class DashToDock_RunningIndicatorDots extends RunningIndicatorBase { + + constructor(source) { + super(source) + + this._hideDefaultDot(); + + this._area = new St.DrawingArea({x_expand: true, y_expand: true}); + + // We draw for the bottom case and rotate the canvas for other placements + //set center of rotatoins to the center + this._area.set_pivot_point(0.5, 0.5); + // prepare transformation matrix + let m = new Cogl.Matrix(); + m.init_identity(); + + switch (this._side) { + case St.Side.TOP: + m.xx = -1; + m.rotate(180, 0, 0, 1); + break + + case St.Side.BOTTOM: + // nothing + break; + + case St.Side.LEFT: + m.yy = -1; + m.rotate(90, 0, 0, 1); + break; + + case St.Side.RIGHT: + m.rotate(-90, 0, 0, 1); + break + } + + this._area.set_transform(m); + + this._area.connect('repaint', this._updateIndicator.bind(this)); + this._source._iconContainer.add_child(this._area); + + let keys = ['custom-theme-running-dots-color', + 'custom-theme-running-dots-border-color', + 'custom-theme-running-dots-border-width', + 'custom-theme-customize-running-dots', + 'unity-backlit-items', + 'running-indicator-dominant-color']; + + keys.forEach(function(key) { + this._signalsHandler.add([ + Docking.DockManager.settings, + 'changed::' + key, + this.update.bind(this) + ]); + }, this); + + // Apply glossy background + // TODO: move to enable/disableBacklit to apply itonly to the running apps? + // TODO: move to css class for theming support + this._glossyBackgroundStyle = 'background-image: url(\'' + Me.path + '/media/glossy.svg\');' + + 'background-size: contain;'; + } + + update() { + super.update(); + + // Enable / Disable the backlight of running apps + if (!Docking.DockManager.settings.get_boolean('apply-custom-theme') && + Docking.DockManager.settings.get_boolean('unity-backlit-items')) { + this._source._iconContainer.get_children()[1].set_style(this._glossyBackgroundStyle); + if (this._isRunning) + this._enableBacklight(); + else + this._disableBacklight(); + } else { + this._disableBacklight(); + this._source._iconContainer.get_children()[1].set_style(null); + } + + if (this._area) + this._area.queue_repaint(); + } + + _computeStyle() { + + let [width, height] = this._area.get_surface_size(); + this._width = height; + this._height = width; + + // By defaut re-use the style - background color, and border width and color - + // of the default dot + let themeNode = this._source._dot.get_theme_node(); + this._borderColor = themeNode.get_border_color(this._side); + this._borderWidth = themeNode.get_border_width(this._side); + this._bodyColor = themeNode.get_background_color(); + + let settings = Docking.DockManager.settings; + if (!settings.get_boolean('apply-custom-theme')) { + // Adjust for the backlit case + if (settings.get_boolean('unity-backlit-items')) { + // Use dominant color for dots too if the backlit is enables + let colorPalette = this._dominantColorExtractor._getColorPalette(); + + // Slightly adjust the styling + this._borderWidth = 2; + + if (colorPalette !== null) { + this._borderColor = Clutter.color_from_string(colorPalette.lighter)[1] ; + this._bodyColor = Clutter.color_from_string(colorPalette.darker)[1]; + } else { + // Fallback + this._borderColor = Clutter.color_from_string('white')[1]; + this._bodyColor = Clutter.color_from_string('gray')[1]; + } + } + + // Apply dominant color if requested + if (settings.get_boolean('running-indicator-dominant-color')) { + let colorPalette = this._dominantColorExtractor._getColorPalette(); + if (colorPalette !== null) { + this._bodyColor = Clutter.color_from_string(colorPalette.original)[1]; + } + } + + // Finally, use customize style if requested + if (settings.get_boolean('custom-theme-customize-running-dots')) { + this._borderColor = Clutter.color_from_string(settings.get_string('custom-theme-running-dots-border-color'))[1]; + this._borderWidth = settings.get_int('custom-theme-running-dots-border-width'); + this._bodyColor = Clutter.color_from_string(settings.get_string('custom-theme-running-dots-color'))[1]; + } + } + + // Define the radius as an arbitrary size, but keep large enough to account + // for the drawing of the border. + this._radius = Math.max(this._width/22, this._borderWidth/2); + this._padding = 0; // distance from the margin + this._spacing = this._radius + this._borderWidth; // separation between the dots + } + + _updateIndicator() { + + let area = this._area; + let cr = this._area.get_context(); + + this._computeStyle(); + this._drawIndicator(cr); + cr.$dispose(); + } + + _drawIndicator(cr) { + // Draw the required numbers of dots + let n = this._nWindows; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + // draw for the bottom case: + cr.translate((this._width - (2*n)*this._radius - (n-1)*this._spacing)/2, this._height - this._padding); + for (let i = 0; i < n; i++) { + cr.newSubPath(); + cr.arc((2*i+1)*this._radius + i*this._spacing, -this._radius - this._borderWidth/2, this._radius, 0, 2*Math.PI); + } + + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill(); + } + + destroy() { + this._area.destroy(); + super.destroy(); + } +}; + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorCiliora = class DashToDock_RunningIndicatorCiliora extends RunningIndicatorDots { + + _drawIndicator(cr) { + if (this._isRunning) { + + let size = Math.max(this._width/20, this._borderWidth); + let spacing = size; // separation between the dots + let lineLength = this._width - (size*(this._nWindows-1)) - (spacing*(this._nWindows-1)); + let padding = this._borderWidth; + // For the backlit case here we don't want the outer border visible + if (Docking.DockManager.settings.get_boolean('unity-backlit-items') && + !Docking.DockManager.settings.get_boolean('custom-theme-customize-running-dots')) + padding = 0; + let yOffset = this._height - padding - size; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + cr.translate(0, yOffset); + cr.newSubPath(); + cr.rectangle(0, 0, lineLength, size); + for (let i = 1; i < this._nWindows; i++) { + cr.newSubPath(); + cr.rectangle(lineLength + (i*spacing) + ((i-1)*size), 0, size, size); + } + + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill(); + } + } +}; + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorSegmented = class DashToDock_RunningIndicatorSegmented extends RunningIndicatorDots { + + _drawIndicator(cr) { + if (this._isRunning) { + let size = Math.max(this._width/20, this._borderWidth); + let spacing = Math.ceil(this._width/18); // separation between the dots + let dashLength = Math.ceil((this._width - ((this._nWindows-1)*spacing))/this._nWindows); + let lineLength = this._width - (size*(this._nWindows-1)) - (spacing*(this._nWindows-1)); + let padding = this._borderWidth; + // For the backlit case here we don't want the outer border visible + if (Docking.DockManager.settings.get_boolean('unity-backlit-items') && + !Docking.DockManager.settings.get_boolean('custom-theme-customize-running-dots')) + padding = 0; + let yOffset = this._height - padding - size; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + cr.translate(0, yOffset); + for (let i = 0; i < this._nWindows; i++) { + cr.newSubPath(); + cr.rectangle(i*dashLength + i*spacing, 0, dashLength, size); + } + + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill() + } + } +}; + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorSolid = class DashToDock_RunningIndicatorSolid extends RunningIndicatorDots { + + _drawIndicator(cr) { + if (this._isRunning) { + + let size = Math.max(this._width/20, this._borderWidth); + let padding = this._borderWidth; + // For the backlit case here we don't want the outer border visible + if (Docking.DockManager.settings.get_boolean('unity-backlit-items') && + !Docking.DockManager.settings.get_boolean('custom-theme-customize-running-dots')) + padding = 0; + let yOffset = this._height - padding - size; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + cr.translate(0, yOffset); + cr.newSubPath(); + cr.rectangle(0, 0, this._width, size); + + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill(); + + } + } +}; + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorSquares = class DashToDock_RunningIndicatorSquares extends RunningIndicatorDots { + + _drawIndicator(cr) { + if (this._isRunning) { + let size = Math.max(this._width/11, this._borderWidth); + let padding = this._borderWidth; + let spacing = Math.ceil(this._width/18); // separation between the dots + let yOffset = this._height - padding - size; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + cr.translate(Math.floor((this._width - this._nWindows*size - (this._nWindows-1)*spacing)/2), yOffset); + for (let i = 0; i < this._nWindows; i++) { + cr.newSubPath(); + cr.rectangle(i*size + i*spacing, 0, size, size); + } + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill(); + } + } +} + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorDashes = class DashToDock_RunningIndicatorDashes extends RunningIndicatorDots { + + _drawIndicator(cr) { + if (this._isRunning) { + let size = Math.max(this._width/20, this._borderWidth); + let padding = this._borderWidth; + let spacing = Math.ceil(this._width/18); // separation between the dots + let dashLength = Math.floor(this._width/4) - spacing; + let yOffset = this._height - padding - size; + + cr.setLineWidth(this._borderWidth); + Clutter.cairo_set_source_color(cr, this._borderColor); + + cr.translate(Math.floor((this._width - this._nWindows*dashLength - (this._nWindows-1)*spacing)/2), yOffset); + for (let i = 0; i < this._nWindows; i++) { + cr.newSubPath(); + cr.rectangle(i*dashLength + i*spacing, 0, dashLength, size); + } + + cr.strokePreserve(); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.fill(); + } + } +} + +// Adapted from dash-to-panel by Jason DeRose +// https://github.com/jderose9/dash-to-panel +var RunningIndicatorMetro = class DashToDock_RunningIndicatorMetro extends RunningIndicatorDots { + + constructor(source) { + super(source); + this._source.actor.add_style_class_name('metro'); + } + + destroy() { + this._source.actor.remove_style_class_name('metro'); + super.destroy(); + } + + _drawIndicator(cr) { + if (this._isRunning) { + let size = Math.max(this._width/20, this._borderWidth); + let padding = 0; + // For the backlit case here we don't want the outer border visible + if (Docking.DockManager.settings.get_boolean('unity-backlit-items') && + !Docking.DockManager.settings.get_boolean('custom-theme-customize-running-dots')) + padding = 0; + let yOffset = this._height - padding - size; + + let n = this._nWindows; + if(n <= 1) { + cr.translate(0, yOffset); + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.newSubPath(); + cr.rectangle(0, 0, this._width, size); + cr.fill(); + } else { + let blackenedLength = (1/48)*this._width; // need to scale with the SVG for the stacked highlight + let darkenedLength = this._isFocused ? (2/48)*this._width : (10/48)*this._width; + let blackenedColor = this._bodyColor.shade(.3); + let darkenedColor = this._bodyColor.shade(.7); + + cr.translate(0, yOffset); + + Clutter.cairo_set_source_color(cr, this._bodyColor); + cr.newSubPath(); + cr.rectangle(0, 0, this._width - darkenedLength - blackenedLength, size); + cr.fill(); + Clutter.cairo_set_source_color(cr, blackenedColor); + cr.newSubPath(); + cr.rectangle(this._width - darkenedLength - blackenedLength, 0, 1, size); + cr.fill(); + Clutter.cairo_set_source_color(cr, darkenedColor); + cr.newSubPath(); + cr.rectangle(this._width - darkenedLength, 0, darkenedLength, size); + cr.fill(); + } + } + } +} + +/* + * Unity like notification and progress indicators + */ +var UnityIndicator = class DashToDock_UnityIndicator extends IndicatorBase { + + constructor(source) { + + super(source); + + this._notificationBadgeLabel = new St.Label(); + this._notificationBadgeBin = new St.Bin({ + child: this._notificationBadgeLabel, + x_align: St.Align.END, y_align: St.Align.START, + x_expand: true, y_expand: true + }); + this._notificationBadgeLabel.add_style_class_name('notification-badge'); + this._notificationBadgeCount = 0; + this._notificationBadgeBin.hide(); + + this._source._iconContainer.add_child(this._notificationBadgeBin); + this._source._iconContainer.connect('allocation-changed', this.updateNotificationBadge.bind(this)); + + this._remoteEntries = []; + this._source.remoteModel.lookupById(this._source.app.id).forEach( + (entry) => { + this.insertEntryRemote(entry); + } + ); + + this._signalsHandler.add([ + this._source.remoteModel, + 'entry-added', + this._onLauncherEntryRemoteAdded.bind(this) + ], [ + this._source.remoteModel, + 'entry-removed', + this._onLauncherEntryRemoteRemoved.bind(this) + ]) + } + + _onLauncherEntryRemoteAdded(remoteModel, entry) { + if (!entry || !entry.appId()) + return; + if (this._source && this._source.app && this._source.app.id == entry.appId()) { + this.insertEntryRemote(entry); + } + } + + _onLauncherEntryRemoteRemoved(remoteModel, entry) { + if (!entry || !entry.appId()) + return; + + if (this._source && this._source.app && this._source.app.id == entry.appId()) { + this.removeEntryRemote(entry); + } + } + + updateNotificationBadge() { + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + let [minWidth, natWidth] = this._source._iconContainer.get_preferred_width(-1); + let logicalNatWidth = natWidth / scaleFactor; + let font_size = Math.max(10, Math.round(logicalNatWidth / 5)); + let margin_left = Math.round(logicalNatWidth / 4); + + this._notificationBadgeLabel.set_style( + 'font-size: ' + font_size + 'px;' + + 'margin-left: ' + margin_left + 'px;' + ); + + this._notificationBadgeBin.width = Math.round(logicalNatWidth - margin_left); + this._notificationBadgeLabel.clutter_text.ellipsize = Pango.EllipsizeMode.MIDDLE; + } + + _notificationBadgeCountToText(count) { + if (count <= 9999) { + return count.toString(); + } else if (count < 1e5) { + let thousands = count / 1e3; + return thousands.toFixed(1).toString() + "k"; + } else if (count < 1e6) { + let thousands = count / 1e3; + return thousands.toFixed(0).toString() + "k"; + } else if (count < 1e8) { + let millions = count / 1e6; + return millions.toFixed(1).toString() + "M"; + } else if (count < 1e9) { + let millions = count / 1e6; + return millions.toFixed(0).toString() + "M"; + } else { + let billions = count / 1e9; + return billions.toFixed(1).toString() + "B"; + } + } + + setNotificationBadge(count) { + this._notificationBadgeCount = count; + let text = this._notificationBadgeCountToText(count); + this._notificationBadgeLabel.set_text(text); + } + + toggleNotificationBadge(activate) { + if (activate && this._notificationBadgeCount > 0) { + this.updateNotificationBadge(); + this._notificationBadgeBin.show(); + } + else + this._notificationBadgeBin.hide(); + } + + _showProgressOverlay() { + if (this._progressOverlayArea) { + this._updateProgressOverlay(); + return; + } + + this._progressOverlayArea = new St.DrawingArea({x_expand: true, y_expand: true}); + this._progressOverlayArea.add_style_class_name('progress-bar'); + this._progressOverlayArea.connect('repaint', () => { + this._drawProgressOverlay(this._progressOverlayArea); + }); + + this._source._iconContainer.add_child(this._progressOverlayArea); + let node = this._progressOverlayArea.get_theme_node(); + + let [hasColor, color] = node.lookup_color('-progress-bar-background', false); + if (hasColor) + this._progressbar_background = color + else + this._progressbar_background = new Clutter.Color({red: 204, green: 204, blue: 204, alpha: 255}); + + [hasColor, color] = node.lookup_color('-progress-bar-border', false); + if (hasColor) + this._progressbar_border = color; + else + this._progressbar_border = new Clutter.Color({red: 230, green: 230, blue: 230, alpha: 255}); + + this._updateProgressOverlay(); + } + + _hideProgressOverlay() { + if (this._progressOverlayArea) + this._progressOverlayArea.destroy(); + this._progressOverlayArea = null; + this._progressbar_background = null; + this._progressbar_border = null; + } + + _updateProgressOverlay() { + if (this._progressOverlayArea) + this._progressOverlayArea.queue_repaint(); + } + + _drawProgressOverlay(area) { + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + let [surfaceWidth, surfaceHeight] = area.get_surface_size(); + let cr = area.get_context(); + + let iconSize = this._source.icon.iconSize * scaleFactor; + + let x = Math.floor((surfaceWidth - iconSize) / 2); + let y = Math.floor((surfaceHeight - iconSize) / 2); + + let lineWidth = Math.floor(1.0 * scaleFactor); + let padding = Math.floor(iconSize * 0.05); + let width = iconSize - 2.0*padding; + let height = Math.floor(Math.min(18.0*scaleFactor, 0.20*iconSize)); + x += padding; + y += iconSize - height - padding; + + cr.setLineWidth(lineWidth); + + // Draw the outer stroke + let stroke = new Cairo.LinearGradient(0, y, 0, y + height); + let fill = null; + stroke.addColorStopRGBA(0.5, 0.5, 0.5, 0.5, 0.1); + stroke.addColorStopRGBA(0.9, 0.8, 0.8, 0.8, 0.4); + Utils.drawRoundedLine(cr, x + lineWidth/2.0, y + lineWidth/2.0, width, height, true, true, stroke, fill); + + // Draw the background + x += lineWidth; + y += lineWidth; + width -= 2.0*lineWidth; + height -= 2.0*lineWidth; + + stroke = Cairo.SolidPattern.createRGBA(0.20, 0.20, 0.20, 0.9); + fill = new Cairo.LinearGradient(0, y, 0, y + height); + fill.addColorStopRGBA(0.4, 0.25, 0.25, 0.25, 1.0); + fill.addColorStopRGBA(0.9, 0.35, 0.35, 0.35, 1.0); + Utils.drawRoundedLine(cr, x + lineWidth/2.0, y + lineWidth/2.0, width, height, true, true, stroke, fill); + + // Draw the finished bar + x += lineWidth; + y += lineWidth; + width -= 2.0*lineWidth; + height -= 2.0*lineWidth; + + let finishedWidth = Math.ceil(this._progress * width); + + let bg = this._progressbar_background; + let bd = this._progressbar_border; + + stroke = Cairo.SolidPattern.createRGBA(bd.red/255, bd.green/255, bd.blue/255, bd.alpha/255); + fill = Cairo.SolidPattern.createRGBA(bg.red/255, bg.green/255, bg.blue/255, bg.alpha/255); + + if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) + Utils.drawRoundedLine(cr, x + lineWidth/2.0 + width - finishedWidth, y + lineWidth/2.0, finishedWidth, height, true, true, stroke, fill); + else + Utils.drawRoundedLine(cr, x + lineWidth/2.0, y + lineWidth/2.0, finishedWidth, height, true, true, stroke, fill); + + cr.$dispose(); + } + + setProgress(progress) { + this._progress = Math.min(Math.max(progress, 0.0), 1.0); + this._updateProgressOverlay(); + } + + toggleProgressOverlay(activate) { + if (activate) { + this._showProgressOverlay(); + } + else { + this._hideProgressOverlay(); + } + } + + insertEntryRemote(remote) { + if (!remote || this._remoteEntries.indexOf(remote) !== -1) + return; + + this._remoteEntries.push(remote); + this._selectEntryRemote(remote); + } + + removeEntryRemote(remote) { + if (!remote || this._remoteEntries.indexOf(remote) == -1) + return; + + this._remoteEntries.splice(this._remoteEntries.indexOf(remote), 1); + + if (this._remoteEntries.length > 0) { + this._selectEntryRemote(this._remoteEntries[this._remoteEntries.length-1]); + } else { + this.setNotificationBadge(0); + this.toggleNotificationBadge(false); + this.setProgress(0); + this.toggleProgressOverlay(false); + } + } + + _selectEntryRemote(remote) { + if (!remote) + return; + + this._signalsHandler.removeWithLabel('entry-remotes'); + + this._signalsHandler.addWithLabel('entry-remotes', + [ + remote, + 'count-changed', + (remote, value) => { + this.setNotificationBadge(value); + } + ], [ + remote, + 'count-visible-changed', + (remote, value) => { + this.toggleNotificationBadge(value); + } + ], [ + remote, + 'progress-changed', + (remote, value) => { + this.setProgress(value); + } + ], [ + remote, + 'progress-visible-changed', + (remote, value) => { + this.toggleProgressOverlay(value); + } + ]); + + this.setNotificationBadge(remote.count()); + this.toggleNotificationBadge(remote.countVisible()); + this.setProgress(remote.progress()); + this.toggleProgressOverlay(remote.progressVisible()); + } +} + + +// We need an icons theme object, this is the only way I managed to get +// pixel buffers that can be used for calculating the backlight color +let themeLoader = null; + +// Global icon cache. Used for Unity7 styling. +let iconCacheMap = new Map(); +// Max number of items to store +// We don't expect to ever reach this number, but let's put an hard limit to avoid +// even the remote possibility of the cached items to grow indefinitely. +const MAX_CACHED_ITEMS = 1000; +// When the size exceed it, the oldest 'n' ones are deleted +const BATCH_SIZE_TO_DELETE = 50; +// The icon size used to extract the dominant color +const DOMINANT_COLOR_ICON_SIZE = 64; + +// Compute dominant color frim the app icon. +// The color is cached for efficiency. +var DominantColorExtractor = class DashToDock_DominantColorExtractor { + + constructor(app) { + this._app = app; + } + + /** + * Try to get the pixel buffer for the current icon, if not fail gracefully + */ + _getIconPixBuf() { + let iconTexture = this._app.create_icon_texture(16); + + if (themeLoader === null) { + let ifaceSettings = new Gio.Settings({ schema: "org.gnome.desktop.interface" }); + + themeLoader = new Gtk.IconTheme(), + themeLoader.set_custom_theme(ifaceSettings.get_string('icon-theme')); // Make sure the correct theme is loaded + } + + // Unable to load the icon texture, use fallback + if (iconTexture instanceof St.Icon === false) { + return null; + } + + iconTexture = iconTexture.get_gicon(); + + // Unable to load the icon texture, use fallback + if (iconTexture === null) { + return null; + } + + if (iconTexture instanceof Gio.FileIcon) { + // Use GdkPixBuf to load the pixel buffer from the provided file path + return GdkPixbuf.Pixbuf.new_from_file(iconTexture.get_file().get_path()); + } + + // Get the pixel buffer from the icon theme + let icon_info = themeLoader.lookup_icon(iconTexture.get_names()[0], DOMINANT_COLOR_ICON_SIZE, 0); + if (icon_info !== null) + return icon_info.load_icon(); + else + return null; + } + + /** + * The backlight color choosing algorithm was mostly ported to javascript from the + * Unity7 C++ source of Canonicals: + * https://bazaar.launchpad.net/~unity-team/unity/trunk/view/head:/launcher/LauncherIcon.cpp + * so it more or less works the same way. + */ + _getColorPalette() { + if (iconCacheMap.get(this._app.get_id())) { + // We already know the answer + return iconCacheMap.get(this._app.get_id()); + } + + let pixBuf = this._getIconPixBuf(); + if (pixBuf == null) + return null; + + let pixels = pixBuf.get_pixels(), + offset = 0; + + let total = 0, + rTotal = 0, + gTotal = 0, + bTotal = 0; + + let resample_y = 1, + resample_x = 1; + + // Resampling of large icons + // We resample icons larger than twice the desired size, as the resampling + // to a size s + // DOMINANT_COLOR_ICON_SIZE < s < 2*DOMINANT_COLOR_ICON_SIZE, + // most of the case exactly DOMINANT_COLOR_ICON_SIZE as the icon size is tipycally + // a multiple of it. + let width = pixBuf.get_width(); + let height = pixBuf.get_height(); + + // Resample + if (height >= 2* DOMINANT_COLOR_ICON_SIZE) + resample_y = Math.floor(height/DOMINANT_COLOR_ICON_SIZE); + + if (width >= 2* DOMINANT_COLOR_ICON_SIZE) + resample_x = Math.floor(width/DOMINANT_COLOR_ICON_SIZE); + + if (resample_x !==1 || resample_y !== 1) + pixels = this._resamplePixels(pixels, resample_x, resample_y); + + // computing the limit outside the for (where it would be repeated at each iteration) + // for performance reasons + let limit = pixels.length; + for (let offset = 0; offset < limit; offset+=4) { + let r = pixels[offset], + g = pixels[offset + 1], + b = pixels[offset + 2], + a = pixels[offset + 3]; + + let saturation = (Math.max(r,g, b) - Math.min(r,g, b)); + let relevance = 0.1 * 255 * 255 + 0.9 * a * saturation; + + rTotal += r * relevance; + gTotal += g * relevance; + bTotal += b * relevance; + + total += relevance; + } + + total = total * 255; + + let r = rTotal / total, + g = gTotal / total, + b = bTotal / total; + + let hsv = Utils.ColorUtils.RGBtoHSV(r * 255, g * 255, b * 255); + + if (hsv.s > 0.15) + hsv.s = 0.65; + hsv.v = 0.90; + + let rgb = Utils.ColorUtils.HSVtoRGB(hsv.h, hsv.s, hsv.v); + + // Cache the result. + let backgroundColor = { + lighter: Utils.ColorUtils.ColorLuminance(rgb.r, rgb.g, rgb.b, 0.2), + original: Utils.ColorUtils.ColorLuminance(rgb.r, rgb.g, rgb.b, 0), + darker: Utils.ColorUtils.ColorLuminance(rgb.r, rgb.g, rgb.b, -0.5) + }; + + if (iconCacheMap.size >= MAX_CACHED_ITEMS) { + //delete oldest cached values (which are in order of insertions) + let ctr=0; + for (let key of iconCacheMap.keys()) { + if (++ctr > BATCH_SIZE_TO_DELETE) + break; + iconCacheMap.delete(key); + } + } + + iconCacheMap.set(this._app.get_id(), backgroundColor); + + return backgroundColor; + } + + /** + * Downsample large icons before scanning for the backlight color to + * improve performance. + * + * @param pixBuf + * @param pixels + * @param resampleX + * @param resampleY + * + * @return []; + */ + _resamplePixels (pixels, resampleX, resampleY) { + let resampledPixels = []; + // computing the limit outside the for (where it would be repeated at each iteration) + // for performance reasons + let limit = pixels.length / (resampleX * resampleY) / 4; + for (let i = 0; i < limit; i++) { + let pixel = i * resampleX * resampleY; + + resampledPixels.push(pixels[pixel * 4]); + resampledPixels.push(pixels[pixel * 4 + 1]); + resampledPixels.push(pixels[pixel * 4 + 2]); + resampledPixels.push(pixels[pixel * 4 + 3]); + } + + return resampledPixels; + } +}; diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js new file mode 100644 index 00000000..071dfd60 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js @@ -0,0 +1,1207 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Clutter = imports.gi.Clutter; +const GdkPixbuf = imports.gi.GdkPixbuf +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Gtk = imports.gi.Gtk; +const Signals = imports.signals; +const Meta = imports.gi.Meta; +const Shell = imports.gi.Shell; +const St = imports.gi.St; +const Mainloop = imports.mainloop; + +// Use __ () and N__() for the extension gettext domain, and reuse +// the shell domain with the default _() and N_() +const Gettext = imports.gettext.domain('dashtodock'); +const __ = Gettext.gettext; +const N__ = function(e) { return e }; + +const AppDisplay = imports.ui.appDisplay; +const AppFavorites = imports.ui.appFavorites; +const Dash = imports.ui.dash; +const DND = imports.ui.dnd; +const IconGrid = imports.ui.iconGrid; +const Main = imports.ui.main; +const PopupMenu = imports.ui.popupMenu; +const Util = imports.misc.util; +const Workspace = imports.ui.workspace; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; +const Utils = Me.imports.utils; +const WindowPreview = Me.imports.windowPreview; +const AppIconIndicators = Me.imports.appIconIndicators; + +let tracker = Shell.WindowTracker.get_default(); + +const clickAction = { + SKIP: 0, + MINIMIZE: 1, + LAUNCH: 2, + CYCLE_WINDOWS: 3, + MINIMIZE_OR_OVERVIEW: 4, + PREVIEWS: 5, + MINIMIZE_OR_PREVIEWS: 6, + FOCUS_OR_PREVIEWS: 7, + QUIT: 8, +}; + +const scrollAction = { + DO_NOTHING: 0, + CYCLE_WINDOWS: 1, + SWITCH_WORKSPACE: 2 +}; + +let recentlyClickedAppLoopId = 0; +let recentlyClickedApp = null; +let recentlyClickedAppWindows = null; +let recentlyClickedAppIndex = 0; +let recentlyClickedAppMonitor = -1; + +/** + * Extend AppIcon + * + * - Apply a css class based on the number of windows of each application (#N); + * - Customized indicators for running applications in place of the default "dot" style which is hidden (#N); + * a class of the form "running#N" is applied to the AppWellIcon actor. + * like the original .running one. + * - Add a .focused style to the focused app + * - Customize click actions. + * - Update minimization animation target + * - Update menu if open on windows change + */ +var MyAppIcon = class DashToDock_AppIcon extends AppDisplay.AppIcon { + + // settings are required inside. + constructor(remoteModel, app, monitorIndex, iconParams) { + super(app, iconParams); + + // a prefix is required to avoid conflicting with the parent class variable + this.monitorIndex = monitorIndex; + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this.remoteModel = remoteModel; + this._indicator = null; + + let appInfo = app.get_app_info(); + this._location = appInfo ? appInfo.get_string('XdtdUri') : null; + + this._updateIndicatorStyle(); + this._optionalScrollCycleWindows(); + + // Monitor windows-changes instead of app state. + // Keep using the same Id and function callback (that is extended) + if (this._stateChangedId > 0) { + this.app.disconnect(this._stateChangedId); + this._stateChangedId = 0; + } + + this._windowsChangedId = this.app.connect('windows-changed', + this.onWindowsChanged.bind(this)); + this._focusAppChangeId = tracker.connect('notify::focus-app', + this._onFocusAppChanged.bind(this)); + + // In Wayland sessions, this signal is needed to track the state of windows dragged + // from one monitor to another. As this is triggered quite often (whenever a new winow + // of any application opened or moved to a different desktop), + // we restrict this signal to the case when 'isolate-monitors' is true, + // and if there are at least 2 monitors. + if (Docking.DockManager.settings.get_boolean('isolate-monitors') && + Main.layoutManager.monitors.length > 1) { + this._signalsHandler.removeWithLabel('isolate-monitors'); + this._signalsHandler.addWithLabel('isolate-monitors', [ + global.display, + 'window-entered-monitor', + this._onWindowEntered.bind(this) + ]); + } + + this._progressOverlayArea = null; + this._progress = 0; + + let keys = ['apply-custom-theme', + 'running-indicator-style', + ]; + + keys.forEach(function(key) { + this._signalsHandler.add([ + Docking.DockManager.settings, + 'changed::' + key, + this._updateIndicatorStyle.bind(this) + ]); + }, this); + + if (this._location) { + this._signalsHandler.add([ + Docking.DockManager.getDefault().fm1Client, + 'windows-changed', + this.onWindowsChanged.bind(this) + ]); + } + + this._signalsHandler.add([ + Docking.DockManager.settings, + 'changed::scroll-action', + this._optionalScrollCycleWindows.bind(this) + ]); + + this._numberOverlay(); + + this._previewMenuManager = null; + this._previewMenu = null; + } + + _onDestroy() { + super._onDestroy(); + + // This is necessary due to an upstream bug + // https://bugzilla.gnome.org/show_bug.cgi?id=757556 + // It can be safely removed once it get solved upstrea. + if (this._menu) + this._menu.close(false); + + // Disconect global signals + + if (this._windowsChangedId > 0) + this.app.disconnect(this._windowsChangedId); + this._windowsChangedId = 0; + + if (this._focusAppChangeId > 0) { + tracker.disconnect(this._focusAppChangeId); + this._focusAppChangeId = 0; + } + + this._signalsHandler.destroy(); + + if (this._scrollEventHandler) + this.actor.disconnect(this._scrollEventHandler); + } + + // TOOD Rename this function + _updateIndicatorStyle() { + + if (this._indicator !== null) { + this._indicator.destroy(); + this._indicator = null; + } + this._indicator = new AppIconIndicators.AppIconIndicator(this); + this._indicator.update(); + } + + _onWindowEntered(metaScreen, monitorIndex, metaWin) { + let app = Shell.WindowTracker.get_default().get_window_app(metaWin); + if (app && app.get_id() == this.app.get_id()) + this.onWindowsChanged(); + } + + _optionalScrollCycleWindows() { + if (this._scrollEventHandler) { + this.actor.disconnect(this._scrollEventHandler); + this._scrollEventHandler = 0; + } + + let settings = Docking.DockManager.settings; + let isEnabled = settings.get_enum('scroll-action') === scrollAction.CYCLE_WINDOWS; + if (!isEnabled) return; + this._scrollEventHandler = this.actor.connect('scroll-event', + this.onScrollEvent.bind(this)); + } + + onScrollEvent(actor, event) { + + // We only activate windows of running applications, i.e. we never open new windows + // We check if the app is running, and that the # of windows is > 0 in + // case we use workspace isolation, + let appIsRunning = this.app.state == Shell.AppState.RUNNING + && this.getInterestingWindows().length > 0; + + if (!appIsRunning) + return false + + if (this._optionalScrollCycleWindowsDeadTimeId) + return false; + else + this._optionalScrollCycleWindowsDeadTimeId = Mainloop.timeout_add(250, () => { + this._optionalScrollCycleWindowsDeadTimeId = 0; + }); + + let direction = null; + + switch (event.get_scroll_direction()) { + case Clutter.ScrollDirection.UP: + direction = Meta.MotionDirection.UP; + break; + case Clutter.ScrollDirection.DOWN: + direction = Meta.MotionDirection.DOWN; + break; + case Clutter.ScrollDirection.SMOOTH: + let [dx, dy] = event.get_scroll_delta(); + if (dy < 0) + direction = Meta.MotionDirection.UP; + else if (dy > 0) + direction = Meta.MotionDirection.DOWN; + break; + } + + let focusedApp = tracker.focus_app; + if (!Main.overview._shown) { + let reversed = direction === Meta.MotionDirection.UP; + if (this.app == focusedApp) + this._cycleThroughWindows(reversed); + else { + // Activate the first window + let windows = this.getInterestingWindows(); + if (windows.length > 0) { + let w = windows[0]; + Main.activateWindow(w); + } + } + } + else + this.app.activate(); + return true; + } + + onWindowsChanged() { + + if (this._menu && this._menu.isOpen) + this._menu.update(); + + this._indicator.update(); + this.updateIconGeometry(); + } + + /** + * Update taraget for minimization animation + */ + updateIconGeometry() { + // If (for unknown reason) the actor is not on the stage the reported size + // and position are random values, which might exceeds the integer range + // resulting in an error when assigned to the a rect. This is a more like + // a workaround to prevent flooding the system with errors. + if (this.actor.get_stage() == null) + return; + + let rect = new Meta.Rectangle(); + + [rect.x, rect.y] = this.actor.get_transformed_position(); + [rect.width, rect.height] = this.actor.get_transformed_size(); + + let windows = this.getWindows(); + if (Docking.DockManager.settings.get_boolean('multi-monitor')) { + let monitorIndex = this.monitorIndex; + windows = windows.filter(function(w) { + return w.get_monitor() == monitorIndex; + }); + } + windows.forEach(function(w) { + w.set_icon_geometry(rect); + }); + } + + _updateRunningStyle() { + // The logic originally in this function has been moved to + // AppIconIndicatorBase._updateDefaultDot(). However it cannot be removed as + // it called by the parent constructor. + } + + popupMenu() { + this._removeMenuTimeout(); + this.actor.fake_release(); + this._draggable.fakeRelease(); + + if (!this._menu) { + this._menu = new MyAppIconMenu(this); + this._menu.connect('activate-window', (menu, window) => { + this.activateWindow(window); + }); + this._menu.connect('open-state-changed', (menu, isPoppedUp) => { + if (!isPoppedUp) + this._onMenuPoppedDown(); + else { + // Setting the max-height is s useful if part of the menu is + // scrollable so the minimum height is smaller than the natural height. + let monitor_index = Main.layoutManager.findIndexForActor(this.actor); + let workArea = Main.layoutManager.getWorkAreaForMonitor(monitor_index); + let position = Utils.getPosition(); + this._isHorizontal = ( position == St.Side.TOP || + position == St.Side.BOTTOM); + // If horizontal also remove the height of the dash + let fixedDock = Docking.DockManager.settings.get_boolean('dock-fixed'); + let additional_margin = this._isHorizontal && !fixedDock ? Main.overview._dash.actor.height : 0; + let verticalMargins = this._menu.actor.margin_top + this._menu.actor.margin_bottom; + // Also set a max width to the menu, so long labels (long windows title) get truncated + this._menu.actor.style = ('max-height: ' + Math.round(workArea.height - additional_margin - verticalMargins) + 'px;' + + 'max-width: 400px'); + } + }); + let id = Main.overview.connect('hiding', () => { + this._menu.close(); + }); + this._menu.actor.connect('destroy', function() { + Main.overview.disconnect(id); + }); + + this._menuManager.addMenu(this._menu); + } + + this.emit('menu-state-changed', true); + + this.actor.set_hover(true); + this._menu.popup(); + this._menuManager.ignoreRelease(); + this.emit('sync-tooltip'); + + return false; + } + + _onFocusAppChanged() { + this._indicator.update(); + } + + activate(button) { + let event = Clutter.get_current_event(); + let modifiers = event ? event.get_state() : 0; + let focusedApp = tracker.focus_app; + + // Only consider SHIFT and CONTROL as modifiers (exclude SUPER, CAPS-LOCK, etc.) + modifiers = modifiers & (Clutter.ModifierType.SHIFT_MASK | Clutter.ModifierType.CONTROL_MASK); + + // We don't change the CTRL-click behaviour: in such case we just chain + // up the parent method and return. + if (modifiers & Clutter.ModifierType.CONTROL_MASK) { + // Keep default behaviour: launch new window + // By calling the parent method I make it compatible + // with other extensions tweaking ctrl + click + super.activate(button); + return; + } + + // We check what type of click we have and if the modifier SHIFT is + // being used. We then define what buttonAction should be for this + // event. + let buttonAction = 0; + let settings = Docking.DockManager.settings; + if (button && button == 2 ) { + if (modifiers & Clutter.ModifierType.SHIFT_MASK) + buttonAction = settings.get_enum('shift-middle-click-action'); + else + buttonAction = settings.get_enum('middle-click-action'); + } + else if (button && button == 1) { + if (modifiers & Clutter.ModifierType.SHIFT_MASK) + buttonAction = settings.get_enum('shift-click-action'); + else + buttonAction = settings.get_enum('click-action'); + } + + // We check if the app is running, and that the # of windows is > 0 in + // case we use workspace isolation. + let windows = this.getInterestingWindows(); + let appIsRunning = (this.app.state == Shell.AppState.RUNNING || this.isLocation()) + && windows.length > 0; + + // Some action modes (e.g. MINIMIZE_OR_OVERVIEW) require overview to remain open + // This variable keeps track of this + let shouldHideOverview = true; + + // We customize the action only when the application is already running + if (appIsRunning) { + switch (buttonAction) { + case clickAction.MINIMIZE: + // In overview just activate the app, unless the acion is explicitely + // requested with a keyboard modifier + if (!Main.overview._shown || modifiers){ + // If we have button=2 or a modifier, allow minimization even if + // the app is not focused + if (this.app == focusedApp || button == 2 || modifiers & Clutter.ModifierType.SHIFT_MASK) { + // minimize all windows on double click and always in the case of primary click without + // additional modifiers + let click_count = 0; + if (Clutter.EventType.CLUTTER_BUTTON_PRESS) + click_count = event.get_click_count(); + let all_windows = (button == 1 && ! modifiers) || click_count > 1; + this._minimizeWindow(all_windows); + } + else + this._activateAllWindows(); + } + else { + let w = windows[0]; + Main.activateWindow(w); + } + break; + + case clickAction.MINIMIZE_OR_OVERVIEW: + // When a single window is present, toggle minimization + // If only one windows is present toggle minimization, but only when trigggered with the + // simple click action (no modifiers, no middle click). + if (windows.length == 1 && !modifiers && button == 1) { + let w = windows[0]; + if (this.app == focusedApp) { + // Window is raised, minimize it + this._minimizeWindow(w); + } else { + // Window is minimized, raise it + Main.activateWindow(w); + } + // Launch overview when multiple windows are present + // TODO: only show current app windows when gnome shell API will allow it + } else { + shouldHideOverview = false; + Main.overview.toggle(); + } + break; + + case clickAction.CYCLE_WINDOWS: + if (!Main.overview._shown){ + if (this.app == focusedApp) + this._cycleThroughWindows(); + else { + // Activate the first window + let w = windows[0]; + Main.activateWindow(w); + } + } + else + this.app.activate(); + break; + + case clickAction.FOCUS_OR_PREVIEWS: + if (this.app == focusedApp && + (windows.length > 1 || modifiers || button != 1)) { + this._windowPreviews(); + } else { + // Activate the first window + let w = windows[0]; + Main.activateWindow(w); + } + break; + + case clickAction.LAUNCH: + this.launchNewWindow(); + break; + + case clickAction.PREVIEWS: + if (!Main.overview._shown) { + // If only one windows is present just switch to it, but only when trigggered with the + // simple click action (no modifiers, no middle click). + if (windows.length == 1 && !modifiers && button == 1) { + let w = windows[0]; + Main.activateWindow(w); + } else + this._windowPreviews(); + } + else { + this.app.activate(); + } + break; + + case clickAction.MINIMIZE_OR_PREVIEWS: + // When a single window is present, toggle minimization + // If only one windows is present toggle minimization, but only when trigggered with the + // simple click action (no modifiers, no middle click). + if (!Main.overview._shown){ + if (windows.length == 1 && !modifiers && button == 1) { + let w = windows[0]; + if (this.app == focusedApp) { + // Window is raised, minimize it + this._minimizeWindow(w); + } else { + // Window is minimized, raise it + Main.activateWindow(w); + } + } else { + // Launch previews when multiple windows are present + this._windowPreviews(); + } + } else { + this.app.activate(); + } + break; + + case clickAction.QUIT: + this.closeAllWindows(); + break; + + case clickAction.SKIP: + let w = windows[0]; + Main.activateWindow(w); + break; + } + } + else { + this.launchNewWindow(); + } + + // Hide overview except when action mode requires it + if(shouldHideOverview) { + Main.overview.hide(); + } + } + + shouldShowTooltip() { + return this.actor.hover && (!this._menu || !this._menu.isOpen) && + (!this._previewMenu || !this._previewMenu.isOpen); + } + + _windowPreviews() { + if (!this._previewMenu) { + this._previewMenuManager = new PopupMenu.PopupMenuManager(this.actor); + + this._previewMenu = new WindowPreview.WindowPreviewMenu(this); + + this._previewMenuManager.addMenu(this._previewMenu); + + this._previewMenu.connect('open-state-changed', (menu, isPoppedUp) => { + if (!isPoppedUp) + this._onMenuPoppedDown(); + }); + let id = Main.overview.connect('hiding', () => { + this._previewMenu.close(); + }); + this._previewMenu.actor.connect('destroy', function() { + Main.overview.disconnect(id); + }); + + } + + if (this._previewMenu.isOpen) + this._previewMenu.close(); + else + this._previewMenu.popup(); + + return false; + } + + // Try to do the right thing when attempting to launch a new window of an app. In + // particular, if the application doens't allow to launch a new window, activate + // the existing window instead. + launchNewWindow(p) { + let appInfo = this.app.get_app_info(); + let actions = appInfo.list_actions(); + if (this.app.can_open_new_window()) { + this.animateLaunch(); + // This is used as a workaround for a bug resulting in no new windows being opened + // for certain running applications when calling open_new_window(). + // + // https://bugzilla.gnome.org/show_bug.cgi?id=756844 + // + // Similar to what done when generating the popupMenu entries, if the application provides + // a "New Window" action, use it instead of directly requesting a new window with + // open_new_window(), which fails for certain application, notably Nautilus. + if (actions.indexOf('new-window') == -1) { + this.app.open_new_window(-1); + } + else { + let i = actions.indexOf('new-window'); + if (i !== -1) + this.app.launch_action(actions[i], global.get_current_time(), -1); + } + } + else { + // Try to manually activate the first window. Otherwise, when the app is activated by + // switching to a different workspace, a launch spinning icon is shown and disappers only + // after a timeout. + let windows = this.getWindows(); + if (windows.length > 0) + Main.activateWindow(windows[0]) + else + this.app.activate(); + } + } + + _numberOverlay() { + // Add label for a Hot-Key visual aid + this._numberOverlayLabel = new St.Label(); + this._numberOverlayBin = new St.Bin({ + child: this._numberOverlayLabel, + x_align: St.Align.START, y_align: St.Align.START, + x_expand: true, y_expand: true + }); + this._numberOverlayLabel.add_style_class_name('number-overlay'); + this._numberOverlayOrder = -1; + this._numberOverlayBin.hide(); + + this._iconContainer.add_child(this._numberOverlayBin); + + } + + updateNumberOverlay() { + // We apply an overall scale factor that might come from a HiDPI monitor. + // Clutter dimensions are in physical pixels, but CSS measures are in logical + // pixels, so make sure to consider the scale. + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + // Set the font size to something smaller than the whole icon so it is + // still visible. The border radius is large to make the shape circular + let [minWidth, natWidth] = this._iconContainer.get_preferred_width(-1); + let font_size = Math.round(Math.max(12, 0.3*natWidth) / scaleFactor); + let size = Math.round(font_size*1.2); + this._numberOverlayLabel.set_style( + 'font-size: ' + font_size + 'px;' + + 'border-radius: ' + this.icon.iconSize + 'px;' + + 'width: ' + size + 'px; height: ' + size +'px;' + ); + } + + setNumberOverlay(number) { + this._numberOverlayOrder = number; + this._numberOverlayLabel.set_text(number.toString()); + } + + toggleNumberOverlay(activate) { + if (activate && this._numberOverlayOrder > -1) { + this.updateNumberOverlay(); + this._numberOverlayBin.show(); + } + else + this._numberOverlayBin.hide(); + } + + _minimizeWindow(param) { + // Param true make all app windows minimize + let windows = this.getInterestingWindows(); + let current_workspace = global.workspace_manager.get_active_workspace(); + for (let i = 0; i < windows.length; i++) { + let w = windows[i]; + if (w.get_workspace() == current_workspace && w.showing_on_its_workspace()) { + w.minimize(); + // Just minimize one window. By specification it should be the + // focused window on the current workspace. + if(!param) + break; + } + } + } + + // By default only non minimized windows are activated. + // This activates all windows in the current workspace. + _activateAllWindows() { + // First activate first window so workspace is switched if needed. + // We don't do this if isolation is on! + if (!Docking.DockManager.settings.get_boolean('isolate-workspaces') && + !Docking.DockManager.settings.get_boolean('isolate-monitors')) + this.app.activate(); + + // then activate all other app windows in the current workspace + let windows = this.getInterestingWindows(); + let activeWorkspace = global.workspace_manager.get_active_workspace_index(); + + if (windows.length <= 0) + return; + + let activatedWindows = 0; + + for (let i = windows.length - 1; i >= 0; i--) { + if (windows[i].get_workspace().index() == activeWorkspace) { + Main.activateWindow(windows[i]); + activatedWindows++; + } + } + } + + //This closes all windows of the app. + closeAllWindows() { + let windows = this.getInterestingWindows(); + for (let i = 0; i < windows.length; i++) + windows[i].delete(global.get_current_time()); + } + + _cycleThroughWindows(reversed) { + // Store for a little amount of time last clicked app and its windows + // since the order changes upon window interaction + let MEMORY_TIME=3000; + + let app_windows = this.getInterestingWindows(); + + if (app_windows.length <1) + return + + if (recentlyClickedAppLoopId > 0) + Mainloop.source_remove(recentlyClickedAppLoopId); + recentlyClickedAppLoopId = Mainloop.timeout_add(MEMORY_TIME, this._resetRecentlyClickedApp); + + // If there isn't already a list of windows for the current app, + // or the stored list is outdated, use the current windows list. + let monitorIsolation = Docking.DockManager.settings.get_boolean('isolate-monitors'); + if (!recentlyClickedApp || + recentlyClickedApp.get_id() != this.app.get_id() || + recentlyClickedAppWindows.length != app_windows.length || + (recentlyClickedAppMonitor != this.monitorIndex && monitorIsolation)) { + recentlyClickedApp = this.app; + recentlyClickedAppWindows = app_windows; + recentlyClickedAppMonitor = this.monitorIndex; + recentlyClickedAppIndex = 0; + } + + if (reversed) { + recentlyClickedAppIndex--; + if (recentlyClickedAppIndex < 0) recentlyClickedAppIndex = recentlyClickedAppWindows.length - 1; + } else { + recentlyClickedAppIndex++; + } + let index = recentlyClickedAppIndex % recentlyClickedAppWindows.length; + let window = recentlyClickedAppWindows[index]; + + Main.activateWindow(window); + } + + _resetRecentlyClickedApp() { + if (recentlyClickedAppLoopId > 0) + Mainloop.source_remove(recentlyClickedAppLoopId); + recentlyClickedAppLoopId=0; + recentlyClickedApp =null; + recentlyClickedAppWindows = null; + recentlyClickedAppIndex = 0; + recentlyClickedAppMonitor = -1; + + return false; + } + + getWindows() { + return getWindows(this.app, this._location); + } + + // Filter out unnecessary windows, for instance + // nautilus desktop window. + getInterestingWindows() { + return getInterestingWindows(this.app, this.monitorIndex, this._location); + } + + // Does the Icon represent a location rather than an App + isLocation() { + return this._location != null; + } +}; +/** + * Extend AppIconMenu + * + * - set popup arrow side based on dash orientation + * - Add close windows option based on quitfromdash extension + * (https://github.com/deuill/shell-extension-quitfromdash) + * - Add open windows thumbnails instead of list + * - update menu when application windows change + */ +const MyAppIconMenu = class DashToDock_MyAppIconMenu extends AppDisplay.AppIconMenu { + + constructor(source) { + let side = Utils.getPosition(); + + // Damm it, there has to be a proper way of doing this... + // As I can't call the parent parent constructor (?) passing the side + // parameter, I overwite what I need later + super(source); + + // Change the initialized side where required. + this._arrowSide = side; + this._boxPointer._arrowSide = side; + this._boxPointer._userArrowSide = side; + } + + _redisplay() { + this.removeAll(); + + if (Docking.DockManager.settings.get_boolean('show-windows-preview')) { + // Display the app windows menu items and the separator between windows + // of the current desktop and other windows. + + this._allWindowsMenuItem = new PopupMenu.PopupSubMenuMenuItem(__('All Windows'), false); + this._allWindowsMenuItem.actor.hide(); + this.addMenuItem(this._allWindowsMenuItem); + + if (!this._source.app.is_window_backed()) { + this._appendSeparator(); + + let appInfo = this._source.app.get_app_info(); + let actions = appInfo.list_actions(); + if (this._source.app.can_open_new_window() && + actions.indexOf('new-window') == -1) { + this._newWindowMenuItem = this._appendMenuItem(_("New Window")); + this._newWindowMenuItem.connect('activate', () => { + if (this._source.app.state == Shell.AppState.STOPPED) + this._source.animateLaunch(); + + this._source.app.open_new_window(-1); + this.emit('activate-window', null); + }); + this._appendSeparator(); + } + + + if (AppDisplay.discreteGpuAvailable && + this._source.app.state == Shell.AppState.STOPPED && + actions.indexOf('activate-discrete-gpu') == -1) { + this._onDiscreteGpuMenuItem = this._appendMenuItem(_("Launch using Dedicated Graphics Card")); + this._onDiscreteGpuMenuItem.connect('activate', () => { + if (this._source.app.state == Shell.AppState.STOPPED) + this._source.animateLaunch(); + + this._source.app.launch(0, -1, true); + this.emit('activate-window', null); + }); + } + + for (let i = 0; i < actions.length; i++) { + let action = actions[i]; + let item = this._appendMenuItem(appInfo.get_action_name(action)); + item.connect('activate', (emitter, event) => { + this._source.app.launch_action(action, event.get_time(), -1); + this.emit('activate-window', null); + }); + } + + let canFavorite = global.settings.is_writable('favorite-apps') && + !this._source.isLocation(); + + if (canFavorite) { + this._appendSeparator(); + + let isFavorite = AppFavorites.getAppFavorites().isFavorite(this._source.app.get_id()); + + if (isFavorite) { + let item = this._appendMenuItem(_("Remove from Favorites")); + item.connect('activate', () => { + let favs = AppFavorites.getAppFavorites(); + favs.removeFavorite(this._source.app.get_id()); + }); + } else { + let item = this._appendMenuItem(_("Add to Favorites")); + item.connect('activate', () => { + let favs = AppFavorites.getAppFavorites(); + favs.addFavorite(this._source.app.get_id()); + }); + } + } + + if (Shell.AppSystem.get_default().lookup_app('org.gnome.Software.desktop') && + !this._source.isLocation()) { + this._appendSeparator(); + let item = this._appendMenuItem(_("Show Details")); + item.connect('activate', () => { + let id = this._source.app.get_id(); + let args = GLib.Variant.new('(ss)', [id, '']); + Gio.DBus.get(Gio.BusType.SESSION, null, + function(o, res) { + let bus = Gio.DBus.get_finish(res); + bus.call('org.gnome.Software', + '/org/gnome/Software', + 'org.gtk.Actions', 'Activate', + GLib.Variant.new('(sava{sv})', + ['details', [args], null]), + null, 0, -1, null, null); + Main.overview.hide(); + }); + }); + } + } + + } else { + super._redisplay(); + } + + // quit menu + this._appendSeparator(); + this._quitfromDashMenuItem = this._appendMenuItem(_("Quit")); + this._quitfromDashMenuItem.connect('activate', () => { + this._source.closeAllWindows(); + }); + + this.update(); + } + + // update menu content when application windows change. This is desirable as actions + // acting on windows (closing) are performed while the menu is shown. + update() { + + if(Docking.DockManager.settings.get_boolean('show-windows-preview')){ + + let windows = this._source.getInterestingWindows(); + + // update, show or hide the quit menu + if ( windows.length > 0) { + let quitFromDashMenuText = ""; + if (windows.length == 1) + this._quitfromDashMenuItem.label.set_text(_("Quit")); + else + this._quitfromDashMenuItem.label.set_text(_("Quit %d Windows").format(windows.length)); + + this._quitfromDashMenuItem.actor.show(); + + } else { + this._quitfromDashMenuItem.actor.hide(); + } + + // update, show, or hide the allWindows menu + // Check if there are new windows not already displayed. In such case, repopulate the allWindows + // menu. Windows removal is already handled by each preview being connected to the destroy signal + let old_windows = this._allWindowsMenuItem.menu._getMenuItems().map(function(item){ + return item._window; + }); + + let new_windows = windows.filter(function(w) {return old_windows.indexOf(w) < 0;}); + if (new_windows.length > 0) { + this._populateAllWindowMenu(windows); + + // Try to set the width to that of the submenu. + // TODO: can't get the actual size, getting a bit less. + // Temporary workaround: add 15px to compensate + this._allWindowsMenuItem.actor.width = this._allWindowsMenuItem.menu.actor.width + 15; + + } + + // The menu is created hidden and never hidded after being shown. Instead, a singlal + // connected to its items destroy will set is insensitive if no more windows preview are shown. + if (windows.length > 0){ + this._allWindowsMenuItem.actor.show(); + this._allWindowsMenuItem.setSensitive(true); + } + + // Update separators + this._getMenuItems().forEach(this._updateSeparatorVisibility.bind(this)); + } + + + } + + _populateAllWindowMenu(windows) { + + this._allWindowsMenuItem.menu.removeAll(); + + if (windows.length > 0) { + + let activeWorkspace = global.workspace_manager.get_active_workspace(); + let separatorShown = windows[0].get_workspace() != activeWorkspace; + + for (let i = 0; i < windows.length; i++) { + let window = windows[i]; + if (!separatorShown && window.get_workspace() != activeWorkspace) { + this._allWindowsMenuItem.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); + separatorShown = true; + } + + let item = new WindowPreview.WindowPreviewMenuItem(window); + this._allWindowsMenuItem.menu.addMenuItem(item); + item.connect('activate', () => { + this.emit('activate-window', window); + }); + + // This is to achieve a more gracefull transition when the last windows is closed. + item.connect('destroy', () => { + if(this._allWindowsMenuItem.menu._getMenuItems().length == 1) // It's still counting the item just going to be destroyed + this._allWindowsMenuItem.setSensitive(false); + }); + } + } + } +}; +Signals.addSignalMethods(MyAppIconMenu.prototype); + +function getWindows(app, location) { + if (location != null && Docking.DockManager.getDefault().fm1Client) { + return Docking.DockManager.getDefault().fm1Client.getWindows(location); + } else { + return app.get_windows(); + } +} + +// Filter out unnecessary windows, for instance +// nautilus desktop window. +function getInterestingWindows(app, monitorIndex, location) { + let windows = getWindows(app, location).filter(function(w) { + return !w.skip_taskbar; + }); + + let settings = Docking.DockManager.settings; + + // When using workspace isolation, we filter out windows + // that are not in the current workspace + if (settings.get_boolean('isolate-workspaces')) + windows = windows.filter(function(w) { + return w.get_workspace().index() == global.workspace_manager.get_active_workspace_index(); + }); + + if (settings.get_boolean('isolate-monitors')) + windows = windows.filter(function(w) { + return w.get_monitor() == monitorIndex; + }); + + return windows; +} + +/** + * A ShowAppsIcon improved class. + * + * - set label position based on dash orientation (Note, I am reusing most machinery of the appIcon class) + * - implement a popupMenu based on the AppIcon code (Note, I am reusing most machinery of the appIcon class) + * + */ + +var MyShowAppsIcon = GObject.registerClass({ + Signals: { + 'menu-state-changed': { param_types: [GObject.TYPE_BOOLEAN] }, + 'sync-tooltip': {} + } +} +, class DashToDock_MyShowAppsIcon extends Dash.ShowAppsIcon { + _init() { + super._init(); + + // Re-use appIcon methods + let appIconPrototype = AppDisplay.AppIcon.prototype; + this.actor.connect('leave-event', appIconPrototype._onLeaveEvent.bind(this)); + this.actor.connect('button-press-event', appIconPrototype._onButtonPress.bind(this)); + this.actor.connect('touch-event', appIconPrototype._onTouchEvent.bind(this)); + this.actor.connect('popup-menu', appIconPrototype._onKeyboardPopupMenu.bind(this)); + this.actor.connect('clicked', this._removeMenuTimeout.bind(this)); + + this._menu = null; + this._menuManager = new PopupMenu.PopupMenuManager(this.actor); + this._menuTimeoutId = 0; + } + + get actor() { + /* Until GNOME Shell AppIcon is an actor we need to provide this + * compatibility layer or the shell won't be able to access to the + * actual actor */ + return this.toggleButton; + } + + showLabel() { + itemShowLabel.call(this); + } + + _onMenuPoppedDown() { + AppDisplay.AppIcon.prototype._onMenuPoppedDown.apply(this, arguments); + } + + _setPopupTimeout() { + AppDisplay.AppIcon.prototype._onMenuPoppedDown.apply(this, arguments); + } + + _removeMenuTimeout() { + AppDisplay.AppIcon.prototype._removeMenuTimeout.apply(this, arguments); + } + + popupMenu() { + this._removeMenuTimeout(); + this.actor.fake_release(); + + if (!this._menu) { + this._menu = new MyShowAppsIconMenu(this); + this._menu.connect('open-state-changed', (menu, isPoppedUp) => { + if (!isPoppedUp) + this._onMenuPoppedDown(); + }); + let id = Main.overview.connect('hiding', () => { + this._menu.close(); + }); + this._menu.actor.connect('destroy', function() { + Main.overview.disconnect(id); + }); + this._menuManager.addMenu(this._menu); + } + + this.emit('menu-state-changed', true); + + this.actor.set_hover(true); + this._menu.popup(); + this._menuManager.ignoreRelease(); + this.emit('sync-tooltip'); + + return false; + } +}); + + +/** + * A menu for the showAppsIcon + */ +var MyShowAppsIconMenu = class DashToDock_MyShowAppsIconMenu extends MyAppIconMenu { + _redisplay() { + this.removeAll(); + + /* Translators: %s is "Settings", which is automatically translated. You + can also translate the full message if this fits better your language. */ + let name = __('Dash to Dock %s').format(_('Settings')) + let item = this._appendMenuItem(name); + + item.connect('activate', function () { + Util.spawn(["gnome-shell-extension-prefs", Me.metadata.uuid]); + }); + } +}; + +/** + * This function is used for both extendShowAppsIcon and extendDashItemContainer + */ +function itemShowLabel() { + // Check if the label is still present at all. When switching workpaces, the + // item might have been destroyed in between. + if (!this._labelText || this.label.get_stage() == null) + return; + + this.label.set_text(this._labelText); + this.label.opacity = 0; + this.label.show(); + + let [stageX, stageY] = this.get_transformed_position(); + let node = this.label.get_theme_node(); + + let itemWidth = this.allocation.x2 - this.allocation.x1; + let itemHeight = this.allocation.y2 - this.allocation.y1; + + let labelWidth = this.label.get_width(); + let labelHeight = this.label.get_height(); + + let x, y, xOffset, yOffset; + + let position = Utils.getPosition(); + this._isHorizontal = ((position == St.Side.TOP) || (position == St.Side.BOTTOM)); + let labelOffset = node.get_length('-x-offset'); + + switch (position) { + case St.Side.LEFT: + yOffset = Math.floor((itemHeight - labelHeight) / 2); + y = stageY + yOffset; + xOffset = labelOffset; + x = stageX + this.get_width() + xOffset; + break; + case St.Side.RIGHT: + yOffset = Math.floor((itemHeight - labelHeight) / 2); + y = stageY + yOffset; + xOffset = labelOffset; + x = Math.round(stageX) - labelWidth - xOffset; + break; + case St.Side.TOP: + y = stageY + labelOffset + itemHeight; + xOffset = Math.floor((itemWidth - labelWidth) / 2); + x = stageX + xOffset; + break; + case St.Side.BOTTOM: + yOffset = labelOffset; + y = stageY - labelHeight - yOffset; + xOffset = Math.floor((itemWidth - labelWidth) / 2); + x = stageX + xOffset; + break; + } + + // keep the label inside the screen border + // Only needed fot the x coordinate. + + // Leave a few pixel gap + let gap = 5; + let monitor = Main.layoutManager.findMonitorForActor(this); + if (x - monitor.x < gap) + x += monitor.x - x + labelOffset; + else if (x + labelWidth > monitor.x + monitor.width - gap) + x -= x + labelWidth - (monitor.x + monitor.width) + gap; + + this.label.remove_all_transitions(); + this.label.set_position(x, y); + this.label.ease({ + opacity: 255, + duration: Dash.DASH_ITEM_LABEL_SHOW_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD + }); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/dash.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/dash.js new file mode 100644 index 00000000..cb245f8c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/dash.js @@ -0,0 +1,1202 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Clutter = imports.gi.Clutter; +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Gtk = imports.gi.Gtk; +const Signals = imports.signals; +const Meta = imports.gi.Meta; +const Shell = imports.gi.Shell; +const St = imports.gi.St; +const Mainloop = imports.mainloop; + +const AppDisplay = imports.ui.appDisplay; +const AppFavorites = imports.ui.appFavorites; +const Dash = imports.ui.dash; +const DND = imports.ui.dnd; +const IconGrid = imports.ui.iconGrid; +const Main = imports.ui.main; +const PopupMenu = imports.ui.popupMenu; +const Util = imports.misc.util; +const Workspace = imports.ui.workspace; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; +const Utils = Me.imports.utils; +const AppIcons = Me.imports.appIcons; +const Locations = Me.imports.locations; + +const DASH_ANIMATION_TIME = Dash.DASH_ANIMATION_TIME; +const DASH_ITEM_LABEL_HIDE_TIME = Dash.DASH_ITEM_LABEL_HIDE_TIME; +const DASH_ITEM_HOVER_TIMEOUT = Dash.DASH_ITEM_HOVER_TIMEOUT; + +/** + * Extend DashItemContainer + * + * - set label position based on dash orientation + * + */ +let MyDashItemContainer = GObject.registerClass( +class DashToDock_MyDashItemContainer extends Dash.DashItemContainer { + + showLabel() { + return AppIcons.itemShowLabel.call(this); + } +}); + +/** + * This class is a fork of the upstream DashActor class (ui.dash.js) + * + * Summary of changes: + * - modified chldBox calculations for when 'show-apps-at-top' option is checked + * - handle horizontal dash + */ +var MyDashActor = GObject.registerClass( +class DashToDock_MyDashActor extends St.Widget { + + _init() { + // a prefix is required to avoid conflicting with the parent class variable + this._rtl = (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL); + + this._position = Utils.getPosition(); + this._isHorizontal = ((this._position == St.Side.TOP) || + (this._position == St.Side.BOTTOM)); + + let layout = new Clutter.BoxLayout({ + orientation: this._isHorizontal ? Clutter.Orientation.HORIZONTAL : Clutter.Orientation.VERTICAL + }); + + super._init({ + name: 'dash', + layout_manager: layout, + clip_to_allocation: true + }); + + // Since we are usually visible but not usually changing, make sure + // most repaint requests don't actually require us to repaint anything. + // This saves significant CPU when repainting the screen. + this.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS); + } + + vfunc_allocate(box, flags) { + this.set_allocation(box, flags); + let contentBox = box; + let availWidth = contentBox.x2 - contentBox.x1; + let availHeight = contentBox.y2 - contentBox.y1; + + let [appIcons, showAppsButton] = this.get_children(); + let [showAppsMinHeight, showAppsNatHeight] = showAppsButton.get_preferred_height(availWidth); + let [showAppsMinWidth, showAppsNatWidth] = showAppsButton.get_preferred_width(availHeight); + + let offset_x = this._isHorizontal?showAppsNatWidth:0; + let offset_y = this._isHorizontal?0:showAppsNatHeight; + + let childBox = new Clutter.ActorBox(); + let settings = Docking.DockManager.settings; + if ((settings.get_boolean('show-apps-at-top') && !this._isHorizontal) + || (settings.get_boolean('show-apps-at-top') && !this._rtl) + || (!settings.get_boolean('show-apps-at-top') && this._isHorizontal && this._rtl)) { + childBox.x1 = contentBox.x1 + offset_x; + childBox.y1 = contentBox.y1 + offset_y; + childBox.x2 = contentBox.x2; + childBox.y2 = contentBox.y2; + appIcons.allocate(childBox, flags); + + childBox.y1 = contentBox.y1; + childBox.x1 = contentBox.x1; + childBox.x2 = contentBox.x1 + showAppsNatWidth; + childBox.y2 = contentBox.y1 + showAppsNatHeight; + showAppsButton.allocate(childBox, flags); + } + else { + childBox.x1 = contentBox.x1; + childBox.y1 = contentBox.y1; + childBox.x2 = contentBox.x2 - offset_x; + childBox.y2 = contentBox.y2 - offset_y; + appIcons.allocate(childBox, flags); + + childBox.x2 = contentBox.x2; + childBox.y2 = contentBox.y2; + childBox.x1 = contentBox.x2 - showAppsNatWidth; + childBox.y1 = contentBox.y2 - showAppsNatHeight; + showAppsButton.allocate(childBox, flags); + } + } + + vfunc_get_preferred_width(forHeight) { + // We want to request the natural height of all our children + // as our natural height, so we chain up to StWidget (which + // then calls BoxLayout), but we only request the showApps + // button as the minimum size + + let [, natWidth] = this.layout_manager.get_preferred_width(this, forHeight); + + let themeNode = this.get_theme_node(); + let [, showAppsButton] = this.get_children(); + let [minWidth, ] = showAppsButton.get_preferred_height(forHeight); + + return [minWidth, natWidth]; + } + + vfunc_get_preferred_height(forWidth) { + // We want to request the natural height of all our children + // as our natural height, so we chain up to StWidget (which + // then calls BoxLayout), but we only request the showApps + // button as the minimum size + + let [, natHeight] = this.layout_manager.get_preferred_height(this, forWidth); + + let themeNode = this.get_theme_node(); + let [, showAppsButton] = this.get_children(); + let [minHeight, ] = showAppsButton.get_preferred_height(forWidth); + + return [minHeight, natHeight]; + } +}); + +const baseIconSizes = [16, 22, 24, 32, 48, 64, 96, 128]; + +/** + * This class is a fork of the upstream dash class (ui.dash.js) + * + * Summary of changes: + * - disconnect global signals adding a destroy method; + * - play animations even when not in overview mode + * - set a maximum icon size + * - show running and/or favorite applications + * - hide showApps label when the custom menu is shown. + * - add scrollview + * ensure actor is visible on keyfocus inseid the scrollview + * - add 128px icon size, might be usefull for hidpi display + * - sync minimization application target position. + * - keep running apps ordered. + */ +var MyDash = GObject.registerClass({ + Signals: { + 'menu-closed': {}, + 'icon-size-changed': {}, + } +}, class DashToDock_MyDash extends St.Bin { + + _init(remoteModel, monitorIndex) { + // Initialize icon variables and size + this._maxHeight = -1; + this.iconSize = Docking.DockManager.settings.get_int('dash-max-icon-size'); + this._availableIconSizes = baseIconSizes; + this._shownInitially = false; + this._initializeIconSize(this.iconSize); + + this._remoteModel = remoteModel; + this._monitorIndex = monitorIndex; + this._position = Utils.getPosition(); + this._isHorizontal = ((this._position == St.Side.TOP) || + (this._position == St.Side.BOTTOM)); + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._dragPlaceholder = null; + this._dragPlaceholderPos = -1; + this._animatingPlaceholdersCount = 0; + this._showLabelTimeoutId = 0; + this._resetHoverTimeoutId = 0; + this._ensureAppIconVisibilityTimeoutId = 0; + this._labelShowing = false; + + this._container = new MyDashActor(); + this._scrollView = new St.ScrollView({ + name: 'dashtodockDashScrollview', + hscrollbar_policy: Gtk.PolicyType.NEVER, + vscrollbar_policy: Gtk.PolicyType.NEVER, + enable_mouse_scrolling: false + }); + + this._scrollView.connect('scroll-event', this._onScrollEvent.bind(this)); + + this._box = new St.BoxLayout({ + vertical: !this._isHorizontal, + clip_to_allocation: false, + x_align: Clutter.ActorAlign.START, + y_align: Clutter.ActorAlign.START + }); + this._box._delegate = this; + this._container.add_actor(this._scrollView); + this._scrollView.add_actor(this._box); + + // Create a wrapper around the real showAppsIcon in order to add a popupMenu. + this._showAppsIcon = new AppIcons.MyShowAppsIcon(); + this._showAppsIcon.show(); + this._showAppsIcon.icon.setIconSize(this.iconSize); + this._hookUpLabel(this._showAppsIcon); + this._showAppsIcon.connect('menu-state-changed', (_icon, opened) => { + this._itemMenuStateChanged(this._showAppsIcon, opened); + }); + + this._container.add_actor(this._showAppsIcon); + + let rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL; + super._init({ + child: this._container, + y_align: St.Align.START, + x_align: rtl ? St.Align.END : St.Align.START + }); + + if (this._isHorizontal) { + this.connect('notify::width', () => { + if (this._maxHeight != this.width) + this._queueRedisplay(); + this._maxHeight = this.width; + }); + } + else { + this.connect('notify::height', () => { + if (this._maxHeight != this.height) + this._queueRedisplay(); + this._maxHeight = this.height; + }); + } + + // Update minimization animation target position on allocation of the + // container and on scrollview change. + this._box.connect('notify::allocation', this._updateAppsIconGeometry.bind(this)); + let scrollViewAdjustment = this._isHorizontal ? this._scrollView.hscroll.adjustment : this._scrollView.vscroll.adjustment; + scrollViewAdjustment.connect('notify::value', this._updateAppsIconGeometry.bind(this)); + + this._workId = Main.initializeDeferredWork(this._box, this._redisplay.bind(this)); + + this._shellSettings = new Gio.Settings({ + schema_id: 'org.gnome.shell' + }); + + this._appSystem = Shell.AppSystem.get_default(); + + this._signalsHandler.add([ + this._appSystem, + 'installed-changed', + () => { + AppFavorites.getAppFavorites().reload(); + this._queueRedisplay(); + } + ], [ + AppFavorites.getAppFavorites(), + 'changed', + this._queueRedisplay.bind(this) + ], [ + this._appSystem, + 'app-state-changed', + this._queueRedisplay.bind(this) + ], [ + Main.overview, + 'item-drag-begin', + this._onDragBegin.bind(this) + ], [ + Main.overview, + 'item-drag-end', + this._onDragEnd.bind(this) + ], [ + Main.overview, + 'item-drag-cancelled', + this._onDragCancelled.bind(this) + ]); + + this.connect('destroy', this._onDestroy.bind(this)); + } + + _onDestroy() { + this._signalsHandler.destroy(); + } + + _onScrollEvent(actor, event) { + // If scroll is not used because the icon is resized, let the scroll event propagate. + if (!Docking.DockManager.settings.get_boolean('icon-size-fixed')) + return Clutter.EVENT_PROPAGATE; + + // reset timeout to avid conflicts with the mousehover event + if (this._ensureAppIconVisibilityTimeoutId > 0) { + Mainloop.source_remove(this._ensureAppIconVisibilityTimeoutId); + this._ensureAppIconVisibilityTimeoutId = 0; + } + + // Skip to avoid double events mouse + if (event.is_pointer_emulated()) + return Clutter.EVENT_STOP; + + let adjustment, delta; + + if (this._isHorizontal) + adjustment = this._scrollView.get_hscroll_bar().get_adjustment(); + else + adjustment = this._scrollView.get_vscroll_bar().get_adjustment(); + + let increment = adjustment.step_increment; + + switch (event.get_scroll_direction()) { + case Clutter.ScrollDirection.UP: + delta = -increment; + break; + case Clutter.ScrollDirection.DOWN: + delta = +increment; + break; + case Clutter.ScrollDirection.SMOOTH: + let [dx, dy] = event.get_scroll_delta(); + delta = dy * increment; + // Also consider horizontal component, for instance touchpad + if (this._isHorizontal) + delta += dx * increment; + break; + } + + adjustment.set_value(adjustment.get_value() + delta); + + return Clutter.EVENT_STOP; + } + + _onDragBegin() { + this._dragCancelled = false; + this._dragMonitor = { + dragMotion: this._onDragMotion.bind(this) + }; + DND.addDragMonitor(this._dragMonitor); + + if (this._box.get_n_children() == 0) { + this._emptyDropTarget = new Dash.EmptyDropTargetItem(); + this._box.insert_child_at_index(this._emptyDropTarget, 0); + this._emptyDropTarget.show(true); + } + } + + _onDragCancelled() { + this._dragCancelled = true; + this._endDrag(); + } + + _onDragEnd() { + if (this._dragCancelled) + return; + + this._endDrag(); + } + + _endDrag() { + this._clearDragPlaceholder(); + this._clearEmptyDropTarget(); + this._showAppsIcon.setDragApp(null); + DND.removeDragMonitor(this._dragMonitor); + } + + _onDragMotion(dragEvent) { + let app = Dash.getAppFromSource(dragEvent.source); + if (app == null) + return DND.DragMotionResult.CONTINUE; + + let showAppsHovered = this._showAppsIcon.contains(dragEvent.targetActor); + + if (!this._box.contains(dragEvent.targetActor) || showAppsHovered) + this._clearDragPlaceholder(); + + if (showAppsHovered) + this._showAppsIcon.setDragApp(app); + else + this._showAppsIcon.setDragApp(null); + + return DND.DragMotionResult.CONTINUE; + } + + _appIdListToHash(apps) { + let ids = {}; + for (let i = 0; i < apps.length; i++) + ids[apps[i].get_id()] = apps[i]; + return ids; + } + + _queueRedisplay() { + Main.queueDeferredWork(this._workId); + } + + _hookUpLabel(item, appIcon) { + item.child.connect('notify::hover', () => { + this._syncLabel(item, appIcon); + }); + + let id = Main.overview.connect('hiding', () => { + this._labelShowing = false; + item.hideLabel(); + }); + item.child.connect('destroy', function() { + Main.overview.disconnect(id); + }); + + if (appIcon) { + appIcon.connect('sync-tooltip', () => { + this._syncLabel(item, appIcon); + }); + } + } + + _createAppItem(app) { + let appIcon = new AppIcons.MyAppIcon(this._remoteModel, app, + this._monitorIndex, + { setSizeManually: true, + showLabel: false }); + + if (appIcon._draggable) { + appIcon._draggable.connect('drag-begin', () => { + appIcon.actor.opacity = 50; + }); + appIcon._draggable.connect('drag-end', () => { + appIcon.actor.opacity = 255; + }); + } + + appIcon.connect('menu-state-changed', (appIcon, opened) => { + this._itemMenuStateChanged(item, opened); + }); + + let item = new MyDashItemContainer(); + item.setChild(appIcon.actor); + + appIcon.actor.connect('notify::hover', () => { + if (appIcon.actor.hover) { + this._ensureAppIconVisibilityTimeoutId = Mainloop.timeout_add(100, () => { + ensureActorVisibleInScrollView(this._scrollView, appIcon.actor); + this._ensureAppIconVisibilityTimeoutId = 0; + return GLib.SOURCE_REMOVE; + }); + } + else { + if (this._ensureAppIconVisibilityTimeoutId > 0) { + Mainloop.source_remove(this._ensureAppIconVisibilityTimeoutId); + this._ensureAppIconVisibilityTimeoutId = 0; + } + } + }); + + appIcon.actor.connect('clicked', (actor) => { + ensureActorVisibleInScrollView(this._scrollView, actor); + }); + + appIcon.actor.connect('key-focus-in', (actor) => { + let [x_shift, y_shift] = ensureActorVisibleInScrollView(this._scrollView, actor); + + // This signal is triggered also by mouse click. The popup menu is opened at the original + // coordinates. Thus correct for the shift which is going to be applied to the scrollview. + if (appIcon._menu) { + appIcon._menu._boxPointer.xOffset = -x_shift; + appIcon._menu._boxPointer.yOffset = -y_shift; + } + }); + + // Override default AppIcon label_actor, now the + // accessible_name is set at DashItemContainer.setLabelText + appIcon.actor.label_actor = null; + item.setLabelText(app.get_name()); + + appIcon.icon.setIconSize(this.iconSize); + this._hookUpLabel(item, appIcon); + + return item; + } + + /** + * Return an array with the "proper" appIcons currently in the dash + */ + getAppIcons() { + // Only consider children which are "proper" + // icons (i.e. ignoring drag placeholders) and which are not + // animating out (which means they will be destroyed at the end of + // the animation) + let iconChildren = this._box.get_children().filter(function(actor) { + return actor.child && + actor.child._delegate && + actor.child._delegate.icon && + !actor.animatingOut; + }); + + let appIcons = iconChildren.map(function(actor) { + return actor.child._delegate; + }); + + return appIcons; + } + + _updateAppsIconGeometry() { + let appIcons = this.getAppIcons(); + appIcons.forEach(function(icon) { + icon.updateIconGeometry(); + }); + } + + _itemMenuStateChanged(item, opened) { + // When the menu closes, it calls sync_hover, which means + // that the notify::hover handler does everything we need to. + if (opened) { + if (this._showLabelTimeoutId > 0) { + Mainloop.source_remove(this._showLabelTimeoutId); + this._showLabelTimeoutId = 0; + } + + item.label.opacity = 0; + item.label.hide(); + } + else { + // I want to listen from outside when a menu is closed. I used to + // add a custom signal to the appIcon, since gnome 3.8 the signal + // calling this callback was added upstream. + this.emit('menu-closed'); + } + } + + _syncLabel(item, appIcon) { + let shouldShow = appIcon ? appIcon.shouldShowTooltip() : item.child.get_hover(); + + if (shouldShow) { + if (this._showLabelTimeoutId == 0) { + let timeout = this._labelShowing ? 0 : DASH_ITEM_HOVER_TIMEOUT; + this._showLabelTimeoutId = Mainloop.timeout_add(timeout, () => { + this._labelShowing = true; + item.showLabel(); + this._showLabelTimeoutId = 0; + return GLib.SOURCE_REMOVE; + }); + GLib.Source.set_name_by_id(this._showLabelTimeoutId, '[gnome-shell] item.showLabel'); + if (this._resetHoverTimeoutId > 0) { + Mainloop.source_remove(this._resetHoverTimeoutId); + this._resetHoverTimeoutId = 0; + } + } + } + else { + if (this._showLabelTimeoutId > 0) + Mainloop.source_remove(this._showLabelTimeoutId); + this._showLabelTimeoutId = 0; + item.hideLabel(); + if (this._labelShowing) { + this._resetHoverTimeoutId = Mainloop.timeout_add(DASH_ITEM_HOVER_TIMEOUT, () => { + this._labelShowing = false; + this._resetHoverTimeoutId = 0; + return GLib.SOURCE_REMOVE; + }); + GLib.Source.set_name_by_id(this._resetHoverTimeoutId, '[gnome-shell] this._labelShowing'); + } + } + } + + _adjustIconSize() { + // For the icon size, we only consider children which are "proper" + // icons (i.e. ignoring drag placeholders) and which are not + // animating out (which means they will be destroyed at the end of + // the animation) + let iconChildren = this._box.get_children().filter(function(actor) { + return actor.child && + actor.child._delegate && + actor.child._delegate.icon && + !actor.animatingOut; + }); + + iconChildren.push(this._showAppsIcon); + + if (this._maxHeight == -1) + return; + + // Check if the container is present in the stage. This avoids critical + // errors when unlocking the screen + if (!this._container.get_stage()) + return; + + let themeNode = this._container.get_theme_node(); + let maxAllocation = new Clutter.ActorBox({ + x1: 0, + y1: 0, + x2: this._isHorizontal ? this._maxHeight : 42 /* whatever */, + y2: this._isHorizontal ? 42 : this._maxHeight + }); + let maxContent = themeNode.get_content_box(maxAllocation); + let availHeight; + if (this._isHorizontal) + availHeight = maxContent.x2 - maxContent.x1; + else + availHeight = maxContent.y2 - maxContent.y1; + let spacing = themeNode.get_length('spacing'); + + let firstButton = iconChildren[0].child; + let firstIcon = firstButton._delegate.icon; + + let minHeight, natHeight, minWidth, natWidth; + + // Enforce the current icon size during the size request + firstIcon.setIconSize(this.iconSize); + [minHeight, natHeight] = firstButton.get_preferred_height(-1); + [minWidth, natWidth] = firstButton.get_preferred_width(-1); + + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + let iconSizes = this._availableIconSizes.map(function(s) { + return s * scaleFactor; + }); + + // Subtract icon padding and box spacing from the available height + if (this._isHorizontal) + availHeight -= iconChildren.length * (natWidth - this.iconSize * scaleFactor) + + (iconChildren.length - 1) * spacing; + else + availHeight -= iconChildren.length * (natHeight - this.iconSize * scaleFactor) + + (iconChildren.length - 1) * spacing; + + let availSize = availHeight / iconChildren.length; + + + let newIconSize = this._availableIconSizes[0]; + for (let i = 0; i < iconSizes.length; i++) { + if (iconSizes[i] < availSize) + newIconSize = this._availableIconSizes[i]; + } + + if (newIconSize == this.iconSize) + return; + + let oldIconSize = this.iconSize; + this.iconSize = newIconSize; + this.emit('icon-size-changed'); + + let scale = oldIconSize / newIconSize; + for (let i = 0; i < iconChildren.length; i++) { + let icon = iconChildren[i].child._delegate.icon; + + // Set the new size immediately, to keep the icons' sizes + // in sync with this.iconSize + icon.setIconSize(this.iconSize); + + // Don't animate the icon size change when the overview + // is transitioning, or when initially filling + // the dash + if (Main.overview.animationInProgress || + !this._shownInitially) + continue; + + let [targetWidth, targetHeight] = icon.icon.get_size(); + + // Scale the icon's texture to the previous size and + // tween to the new size + icon.icon.set_size(icon.icon.width * scale, + icon.icon.height * scale); + + icon.icon.remove_all_transitions(); + icon.icon.ease({ + width: targetWidth, + height: targetHeight, + time: DASH_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD + }); + } + } + + _redisplay() { + let favorites = AppFavorites.getAppFavorites().getFavoriteMap(); + + let running = this._appSystem.get_running(); + let settings = Docking.DockManager.settings; + + if (settings.get_boolean('isolate-workspaces') || + settings.get_boolean('isolate-monitors')) { + // When using isolation, we filter out apps that have no windows in + // the current workspace + let monitorIndex = this._monitorIndex; + running = running.filter(function(_app) { + return AppIcons.getInterestingWindows(_app, monitorIndex).length != 0; + }); + } + + let children = this._box.get_children().filter(function(actor) { + return actor.child && + actor.child._delegate && + actor.child._delegate.app; + }); + // Apps currently in the dash + let oldApps = children.map(function(actor) { + return actor.child._delegate.app; + }); + // Apps supposed to be in the dash + let newApps = []; + + if (settings.get_boolean('show-favorites')) { + for (let id in favorites) + newApps.push(favorites[id]); + } + + // We reorder the running apps so that they don't change position on the + // dash with every redisplay() call + if (settings.get_boolean('show-running')) { + // First: add the apps from the oldApps list that are still running + for (let i = 0; i < oldApps.length; i++) { + let index = running.indexOf(oldApps[i]); + if (index > -1) { + let app = running.splice(index, 1)[0]; + if (settings.get_boolean('show-favorites') && (app.get_id() in favorites)) + continue; + newApps.push(app); + } + } + // Second: add the new apps + for (let i = 0; i < running.length; i++) { + let app = running[i]; + if (settings.get_boolean('show-favorites') && (app.get_id() in favorites)) + continue; + newApps.push(app); + } + } + + if (settings.get_boolean('show-mounts')) { + if (!this._removables) { + this._removables = new Locations.Removables(); + this._signalsHandler.addWithLabel('show-mounts', + [ this._removables, + 'changed', + this._queueRedisplay.bind(this) ]); + } + Array.prototype.push.apply(newApps, this._removables.getApps()); + } else if (this._removables) { + this._signalsHandler.removeWithLabel('show-mounts'); + this._removables.destroy(); + this._removables = null; + } + + if (settings.get_boolean('show-trash')) { + if (!this._trash) { + this._trash = new Locations.Trash(); + this._signalsHandler.addWithLabel('show-trash', + [ this._trash, + 'changed', + this._queueRedisplay.bind(this) ]); + } + newApps.push(this._trash.getApp()); + } else if (this._trash) { + this._signalsHandler.removeWithLabel('show-trash'); + this._trash.destroy(); + this._trash = null; + } + + // Figure out the actual changes to the list of items; we iterate + // over both the list of items currently in the dash and the list + // of items expected there, and collect additions and removals. + // Moves are both an addition and a removal, where the order of + // the operations depends on whether we encounter the position + // where the item has been added first or the one from where it + // was removed. + // There is an assumption that only one item is moved at a given + // time; when moving several items at once, everything will still + // end up at the right position, but there might be additional + // additions/removals (e.g. it might remove all the launchers + // and add them back in the new order even if a smaller set of + // additions and removals is possible). + // If above assumptions turns out to be a problem, we might need + // to use a more sophisticated algorithm, e.g. Longest Common + // Subsequence as used by diff. + + let addedItems = []; + let removedActors = []; + + let newIndex = 0; + let oldIndex = 0; + while ((newIndex < newApps.length) || (oldIndex < oldApps.length)) { + // No change at oldIndex/newIndex + if (oldApps[oldIndex] && oldApps[oldIndex] == newApps[newIndex]) { + oldIndex++; + newIndex++; + continue; + } + + // App removed at oldIndex + if (oldApps[oldIndex] && (newApps.indexOf(oldApps[oldIndex]) == -1)) { + removedActors.push(children[oldIndex]); + oldIndex++; + continue; + } + + // App added at newIndex + if (newApps[newIndex] && (oldApps.indexOf(newApps[newIndex]) == -1)) { + let newItem = this._createAppItem(newApps[newIndex]); + addedItems.push({ app: newApps[newIndex], + item: newItem, + pos: newIndex }); + newIndex++; + continue; + } + + // App moved + let insertHere = newApps[newIndex + 1] && (newApps[newIndex + 1] == oldApps[oldIndex]); + let alreadyRemoved = removedActors.reduce(function(result, actor) { + let removedApp = actor.child._delegate.app; + return result || removedApp == newApps[newIndex]; + }, false); + + if (insertHere || alreadyRemoved) { + let newItem = this._createAppItem(newApps[newIndex]); + addedItems.push({ + app: newApps[newIndex], + item: newItem, + pos: newIndex + removedActors.length + }); + newIndex++; + } + else { + removedActors.push(children[oldIndex]); + oldIndex++; + } + } + + for (let i = 0; i < addedItems.length; i++) + this._box.insert_child_at_index(addedItems[i].item, + addedItems[i].pos); + + for (let i = 0; i < removedActors.length; i++) { + let item = removedActors[i]; + + // Don't animate item removal when the overview is transitioning + if (!Main.overview.animationInProgress) + item.animateOutAndDestroy(); + else + item.destroy(); + } + + this._adjustIconSize(); + + // Skip animations on first run when adding the initial set + // of items, to avoid all items zooming in at once + + let animate = this._shownInitially && + !Main.overview.animationInProgress; + + if (!this._shownInitially) + this._shownInitially = true; + + for (let i = 0; i < addedItems.length; i++) + addedItems[i].item.show(animate); + + // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=692744 + // Without it, StBoxLayout may use a stale size cache + this._box.queue_relayout(); + + // This is required for icon reordering when the scrollview is used. + this._updateAppsIconGeometry(); + + // This will update the size, and the corresponding number for each icon + this._updateNumberOverlay(); + } + + _updateNumberOverlay() { + let appIcons = this.getAppIcons(); + let counter = 1; + appIcons.forEach(function(icon) { + if (counter < 10){ + icon.setNumberOverlay(counter); + counter++; + } + else if (counter == 10) { + icon.setNumberOverlay(0); + counter++; + } + else { + // No overlay after 10 + icon.setNumberOverlay(-1); + } + icon.updateNumberOverlay(); + }); + + } + + toggleNumberOverlay(activate) { + let appIcons = this.getAppIcons(); + appIcons.forEach(function(icon) { + icon.toggleNumberOverlay(activate); + }); + } + + _initializeIconSize(max_size) { + let max_allowed = baseIconSizes[baseIconSizes.length-1]; + max_size = Math.min(max_size, max_allowed); + + if (Docking.DockManager.settings.get_boolean('icon-size-fixed')) + this._availableIconSizes = [max_size]; + else { + this._availableIconSizes = baseIconSizes.filter(function(val) { + return (val { + this._animatingPlaceholdersCount--; + }); + this._dragPlaceholder = null; + } + this._dragPlaceholderPos = -1; + } + + _clearEmptyDropTarget() { + if (this._emptyDropTarget) { + this._emptyDropTarget.animateOutAndDestroy(); + this._emptyDropTarget = null; + } + } + + handleDragOver(source, actor, x, y, time) { + let app = Dash.getAppFromSource(source); + + // Don't allow favoriting of transient apps + if (app == null || app.is_window_backed()) + return DND.DragMotionResult.NO_DROP; + + if (!this._shellSettings.is_writable('favorite-apps') || + !Docking.DockManager.settings.get_boolean('show-favorites')) + return DND.DragMotionResult.NO_DROP; + + let favorites = AppFavorites.getAppFavorites().getFavorites(); + let numFavorites = favorites.length; + + let favPos = favorites.indexOf(app); + + let children = this._box.get_children(); + let numChildren = children.length; + let boxHeight = 0; + for (let i = 0; i < numChildren; i++) + boxHeight += this._isHorizontal?children[i].width:children[i].height; + + // Keep the placeholder out of the index calculation; assuming that + // the remove target has the same size as "normal" items, we don't + // need to do the same adjustment there. + if (this._dragPlaceholder) { + boxHeight -= this._isHorizontal?this._dragPlaceholder.width:this._dragPlaceholder.height; + numChildren--; + } + + let pos; + if (!this._emptyDropTarget) { + pos = Math.floor((this._isHorizontal?x:y) * numChildren / boxHeight); + if (pos > numChildren) + pos = numChildren; + } + else + pos = 0; // always insert at the top when dash is empty + + // Take into account childredn position in rtl + if (this._isHorizontal && (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)) + pos = numChildren - pos; + + if ((pos != this._dragPlaceholderPos) && (pos <= numFavorites) && (this._animatingPlaceholdersCount == 0)) { + this._dragPlaceholderPos = pos; + + // Don't allow positioning before or after self + if ((favPos != -1) && (pos == favPos || pos == favPos + 1)) { + this._clearDragPlaceholder(); + return DND.DragMotionResult.CONTINUE; + } + + // If the placeholder already exists, we just move + // it, but if we are adding it, expand its size in + // an animation + let fadeIn; + if (this._dragPlaceholder) { + this._dragPlaceholder.destroy(); + fadeIn = false; + } + else + fadeIn = true; + + this._dragPlaceholder = new Dash.DragPlaceholderItem(); + this._dragPlaceholder.child.set_width (this.iconSize); + this._dragPlaceholder.child.set_height (this.iconSize / 2); + this._box.insert_child_at_index(this._dragPlaceholder, + this._dragPlaceholderPos); + this._dragPlaceholder.show(fadeIn); + // Ensure the next and previous icon are visible when moving the placeholder + // (I assume there's room for both of them) + if (this._dragPlaceholderPos > 1) + ensureActorVisibleInScrollView(this._scrollView, this._box.get_children()[this._dragPlaceholderPos-1]); + if (this._dragPlaceholderPos < this._box.get_children().length-1) + ensureActorVisibleInScrollView(this._scrollView, this._box.get_children()[this._dragPlaceholderPos+1]); + } + + // Remove the drag placeholder if we are not in the + // "favorites zone" + if (pos > numFavorites) + this._clearDragPlaceholder(); + + if (!this._dragPlaceholder) + return DND.DragMotionResult.NO_DROP; + + let srcIsFavorite = (favPos != -1); + + if (srcIsFavorite) + return DND.DragMotionResult.MOVE_DROP; + + return DND.DragMotionResult.COPY_DROP; + } + + /** + * Draggable target interface + */ + acceptDrop(source, actor, x, y, time) { + let app = Dash.getAppFromSource(source); + + // Don't allow favoriting of transient apps + if (app == null || app.is_window_backed()) + return false; + + if (!this._shellSettings.is_writable('favorite-apps') || + !Docking.DockManager.settings.get_boolean('show-favorites')) + return false; + + let id = app.get_id(); + + let favorites = AppFavorites.getAppFavorites().getFavoriteMap(); + + let srcIsFavorite = (id in favorites); + + let favPos = 0; + let children = this._box.get_children(); + for (let i = 0; i < this._dragPlaceholderPos; i++) { + if (this._dragPlaceholder && (children[i] == this._dragPlaceholder)) + continue; + + let childId = children[i].child._delegate.app.get_id(); + if (childId == id) + continue; + if (childId in favorites) + favPos++; + } + + // No drag placeholder means we don't wan't to favorite the app + // and we are dragging it to its original position + if (!this._dragPlaceholder) + return true; + + Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { + let appFavorites = AppFavorites.getAppFavorites(); + if (srcIsFavorite) + appFavorites.moveFavoriteToPos(id, favPos); + else + appFavorites.addFavoriteAtPos(id, favPos); + return false; + }); + + return true; + } + + get showAppsButton() { + return this._showAppsIcon.toggleButton; + } + + showShowAppsButton() { + this.showAppsButton.visible = true + this.showAppsButton.set_width(-1) + this.showAppsButton.set_height(-1) + } + + hideShowAppsButton() { + this.showAppsButton.hide() + this.showAppsButton.set_width(0) + this.showAppsButton.set_height(0) + } +}); + + +/** + * This is a copy of the same function in utils.js, but also adjust horizontal scrolling + * and perform few further cheks on the current value to avoid changing the values when + * it would be clamp to the current one in any case. + * Return the amount of shift applied + */ +function ensureActorVisibleInScrollView(scrollView, actor) { + let adjust_v = true; + let adjust_h = true; + + let vadjustment = scrollView.get_vscroll_bar().get_adjustment(); + let hadjustment = scrollView.get_hscroll_bar().get_adjustment(); + let [vvalue, vlower, vupper, vstepIncrement, vpageIncrement, vpageSize] = vadjustment.get_values(); + let [hvalue, hlower, hupper, hstepIncrement, hpageIncrement, hpageSize] = hadjustment.get_values(); + + let [hvalue0, vvalue0] = [hvalue, vvalue]; + + let voffset = 0; + let hoffset = 0; + let fade = scrollView.get_effect('fade'); + if (fade) { + voffset = fade.vfade_offset; + hoffset = fade.hfade_offset; + } + + let box = actor.get_allocation_box(); + let y1 = box.y1, y2 = box.y2, x1 = box.x1, x2 = box.x2; + + let parent = actor.get_parent(); + while (parent != scrollView) { + if (!parent) + throw new Error('Actor not in scroll view'); + + let box = parent.get_allocation_box(); + y1 += box.y1; + y2 += box.y1; + x1 += box.x1; + x2 += box.x1; + parent = parent.get_parent(); + } + + if (y1 < vvalue + voffset) + vvalue = Math.max(0, y1 - voffset); + else if (vvalue < vupper - vpageSize && y2 > vvalue + vpageSize - voffset) + vvalue = Math.min(vupper -vpageSize, y2 + voffset - vpageSize); + + if (x1 < hvalue + hoffset) + hvalue = Math.max(0, x1 - hoffset); + else if (hvalue < hupper - hpageSize && x2 > hvalue + hpageSize - hoffset) + hvalue = Math.min(hupper - hpageSize, x2 + hoffset - hpageSize); + + if (vvalue !== vvalue0) { + vadjustment.ease(vvalue, { + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + duration: Util.SCROLL_TIME + }); + } + + if (hvalue !== hvalue0) { + hadjustment.ease(hvalue, { + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + duration: Util.SCROLL_TIME + }); + } + + return [hvalue- hvalue0, vvalue - vvalue0]; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/docking.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/docking.js new file mode 100644 index 00000000..1b34cfa0 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/docking.js @@ -0,0 +1,1916 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Clutter = imports.gi.Clutter; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Gtk = imports.gi.Gtk; +const Meta = imports.gi.Meta; +const Shell = imports.gi.Shell; +const St = imports.gi.St; +const Mainloop = imports.mainloop; +const Params = imports.misc.params; + +const Main = imports.ui.main; +const Dash = imports.ui.dash; +const IconGrid = imports.ui.iconGrid; +const Overview = imports.ui.overview; +const OverviewControls = imports.ui.overviewControls; +const PointerWatcher = imports.ui.pointerWatcher; +const Signals = imports.signals; +const ViewSelector = imports.ui.viewSelector; +const WorkspaceSwitcherPopup= imports.ui.workspaceSwitcherPopup; +const Layout = imports.ui.layout; +const LayoutManager = imports.ui.main.layoutManager; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Utils = Me.imports.utils; +const Intellihide = Me.imports.intellihide; +const Theming = Me.imports.theming; +const MyDash = Me.imports.dash; +const LauncherAPI = Me.imports.launcherAPI; +const FileManager1API = Me.imports.fileManager1API; + +const DOCK_DWELL_CHECK_INTERVAL = 100; + +var State = { + HIDDEN: 0, + SHOWING: 1, + SHOWN: 2, + HIDING: 3 +}; + +const scrollAction = { + DO_NOTHING: 0, + CYCLE_WINDOWS: 1, + SWITCH_WORKSPACE: 2 +}; + +/** + * A simple St.Widget with one child whose allocation takes into account the + * slide out of its child via the _slidex parameter ([0:1]). + * + * Required since I want to track the input region of this container which is + * based on its allocation even if the child overlows the parent actor. By doing + * this the region of the dash that is slideout is not steling anymore the input + * regions making the extesion usable when the primary monitor is the right one. + * + * The slidex parameter can be used to directly animate the sliding. The parent + * must have a WEST (SOUTH) anchor_point to achieve the sliding to the RIGHT (BOTTOM) + * side. +*/ +var DashSlideContainer = GObject.registerClass({ + Properties: { + 'side': GObject.ParamSpec.enum( + 'side', 'side', 'side', + GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY, + St.Side, St.Side.LEFT), + 'slidex': GObject.ParamSpec.double( + 'slidex', 'slidex', 'slidex', + GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT, + 0, 1, 1), + } +}, class DashToDock_DashSlideContainer extends St.Widget { + + _init(params = {}) { + super._init(params); + this._child = null; + + // slide parameter: 1 = visible, 0 = hidden. + this._slidex = params.slidex || 1; + this._slideoutSize = 0; // minimum size when slided out + } + + vfunc_allocate(box, flags) { + this.set_allocation(box, flags); + + if (this._child == null) + return; + + let availWidth = box.x2 - box.x1; + let availHeight = box.y2 - box.y1; + let [, , natChildWidth, natChildHeight] = + this._child.get_preferred_size(); + + let childWidth = natChildWidth; + let childHeight = natChildHeight; + + let childBox = new Clutter.ActorBox(); + + let slideoutSize = this._slideoutSize; + + if (this.side == St.Side.LEFT) { + childBox.x1 = (this._slidex -1) * (childWidth - slideoutSize); + childBox.x2 = slideoutSize + this._slidex*(childWidth - slideoutSize); + childBox.y1 = 0; + childBox.y2 = childBox.y1 + childHeight; + } + else if ((this.side == St.Side.RIGHT) || (this.side == St.Side.BOTTOM)) { + childBox.x1 = 0; + childBox.x2 = childWidth; + childBox.y1 = 0; + childBox.y2 = childBox.y1 + childHeight; + } + else if (this.side == St.Side.TOP) { + childBox.x1 = 0; + childBox.x2 = childWidth; + childBox.y1 = (this._slidex -1) * (childHeight - slideoutSize); + childBox.y2 = slideoutSize + this._slidex * (childHeight - slideoutSize); + } + + this._child.allocate(childBox, flags); + this._child.set_clip(-childBox.x1, -childBox.y1, + -childBox.x1+availWidth, -childBox.y1 + availHeight); + } + + /** + * Just the child width but taking into account the slided out part + */ + vfunc_get_preferred_width(forHeight) { + let [minWidth, natWidth] = this._child.get_preferred_width(forHeight); + if ((this.side == St.Side.LEFT) || (this.side == St.Side.RIGHT)) { + minWidth = (minWidth - this._slideoutSize) * this._slidex + this._slideoutSize; + natWidth = (natWidth - this._slideoutSize) * this._slidex + this._slideoutSize; + } + return [minWidth, natWidth]; + } + + /** + * Just the child height but taking into account the slided out part + */ + vfunc_get_preferred_height(forWidth) { + let [minHeight, natHeight] = this._child.get_preferred_height(forWidth); + if ((this.side == St.Side.TOP) || (this.side == St.Side.BOTTOM)) { + minHeight = (minHeight - this._slideoutSize) * this._slidex + this._slideoutSize; + natHeight = (natHeight - this._slideoutSize) * this._slidex + this._slideoutSize; + } + return [minHeight, natHeight]; + } + + /** + * I was expecting it to be a virtual function... stil I don't understand + * how things work. + */ + add_child(actor) { + // I'm supposed to have only on child + if (this._child !== null) + this.remove_child(actor); + + this._child = actor; + super.add_child(actor); + } + + set slidex(value) { + if (value == this._slidex) + return; + + this._slidex = value; + this.notify('slidex'); + + if (this._child) + this._child.queue_relayout(); + } + + get slidex() { + return this._slidex; + } +}); + +var DockedDash = GObject.registerClass({ + Signals: { + 'showing': {}, + 'hiding': {}, + } +}, class DashToDock extends St.Bin { + + _init(remoteModel, monitorIndex) { + this._rtl = (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL); + + // Load settings + let settings = DockManager.settings; + this._remoteModel = remoteModel; + this._monitorIndex = monitorIndex; + // Connect global signals + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._bindSettingsChanges(); + + this._position = Utils.getPosition(); + this._isHorizontal = ((this._position == St.Side.TOP) || (this._position == St.Side.BOTTOM)); + + // Temporary ignore hover events linked to autohide for whatever reason + this._ignoreHover = false; + this._oldignoreHover = null; + // This variables are linked to the settings regardles of autohide or intellihide + // being temporary disable. Get set by _updateVisibilityMode; + this._autohideIsEnabled = null; + this._intellihideIsEnabled = null; + this._fixedIsEnabled = null; + + // Create intellihide object to monitor windows overlapping + this._intellihide = new Intellihide.Intellihide(this._monitorIndex); + + // initialize dock state + this._dockState = State.HIDDEN; + + // Put dock on the required monitor + this._monitor = Main.layoutManager.monitors[this._monitorIndex]; + + // this store size and the position where the dash is shown; + // used by intellihide module to check window overlap. + this.staticBox = new Clutter.ActorBox(); + + // Initialize pressure barrier variables + this._canUsePressure = false; + this._pressureBarrier = null; + this._barrier = null; + this._removeBarrierTimeoutId = 0; + + // Initialize dwelling system variables + this._dockDwelling = false; + this._dockWatch = null; + this._dockDwellUserTime = 0; + this._dockDwellTimeoutId = 0 + + // Create a new dash object + this.dash = new MyDash.MyDash(this._remoteModel, this._monitorIndex); + + if (!settings.get_boolean('show-show-apps-button')) + this.dash.hideShowAppsButton(); + + // Create the main actor and the containers for sliding in and out and + // centering, turn on track hover + + let positionStyleClass = ['top', 'right', 'bottom', 'left']; + // This is the centering actor + super._init({ + name: 'dashtodockContainer', + reactive: false, + style_class: positionStyleClass[this._position], + x_align: this._isHorizontal?St.Align.MIDDLE:St.Align.START, + y_align: this._isHorizontal?St.Align.START:St.Align.MIDDLE + }); + this._delegate = this; + + // This is the sliding actor whose allocation is to be tracked for input regions + this._slider = new DashSlideContainer({ + side: this._position, + slidex: 0 + }); + + // This is the actor whose hover status us tracked for autohide + this._box = new St.BoxLayout({ + name: 'dashtodockBox', + reactive: true, + track_hover: true + }); + this._box.connect('notify::hover', this._hoverChanged.bind(this)); + + // Create and apply height constraint to the dash. It's controlled by this.height + this.constrainSize = new Clutter.BindConstraint({ + source: this, + coordinate: this._isHorizontal?Clutter.BindCoordinate.WIDTH:Clutter.BindCoordinate.HEIGHT + }); + this.dash.add_constraint(this.constrainSize); + + this._signalsHandler.add([ + Main.overview, + 'item-drag-begin', + this._onDragStart.bind(this) + ], [ + Main.overview, + 'item-drag-end', + this._onDragEnd.bind(this) + ], [ + Main.overview, + 'item-drag-cancelled', + this._onDragEnd.bind(this) + ], [ + // update when workarea changes, for instance if other extensions modify the struts + //(like moving th panel at the bottom) + global.display, + 'workareas-changed', + this._resetPosition.bind(this) + ], [ + Main.overview, + 'showing', + this._onOverviewShowing.bind(this) + ], [ + Main.overview, + 'hiding', + this._onOverviewHiding.bind(this) + ], [ + // Hide on appview + Main.overview.viewSelector, + 'page-changed', + this._pageChanged.bind(this) + ], [ + Main.overview.viewSelector, + 'page-empty', + this._onPageEmpty.bind(this) + ], [ + // Ensure the ShowAppsButton status is kept in sync + Main.overview.viewSelector._showAppsButton, + 'notify::checked', + this._syncShowAppsButtonToggled.bind(this) + ], [ + global.display, + 'in-fullscreen-changed', + this._updateBarrier.bind(this) + ], [ + // Monitor windows overlapping + this._intellihide, + 'status-changed', + this._updateDashVisibility.bind(this) + ], [ + // Keep dragged icon consistent in size with this dash + this.dash, + 'icon-size-changed', + () => { Main.overview.dashIconSize = this.dash.iconSize; } + ], [ + // This duplicate the similar signal which is in owerview.js. + // Being connected and thus executed later this effectively + // overwrite any attempt to use the size of the default dash + //which given the customization is usually much smaller. + // I can't easily disconnect the original signal + Main.overview._controls.dash, + 'icon-size-changed', + () => { Main.overview.dashIconSize = this.dash.iconSize; } + ], [ + // sync hover after a popupmenu is closed + this.dash, + 'menu-closed', + () => { this._box.sync_hover() } + ]); + + this._injectionsHandler = new Utils.InjectionsHandler(); + this._themeManager = new Theming.ThemeManager(this); + + // Since the actor is not a topLevel child and its parent is now not added to the Chrome, + // the allocation change of the parent container (slide in and slideout) doesn't trigger + // anymore an update of the input regions. Force the update manually. + this.connect('notify::allocation', + Main.layoutManager._queueUpdateRegions.bind(Main.layoutManager)); + + this.dash._container.connect('allocation-changed', this._updateStaticBox.bind(this)); + this._slider.connect(this._isHorizontal ? 'notify::x' : 'notify::y', this._updateStaticBox.bind(this)); + + // Load optional features that need to be activated for one dock only + if (this._monitorIndex == settings.get_int('preferred-monitor')) + this._enableExtraFeatures(); + // Load optional features that need to be activated once per dock + this._optionalScrollWorkspaceSwitch(); + + // Delay operations that require the shell to be fully loaded and with + // user theme applied. + + this._paintId = this.connect('paint', this._initialize.bind(this)); + + // Manage the which is used to reserve space in the overview for the dock + // Add and additional dashSpacer positioned according to the dash positioning. + // It gets restored on extension unload. + this._dashSpacer = new OverviewControls.DashSpacer(); + this._dashSpacer.setDashActor(this._box); + + if (this._position == St.Side.LEFT) + Main.overview._controls._group.insert_child_at_index(this._dashSpacer, this._rtl ? -1 : 0); // insert on first + else if (this._position == St.Side.RIGHT) + Main.overview._controls._group.insert_child_at_index(this._dashSpacer, this._rtl ? 0 : -1); // insert on last + else if (this._position == St.Side.TOP) + Main.overview._overview.insert_child_at_index(this._dashSpacer, 0); + else if (this._position == St.Side.BOTTOM) + Main.overview._overview.insert_child_at_index(this._dashSpacer, -1); + + // Add dash container actor and the container to the Chrome. + this.set_child(this._slider); + this._slider.add_child(this._box); + this._box.add_actor(this.dash); + + // Add aligning container without tracking it for input region + Main.uiGroup.add_child(this); + + if (settings.get_boolean('dock-fixed')) { + // Note: tracking the fullscreen directly on the slider actor causes some hiccups when fullscreening + // windows of certain applications + Main.layoutManager._trackActor(this, {affectsInputRegion: false, trackFullscreen: true}); + Main.layoutManager._trackActor(this._slider, {affectsStruts: true}); + } + else + Main.layoutManager._trackActor(this._slider); + + // Set initial position + this._resetDepth(); + this._resetPosition(); + + this.connect('destroy', this._onDestroy.bind(this)); + } + + _initialize() { + if (this._paintId > 0) { + this.disconnect(this._paintId); + this._paintId=0; + } + + // Apply custome css class according to the settings + this._themeManager.updateCustomTheme(); + + // Since Gnome 3.8 dragging an app without having opened the overview before cause the attemp to + //animate a null target since some variables are not initialized when the viewSelector is created + if (Main.overview.viewSelector._activePage == null) + Main.overview.viewSelector._activePage = Main.overview.viewSelector._workspacesPage; + + this._updateVisibilityMode(); + + // In case we are already inside the overview when the extension is loaded, + // for instance on unlocking the screen if it was locked with the overview open. + if (Main.overview.visibleTarget) { + this._onOverviewShowing(); + this._pageChanged(); + } + + // Setup pressure barrier (GS38+ only) + this._updatePressureBarrier(); + this._updateBarrier(); + + // setup dwelling system if pressure barriers are not available + this._setupDockDwellIfNeeded(); + } + + _onDestroy() { + // Disconnect global signals + this._signalsHandler.destroy(); + // The dash, intellihide and themeManager have global signals as well internally + this.dash.destroy(); + this._intellihide.destroy(); + this._themeManager.destroy(); + + this._injectionsHandler.destroy(); + + // Remove barrier timeout + if (this._removeBarrierTimeoutId > 0) + Mainloop.source_remove(this._removeBarrierTimeoutId); + + // Remove existing barrier + this._removeBarrier(); + + // Remove pointer watcher + if (this._dockWatch) { + PointerWatcher.getPointerWatcher()._removeWatch(this._dockWatch); + this._dockWatch = null; + } + + // Remove the dashSpacer + this._dashSpacer.destroy(); + } + + _bindSettingsChanges() { + let settings = DockManager.settings; + this._signalsHandler.add([ + settings, + 'changed::scroll-action', + () => { this._optionalScrollWorkspaceSwitch(); } + ], [ + settings, + 'changed::dash-max-icon-size', + () => { this.dash.setIconSize(settings.get_int('dash-max-icon-size')); } + ], [ + settings, + 'changed::icon-size-fixed', + () => { this.dash.setIconSize(settings.get_int('dash-max-icon-size')); } + ], [ + settings, + 'changed::show-favorites', + () => { this.dash.resetAppIcons(); } + ], [ + settings, + 'changed::show-trash', + () => { this.dash.resetAppIcons(); }, + Utils.SignalsHandlerFlags.CONNECT_AFTER, + ], [ + settings, + 'changed::show-mounts', + () => { this.dash.resetAppIcons(); }, + Utils.SignalsHandlerFlags.CONNECT_AFTER + ], [ + settings, + 'changed::show-running', + () => { this.dash.resetAppIcons(); } + ], [ + settings, + 'changed::show-apps-at-top', + () => { this.dash.resetAppIcons(); } + ], [ + settings, + 'changed::show-show-apps-button', + () => { + if (settings.get_boolean('show-show-apps-button')) + this.dash.showShowAppsButton(); + else + this.dash.hideShowAppsButton(); + } + ], [ + settings, + 'changed::dock-fixed', + () => { + if (settings.get_boolean('dock-fixed')) { + Main.layoutManager._untrackActor(this); + Main.layoutManager._trackActor(this, {affectsInputRegion: false, trackFullscreen: true}); + Main.layoutManager._untrackActor(this._slider); + Main.layoutManager._trackActor(this._slider, {affectsStruts: true}); + } else { + Main.layoutManager._untrackActor(this); + Main.layoutManager._untrackActor(this._slider); + Main.layoutManager._trackActor(this._slider); + } + + this._resetPosition(); + + // Add or remove barrier depending on if dock-fixed + this._updateBarrier(); + + this._updateVisibilityMode(); + } + ], [ + settings, + 'changed::intellihide', + this._updateVisibilityMode.bind(this) + ], [ + settings, + 'changed::intellihide-mode', + () => { this._intellihide.forceUpdate(); } + ], [ + settings, + 'changed::autohide', + () => { + this._updateVisibilityMode(); + this._updateBarrier(); + } + ], [ + settings, + 'changed::autohide-in-fullscreen', + this._updateBarrier.bind(this) + ], + [ + settings, + 'changed::extend-height', + this._resetPosition.bind(this) + ], [ + settings, + 'changed::height-fraction', + this._resetPosition.bind(this) + ], [ + settings, + 'changed::require-pressure-to-show', + () => { + // Remove pointer watcher + if (this._dockWatch) { + PointerWatcher.getPointerWatcher()._removeWatch(this._dockWatch); + this._dockWatch = null; + } + this._setupDockDwellIfNeeded(); + this._updateBarrier(); + } + ], [ + settings, + 'changed::pressure-threshold', + () => { + this._updatePressureBarrier(); + this._updateBarrier(); + } + ]); + + } + + /** + * This is call when visibility settings change + */ + _updateVisibilityMode() { + let settings = DockManager.settings; + if (settings.get_boolean('dock-fixed')) { + this._fixedIsEnabled = true; + this._autohideIsEnabled = false; + this._intellihideIsEnabled = false; + } + else { + this._fixedIsEnabled = false; + this._autohideIsEnabled = settings.get_boolean('autohide') + this._intellihideIsEnabled = settings.get_boolean('intellihide') + } + + if (this._intellihideIsEnabled) + this._intellihide.enable(); + else + this._intellihide.disable(); + + this._updateDashVisibility(); + } + + /** + * Show/hide dash based on, in order of priority: + * overview visibility + * fixed mode + * intellihide + * autohide + * overview visibility + */ + _updateDashVisibility() { + if (Main.overview.visibleTarget) + return; + + let settings = DockManager.settings; + + if (this._fixedIsEnabled) { + this._removeAnimations(); + this._animateIn(settings.get_double('animation-time'), 0); + } + else if (this._intellihideIsEnabled) { + if (this._intellihide.getOverlapStatus()) { + this._ignoreHover = false; + // Do not hide if autohide is enabled and mouse is hover + if (!this._box.hover || !this._autohideIsEnabled) + this._animateOut(settings.get_double('animation-time'), 0); + } + else { + this._ignoreHover = true; + this._removeAnimations(); + this._animateIn(settings.get_double('animation-time'), 0); + } + } + else { + if (this._autohideIsEnabled) { + this._ignoreHover = false; + global.sync_pointer(); + + if (this._box.hover) + this._animateIn(settings.get_double('animation-time'), 0); + else + this._animateOut(settings.get_double('animation-time'), 0); + } + else + this._animateOut(settings.get_double('animation-time'), 0); + } + } + + _onOverviewShowing() { + this._ignoreHover = true; + this._intellihide.disable(); + this._removeAnimations(); + this._animateIn(DockManager.settings.get_double('animation-time'), 0); + } + + _onOverviewHiding() { + this._ignoreHover = false; + this._intellihide.enable(); + this._updateDashVisibility(); + } + + _hoverChanged() { + if (!this._ignoreHover) { + // Skip if dock is not in autohide mode for instance because it is shown + // by intellihide. + if (this._autohideIsEnabled) { + if (this._box.hover) + this._show(); + else + this._hide(); + } + } + } + + getDockState() { + return this._dockState; + } + + _show() { + if ((this._dockState == State.HIDDEN) || (this._dockState == State.HIDING)) { + if (this._dockState == State.HIDING) + // suppress all potential queued transitions - i.e. added but not started, + // always give priority to show + this._removeAnimations(); + + this.emit('showing'); + this._animateIn(DockManager.settings.get_double('animation-time'), 0); + } + } + + _hide() { + // If no hiding animation is running or queued + if ((this._dockState == State.SHOWN) || (this._dockState == State.SHOWING)) { + let settings = DockManager.settings; + let delay; + + if (this._dockState == State.SHOWING) + //if a show already started, let it finish; queue hide without removing the show. + // to obtain this I increase the delay to avoid the overlap and interference + // between the animations + delay = settings.get_double('hide-delay') + settings.get_double('animation-time'); + else + delay = settings.get_double('hide-delay'); + + this.emit('hiding'); + this._animateOut(settings.get_double('animation-time'), delay); + } + } + + _animateIn(time, delay) { + this._dockState = State.SHOWING; + + this._slider.ease_property('slidex', 1, { + duration: time * 1000, + delay: delay * 1000, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => { + this._dockState = State.SHOWN; + // Remove barrier so that mouse pointer is released and can access monitors on other side of dock + // NOTE: Delay needed to keep mouse from moving past dock and re-hiding dock immediately. This + // gives users an opportunity to hover over the dock + if (this._removeBarrierTimeoutId > 0) + Mainloop.source_remove(this._removeBarrierTimeoutId); + this._removeBarrierTimeoutId = Mainloop.timeout_add(100, this._removeBarrier.bind(this)); + } + }); + } + + _animateOut(time, delay) { + this._dockState = State.HIDING; + + this._slider.ease_property('slidex', 0, { + duration: time * 1000, + delay: delay * 1000, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + onComplete: () => { + this._dockState = State.HIDDEN; + // Remove queued barried removal if any + if (this._removeBarrierTimeoutId > 0) + Mainloop.source_remove(this._removeBarrierTimeoutId); + this._updateBarrier(); + } + }); + } + + /** + * Dwelling system based on the GNOME Shell 3.14 messageTray code. + */ + _setupDockDwellIfNeeded() { + // If we don't have extended barrier features, then we need + // to support the old tray dwelling mechanism. + if (!global.display.supports_extended_barriers() || + !DockManager.settings.get_boolean('require-pressure-to-show')) { + let pointerWatcher = PointerWatcher.getPointerWatcher(); + this._dockWatch = pointerWatcher.addWatch(DOCK_DWELL_CHECK_INTERVAL, this._checkDockDwell.bind(this)); + this._dockDwelling = false; + this._dockDwellUserTime = 0; + } + } + + _checkDockDwell(x, y) { + + let workArea = Main.layoutManager.getWorkAreaForMonitor(this._monitor.index) + let shouldDwell; + // Check for the correct screen edge, extending the sensitive area to the whole workarea, + // minus 1 px to avoid conflicting with other active corners. + if (this._position == St.Side.LEFT) + shouldDwell = (x == this._monitor.x) && (y > workArea.y) && (y < workArea.y + workArea.height); + else if (this._position == St.Side.RIGHT) + shouldDwell = (x == this._monitor.x + this._monitor.width - 1) && (y > workArea.y) && (y < workArea.y + workArea.height); + else if (this._position == St.Side.TOP) + shouldDwell = (y == this._monitor.y) && (x > workArea.x) && (x < workArea.x + workArea.width); + else if (this._position == St.Side.BOTTOM) + shouldDwell = (y == this._monitor.y + this._monitor.height - 1) && (x > workArea.x) && (x < workArea.x + workArea.width); + + if (shouldDwell) { + // We only set up dwell timeout when the user is not hovering over the dock + // already (!this._box.hover). + // The _dockDwelling variable is used so that we only try to + // fire off one dock dwell - if it fails (because, say, the user has the mouse down), + // we don't try again until the user moves the mouse up and down again. + if (!this._dockDwelling && !this._box.hover && (this._dockDwellTimeoutId == 0)) { + // Save the interaction timestamp so we can detect user input + let focusWindow = global.display.focus_window; + this._dockDwellUserTime = focusWindow ? focusWindow.user_time : 0; + + this._dockDwellTimeoutId = Mainloop.timeout_add(DockManager.settings.get_double('show-delay') * 1000, + this._dockDwellTimeout.bind(this)); + GLib.Source.set_name_by_id(this._dockDwellTimeoutId, '[dash-to-dock] this._dockDwellTimeout'); + } + this._dockDwelling = true; + } + else { + this._cancelDockDwell(); + this._dockDwelling = false; + } + } + + _cancelDockDwell() { + if (this._dockDwellTimeoutId != 0) { + Mainloop.source_remove(this._dockDwellTimeoutId); + this._dockDwellTimeoutId = 0; + } + } + + _dockDwellTimeout() { + this._dockDwellTimeoutId = 0; + + if (!DockManager.settings.get_boolean('autohide-in-fullscreen') && + this._monitor.inFullscreen) + return GLib.SOURCE_REMOVE; + + // We don't want to open the tray when a modal dialog + // is up, so we check the modal count for that. When we are in the + // overview we have to take the overview's modal push into account + if (Main.modalCount > (Main.overview.visible ? 1 : 0)) + return GLib.SOURCE_REMOVE; + + // If the user interacted with the focus window since we started the tray + // dwell (by clicking or typing), don't activate the message tray + let focusWindow = global.display.focus_window; + let currentUserTime = focusWindow ? focusWindow.user_time : 0; + if (currentUserTime != this._dockDwellUserTime) + return GLib.SOURCE_REMOVE; + + // Reuse the pressure version function, the logic is the same + this._onPressureSensed(); + return GLib.SOURCE_REMOVE; + } + + _updatePressureBarrier() { + let settings = DockManager.settings; + this._canUsePressure = global.display.supports_extended_barriers(); + let pressureThreshold = settings.get_double('pressure-threshold'); + + // Remove existing pressure barrier + if (this._pressureBarrier) { + this._pressureBarrier.destroy(); + this._pressureBarrier = null; + } + + if (this._barrier) { + this._barrier.destroy(); + this._barrier = null; + } + + // Create new pressure barrier based on pressure threshold setting + if (this._canUsePressure) { + this._pressureBarrier = new Layout.PressureBarrier(pressureThreshold, settings.get_double('show-delay')*1000, + Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW); + this._pressureBarrier.connect('trigger', (barrier) => { + if (!settings.get_boolean('autohide-in-fullscreen') && this._monitor.inFullscreen) + return; + this._onPressureSensed(); + }); + } + } + + /** + * handler for mouse pressure sensed + */ + _onPressureSensed() { + if (Main.overview.visibleTarget) + return; + + // In case the mouse move away from the dock area before hovering it, in such case the leave event + // would never be triggered and the dock would stay visible forever. + let triggerTimeoutId = Mainloop.timeout_add(250, () => { + triggerTimeoutId = 0; + + let [x, y, mods] = global.get_pointer(); + let shouldHide = true; + switch (this._position) { + case St.Side.LEFT: + if (x <= this.staticBox.x2 && + x >= this._monitor.x && + y >= this._monitor.y && + y <= this._monitor.y + this._monitor.height) { + shouldHide = false; + } + break; + case St.Side.RIGHT: + if (x >= this.staticBox.x1 && + x <= this._monitor.x + this._monitor.width && + y >= this._monitor.y && + y <= this._monitor.y + this._monitor.height) { + shouldHide = false; + } + break; + case St.Side.TOP: + if (x >= this._monitor.x && + x <= this._monitor.x + this._monitor.width && + y <= this.staticBox.y2 && + y >= this._monitor.y) { + shouldHide = false; + } + break; + case St.Side.BOTTOM: + if (x >= this._monitor.x && + x <= this._monitor.x + this._monitor.width && + y >= this.staticBox.y1 && + y <= this._monitor.y + this._monitor.height) { + shouldHide = false; + } + } + if (shouldHide) { + this._hoverChanged(); + return GLib.SOURCE_REMOVE; + } + else { + return GLib.SOURCE_CONTINUE; + } + + }); + + this._show(); + } + + /** + * Remove pressure barrier + */ + _removeBarrier() { + if (this._barrier) { + if (this._pressureBarrier) + this._pressureBarrier.removeBarrier(this._barrier); + this._barrier.destroy(); + this._barrier = null; + } + this._removeBarrierTimeoutId = 0; + return false; + } + + /** + * Update pressure barrier size + */ + _updateBarrier() { + // Remove existing barrier + this._removeBarrier(); + + // The barrier needs to be removed in fullscreen with autohide disabled, otherwise the mouse can + // get trapped on monitor. + if (this._monitor.inFullscreen && + !DockManager.settings.get_boolean('autohide-in-fullscreen')) + return + + // Manually reset pressure barrier + // This is necessary because we remove the pressure barrier when it is triggered to show the dock + if (this._pressureBarrier) { + this._pressureBarrier._reset(); + this._pressureBarrier._isTriggered = false; + } + + // Create new barrier + // The barrier extends to the whole workarea, minus 1 px to avoid conflicting with other active corners + // Note: dash in fixed position doesn't use pressure barrier. + if (this._canUsePressure && this._autohideIsEnabled && + DockManager.settings.get_boolean('require-pressure-to-show')) { + let x1, x2, y1, y2, direction; + let workArea = Main.layoutManager.getWorkAreaForMonitor(this._monitor.index) + + if (this._position == St.Side.LEFT) { + x1 = this._monitor.x + 1; + x2 = x1; + y1 = workArea.y + 1; + y2 = workArea.y + workArea.height - 1; + direction = Meta.BarrierDirection.POSITIVE_X; + } + else if (this._position == St.Side.RIGHT) { + x1 = this._monitor.x + this._monitor.width - 1; + x2 = x1; + y1 = workArea.y + 1; + y2 = workArea.y + workArea.height - 1; + direction = Meta.BarrierDirection.NEGATIVE_X; + } + else if (this._position == St.Side.TOP) { + x1 = workArea.x + 1; + x2 = workArea.x + workArea.width - 1; + y1 = this._monitor.y; + y2 = y1; + direction = Meta.BarrierDirection.POSITIVE_Y; + } + else if (this._position == St.Side.BOTTOM) { + x1 = workArea.x + 1; + x2 = workArea.x + workArea.width - 1; + y1 = this._monitor.y + this._monitor.height; + y2 = y1; + direction = Meta.BarrierDirection.NEGATIVE_Y; + } + + this._barrier = new Meta.Barrier({ + display: global.display, + x1: x1, + x2: x2, + y1: y1, + y2: y2, + directions: direction + }); + if (this._pressureBarrier) + this._pressureBarrier.addBarrier(this._barrier); + } + } + + _isPrimaryMonitor() { + return (this._monitorIndex == Main.layoutManager.primaryIndex); + } + + _resetPosition() { + // Ensure variables linked to settings are updated. + this._updateVisibilityMode(); + + let extendHeight = DockManager.settings.get_boolean('extend-height'); + + // Note: do not use the workarea coordinates in the direction on which the dock is placed, + // to avoid a loop [position change -> workArea change -> position change] with + // fixed dock. + let workArea = Main.layoutManager.getWorkAreaForMonitor(this._monitorIndex); + + // Reserve space for the dash on the overview + // if the dock is on the primary monitor + if (this._isPrimaryMonitor()) + this._dashSpacer.show(); + else + // No space is required in the overview of the dash + this._dashSpacer.hide(); + + let fraction = DockManager.settings.get_double('height-fraction'); + + if (extendHeight) + fraction = 1; + else if ((fraction < 0) || (fraction > 1)) + fraction = 0.95; + + let anchor_point; + + if (this._isHorizontal) { + this.width = Math.round(fraction * workArea.width); + + let pos_y; + if (this._position == St.Side.BOTTOM) { + pos_y = this._monitor.y + this._monitor.height; + anchor_point = Clutter.Gravity.SOUTH_WEST; + } + else { + pos_y = this._monitor.y; + anchor_point = Clutter.Gravity.NORTH_WEST; + } + + this.move_anchor_point_from_gravity(anchor_point); + this.x = workArea.x + Math.round((1 - fraction) / 2 * workArea.width); + this.y = pos_y; + + if (extendHeight) { + this.dash._container.set_width(this.width); + this.add_style_class_name('extended'); + } + else { + this.dash._container.set_width(-1); + this.remove_style_class_name('extended'); + } + } + else { + this.height = Math.round(fraction * workArea.height); + + let pos_x; + if (this._position == St.Side.RIGHT) { + pos_x = this._monitor.x + this._monitor.width; + anchor_point = Clutter.Gravity.NORTH_EAST; + } + else { + pos_x = this._monitor.x; + anchor_point = Clutter.Gravity.NORTH_WEST; + } + + this.move_anchor_point_from_gravity(anchor_point); + this.x = pos_x; + this.y = workArea.y + Math.round((1 - fraction) / 2 * workArea.height); + + if (extendHeight) { + this.dash._container.set_height(this.height); + this.add_style_class_name('extended'); + } + else { + this.dash._container.set_height(-1); + this.remove_style_class_name('extended'); + } + } + + this._y0 = this.y; + } + + // Set the dash at the correct depth in z + _resetDepth() { + // Keep the dash below the modalDialogGroup + Main.layoutManager.uiGroup.set_child_below_sibling(this, Main.layoutManager.modalDialogGroup); + } + + _updateStaticBox() { + this.staticBox.init_rect( + this.x + this._slider.x - (this._position == St.Side.RIGHT ? this._box.width : 0), + this.y + this._slider.y - (this._position == St.Side.BOTTOM ? this._box.height : 0), + this._box.width, + this._box.height + ); + + this._intellihide.updateTargetBox(this.staticBox); + } + + _removeAnimations() { + this._slider.remove_all_transitions(); + } + + _onDragStart() { + // The dash need to be above the top_window_group, otherwise it doesn't + // accept dnd of app icons when not in overiew mode. + Main.layoutManager.uiGroup.set_child_above_sibling(this, global.top_window_group); + this._oldignoreHover = this._ignoreHover; + this._ignoreHover = true; + this._animateIn(DockManager.settings.get_double('animation-time'), 0); + } + + _onDragEnd() { + // Restore drag default dash stack order + this._resetDepth(); + if (this._oldignoreHover !== null) + this._ignoreHover = this._oldignoreHover; + this._oldignoreHover = null; + this._box.sync_hover(); + if (Main.overview._shown) + this._pageChanged(); + } + + _pageChanged() { + let activePage = Main.overview.viewSelector.getActivePage(); + let dashVisible = (activePage == ViewSelector.ViewPage.WINDOWS || + activePage == ViewSelector.ViewPage.APPS); + + if (dashVisible) + this._animateIn(DockManager.settings.get_double('animation-time'), 0); + else + this._animateOut(DockManager.settings.get_double('animation-time'), 0); + } + + _onPageEmpty() { + /* The dash spacer is required only in the WINDOWS view if in the default position. + * The 'page-empty' signal is emitted in between a change of view, + * signalling the spacer can be added and removed without visible effect, + * as it's done for the upstream dashSpacer. + * + * Moreover, hiding the spacer ensure the appGrid allocaton is triggered. + * This matter as the appview spring animation is triggered by to first reallocaton of the appGrid, + * (See appDisplay.js, line 202 on GNOME Shell 3.14: + * this._grid.actor.connect('notify::allocation', ...) + * which in turn seems to be triggered by changes in the other actors in the overview. + * Normally, as far as I could understand, either the dashSpacer being hidden or the workspacesThumbnails + * sliding out would trigger the allocation. However, with no stock dash + * and no thumbnails, which happen if the user configured only 1 and static workspace, + * the animation out of icons is not played. + */ + + let activePage = Main.overview.viewSelector.getActivePage(); + this._dashSpacer.visible = (this._isHorizontal || activePage == ViewSelector.ViewPage.WINDOWS); + } + + /** + * Show dock and give key focus to it + */ + _onAccessibilityFocus() { + this._box.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false); + this._animateIn(DockManager.settings.get_double('animation-time'), 0); + } + + /** + * Keep ShowAppsButton status in sync with the overview status + */ + _syncShowAppsButtonToggled() { + let status = Main.overview.viewSelector._showAppsButton.checked; + if (this.dash.showAppsButton.checked !== status) + this.dash.showAppsButton.checked = status; + } + + // Optional features to be enabled only for the main Dock + _enableExtraFeatures() { + // Restore dash accessibility + Main.ctrlAltTabManager.addGroup( + this.dash, _('Dash'), 'user-bookmarks-symbolic', + {focusCallback: this._onAccessibilityFocus.bind(this)}); + } + + /** + * Switch workspace by scrolling over the dock + */ + _optionalScrollWorkspaceSwitch() { + let label = 'optionalScrollWorkspaceSwitch'; + + function isEnabled() { + return DockManager.settings.get_enum('scroll-action') === scrollAction.SWITCH_WORKSPACE; + } + + DockManager.settings.connect('changed::scroll-action', () => { + if (isEnabled.bind(this)()) + enable.bind(this)(); + else + disable.bind(this)(); + }); + + if (isEnabled.bind(this)()) + enable.bind(this)(); + + function enable() { + this._signalsHandler.removeWithLabel(label); + + this._signalsHandler.addWithLabel(label, [ + this._box, + 'scroll-event', + onScrollEvent.bind(this) + ]); + } + + function disable() { + this._signalsHandler.removeWithLabel(label); + + if (this._optionalScrollWorkspaceSwitchDeadTimeId) { + Mainloop.source_remove(this._optionalScrollWorkspaceSwitchDeadTimeId); + this._optionalScrollWorkspaceSwitchDeadTimeId = 0; + } + } + + // This was inspired to desktop-scroller@obsidien.github.com + function onScrollEvent(actor, event) { + // When in overview change workscape only in windows view + if (Main.overview.visible && Main.overview.viewSelector.getActivePage() !== ViewSelector.ViewPage.WINDOWS) + return false; + + let activeWs = global.workspace_manager.get_active_workspace(); + let direction = null; + + switch (event.get_scroll_direction()) { + case Clutter.ScrollDirection.UP: + direction = Meta.MotionDirection.UP; + break; + case Clutter.ScrollDirection.DOWN: + direction = Meta.MotionDirection.DOWN; + break; + case Clutter.ScrollDirection.SMOOTH: + let [dx, dy] = event.get_scroll_delta(); + if (dy < 0) + direction = Meta.MotionDirection.UP; + else if (dy > 0) + direction = Meta.MotionDirection.DOWN; + break; + } + + if (direction !== null) { + // Prevent scroll events from triggering too many workspace switches + // by adding a 250ms deadtime between each scroll event. + // Usefull on laptops when using a touchpad. + + // During the deadtime do nothing + if (this._optionalScrollWorkspaceSwitchDeadTimeId) + return false; + else + this._optionalScrollWorkspaceSwitchDeadTimeId = Mainloop.timeout_add(250, () => { + this._optionalScrollWorkspaceSwitchDeadTimeId = 0; + }); + + let ws; + + ws = activeWs.get_neighbor(direction) + + if (Main.wm._workspaceSwitcherPopup == null) + Main.wm._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); + // Set the actor non reactive, so that it doesn't prevent the + // clicks events from reaching the dash actor. I can't see a reason + // why it should be reactive. + Main.wm._workspaceSwitcherPopup.actor.reactive = false; + Main.wm._workspaceSwitcherPopup.connect('destroy', function() { + Main.wm._workspaceSwitcherPopup = null; + }); + + // Do not show wokspaceSwithcer in overview + if (!Main.overview.visible) + Main.wm._workspaceSwitcherPopup.display(direction, ws.index()); + Main.wm.actionMoveWorkspace(ws); + + return true; + } + else + return false; + } + } + + _activateApp(appIndex) { + let children = this.dash._box.get_children().filter(function(actor) { + return actor.child && + actor.child._delegate && + actor.child._delegate.app; + }); + + // Apps currently in the dash + let apps = children.map(function(actor) { + return actor.child._delegate; + }); + + // Activate with button = 1, i.e. same as left click + let button = 1; + if (appIndex < apps.length) + apps[appIndex].activate(button); + } +}); + +/* + * Handle keybaord shortcuts + */ +const DashToDock_KeyboardShortcuts_NUM_HOTKEYS = 10; + +var KeyboardShortcuts = class DashToDock_KeyboardShortcuts { + + constructor(allDocks){ + this._allDocks = allDocks; + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._hotKeysEnabled = false; + if (DockManager.settings.get_boolean('hot-keys')) + this._enableHotKeys(); + + this._signalsHandler.add([ + DockManager.settings, + 'changed::hot-keys', + () => { + if (DockManager.settings.get_boolean('hot-keys')) + this._enableHotKeys.bind(this)(); + else + this._disableHotKeys.bind(this)(); + } + ]); + + this._optionalNumberOverlay(); + } + + destroy() { + // Remove keybindings + this._disableHotKeys(); + this._disableExtraShortcut(); + this._signalsHandler.destroy(); + } + + _enableHotKeys() { + if (this._hotKeysEnabled) + return; + + // Setup keyboard bindings for dash elements + let keys = ['app-hotkey-', 'app-shift-hotkey-', 'app-ctrl-hotkey-']; + keys.forEach( function(key) { + for (let i = 0; i < DashToDock_KeyboardShortcuts_NUM_HOTKEYS; i++) { + let appNum = i; + Main.wm.addKeybinding(key + (i + 1), DockManager.settings, + Meta.KeyBindingFlags.NONE, + Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, + () => { + this._allDocks[0]._activateApp(appNum); + this._showOverlay(); + }); + } + }, this); + + this._hotKeysEnabled = true; + } + + _disableHotKeys() { + if (!this._hotKeysEnabled) + return; + + let keys = ['app-hotkey-', 'app-shift-hotkey-', 'app-ctrl-hotkey-']; + keys.forEach( function(key) { + for (let i = 0; i < DashToDock_KeyboardShortcuts_NUM_HOTKEYS; i++) + Main.wm.removeKeybinding(key + (i + 1)); + }, this); + + this._hotKeysEnabled = false; + } + + _optionalNumberOverlay() { + let settings = DockManager.settings; + this._shortcutIsSet = false; + // Enable extra shortcut if either 'overlay' or 'show-dock' are true + if (settings.get_boolean('hot-keys') && + (settings.get_boolean('hotkeys-overlay') || settings.get_boolean('hotkeys-show-dock'))) + this._enableExtraShortcut(); + + this._signalsHandler.add([ + settings, + 'changed::hot-keys', + this._checkHotkeysOptions.bind(this) + ], [ + settings, + 'changed::hotkeys-overlay', + this._checkHotkeysOptions.bind(this) + ], [ + settings, + 'changed::hotkeys-show-dock', + this._checkHotkeysOptions.bind(this) + ]); + } + + _checkHotkeysOptions() { + let settings = DockManager.settings; + + if (settings.get_boolean('hot-keys') && + (settings.get_boolean('hotkeys-overlay') || settings.get_boolean('hotkeys-show-dock'))) + this._enableExtraShortcut(); + else + this._disableExtraShortcut(); + } + + _enableExtraShortcut() { + if (!this._shortcutIsSet) { + Main.wm.addKeybinding('shortcut', DockManager.settings, + Meta.KeyBindingFlags.NONE, + Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, + this._showOverlay.bind(this)); + this._shortcutIsSet = true; + } + } + + _disableExtraShortcut() { + if (this._shortcutIsSet) { + Main.wm.removeKeybinding('shortcut'); + this._shortcutIsSet = false; + } + } + + _showOverlay() { + for (let i = 0; i < this._allDocks.length; i++) { + let dock = this._allDocks[i]; + if (dock._settings.get_boolean('hotkeys-overlay')) + dock.dash.toggleNumberOverlay(true); + + // Restart the counting if the shortcut is pressed again + if (dock._numberOverlayTimeoutId) { + Mainloop.source_remove(dock._numberOverlayTimeoutId); + dock._numberOverlayTimeoutId = 0; + } + + // Hide the overlay/dock after the timeout + let timeout = dock._settings.get_double('shortcut-timeout') * 1000; + dock._numberOverlayTimeoutId = Mainloop.timeout_add(timeout, () => { + dock._numberOverlayTimeoutId = 0; + dock.dash.toggleNumberOverlay(false); + // Hide the dock again if necessary + dock._updateDashVisibility(); + }); + + // Show the dock if it is hidden + if (dock._settings.get_boolean('hotkeys-show-dock')) { + let showDock = (dock._intellihideIsEnabled || dock._autohideIsEnabled); + if (showDock) + dock._show(); + } + } + } +}; + +/** + * Isolate overview to open new windows for inactive apps + * Note: the future implementaion is not fully contained here. Some bits are around in other methods of other classes. + * This class just take care of enabling/disabling the option. + */ +var WorkspaceIsolation = class DashToDock_WorkspaceIsolation { + + constructor(allDocks) { + + let settings = DockManager.settings; + this._allDocks = allDocks; + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._injectionsHandler = new Utils.InjectionsHandler(); + + this._signalsHandler.add([ + settings, + 'changed::isolate-workspaces', + () => { + this._allDocks.forEach(function(dock) { + dock.dash.resetAppIcons(); + }); + if (settings.get_boolean('isolate-workspaces') || + settings.get_boolean('isolate-monitors')) + this._enable.bind(this)(); + else + this._disable.bind(this)(); + } + ],[ + settings, + 'changed::isolate-monitors', + () => { + this._allDocks.forEach(function(dock) { + dock.dash.resetAppIcons(); + }); + if (settings.get_boolean('isolate-workspaces') || + settings.get_boolean('isolate-monitors')) + this._enable.bind(this)(); + else + this._disable.bind(this)(); + } + ]); + + if (settings.get_boolean('isolate-workspaces') || + settings.get_boolean('isolate-monitors')) + this._enable(); + + } + + _enable() { + + // ensure I never double-register/inject + // although it should never happen + this._disable(); + + this._allDocks.forEach(function(dock) { + this._signalsHandler.addWithLabel('isolation', [ + global.display, + 'restacked', + dock.dash._queueRedisplay.bind(dock.dash) + ], [ + global.window_manager, + 'switch-workspace', + dock.dash._queueRedisplay.bind(dock.dash) + ]); + + // This last signal is only needed for monitor isolation, as windows + // might migrate from one monitor to another without triggering 'restacked' + if (DockManager.settings.get_boolean('isolate-monitors')) + this._signalsHandler.addWithLabel('isolation', [ + global.display, + 'window-entered-monitor', + dock.dash._queueRedisplay.bind(dock.dash) + ]); + + }, this); + + // here this is the Shell.App + function IsolatedOverview() { + // These lines take care of Nautilus for icons on Desktop + let windows = this.get_windows().filter(function(w) { + return w.get_workspace().index() == global.workspace_manager.get_active_workspace_index(); + }); + if (windows.length == 1) + if (windows[0].skip_taskbar) + return this.open_new_window(-1); + + if (this.is_on_workspace(global.workspace_manager.get_active_workspace())) + return Main.activateWindow(windows[0]); + return this.open_new_window(-1); + } + + this._injectionsHandler.addWithLabel('isolation', [ + Shell.App.prototype, + 'activate', + IsolatedOverview + ]); + } + + _disable () { + this._signalsHandler.removeWithLabel('isolation'); + this._injectionsHandler.removeWithLabel('isolation'); + } + + destroy() { + this._signalsHandler.destroy(); + this._injectionsHandler.destroy(); + } +}; + + +var DockManager = class DashToDock_DockManager { + + constructor() { + if (Me.imports.extension.dockManager) + throw new Error('DashToDock has been already initialized'); + + Me.imports.extension.dockManager = this; + + this._remoteModel = new LauncherAPI.LauncherEntryRemoteModel(); + this._settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.dash-to-dock'); + this._oldDash = Main.overview._dash; + this._ensureFileManagerClient(); + + /* Array of all the docks created */ + this._allDocks = []; + this._createDocks(); + + // status variable: true when the overview is shown through the dash + // applications button. + this._forcedOverview = false; + + // Connect relevant signals to the toggling function + this._bindSettingsChanges(); + } + + static getDefault() { + return Me.imports.extension.dockManager + } + + static get settings() { + return DockManager.getDefault()._settings; + } + + get fm1Client() { + return this._fm1Client; + } + + _ensureFileManagerClient() { + let supportsLocations = ['show-trash', 'show-mounts'].some((s) => { + return this._settings.get_boolean(s); + }); + + if (supportsLocations) { + if (!this._fm1Client) + this._fm1Client = new FileManager1API.FileManager1Client(); + } else if (this._fm1Client) { + this._fm1Client.destroy(); + this._fm1Client = null; + } + } + + _toggle() { + this._deleteDocks(); + this._createDocks(); + this.emit('toggled'); + } + + _bindSettingsChanges() { + // Connect relevant signals to the toggling function + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._signalsHandler.add([ + Meta.MonitorManager.get(), + 'monitors-changed', + this._toggle.bind(this) + ], [ + this._settings, + 'changed::multi-monitor', + this._toggle.bind(this) + ], [ + this._settings, + 'changed::preferred-monitor', + this._toggle.bind(this) + ], [ + this._settings, + 'changed::dock-position', + this._toggle.bind(this) + ], [ + this._settings, + 'changed::extend-height', + this._adjustPanelCorners.bind(this) + ], [ + this._settings, + 'changed::dock-fixed', + this._adjustPanelCorners.bind(this) + ], [ + this._settings, + 'changed::show-trash', + () => this._ensureFileManagerClient() + ], [ + this._settings, + 'changed::show-mounts', + () => this._ensureFileManagerClient() + ], ); + } + + _createDocks() { + + // If there are no monitors (headless configurations, but it can also happen temporary while disconnecting + // and reconnecting monitors), just do nothing. When a monitor will be connected we we'll be notified and + // and thus create the docks. This prevents pointing trying to access monitors throughout the code, were we + // are assuming that at least the primary monitor is present. + if (Main.layoutManager.monitors.length <= 0) { + return; + } + + this._preferredMonitorIndex = this._settings.get_int('preferred-monitor'); + // In case of multi-monitor, we consider the dock on the primary monitor to be the preferred (main) one + // regardless of the settings + // The dock goes on the primary monitor also if the settings are incosistent (e.g. desired monitor not connected). + if (this._settings.get_boolean('multi-monitor') || + this._preferredMonitorIndex < 0 || this._preferredMonitorIndex > Main.layoutManager.monitors.length - 1 + ) { + this._preferredMonitorIndex = Main.layoutManager.primaryIndex; + } else { + // Gdk and shell monitors numbering differ at least under wayland: + // While the primary monitor appears to be always index 0 in Gdk, + // the shell can assign a different number (Main.layoutManager.primaryMonitor) + // This ensure the indexing in the settings (Gdk) and in the shell are matched, + // i.e. that we start counting from the primaryMonitorIndex + this._preferredMonitorIndex = (Main.layoutManager.primaryIndex + this._preferredMonitorIndex) % Main.layoutManager.monitors.length ; + } + + // First we create the main Dock, to get the extra features to bind to this one + let dock = new DockedDash(this._remoteModel, this._preferredMonitorIndex); + this._allDocks.push(dock); + + // connect app icon into the view selector + dock.dash.showAppsButton.connect('notify::checked', this._onShowAppsButtonToggled.bind(this)); + + // Make the necessary changes to Main.overview._dash + this._prepareMainDash(); + + // Adjust corners if necessary + this._adjustPanelCorners(); + + if (this._settings.get_boolean('multi-monitor')) { + let nMon = Main.layoutManager.monitors.length; + for (let iMon = 0; iMon < nMon; iMon++) { + if (iMon == this._preferredMonitorIndex) + continue; + let dock = new DockedDash(this._remoteModel, iMon); + this._allDocks.push(dock); + // connect app icon into the view selector + dock.dash.showAppsButton.connect('notify::checked', this._onShowAppsButtonToggled.bind(this)); + } + } + + // Load optional features. We load *after* the docks are created, since + // we need to connect the signals to all dock instances. + this._workspaceIsolation = new WorkspaceIsolation(this._allDocks); + this._keyboardShortcuts = new KeyboardShortcuts(this._allDocks); + } + + _prepareMainDash() { + // Pretend I'm the dash: meant to make appgrd swarm animation come from the + // right position of the appShowButton. + Main.overview._dash = this._allDocks[0].dash; + + // set stored icon size to the new dash + Main.overview.dashIconSize = this._allDocks[0].dash.iconSize; + + // Hide usual Dash + Main.overview._controls.dash.actor.hide(); + + // Also set dash width to 1, so it's almost not taken into account by code + // calculaing the reserved space in the overview. The reason to keep it at 1 is + // to allow its visibility change to trigger an allocaion of the appGrid which + // in turn is triggergin the appsIcon spring animation, required when no other + // actors has this effect, i.e in horizontal mode and without the workspaceThumnails + // 1 static workspace only) + Main.overview._controls.dash.actor.set_width(1); + } + + _deleteDocks() { + // Remove extra features + this._workspaceIsolation.destroy(); + this._keyboardShortcuts.destroy(); + + // Delete all docks + let nDocks = this._allDocks.length; + for (let i = nDocks-1; i >= 0; i--) { + this._allDocks[i].destroy(); + this._allDocks.pop(); + } + } + + _restoreDash() { + Main.overview._controls.dash.actor.show(); + Main.overview._controls.dash.actor.set_width(-1); //reset default dash size + // This force the recalculation of the icon size + Main.overview._controls.dash._maxHeight = -1; + + // reset stored icon size to the default dash + Main.overview.dashIconSize = Main.overview._controls.dash.iconSize; + + Main.overview._dash = this._oldDash; + } + + _onShowAppsButtonToggled(button) { + // Sync the status of the default appButtons. Only if the two statuses are + // different, that means the user interacted with the extension provided + // application button, cutomize the behaviour. Otherwise the shell has changed the + // status (due to the _syncShowAppsButtonToggled function below) and it + // has already performed the desired action. + + let animate = this._settings.get_boolean('animate-show-apps'); + let selector = Main.overview.viewSelector; + + if (selector._showAppsButton.checked !== button.checked) { + // find visible view + let visibleView; + Main.overview.viewSelector.appDisplay._views.every(function(v, index) { + if (v.view.actor.visible) { + visibleView = index; + return false; + } + else + return true; + }); + + if (button.checked) { + // force spring animation triggering.By default the animation only + // runs if we are already inside the overview. + if (!Main.overview._shown) { + this._forcedOverview = true; + let view = Main.overview.viewSelector.appDisplay._views[visibleView].view; + let grid = view._grid; + if (animate) { + // Animate in the the appview, hide the appGrid to avoiud flashing + // Go to the appView before entering the overview, skipping the workspaces. + // Do this manually avoiding opacity in transitions so that the setting of the opacity + // to 0 doesn't get overwritten. + Main.overview.viewSelector._activePage.opacity = 0; + Main.overview.viewSelector._activePage.hide(); + Main.overview.viewSelector._activePage = Main.overview.viewSelector._appsPage; + Main.overview.viewSelector._activePage.show(); + grid.opacity = 0; + + // The animation has to be trigered manually because the AppDisplay.animate + // method is waiting for an allocation not happening, as we skip the workspace view + // and the appgrid could already be allocated from previous shown. + // It has to be triggered after the overview is shown as wrong coordinates are obtained + // otherwise. + let overviewShownId = Main.overview.connect('shown', () => { + Main.overview.disconnect(overviewShownId); + Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { + grid.opacity = 255; + grid.animateSpring(IconGrid.AnimationDirection.IN, this._allDocks[0].dash.showAppsButton); + }); + }); + } + else { + Main.overview.viewSelector._activePage = Main.overview.viewSelector._appsPage; + Main.overview.viewSelector._activePage.show(); + grid.opacity = 255; + } + + } + + // Finally show the overview + selector._showAppsButton.checked = true; + Main.overview.show(); + } + else { + if (this._forcedOverview) { + // force exiting overview if needed + + if (animate) { + // Manually trigger springout animation without activating the + // workspaceView to avoid the zoomout animation. Hide the appPage + // onComplete to avoid ugly flashing of original icons. + let view = Main.overview.viewSelector.appDisplay._views[visibleView].view; + view.animate(IconGrid.AnimationDirection.OUT, () => { + Main.overview.viewSelector._appsPage.hide(); + Main.overview.hide(); + selector._showAppsButton.checked = false; + this._forcedOverview = false; + }); + } + else { + Main.overview.hide(); + this._forcedOverview = false; + } + } + else { + selector._showAppsButton.checked = false; + this._forcedOverview = false; + } + } + } + + // whenever the button is unactivated even if not by the user still reset the + // forcedOverview flag + if (button.checked == false) + this._forcedOverview = false; + } + + destroy() { + this._signalsHandler.destroy(); + this._deleteDocks(); + this._revertPanelCorners(); + this._restoreDash(); + if (this._fm1Client) { + this._fm1Client.destroy(); + this._fm1Client = null; + } + this._remoteModel.destroy(); + this._settings.run_dispose(); + this._settings = null; + + Me.imports.extension.dockManager = null; + } + + /** + * Adjust Panel corners + */ + _adjustPanelCorners() { + let position = Utils.getPosition(); + let isHorizontal = ((position == St.Side.TOP) || (position == St.Side.BOTTOM)); + let extendHeight = this._settings.get_boolean('extend-height'); + let fixedIsEnabled = this._settings.get_boolean('dock-fixed'); + let dockOnPrimary = this._settings.get_boolean('multi-monitor') || + this._preferredMonitorIndex == Main.layoutManager.primaryIndex; + + if (!isHorizontal && dockOnPrimary && extendHeight && fixedIsEnabled) { + Main.panel._rightCorner.actor.hide(); + Main.panel._leftCorner.actor.hide(); + } + else + this._revertPanelCorners(); + } + + _revertPanelCorners() { + Main.panel._leftCorner.actor.show(); + Main.panel._rightCorner.actor.show(); + } +}; +Signals.addSignalMethods(DockManager.prototype); diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/extension.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/extension.js new file mode 100644 index 00000000..0b7b5c63 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/extension.js @@ -0,0 +1,21 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; + +// We declare this with var so it can be accessed by other extensions in +// GNOME Shell 3.26+ (mozjs52+). +var dockManager; + +function init() { + ExtensionUtils.initTranslations('dashtodock'); +} + +function enable() { + new Docking.DockManager(); +} + +function disable() { + dockManager.destroy(); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/fileManager1API.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/fileManager1API.js new file mode 100644 index 00000000..2b9bbe88 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/fileManager1API.js @@ -0,0 +1,217 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Gio = imports.gi.Gio; +const Signals = imports.signals; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Utils = Me.imports.utils; + +const FileManager1Iface = '\ + \ + \ + '; + +const FileManager1Proxy = Gio.DBusProxy.makeProxyWrapper(FileManager1Iface); + +/** + * This class implements a client for the org.freedesktop.FileManager1 dbus + * interface, and specifically for the OpenWindowsWithLocations property + * which is published by Nautilus, but is not an official part of the interface. + * + * The property is a map from window identifiers to a list of locations open in + * the window. + * + * While OpeWindowsWithLocations is part of upstream Nautilus, for many years + * prior, Ubuntu patched Nautilus to publish XUbuntuOpenLocationsXids, which is + * similar but uses Xids as the window identifiers instead of gtk window paths. + * + * When an old or unpatched Nautilus is running, we will observe the properties + * to always be empty arrays, but there will not be any correctness issues. + */ +var FileManager1Client = class DashToDock_FileManager1Client { + + constructor() { + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._locationMap = new Map(); + this._proxy = new FileManager1Proxy(Gio.DBus.session, + "org.freedesktop.FileManager1", + "/org/freedesktop/FileManager1", + (initable, error) => { + // Use async construction to avoid blocking on errors. + if (error) { + global.log(error); + } else { + this._updateLocationMap(); + } + }); + + this._signalsHandler.add([ + this._proxy, + 'g-properties-changed', + this._onPropertyChanged.bind(this) + ], [ + // We must additionally listen for Screen events to know when to + // rebuild our location map when the set of available windows changes. + global.workspace_manager, + 'workspace-switched', + this._updateLocationMap.bind(this) + ], [ + global.display, + 'window-entered-monitor', + this._updateLocationMap.bind(this) + ], [ + global.display, + 'window-left-monitor', + this._updateLocationMap.bind(this) + ]); + } + + destroy() { + this._signalsHandler.destroy(); + this._proxy.run_dispose(); + } + + /** + * Return an array of windows that are showing a location or + * sub-directories of that location. + */ + getWindows(location) { + let ret = new Set(); + for (let [k,v] of this._locationMap) { + if (k.startsWith(location)) { + for (let l of v) { + ret.add(l); + } + } + } + return Array.from(ret); + } + + _onPropertyChanged(proxy, changed, invalidated) { + let property = changed.unpack(); + if (property && + ('XUbuntuOpenLocationsXids' in property || + 'OpenWindowsWithLocations' in property)) { + this._updateLocationMap(); + } + } + + _updateLocationMap() { + let properties = this._proxy.get_cached_property_names(); + if (properties == null) { + // Nothing to check yet. + return; + } + + if (properties.includes('OpenWindowsWithLocations')) { + this._updateFromPaths(); + } else if (properties.includes('XUbuntuOpenLocationsXids')) { + this._updateFromXids(); + } + } + + _updateFromPaths() { + let pathToLocations = this._proxy.OpenWindowsWithLocations; + let pathToWindow = getPathToWindow(); + + let locationToWindow = new Map(); + for (let path in pathToLocations) { + let locations = pathToLocations[path]; + for (let i = 0; i < locations.length; i++) { + let l = locations[i]; + // Use a set to deduplicate when a window has a + // location open in multiple tabs. + if (!locationToWindow.has(l)) { + locationToWindow.set(l, new Set()); + } + let window = pathToWindow.get(path); + if (window != null) { + locationToWindow.get(l).add(window); + } + } + } + this._locationMap = locationToWindow; + this.emit('windows-changed'); + } + + _updateFromXids() { + let xidToLocations = this._proxy.XUbuntuOpenLocationsXids; + let xidToWindow = getXidToWindow(); + + let locationToWindow = new Map(); + for (let xid in xidToLocations) { + let locations = xidToLocations[xid]; + for (let i = 0; i < locations.length; i++) { + let l = locations[i]; + // Use a set to deduplicate when a window has a + // location open in multiple tabs. + if (!locationToWindow.has(l)) { + locationToWindow.set(l, new Set()); + } + let window = xidToWindow.get(parseInt(xid)); + if (window != null) { + locationToWindow.get(l).add(window); + } + } + } + this._locationMap = locationToWindow; + this.emit('windows-changed'); + } +} +Signals.addSignalMethods(FileManager1Client.prototype); + +/** + * Construct a map of gtk application window object paths to MetaWindows. + */ +function getPathToWindow() { + let pathToWindow = new Map(); + + for (let i = 0; i < global.workspace_manager.n_workspaces; i++) { + let ws = global.workspace_manager.get_workspace_by_index(i); + ws.list_windows().map(function(w) { + let path = w.get_gtk_window_object_path(); + if (path != null) { + pathToWindow.set(path, w); + } + }); + } + return pathToWindow; +} + +/** + * Construct a map of XIDs to MetaWindows. + * + * This is somewhat annoying as you cannot lookup a window by + * XID in any way, and must iterate through all of them looking + * for a match. + */ +function getXidToWindow() { + let xidToWindow = new Map(); + + for (let i = 0; i < global.workspace_manager.n_workspaces; i++) { + let ws = global.workspace_manager.get_workspace_by_index(i); + ws.list_windows().map(function(w) { + let xid = guessWindowXID(w); + if (xid != null) { + xidToWindow.set(parseInt(xid), w); + } + }); + } + return xidToWindow; +} + +/** + * Guesses the X ID of a window. + * + * This is the basic implementation that is sufficient for Nautilus + * windows. The pixel-saver extension has a much more complex + * implementation if we ever need it. + */ +function guessWindowXID(win) { + try { + return win.get_description().match(/0x[0-9a-f]+/)[0]; + } catch (err) { + return null; + } +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/intellihide.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/intellihide.js new file mode 100644 index 00000000..2fd700ba --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/intellihide.js @@ -0,0 +1,321 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const GLib = imports.gi.GLib; +const Mainloop = imports.mainloop; +const Meta = imports.gi.Meta; +const Shell = imports.gi.Shell; + +const Main = imports.ui.main; +const Signals = imports.signals; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; +const Utils = Me.imports.utils; + +// A good compromise between reactivity and efficiency; to be tuned. +const INTELLIHIDE_CHECK_INTERVAL = 100; + +const OverlapStatus = { + UNDEFINED: -1, + FALSE: 0, + TRUE: 1 +}; + +const IntellihideMode = { + ALL_WINDOWS: 0, + FOCUS_APPLICATION_WINDOWS: 1, + MAXIMIZED_WINDOWS : 2 +}; + +// List of windows type taken into account. Order is important (keep the original +// enum order). +const handledWindowTypes = [ + Meta.WindowType.NORMAL, + Meta.WindowType.DOCK, + Meta.WindowType.DIALOG, + Meta.WindowType.MODAL_DIALOG, + Meta.WindowType.TOOLBAR, + Meta.WindowType.MENU, + Meta.WindowType.UTILITY, + Meta.WindowType.SPLASHSCREEN +]; + +/** + * A rough and ugly implementation of the intellihide behaviour. + * Intallihide object: emit 'status-changed' signal when the overlap of windows + * with the provided targetBoxClutter.ActorBox changes; + */ +var Intellihide = class DashToDock_Intellihide { + + constructor(monitorIndex) { + // Load settings + this._monitorIndex = monitorIndex; + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._tracker = Shell.WindowTracker.get_default(); + this._focusApp = null; // The application whose window is focused. + this._topApp = null; // The application whose window is on top on the monitor with the dock. + + this._isEnabled = false; + this.status = OverlapStatus.UNDEFINED; + this._targetBox = null; + + this._checkOverlapTimeoutContinue = false; + this._checkOverlapTimeoutId = 0; + + this._trackedWindows = new Map(); + + // Connect global signals + this._signalsHandler.add([ + // Add signals on windows created from now on + global.display, + 'window-created', + this._windowCreated.bind(this) + ], [ + // triggered for instance when the window list order changes, + // included when the workspace is switched + global.display, + 'restacked', + this._checkOverlap.bind(this) + ], [ + // when windows are alwasy on top, the focus window can change + // without the windows being restacked. Thus monitor window focus change. + this._tracker, + 'notify::focus-app', + this._checkOverlap.bind(this) + ], [ + // update wne monitor changes, for instance in multimonitor when monitor are attached + Meta.MonitorManager.get(), + 'monitors-changed', + this._checkOverlap.bind(this) + ]); + } + + destroy() { + // Disconnect global signals + this._signalsHandler.destroy(); + + // Remove residual windows signals + this.disable(); + } + + enable() { + this._isEnabled = true; + this._status = OverlapStatus.UNDEFINED; + global.get_window_actors().forEach(function(wa) { + this._addWindowSignals(wa); + }, this); + this._doCheckOverlap(); + } + + disable() { + this._isEnabled = false; + + for (let wa of this._trackedWindows.keys()) { + this._removeWindowSignals(wa); + } + this._trackedWindows.clear(); + + if (this._checkOverlapTimeoutId > 0) { + Mainloop.source_remove(this._checkOverlapTimeoutId); + this._checkOverlapTimeoutId = 0; + } + } + + _windowCreated(display, metaWindow) { + this._addWindowSignals(metaWindow.get_compositor_private()); + } + + _addWindowSignals(wa) { + if (!this._handledWindow(wa)) + return; + let signalId = wa.connect('allocation-changed', this._checkOverlap.bind(this)); + this._trackedWindows.set(wa, signalId); + wa.connect('destroy', this._removeWindowSignals.bind(this)); + } + + _removeWindowSignals(wa) { + if (this._trackedWindows.get(wa)) { + wa.disconnect(this._trackedWindows.get(wa)); + this._trackedWindows.delete(wa); + } + + } + + updateTargetBox(box) { + this._targetBox = box; + this._checkOverlap(); + } + + forceUpdate() { + this._status = OverlapStatus.UNDEFINED; + this._doCheckOverlap(); + } + + getOverlapStatus() { + return (this._status == OverlapStatus.TRUE); + } + + _checkOverlap() { + if (!this._isEnabled || (this._targetBox == null)) + return; + + /* Limit the number of calls to the doCheckOverlap function */ + if (this._checkOverlapTimeoutId) { + this._checkOverlapTimeoutContinue = true; + return + } + + this._doCheckOverlap(); + + this._checkOverlapTimeoutId = Mainloop.timeout_add(INTELLIHIDE_CHECK_INTERVAL, () => { + this._doCheckOverlap(); + if (this._checkOverlapTimeoutContinue) { + this._checkOverlapTimeoutContinue = false; + return GLib.SOURCE_CONTINUE; + } else { + this._checkOverlapTimeoutId = 0; + return GLib.SOURCE_REMOVE; + } + }); + } + + _doCheckOverlap() { + + if (!this._isEnabled || (this._targetBox == null)) + return; + + let overlaps = OverlapStatus.FALSE; + let windows = global.get_window_actors(); + + if (windows.length > 0) { + /* + * Get the top window on the monitor where the dock is placed. + * The idea is that we dont want to overlap with the windows of the topmost application, + * event is it's not the focused app -- for instance because in multimonitor the user + * select a window in the secondary monitor. + */ + + let topWindow = null; + for (let i = windows.length - 1; i >= 0; i--) { + let meta_win = windows[i].get_meta_window(); + if (this._handledWindow(windows[i]) && (meta_win.get_monitor() == this._monitorIndex)) { + topWindow = meta_win; + break; + } + } + + if (topWindow !== null) { + this._topApp = this._tracker.get_window_app(topWindow); + // If there isn't a focused app, use that of the window on top + this._focusApp = this._tracker.focus_app || this._topApp + + windows = windows.filter(this._intellihideFilterInteresting, this); + + for (let i = 0; i < windows.length; i++) { + let win = windows[i].get_meta_window(); + + if (win) { + let rect = win.get_frame_rect(); + + let test = (rect.x < this._targetBox.x2) && + (rect.x + rect.width > this._targetBox.x1) && + (rect.y < this._targetBox.y2) && + (rect.y + rect.height > this._targetBox.y1); + + if (test) { + overlaps = OverlapStatus.TRUE; + break; + } + } + } + } + } + + if (this._status !== overlaps) { + this._status = overlaps; + this.emit('status-changed', this._status); + } + + } + + // Filter interesting windows to be considered for intellihide. + // Consider all windows visible on the current workspace. + // Optionally skip windows of other applications + _intellihideFilterInteresting(wa) { + let meta_win = wa.get_meta_window(); + if (!this._handledWindow(wa)) + return false; + + let currentWorkspace = global.workspace_manager.get_active_workspace_index(); + let wksp = meta_win.get_workspace(); + let wksp_index = wksp.index(); + + // Depending on the intellihide mode, exclude non-relevent windows + switch (Docking.DockManager.settings.get_enum('intellihide-mode')) { + case IntellihideMode.ALL_WINDOWS: + // Do nothing + break; + + case IntellihideMode.FOCUS_APPLICATION_WINDOWS: + // Skip windows of other apps + if (this._focusApp) { + // The DropDownTerminal extension is not an application per se + // so we match its window by wm class instead + if (meta_win.get_wm_class() == 'DropDownTerminalWindow') + return true; + + let currentApp = this._tracker.get_window_app(meta_win); + let focusWindow = global.display.get_focus_window() + + // Consider half maximized windows side by side + // and windows which are alwayson top + if((currentApp != this._focusApp) && (currentApp != this._topApp) + && !((focusWindow && focusWindow.maximized_vertically && !focusWindow.maximized_horizontally) + && (meta_win.maximized_vertically && !meta_win.maximized_horizontally) + && meta_win.get_monitor() == focusWindow.get_monitor()) + && !meta_win.is_above()) + return false; + } + break; + + case IntellihideMode.MAXIMIZED_WINDOWS: + // Skip unmaximized windows + if (!meta_win.maximized_vertically && !meta_win.maximized_horizontally) + return false; + break; + } + + if ( wksp_index == currentWorkspace && meta_win.showing_on_its_workspace() ) + return true; + else + return false; + + } + + // Filter windows by type + // inspired by Opacify@gnome-shell.localdomain.pl + _handledWindow(wa) { + let metaWindow = wa.get_meta_window(); + + if (!metaWindow) + return false; + + // The DropDownTerminal extension uses the POPUP_MENU window type hint + // so we match its window by wm class instead + if (metaWindow.get_wm_class() == 'DropDownTerminalWindow') + return true; + + let wtype = metaWindow.get_window_type(); + for (let i = 0; i < handledWindowTypes.length; i++) { + var hwtype = handledWindowTypes[i]; + if (hwtype == wtype) + return true; + else if (hwtype > wtype) + return false; + } + return false; + } +}; + +Signals.addSignalMethods(Intellihide.prototype); diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/launcherAPI.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/launcherAPI.js new file mode 100644 index 00000000..f0b61990 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/launcherAPI.js @@ -0,0 +1,239 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Gio = imports.gi.Gio; +const Signals = imports.signals; + +var LauncherEntryRemoteModel = class DashToDock_LauncherEntryRemoteModel { + + constructor() { + this._entriesByDBusName = {}; + + this._launcher_entry_dbus_signal_id = + Gio.DBus.session.signal_subscribe(null, // sender + 'com.canonical.Unity.LauncherEntry', // iface + null, // member + null, // path + null, // arg0 + Gio.DBusSignalFlags.NONE, + this._onEntrySignalReceived.bind(this)); + + this._dbus_name_owner_changed_signal_id = + Gio.DBus.session.signal_subscribe('org.freedesktop.DBus', // sender + 'org.freedesktop.DBus', // interface + 'NameOwnerChanged', // member + '/org/freedesktop/DBus', // path + null, // arg0 + Gio.DBusSignalFlags.NONE, + this._onDBusNameOwnerChanged.bind(this)); + + this._acquireUnityDBus(); + } + + destroy() { + if (this._launcher_entry_dbus_signal_id) { + Gio.DBus.session.signal_unsubscribe(this._launcher_entry_dbus_signal_id); + } + + if (this._dbus_name_owner_changed_signal_id) { + Gio.DBus.session.signal_unsubscribe(this._dbus_name_owner_changed_signal_id); + } + + this._releaseUnityDBus(); + } + + size() { + return Object.keys(this._entriesByDBusName).length; + } + + lookupByDBusName(dbusName) { + return this._entriesByDBusName.hasOwnProperty(dbusName) ? this._entriesByDBusName[dbusName] : null; + } + + lookupById(appId) { + let ret = []; + for (let dbusName in this._entriesByDBusName) { + let entry = this._entriesByDBusName[dbusName]; + if (entry && entry.appId() == appId) { + ret.push(entry); + } + } + + return ret; + } + + addEntry(entry) { + let existingEntry = this.lookupByDBusName(entry.dbusName()); + if (existingEntry) { + existingEntry.update(entry); + } else { + this._entriesByDBusName[entry.dbusName()] = entry; + this.emit('entry-added', entry); + } + } + + removeEntry(entry) { + delete this._entriesByDBusName[entry.dbusName()] + this.emit('entry-removed', entry); + } + + _acquireUnityDBus() { + if (!this._unity_bus_id) { + Gio.DBus.session.own_name('com.canonical.Unity', + Gio.BusNameOwnerFlags.ALLOW_REPLACEMENT, null, null); + } + } + + _releaseUnityDBus() { + if (this._unity_bus_id) { + Gio.DBus.session.unown_name(this._unity_bus_id); + this._unity_bus_id = 0; + } + } + + _onEntrySignalReceived(connection, sender_name, object_path, + interface_name, signal_name, parameters, user_data) { + if (!parameters || !signal_name) + return; + + if (signal_name == 'Update') { + if (!sender_name) { + return; + } + + this._handleUpdateRequest(sender_name, parameters); + } + } + + _onDBusNameOwnerChanged(connection, sender_name, object_path, + interface_name, signal_name, parameters, user_data) { + if (!parameters || !this.size()) + return; + + let [name, before, after] = parameters.deep_unpack(); + + if (!after) { + if (this._entriesByDBusName.hasOwnProperty(before)) { + this.removeEntry(this._entriesByDBusName[before]); + } + } + } + + _handleUpdateRequest(senderName, parameters) { + if (!senderName || !parameters) { + return; + } + + let [appUri, properties] = parameters.deep_unpack(); + let appId = appUri.replace(/(^\w+:|^)\/\//, ''); + let entry = this.lookupByDBusName(senderName); + + if (entry) { + entry.setDBusName(senderName); + entry.update(properties); + } else { + let entry = new LauncherEntryRemote(senderName, appId, properties); + this.addEntry(entry); + } + } +}; +Signals.addSignalMethods(LauncherEntryRemoteModel.prototype); + +var LauncherEntryRemote = class DashToDock_LauncherEntryRemote { + + constructor(dbusName, appId, properties) { + this._dbusName = dbusName; + this._appId = appId; + this._count = 0; + this._countVisible = false; + this._progress = 0.0; + this._progressVisible = false; + this.update(properties); + } + + appId() { + return this._appId; + } + + dbusName() { + return this._dbusName; + } + + count() { + return this._count; + } + + setCount(count) { + if (this._count != count) { + this._count = count; + this.emit('count-changed', this._count); + } + } + + countVisible() { + return this._countVisible; + } + + setCountVisible(countVisible) { + if (this._countVisible != countVisible) { + this._countVisible = countVisible; + this.emit('count-visible-changed', this._countVisible); + } + } + + progress() { + return this._progress; + } + + setProgress(progress) { + if (this._progress != progress) { + this._progress = progress; + this.emit('progress-changed', this._progress); + } + } + + progressVisible() { + return this._progressVisible; + } + + setProgressVisible(progressVisible) { + if (this._progressVisible != progressVisible) { + this._progressVisible = progressVisible; + this.emit('progress-visible-changed', this._progressVisible); + } + } + + setDBusName(dbusName) { + if (this._dbusName != dbusName) { + let oldName = this._dbusName; + this._dbusName = dbusName; + this.emit('dbus-name-changed', oldName); + } + } + + update(other) { + if (other instanceof LauncherEntryRemote) { + this.setDBusName(other.dbusName()) + this.setCount(other.count()); + this.setCountVisible(other.countVisible()); + this.setProgress(other.progress()); + this.setProgressVisible(other.progressVisible()) + } else { + for (let property in other) { + if (other.hasOwnProperty(property)) { + if (property == 'count') { + this.setCount(other[property].get_int64()); + } else if (property == 'count-visible') { + this.setCountVisible(other[property].get_boolean()); + } if (property == 'progress') { + this.setProgress(other[property].get_double()); + } else if (property == 'progress-visible') { + this.setProgressVisible(other[property].get_boolean()); + } else { + // Not implemented yet + } + } + } + } + } +}; +Signals.addSignalMethods(LauncherEntryRemote.prototype); diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ar/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ar/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..15b1360f Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ar/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/cs/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/cs/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..e5ac24b3 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/cs/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/de/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/de/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..f7b2ed5d Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/de/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/el/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/el/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..40ff36f2 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/el/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/es/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/es/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..7438734e Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/es/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/fr/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/fr/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..2bed007e Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/fr/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/gl/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/gl/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..b89c1027 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/gl/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/hu/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/hu/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..610c61a4 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/hu/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/id/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/id/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..638596c3 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/id/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/it/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/it/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..dc3ccb95 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/it/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ja/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ja/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..2a5666f3 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ja/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nb/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nb/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..cb24fb31 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nb/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nl/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nl/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..9b39fb14 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/nl/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pl/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pl/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..7255a297 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pl/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..acd27b17 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt_BR/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt_BR/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..87fbd19e Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/pt_BR/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ru/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ru/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..757906bd Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/ru/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sk/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sk/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..2457462d Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sk/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..f35be7c3 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr@latin/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr@latin/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..a4a06627 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sr@latin/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sv/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sv/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..58f5c728 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/sv/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/tr/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/tr/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..49fb0f16 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/tr/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/uk_UA/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/uk_UA/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..a475c96e Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/uk_UA/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_CN/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_CN/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..5511cf8d Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_CN/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_TW/LC_MESSAGES/dashtodock.mo b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_TW/LC_MESSAGES/dashtodock.mo new file mode 100644 index 00000000..54137095 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locale/zh_TW/LC_MESSAGES/dashtodock.mo differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locations.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locations.js new file mode 100644 index 00000000..25524ae4 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/locations.js @@ -0,0 +1,268 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const Gtk = imports.gi.Gtk; +const Shell = imports.gi.Shell; +const Signals = imports.signals; + +// Use __ () and N__() for the extension gettext domain, and reuse +// the shell domain with the default _() and N_() +const Gettext = imports.gettext.domain('dashtodock'); +const __ = Gettext.gettext; +const N__ = function(e) { return e }; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Utils = Me.imports.utils; + +/** + * This class maintains a Shell.App representing the Trash and keeps it + * up-to-date as the trash fills and is emptied over time. + */ +var Trash = class DashToDock_Trash { + + constructor() { + this._file = Gio.file_new_for_uri('trash://'); + try { + this._monitor = this._file.monitor_directory(0, null); + this._signalId = this._monitor.connect( + 'changed', + this._onTrashChange.bind(this) + ); + } catch (e) { + log(`Impossible to monitor trash: ${e}`) + } + this._lastEmpty = true; + this._empty = true; + this._onTrashChange(); + } + + destroy() { + if (this._monitor) { + this._monitor.disconnect(this._signalId); + this._monitor.run_dispose(); + } + this._file.run_dispose(); + } + + _onTrashChange() { + try { + let children = this._file.enumerate_children('*', 0, null); + this._empty = children.next_file(null) == null; + children.close(null); + } catch (e) { + log(`Impossible to enumerate trash children: ${e}`) + return; + } + + this._ensureApp(); + } + + _ensureApp() { + if (this._trashApp == null || + this._lastEmpty != this._empty) { + let trashKeys = new GLib.KeyFile(); + trashKeys.set_string('Desktop Entry', 'Name', __('Trash')); + trashKeys.set_string('Desktop Entry', 'Icon', + this._empty ? 'user-trash' : 'user-trash-full'); + trashKeys.set_string('Desktop Entry', 'Type', 'Application'); + trashKeys.set_string('Desktop Entry', 'Exec', 'gio open trash:///'); + trashKeys.set_string('Desktop Entry', 'StartupNotify', 'false'); + trashKeys.set_string('Desktop Entry', 'XdtdUri', 'trash:///'); + if (!this._empty) { + trashKeys.set_string('Desktop Entry', 'Actions', 'empty-trash;'); + trashKeys.set_string('Desktop Action empty-trash', 'Name', __('Empty Trash')); + trashKeys.set_string('Desktop Action empty-trash', 'Exec', + 'dbus-send --print-reply --dest=org.gnome.Nautilus /org/gnome/Nautilus org.gnome.Nautilus.FileOperations.EmptyTrash'); + } + + let trashAppInfo = Gio.DesktopAppInfo.new_from_keyfile(trashKeys); + this._trashApp = new Shell.App({appInfo: trashAppInfo}); + this._lastEmpty = this._empty; + + this.emit('changed'); + } + } + + getApp() { + this._ensureApp(); + return this._trashApp; + } +} +Signals.addSignalMethods(Trash.prototype); + +/** + * This class maintains Shell.App representations for removable devices + * plugged into the system, and keeps the list of Apps up-to-date as + * devices come and go and are mounted and unmounted. + */ +var Removables = class DashToDock_Removables { + + constructor() { + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._monitor = Gio.VolumeMonitor.get(); + this._volumeApps = [] + this._mountApps = [] + + this._monitor.get_volumes().forEach( + (volume) => { + this._onVolumeAdded(this._monitor, volume); + } + ); + + this._monitor.get_mounts().forEach( + (mount) => { + this._onMountAdded(this._monitor, mount); + } + ); + + this._signalsHandler.add([ + this._monitor, + 'mount-added', + this._onMountAdded.bind(this) + ], [ + this._monitor, + 'mount-removed', + this._onMountRemoved.bind(this) + ], [ + this._monitor, + 'volume-added', + this._onVolumeAdded.bind(this) + ], [ + this._monitor, + 'volume-removed', + this._onVolumeRemoved.bind(this) + ]); + } + + destroy() { + this._signalsHandler.destroy(); + this._monitor.run_dispose(); + } + + _getWorkingIconName(icon) { + if (icon instanceof Gio.ThemedIcon) { + let iconTheme = Gtk.IconTheme.get_default(); + let names = icon.get_names(); + for (let i = 0; i < names.length; i++) { + let iconName = names[i]; + if (iconTheme.has_icon(iconName)) { + return iconName; + } + } + return ''; + } else { + return icon.to_string(); + } + } + + _onVolumeAdded(monitor, volume) { + if (!volume.can_mount()) { + return; + } + + let activationRoot = volume.get_activation_root(); + if (!activationRoot) { + // Can't offer to mount a device if we don't know + // where to mount it. + // These devices are usually ejectable so you + // don't normally unmount them anyway. + return; + } + let uri = GLib.uri_unescape_string(activationRoot.get_uri(), null); + + let volumeKeys = new GLib.KeyFile(); + volumeKeys.set_string('Desktop Entry', 'Name', volume.get_name()); + volumeKeys.set_string('Desktop Entry', 'Icon', this._getWorkingIconName(volume.get_icon())); + volumeKeys.set_string('Desktop Entry', 'Type', 'Application'); + volumeKeys.set_string('Desktop Entry', 'Exec', 'nautilus "' + uri + '"'); + volumeKeys.set_string('Desktop Entry', 'StartupNotify', 'false'); + volumeKeys.set_string('Desktop Entry', 'Actions', 'mount;'); + volumeKeys.set_string('Desktop Action mount', 'Name', __('Mount')); + volumeKeys.set_string('Desktop Action mount', 'Exec', 'gio mount "' + uri + '"'); + let volumeAppInfo = Gio.DesktopAppInfo.new_from_keyfile(volumeKeys); + let volumeApp = new Shell.App({appInfo: volumeAppInfo}); + this._volumeApps.push(volumeApp); + this.emit('changed'); + } + + _onVolumeRemoved(monitor, volume) { + for (let i = 0; i < this._volumeApps.length; i++) { + let app = this._volumeApps[i]; + if (app.get_name() == volume.get_name()) { + this._volumeApps.splice(i, 1); + } + } + this.emit('changed'); + } + + _onMountAdded(monitor, mount) { + // Filter out uninteresting mounts + if (!mount.can_eject() && !mount.can_unmount()) + return; + if (mount.is_shadowed()) + return; + + let volume = mount.get_volume(); + if (!volume || volume.get_identifier('class') == 'network') { + return; + } + + let escapedUri = mount.get_root().get_uri() + let uri = GLib.uri_unescape_string(escapedUri, null); + + let mountKeys = new GLib.KeyFile(); + mountKeys.set_string('Desktop Entry', 'Name', mount.get_name()); + mountKeys.set_string('Desktop Entry', 'Icon', + this._getWorkingIconName(volume.get_icon())); + mountKeys.set_string('Desktop Entry', 'Type', 'Application'); + mountKeys.set_string('Desktop Entry', 'Exec', 'gio open "' + uri + '"'); + mountKeys.set_string('Desktop Entry', 'StartupNotify', 'false'); + mountKeys.set_string('Desktop Entry', 'XdtdUri', escapedUri); + mountKeys.set_string('Desktop Entry', 'Actions', 'unmount;'); + if (mount.can_eject()) { + mountKeys.set_string('Desktop Action unmount', 'Name', __('Eject')); + mountKeys.set_string('Desktop Action unmount', 'Exec', + 'gio mount -e "' + uri + '"'); + } else { + mountKeys.set_string('Desktop Entry', 'Actions', 'unmount;'); + mountKeys.set_string('Desktop Action unmount', 'Name', __('Unmount')); + mountKeys.set_string('Desktop Action unmount', 'Exec', + 'gio mount -u "' + uri + '"'); + } + let mountAppInfo = Gio.DesktopAppInfo.new_from_keyfile(mountKeys); + let mountApp = new Shell.App({appInfo: mountAppInfo}); + this._mountApps.push(mountApp); + this.emit('changed'); + } + + _onMountRemoved(monitor, mount) { + for (let i = 0; i < this._mountApps.length; i++) { + let app = this._mountApps[i]; + if (app.get_name() == mount.get_name()) { + this._mountApps.splice(i, 1); + } + } + this.emit('changed'); + } + + getApps() { + // When we have both a volume app and a mount app, we prefer + // the mount app. + let apps = new Map(); + this._volumeApps.map(function(app) { + apps.set(app.get_name(), app); + }); + this._mountApps.map(function(app) { + apps.set(app.get_name(), app); + }); + + let ret = []; + for (let app of apps.values()) { + ret.push(app); + } + return ret; + } +} +Signals.addSignalMethods(Removables.prototype); diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/glossy.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/glossy.svg new file mode 100644 index 00000000..55b71baa --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/glossy.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg.svg new file mode 100644 index 00000000..19be5a9d --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg.svg @@ -0,0 +1,82 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg_h.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg_h.svg new file mode 100644 index 00000000..eeaa8691 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/highlight_stacked_bg_h.svg @@ -0,0 +1,82 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/logo.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/logo.svg new file mode 100644 index 00000000..eebd0b1d --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/media/logo.svg @@ -0,0 +1,528 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dash to Dock + Michele + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/metadata.json b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/metadata.json new file mode 100644 index 00000000..a58baa03 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/metadata.json @@ -0,0 +1,13 @@ +{ + "_generated": "Generated by SweetTooth, do not edit", + "description": "A dock for the Gnome Shell. This extension moves the dash out of the overview transforming it in a dock for an easier launching of applications and a faster switching between windows and desktops. Side and bottom placement options are available.", + "gettext-domain": "dashtodock", + "name": "Dash to Dock", + "original-author": "micxgx@gmail.com", + "shell-version": [ + "3.34" + ], + "url": "https://micheleg.github.io/dash-to-dock/", + "uuid": "dash-to-dock@micxgx.gmail.com", + "version": 67 +} \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/prefs.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/prefs.js new file mode 100644 index 00000000..55230298 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/prefs.js @@ -0,0 +1,869 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Gtk = imports.gi.Gtk; +const Gdk = imports.gi.Gdk; +const Mainloop = imports.mainloop; + +// Use __ () and N__() for the extension gettext domain, and reuse +// the shell domain with the default _() and N_() +const Gettext = imports.gettext.domain('dashtodock'); +const __ = Gettext.gettext; +const N__ = function(e) { return e }; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const SCALE_UPDATE_TIMEOUT = 500; +const DEFAULT_ICONS_SIZES = [ 128, 96, 64, 48, 32, 24, 16 ]; + +const TransparencyMode = { + DEFAULT: 0, + FIXED: 1, + DYNAMIC: 3 +}; + +const RunningIndicatorStyle = { + DEFAULT: 0, + DOTS: 1, + SQUARES: 2, + DASHES: 3, + SEGMENTED: 4, + SOLID: 5, + CILIORA: 6, + METRO: 7 +}; + +/** + * This function was copied from the activities-config extension + * https://github.com/nls1729/acme-code/tree/master/activities-config + * by Norman L. Smith. + */ +function cssHexString(css) { + let rrggbb = '#'; + let start; + for (let loop = 0; loop < 3; loop++) { + let end = 0; + let xx = ''; + for (let loop = 0; loop < 2; loop++) { + while (true) { + let x = css.slice(end, end + 1); + if ((x == '(') || (x == ',') || (x == ')')) + break; + end++; + } + if (loop == 0) { + end++; + start = end; + } + } + xx = parseInt(css.slice(start, end)).toString(16); + if (xx.length == 1) + xx = '0' + xx; + rrggbb += xx; + css = css.slice(end); + } + return rrggbb; +} + +function setShortcut(settings) { + let shortcut_text = settings.get_string('shortcut-text'); + let [key, mods] = Gtk.accelerator_parse(shortcut_text); + + if (Gtk.accelerator_valid(key, mods)) { + let shortcut = Gtk.accelerator_name(key, mods); + settings.set_strv('shortcut', [shortcut]); + } + else { + settings.set_strv('shortcut', []); + } +} + +var Settings = class DashToDock_Settings { + + constructor() { + this._settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.dash-to-dock'); + + this._rtl = (Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL); + + this._builder = new Gtk.Builder(); + this._builder.set_translation_domain(Me.metadata['gettext-domain']); + this._builder.add_from_file(Me.path + '/Settings.ui'); + + this.widget = new Gtk.ScrolledWindow({ hscrollbar_policy: Gtk.PolicyType.NEVER }); + this._notebook = this._builder.get_object('settings_notebook'); + this.widget.add(this._notebook); + + // Set a reasonable initial window height + this.widget.connect('realize', () => { + let window = this.widget.get_toplevel(); + let [default_width, default_height] = window.get_default_size(); + window.resize(default_width, 650); + }); + + // Timeout to delay the update of the settings + this._dock_size_timeout = 0; + this._icon_size_timeout = 0; + this._opacity_timeout = 0; + + this._bindSettings(); + + this._builder.connect_signals_full(this._connector.bind(this)); + } + + /** + * Connect signals + */ + _connector(builder, object, signal, handler) { + /**init + * Object containing all signals defined in the glade file + */ + const SignalHandler = { + dock_display_combo_changed_cb(combo) { + this._settings.set_int('preferred-monitor', this._monitors[combo.get_active()]); + }, + + position_top_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('dock-position', 0); + }, + + position_right_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('dock-position', 1); + }, + + position_bottom_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('dock-position', 2); + }, + + position_left_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('dock-position', 3); + }, + + icon_size_combo_changed_cb(combo) { + this._settings.set_int('dash-max-icon-size', this._allIconSizes[combo.get_active()]); + }, + + dock_size_scale_format_value_cb(scale, value) { + return Math.round(value * 100) + ' %'; + }, + + dock_size_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._dock_size_timeout > 0) + Mainloop.source_remove(this._dock_size_timeout); + + this._dock_size_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => { + this._settings.set_double('height-fraction', scale.get_value()); + this._dock_size_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + }, + + icon_size_scale_format_value_cb(scale, value) { + return value + ' px'; + }, + + icon_size_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._icon_size_timeout > 0) + Mainloop.source_remove(this._icon_size_timeout); + + this._icon_size_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => { + this._settings.set_int('dash-max-icon-size', scale.get_value()); + this._icon_size_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + }, + + custom_opacity_scale_value_changed_cb(scale) { + // Avoid settings the opacity consinuosly as it's change is animated + if (this._opacity_timeout > 0) + Mainloop.source_remove(this._opacity_timeout); + + this._opacity_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => { + this._settings.set_double('background-opacity', scale.get_value()); + this._opacity_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + }, + + min_opacity_scale_value_changed_cb(scale) { + // Avoid settings the opacity consinuosly as it's change is animated + if (this._opacity_timeout > 0) + Mainloop.source_remove(this._opacity_timeout); + + this._opacity_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => { + this._settings.set_double('min-alpha', scale.get_value()); + this._opacity_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + }, + + max_opacity_scale_value_changed_cb(scale) { + // Avoid settings the opacity consinuosly as it's change is animated + if (this._opacity_timeout > 0) + Mainloop.source_remove(this._opacity_timeout); + + this._opacity_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => { + this._settings.set_double('max-alpha', scale.get_value()); + this._opacity_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + }, + + custom_opacity_scale_format_value_cb(scale, value) { + return Math.round(value * 100) + ' %'; + }, + + min_opacity_scale_format_value_cb(scale, value) { + return Math.round(value * 100) + ' %'; + }, + + max_opacity_scale_format_value_cb(scale, value) { + return Math.round(value * 100) + ' %'; + }, + + all_windows_radio_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('intellihide-mode', 0); + }, + + focus_application_windows_radio_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('intellihide-mode', 1); + }, + + maximized_windows_radio_button_toggled_cb(button) { + if (button.get_active()) + this._settings.set_enum('intellihide-mode', 2); + } + } + + object.connect(signal, SignalHandler[handler].bind(this)); + } + + _bindSettings() { + // Position and size panel + + // Monitor options + + this._monitors = []; + // Build options based on the number of monitors and the current settings. + let n_monitors = Gdk.Screen.get_default().get_n_monitors(); + let primary_monitor = Gdk.Screen.get_default().get_primary_monitor(); + + let monitor = this._settings.get_int('preferred-monitor'); + + // Add primary monitor with index 0, because in GNOME Shell the primary monitor is always 0 + this._builder.get_object('dock_monitor_combo').append_text(__('Primary monitor')); + this._monitors.push(0); + + // Add connected monitors + let ctr = 0; + for (let i = 0; i < n_monitors; i++) { + if (i !== primary_monitor) { + ctr++; + this._monitors.push(ctr); + this._builder.get_object('dock_monitor_combo').append_text(__('Secondary monitor ') + ctr); + } + } + + // If one of the external monitor is set as preferred, show it even if not attached + if ((monitor >= n_monitors) && (monitor !== primary_monitor)) { + this._monitors.push(monitor) + this._builder.get_object('dock_monitor_combo').append_text(__('Secondary monitor ') + ++ctr); + } + + this._builder.get_object('dock_monitor_combo').set_active(this._monitors.indexOf(monitor)); + + // Position option + let position = this._settings.get_enum('dock-position'); + + switch (position) { + case 0: + this._builder.get_object('position_top_button').set_active(true); + break; + case 1: + this._builder.get_object('position_right_button').set_active(true); + break; + case 2: + this._builder.get_object('position_bottom_button').set_active(true); + break; + case 3: + this._builder.get_object('position_left_button').set_active(true); + break; + } + + if (this._rtl) { + /* Left is Right in rtl as a setting */ + this._builder.get_object('position_left_button').set_label(__('Right')); + this._builder.get_object('position_right_button').set_label(__('Left')); + } + + // Intelligent autohide options + this._settings.bind('dock-fixed', + this._builder.get_object('intelligent_autohide_switch'), + 'active', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + this._settings.bind('dock-fixed', + this._builder.get_object('intelligent_autohide_button'), + 'sensitive', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + this._settings.bind('autohide', + this._builder.get_object('autohide_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('autohide-in-fullscreen', + this._builder.get_object('autohide_enable_in_fullscreen_checkbutton'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('require-pressure-to-show', + this._builder.get_object('require_pressure_checkbutton'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('intellihide', + this._builder.get_object('intellihide_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('animation-time', + this._builder.get_object('animation_duration_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('hide-delay', + this._builder.get_object('hide_timeout_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-delay', + this._builder.get_object('show_timeout_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('pressure-threshold', + this._builder.get_object('pressure_threshold_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + + //this._builder.get_object('animation_duration_spinbutton').set_value(this._settings.get_double('animation-time')); + + // Create dialog for intelligent autohide advanced settings + this._builder.get_object('intelligent_autohide_button').connect('clicked', () => { + + let dialog = new Gtk.Dialog({ title: __('Intelligent autohide customization'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + // GTK+ leaves positive values for application-defined response ids. + // Use +1 for the reset action + dialog.add_button(__('Reset to defaults'), 1); + + let box = this._builder.get_object('intelligent_autohide_advanced_settings_box'); + dialog.get_content_area().add(box); + + this._settings.bind('intellihide', + this._builder.get_object('intellihide_mode_box'), + 'sensitive', + Gio.SettingsBindFlags.GET); + + // intellihide mode + + let intellihideModeRadioButtons = [ + this._builder.get_object('all_windows_radio_button'), + this._builder.get_object('focus_application_windows_radio_button'), + this._builder.get_object('maximized_windows_radio_button') + ]; + + intellihideModeRadioButtons[this._settings.get_enum('intellihide-mode')].set_active(true); + + this._settings.bind('autohide', + this._builder.get_object('require_pressure_checkbutton'), + 'sensitive', + Gio.SettingsBindFlags.GET); + + this._settings.bind('autohide', + this._builder.get_object('autohide_enable_in_fullscreen_checkbutton'), + 'sensitive', + Gio.SettingsBindFlags.GET); + + this._settings.bind('require-pressure-to-show', + this._builder.get_object('show_timeout_spinbutton'), + 'sensitive', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + this._settings.bind('require-pressure-to-show', + this._builder.get_object('show_timeout_label'), + 'sensitive', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + this._settings.bind('require-pressure-to-show', + this._builder.get_object('pressure_threshold_spinbutton'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('require-pressure-to-show', + this._builder.get_object('pressure_threshold_label'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + dialog.connect('response', (dialog, id) => { + if (id == 1) { + // restore default settings for the relevant keys + let keys = ['intellihide', 'autohide', 'intellihide-mode', 'autohide-in-fullscreen', 'require-pressure-to-show', + 'animation-time', 'show-delay', 'hide-delay', 'pressure-threshold']; + keys.forEach(function(val) { + this._settings.set_value(val, this._settings.get_default_value(val)); + }, this); + intellihideModeRadioButtons[this._settings.get_enum('intellihide-mode')].set_active(true); + } else { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + } + return; + }); + + dialog.show_all(); + + }); + + // size options + this._builder.get_object('dock_size_scale').set_value(this._settings.get_double('height-fraction')); + this._builder.get_object('dock_size_scale').add_mark(0.9, Gtk.PositionType.TOP, null); + let icon_size_scale = this._builder.get_object('icon_size_scale'); + icon_size_scale.set_range(8, DEFAULT_ICONS_SIZES[0]); + icon_size_scale.set_value(this._settings.get_int('dash-max-icon-size')); + DEFAULT_ICONS_SIZES.forEach(function(val) { + icon_size_scale.add_mark(val, Gtk.PositionType.TOP, val.toString()); + }); + + // Corrent for rtl languages + if (this._rtl) { + // Flip value position: this is not done automatically + this._builder.get_object('dock_size_scale').set_value_pos(Gtk.PositionType.LEFT); + icon_size_scale.set_value_pos(Gtk.PositionType.LEFT); + // I suppose due to a bug, having a more than one mark and one above a value of 100 + // makes the rendering of the marks wrong in rtl. This doesn't happen setting the scale as not flippable + // and then manually inverting it + icon_size_scale.set_flippable(false); + icon_size_scale.set_inverted(true); + } + + this._settings.bind('icon-size-fixed', this._builder.get_object('icon_size_fixed_checkbutton'), 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('extend-height', this._builder.get_object('dock_size_extend_checkbutton'), 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('extend-height', this._builder.get_object('dock_size_scale'), 'sensitive', Gio.SettingsBindFlags.INVERT_BOOLEAN); + + + // Apps panel + + this._settings.bind('show-running', + this._builder.get_object('show_running_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('isolate-workspaces', + this._builder.get_object('application_button_isolation_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('isolate-monitors', + this._builder.get_object('application_button_monitor_isolation_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-windows-preview', + this._builder.get_object('windows_preview_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('multi-monitor', + this._builder.get_object('multi_monitor_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-favorites', + this._builder.get_object('show_favorite_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-trash', + this._builder.get_object('show_trash_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-mounts', + this._builder.get_object('show_mounts_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-show-apps-button', + this._builder.get_object('show_applications_button_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-apps-at-top', + this._builder.get_object('application_button_first_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-show-apps-button', + this._builder.get_object('application_button_first_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('animate-show-apps', + this._builder.get_object('application_button_animation_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-show-apps-button', + this._builder.get_object('application_button_animation_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + + // Behavior panel + + this._settings.bind('hot-keys', + this._builder.get_object('hot_keys_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('hot-keys', + this._builder.get_object('overlay_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('click_action_combo').set_active(this._settings.get_enum('click-action')); + this._builder.get_object('click_action_combo').connect('changed', (widget) => { + this._settings.set_enum('click-action', widget.get_active()); + }); + + this._builder.get_object('scroll_action_combo').set_active(this._settings.get_enum('scroll-action')); + this._builder.get_object('scroll_action_combo').connect('changed', (widget) => { + this._settings.set_enum('scroll-action', widget.get_active()); + }); + + this._builder.get_object('shift_click_action_combo').connect('changed', (widget) => { + this._settings.set_enum('shift-click-action', widget.get_active()); + }); + + this._builder.get_object('middle_click_action_combo').connect('changed', (widget) => { + this._settings.set_enum('middle-click-action', widget.get_active()); + }); + this._builder.get_object('shift_middle_click_action_combo').connect('changed', (widget) => { + this._settings.set_enum('shift-middle-click-action', widget.get_active()); + }); + + // Create dialog for number overlay options + this._builder.get_object('overlay_button').connect('clicked', () => { + + let dialog = new Gtk.Dialog({ title: __('Show dock and application numbers'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + // GTK+ leaves positive values for application-defined response ids. + // Use +1 for the reset action + dialog.add_button(__('Reset to defaults'), 1); + + let box = this._builder.get_object('box_overlay_shortcut'); + dialog.get_content_area().add(box); + + this._builder.get_object('overlay_switch').set_active(this._settings.get_boolean('hotkeys-overlay')); + this._builder.get_object('show_dock_switch').set_active(this._settings.get_boolean('hotkeys-show-dock')); + + // We need to update the shortcut 'strv' when the text is modified + this._settings.connect('changed::shortcut-text', () => {setShortcut(this._settings);}); + this._settings.bind('shortcut-text', + this._builder.get_object('shortcut_entry'), + 'text', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('hotkeys-overlay', + this._builder.get_object('overlay_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('hotkeys-show-dock', + this._builder.get_object('show_dock_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('shortcut-timeout', + this._builder.get_object('timeout_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + + dialog.connect('response', (dialog, id) => { + if (id == 1) { + // restore default settings for the relevant keys + let keys = ['shortcut-text', 'hotkeys-overlay', 'hotkeys-show-dock', 'shortcut-timeout']; + keys.forEach(function(val) { + this._settings.set_value(val, this._settings.get_default_value(val)); + }, this); + } else { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + } + return; + }); + + dialog.show_all(); + }); + + // Create dialog for middle-click options + this._builder.get_object('middle_click_options_button').connect('clicked', () => { + + let dialog = new Gtk.Dialog({ title: __('Customize middle-click behavior'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + // GTK+ leaves positive values for application-defined response ids. + // Use +1 for the reset action + dialog.add_button(__('Reset to defaults'), 1); + + let box = this._builder.get_object('box_middle_click_options'); + dialog.get_content_area().add(box); + + this._builder.get_object('shift_click_action_combo').set_active(this._settings.get_enum('shift-click-action')); + + this._builder.get_object('middle_click_action_combo').set_active(this._settings.get_enum('middle-click-action')); + + this._builder.get_object('shift_middle_click_action_combo').set_active(this._settings.get_enum('shift-middle-click-action')); + + this._settings.bind('shift-click-action', + this._builder.get_object('shift_click_action_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('middle-click-action', + this._builder.get_object('middle_click_action_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('shift-middle-click-action', + this._builder.get_object('shift_middle_click_action_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + + dialog.connect('response', (dialog, id) => { + if (id == 1) { + // restore default settings for the relevant keys + let keys = ['shift-click-action', 'middle-click-action', 'shift-middle-click-action']; + keys.forEach(function(val) { + this._settings.set_value(val, this._settings.get_default_value(val)); + }, this); + this._builder.get_object('shift_click_action_combo').set_active(this._settings.get_enum('shift-click-action')); + this._builder.get_object('middle_click_action_combo').set_active(this._settings.get_enum('middle-click-action')); + this._builder.get_object('shift_middle_click_action_combo').set_active(this._settings.get_enum('shift-middle-click-action')); + } else { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + } + return; + }); + + dialog.show_all(); + + }); + + // Appearance Panel + + this._settings.bind('apply-custom-theme', this._builder.get_object('customize_theme'), 'sensitive', Gio.SettingsBindFlags.INVERT_BOOLEAN | Gio.SettingsBindFlags.GET); + this._settings.bind('apply-custom-theme', this._builder.get_object('builtin_theme_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('custom-theme-shrink', this._builder.get_object('shrink_dash_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); + + // Running indicators + this._builder.get_object('running_indicators_combo').set_active( + this._settings.get_enum('running-indicator-style') + ); + this._builder.get_object('running_indicators_combo').connect( + 'changed', + (widget) => { + this._settings.set_enum('running-indicator-style', widget.get_active()); + } + ); + + if (this._settings.get_enum('running-indicator-style') == RunningIndicatorStyle.DEFAULT) + this._builder.get_object('running_indicators_advance_settings_button').set_sensitive(false); + + this._settings.connect('changed::running-indicator-style', () => { + if (this._settings.get_enum('running-indicator-style') == RunningIndicatorStyle.DEFAULT) + this._builder.get_object('running_indicators_advance_settings_button').set_sensitive(false); + else + this._builder.get_object('running_indicators_advance_settings_button').set_sensitive(true); + }); + + // Create dialog for running indicators advanced settings + this._builder.get_object('running_indicators_advance_settings_button').connect('clicked', () => { + + let dialog = new Gtk.Dialog({ title: __('Customize running indicators'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + let box = this._builder.get_object('running_dots_advance_settings_box'); + dialog.get_content_area().add(box); + + this._settings.bind('running-indicator-dominant-color', + this._builder.get_object('dominant_color_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('custom-theme-customize-running-dots', + this._builder.get_object('dot_style_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('custom-theme-customize-running-dots', + this._builder.get_object('dot_style_settings_box'), + 'sensitive', Gio.SettingsBindFlags.DEFAULT); + + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('custom-theme-running-dots-color')); + this._builder.get_object('dot_color_colorbutton').set_rgba(rgba); + + this._builder.get_object('dot_color_colorbutton').connect('notify::color', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('custom-theme-running-dots-color', hexString); + }); + + rgba.parse(this._settings.get_string('custom-theme-running-dots-border-color')); + this._builder.get_object('dot_border_color_colorbutton').set_rgba(rgba); + + this._builder.get_object('dot_border_color_colorbutton').connect('notify::color', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('custom-theme-running-dots-border-color', hexString); + }); + + this._settings.bind('custom-theme-running-dots-border-width', + this._builder.get_object('dot_border_width_spin_button'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + + + dialog.connect('response', (dialog, id) => { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + return; + }); + + dialog.show_all(); + + }); + + this._settings.bind('custom-background-color', this._builder.get_object('custom_background_color_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('custom-background-color', this._builder.get_object('custom_background_color'), 'sensitive', Gio.SettingsBindFlags.DEFAULT); + + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('background-color')); + this._builder.get_object('custom_background_color').set_rgba(rgba); + + this._builder.get_object('custom_background_color').connect('notify::color', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('background-color', hexString); + }); + + // Opacity + this._builder.get_object('customize_opacity_combo').set_active_id( + this._settings.get_enum('transparency-mode').toString() + ); + this._builder.get_object('customize_opacity_combo').connect( + 'changed', + (widget) => { + this._settings.set_enum('transparency-mode', parseInt(widget.get_active_id())); + } + ); + + this._builder.get_object('custom_opacity_scale').set_value(this._settings.get_double('background-opacity')); + + if (this._settings.get_enum('transparency-mode') !== TransparencyMode.FIXED) + this._builder.get_object('custom_opacity_scale').set_sensitive(false); + + this._settings.connect('changed::transparency-mode', () => { + if (this._settings.get_enum('transparency-mode') !== TransparencyMode.FIXED) + this._builder.get_object('custom_opacity_scale').set_sensitive(false); + else + this._builder.get_object('custom_opacity_scale').set_sensitive(true); + }); + + if (this._settings.get_enum('transparency-mode') !== TransparencyMode.DYNAMIC) { + this._builder.get_object('dynamic_opacity_button').set_sensitive(false); + } + + this._settings.connect('changed::transparency-mode', () => { + if (this._settings.get_enum('transparency-mode') !== TransparencyMode.DYNAMIC) { + this._builder.get_object('dynamic_opacity_button').set_sensitive(false); + } + else { + this._builder.get_object('dynamic_opacity_button').set_sensitive(true); + } + }); + + // Create dialog for transparency advanced settings + this._builder.get_object('dynamic_opacity_button').connect('clicked', () => { + + let dialog = new Gtk.Dialog({ title: __('Cutomize opacity'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + let box = this._builder.get_object('advanced_transparency_dialog'); + dialog.get_content_area().add(box); + + this._settings.bind( + 'customize-alphas', + this._builder.get_object('customize_alphas_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT + ); + this._settings.bind( + 'customize-alphas', + this._builder.get_object('min_alpha_scale'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT + ); + this._settings.bind( + 'customize-alphas', + this._builder.get_object('max_alpha_scale'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT + ); + + this._builder.get_object('min_alpha_scale').set_value( + this._settings.get_double('min-alpha') + ); + this._builder.get_object('max_alpha_scale').set_value( + this._settings.get_double('max-alpha') + ); + + dialog.connect('response', (dialog, id) => { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + return; + }); + + dialog.show_all(); + }); + + + this._settings.bind('unity-backlit-items', + this._builder.get_object('unity_backlit_items_switch'), + 'active', Gio.SettingsBindFlags.DEFAULT + ); + + this._settings.bind('force-straight-corner', + this._builder.get_object('force_straight_corner_switch'), + 'active', Gio.SettingsBindFlags.DEFAULT); + + // About Panel + + this._builder.get_object('extension_version').set_label(Me.metadata.version.toString()); + } +}; + +function init() { + ExtensionUtils.initTranslations(); +} + +function buildPrefsWidget() { + let settings = new Settings(); + let widget = settings.widget; + widget.show_all(); + return widget; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/gschemas.compiled b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/gschemas.compiled new file mode 100644 index 00000000..4dcbc356 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/gschemas.compiled differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml new file mode 100644 index 00000000..65a0c10f --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml @@ -0,0 +1,550 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'LEFT' + Dock position + Dock is shown on the Left, Right, Top or Bottom side of the screen. + + + 0.2 + Animation time + Sets the time duration of the autohide effect. + + + 0.25 + Show delay + Sets the delay after the mouse reaches the screen border before showing the dock. + + + 0.20 + Show delay + Sets the delay after the mouse left the dock before hiding it. + + + false + Set a custom dash background background color + Sets the color for the dash background. + + + "#ffffff" + Dash background color. + Customize the background color of the dash. + + + 'DEFAULT' + Transparency mode for the dock + FIXED: constant transparency. DYNAMIC: dock takes the opaque style only when windows are close to it. + + + 'DEFAULT' + ... + DEFAULT: .... DOTS: .... + + + false + Use application icon dominant color for the indicator color + + + + false + Manually set the min and max opacity + For the dynamic mode, the min/max opacity values will be given by 'min-alpha' and 'max-alpha'. + + + 0.2 + Opacity of the dash background when free-floating + Sets the opacity of the dash background when no windows are close. + + + 0.8 + Opacity of the dash background when windows are close. + Sets the opacity of the dash background when windows are close. + + + 0.8 + Opacity of the dash background + Sets the opacity of the dash background when in autohide mode. + + + true + Dock dodges windows + Enable or disable intellihide mode + + + 'FOCUS_APPLICATION_WINDOWS' + Define which windows are considered for intellihide. + + + + true + Dock shown on mouse over + Enable or disable autohide mode + + + true + Require pressure to show dash + Enable or disable requiring pressure to show the dash + + + 100 + Pressure threshold + Sets how much pressure is needed to show the dash. + + + false + Enable autohide in fullscreen mode. + Enable autohide in fullscreen mode. + + + false + Dock always visible + Dock is always visible + + + true + Switch workspace by scrolling over the dock + Add the possibility to switch workspace by mouse scrolling over the dock. + + + 48 + Maximum dash icon size + Set the allowed maximum dash icon size. Allowed range: 16..64. + + + false + Fixed icon size + Keep the icon size fived by scrolling the dock. + + + false + Apply custom theme + Apply customization to the dash appearance + + + false + TODO + TODO + + + false + Customize the style of the running application indicators. + Customize the style of the running application indicators. + + + "#ffffff" + Running application indicators color + Customize the color of the running application indicators. + + + "#ffffff" + Running application indicators border color. + Customize the border color of the running application indicators. + + + 0 + Running application indicators border width. + Customize the border width of the running application indicators. + + + true + Show running apps + Show or hide running appplications icons in the dash + + + false + Provide workspace isolation + Dash shows only windows from the currentworkspace + + + false + Provide monitor isolation + Dash shows only windows from the monitor + + + true + Show preview of the open windows + Replace open windows list with windows previews + + + true + Show favorites apps + Show or hide favorite appplications icons in the dash + + + true + Show trash can + Show or hide the trash can icon in the dash + + + true + Show mounted volumes and devices + Show or hide mounted volume and device icons in the dash + + + true + Show applications button + Show appplications button in the dash + + + false + Show application button at top + Show appplication button at top of the dash + + + true + Animate Show Applications from the desktop + Animate Show Applications from the desktop + + + true + Basic compatibility with bolt extensions + Make the extension work properly when bolt extensions is enabled + + + 0.90 + Dock max height (fraction of available space) + + + false + Extend the dock container to all the available height + + + -1 + Monitor on which putting the dock + Set on which monitor to put the dock, use -1 for the primary one + + + false + Enable multi-monitor docks + Show a dock on every monitor + + + true + Minimize on shift+click + + + true + Activate only one window + + + 'cycle-windows' + Action when clicking on a running app + Set the action that is executed when clicking on the icon of a running application + + + 'do-nothing' + Action when scrolling app + Set the action that is executed when scrolling on the application icon + + + 'minimize' + Action when shift+clicking on a running app + Set the action that is executed when shift+clicking on the icon of a running application + + + 'launch' + Action when clicking on a running app + Set the action that is executed when middle-clicking on the icon of a running application + + + 'launch' + Action when clicking on a running app + Set the action that is executed when shift+middle-clicking on the icon of a running application + + + true + Super Hot-Keys + Launch and switch between dash items using Super+(0-9) + + + true + Show the dock when using the hotkeys + The dock will be quickly shown so that the number-overlay is visible and app activation is easier + + + "<Super>q" + Keybinding to show the dock and the number overlay. + Behavior depends on hotkeys-show-dock and hotkeys-overlay. + + + q']]]> + Keybinding to show the dock and the number overlay. + Behavior depends on hotkeys-show-dock and hotkeys-overlay. + + + 2 + Timeout to hide the dock + Sets the time duration before the dock is hidden again. + + + true + Show the dock when using the hotkeys + The dock will be quickly shown so that the number-overlay is visible and app activation is easier + + + 1']]]> + Keybinding to launch 1st dash app + + Keybinding to launch 1st app. + + + + 2']]]> + Keybinding to launch 2nd dash app + + Keybinding to launch 2nd app. + + + + 3']]]> + Keybinding to launch 3rd dash app + + Keybinding to launch 3rd app. + + + + 4']]]> + Keybinding to launch 4th dash app + + Keybinding to launch 4th app. + + + + 5']]]> + Keybinding to launch 5th dash app + + Keybinding to launch 5th app. + + + + 6']]]> + Keybinding to launch 6th dash app + + Keybinding to launch 6th app. + + + + 7']]]> + Keybinding to launch 7th dash app + + Keybinding to launch 7th app. + + + + 8']]]> + Keybinding to launch 8th dash app + + Keybinding to launch 8th app. + + + + 9']]]> + Keybinding to launch 9th dash app + + Keybinding to launch 9th app. + + + + 0']]]> + Keybinding to launch 10th dash app + + Keybinding to launch 10th app. + + + + 1']]]> + Keybinding to trigger 1st dash app with shift behavior + + Keybinding to trigger 1st app with shift behavior. + + + + 2']]]> + Keybinding to trigger 2nd dash app with shift behavior + + Keybinding to trigger 2nd app with shift behavior. + + + + 3']]]> + Keybinding to trigger 3rd dash app with shift behavior + + Keybinding to trigger 3rd app with shift behavior. + + + + 4']]]> + Keybinding to trigger 4th dash app with shift behavior + + Keybinding to trigger 4th app with shift behavior. + + + + 5']]]> + Keybinding to trigger 5th dash app with shift behavior + + Keybinding to trigger 5th app with shift behavior. + + + + 6']]]> + Keybinding to trigger 6th dash app with shift behavior + + Keybinding to trigger 6th app with shift behavior. + + + + 7']]]> + Keybinding to trigger 7th dash app with shift behavior + + Keybinding to trigger 7th app with shift behavior. + + + + 8']]]> + Keybinding to trigger 8th dash app with shift behavior + + Keybinding to trigger 8th app with shift behavior. + + + + 9']]]> + Keybinding to trigger 9th dash app with shift behavior + + Keybinding to trigger 9th app with shift behavior. + + + + 0']]]> + Keybinding to trigger 10th dash app with shift behavior + + Keybinding to trigger 10th app with shift behavior. + + + + 1']]]> + Keybinding to trigger 1st dash app + + Keybinding to either show or launch the 1st application in the dash. + + + + 2']]]> + Keybinding to trigger 2nd dash app + + Keybinding to either show or launch the 2nd application in the dash. + + + + 3']]]> + Keybinding to trigger 3rd dash app + + Keybinding to either show or launch the 3rd application in the dash. + + + + 4']]]> + Keybinding to trigger 4th dash app + + Keybinding to either show or launch the 4th application in the dash. + + + + 5']]]> + Keybinding to trigger 5th dash app + + Keybinding to either show or launch the 5th application in the dash. + + + + 6']]]> + Keybinding to trigger 6th dash app + + Keybinding to either show or launch the 6th application in the dash. + + + + 7']]]> + Keybinding to trigger 7th dash app + + Keybinding to either show or launch the 7th application in the dash. + + + + 8']]]> + Keybinding to trigger 8th dash app + + Keybinding to either show or launch the 8th application in the dash. + + + + 9']]]> + Keybinding to trigger 9th dash app + + Keybinding to either show or launch the 9th application in the dash. + + + + 0']]]> + Keybinding to trigger 10th dash app + + Keybinding to either show or launch the 10th application in the dash. + + + + false + Force straight corners in dash + Make the borders in the dash non rounded + + + false + Enable unity7 like glossy backlit items + Emulate the unity7 backlit glossy items behaviour + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/stylesheet.css new file mode 100644 index 00000000..90c448cf --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/stylesheet.css @@ -0,0 +1,178 @@ +/* Shrink the dash by reducing padding and border radius */ +#dashtodockContainer.shrink #dash, +#dashtodockContainer.dashtodock #dash { + border:1px; + padding:0px; +} + +#dashtodockContainer.shrink.left #dash, +#dashtodockContainer.dashtodock.left #dash { + border-left: 0px; +} + + +#dashtodockContainer.shrink.right #dash, +#dashtodockContainer.dashtodock.right #dash { + border-right: 0px; +} + + +#dashtodockContainer.shrink.top #dash, +#dashtodockContainer.dashtodock.top #dash { + border-top: 0px; +} + +#dashtodockContainer.shrink.bottom #dash, +#dashtodockContainer.dashtodock.bottom #dash { + border-bottom: 0px; +} + +#dashtodockContainer.straight-corner #dash, +#dashtodockContainer.shrink.straight-corner #dash { + border-radius: 0px; +} + +/* Scrollview style */ +.bottom #dashtodockDashScrollview, +.top #dashtodockDashScrollview { + -st-hfade-offset: 24px; +} + +.left #dashtodockDashScrollview, +.right #dashtodockDashScrollview { + -st-vfade-offset: 24px; +} + +#dashtodockContainer.running-dots .dash-item-container > StButton, +#dashtodockContainer.dashtodock .dash-item-container > StButton { + transition-duration: 250; + background-size: contain; +} + +#dashtodockContainer.shrink .dash-item-container > StButton, +#dashtodockContainer.dashtodock .dash-item-container > StButton { + padding: 1px 2px; +} + +/* Dash height extended to the whole available vertical space */ +#dashtodockContainer.extended.top #dash, +#dashtodockContainer.extended.right #dash, +#dashtodockContainer.extended.bottom #dash, +#dashtodockContainer.extended.left #dash { + border-radius: 0; +} + +#dashtodockContainer.extended.top #dash, +#dashtodockContainer.extended.bottom #dash { + border-left:0px; + border-right:0px; +} + +#dashtodockContainer.extended.right #dash, +#dashtodockContainer.extended.left #dash { + border-top:0px; + border-bottom:0px; +} + +/* Running and focused application style */ + +#dashtodockContainer.running-dots .app-well-app.running > .overview-icon, +#dashtodockContainer.dashtodock .app-well-app.running > .overview-icon { + background-image:none; +} + + +#dashtodockContainer.running-dots .app-well-app.focused .overview-icon, +#dashtodockContainer.dashtodock .app-well-app.focused .overview-icon { + background-color: rgba(238, 238, 236, 0.2); +} + +#dashtodockContainer.dashtodock #dash { + background: #2e3436; +} + +#dashtodockContainer.dashtodock .progress-bar { + /* Customization of the progress bar style, e.g.: + -progress-bar-background: rgba(0.8, 0.8, 0.8, 1); + -progress-bar-border: rgba(0.9, 0.9, 0.9, 1); + */ +} + +/* + * This is applied to a dummy actor. Only the alpha value for the background and border color + * and the transition-duration are used + */ +#dashtodockContainer.dummy-opaque { + background-color: rgba(0, 0, 0, 0.8); + border-color: rgba(0, 0, 0, 0.4); + transition-duration: 300ms; +} + +/* + * This is applied to a dummy actor. Only the alpha value for the background and border color + * and the transition-duration are used + */ +#dashtodockContainer.dummy-transparent { + background-color: rgba(0, 0, 0, 0.2); + border-color: rgba(0, 0, 0, 0.1); + transition-duration: 500ms; +} + +#dashtodockContainer.opaque { +} + +#dashtodockContainer.transparent { +} + +#dashtodockContainer .number-overlay { + color: rgba(255,255,255,1); + background-color: rgba(0,0,0,0.8); + text-align: center; +} + +#dashtodockContainer .notification-badge { + color: rgba(255,255,255,1); + background-color: rgba(255,0,0,1.0); + padding: 0.2em 0.5em; + border-radius: 1em; + font-weight: bold; + text-align: center; + margin: 2px; +} + +#dashtodockPreviewSeparator.popup-separator-menu-item-horizontal { + width: 1px; + height: auto; + border-right-width: 1px; + margin: 32px 0px; +} + +.dashtodock-app-well-preview-menu-item { + padding: 1em 1em 0.5em 1em; +} + +#dashtodockContainer .metro .overview-icon{ + border-radius: 0px; +} + +#dashtodockContainer.bottom .metro.running2.focused, +#dashtodockContainer.bottom .metro.running3.focused, +#dashtodockContainer.bottom .metro.running4.focused, +#dashtodockContainer.top .metro.running2.focused, +#dashtodockContainer.top .metro.running3.focused, +#dashtodockContainer.top .metro.running4.focused { + background-image: url('./media/highlight_stacked_bg.svg'); + background-position: 0px 0px; + background-size: contain; +} + +#dashtodockContainer.left .metro.running2.focused, +#dashtodockContainer.left .metro.running3.focused, +#dashtodockContainer.left .metro.running4.focused, +#dashtodockContainer.right .metro.running2.focused, +#dashtodockContainer.right .metro.running3.focused, +#dashtodockContainer.right .metro.running4.focused { + background-image: url('./media/highlight_stacked_bg_h.svg'); + background-position: 0px 0px; + background-size: contain; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/theming.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/theming.js new file mode 100644 index 00000000..5ed4cd71 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/theming.js @@ -0,0 +1,572 @@ +// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- + +const Clutter = imports.gi.Clutter; +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const Gtk = imports.gi.Gtk; +const Signals = imports.signals; +const Meta = imports.gi.Meta; +const Shell = imports.gi.Shell; +const St = imports.gi.St; +const Mainloop = imports.mainloop; + +const AppDisplay = imports.ui.appDisplay; +const AppFavorites = imports.ui.appFavorites; +const Dash = imports.ui.dash; +const DND = imports.ui.dnd; +const IconGrid = imports.ui.iconGrid; +const Main = imports.ui.main; +const PopupMenu = imports.ui.popupMenu; +const Util = imports.misc.util; +const Workspace = imports.ui.workspace; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; +const Utils = Me.imports.utils; + +/* + * DEFAULT: transparency given by theme + * FIXED: constant transparency chosen by user + * DYNAMIC: apply 'transparent' style when no windows are close to the dock + * */ +const TransparencyMode = { + DEFAULT: 0, + FIXED: 1, + DYNAMIC: 3 +}; + +/** + * Manage theme customization and custom theme support + */ +var ThemeManager = class DashToDock_ThemeManager { + + constructor(dock) { + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._bindSettingsChanges(); + this._actor = dock; + this._dash = dock.dash; + + // initialize colors with generic values + this._customizedBackground = {red: 0, green: 0, blue: 0, alpha: 0}; + this._customizedBorder = {red: 0, green: 0, blue: 0, alpha: 0}; + this._transparency = new Transparency(dock); + + this._signalsHandler.add([ + // When theme changes re-obtain default background color + St.ThemeContext.get_for_stage (global.stage), + 'changed', + this.updateCustomTheme.bind(this) + ], [ + // update :overview pseudoclass + Main.overview, + 'showing', + this._onOverviewShowing.bind(this) + ], [ + Main.overview, + 'hiding', + this._onOverviewHiding.bind(this) + ]); + + this._updateCustomStyleClasses(); + + // destroy themeManager when the managed actor is destroyed (e.g. extension unload) + // in order to disconnect signals + this._actor.connect('destroy', this.destroy.bind(this)); + + } + + destroy() { + this._signalsHandler.destroy(); + this._transparency.destroy(); + } + + _onOverviewShowing() { + this._actor.add_style_pseudo_class('overview'); + } + + _onOverviewHiding() { + this._actor.remove_style_pseudo_class('overview'); + } + + _updateDashOpacity() { + let newAlpha = Docking.DockManager.settings.get_double('background-opacity'); + + let [backgroundColor, borderColor] = this._getDefaultColors(); + + if (backgroundColor==null) + return; + + // Get the background and border alphas. We check the background alpha + // for a minimum of .001 to prevent division by 0 errors + let backgroundAlpha = Math.max(Math.round(backgroundColor.alpha/2.55)/100, .001); + let borderAlpha = Math.round(borderColor.alpha/2.55)/100; + + // The border and background alphas should remain in sync + // We also limit the borderAlpha to a maximum of 1 (full opacity) + borderAlpha = Math.min((borderAlpha/backgroundAlpha)*newAlpha, 1); + + this._customizedBackground = 'rgba(' + + backgroundColor.red + ',' + + backgroundColor.green + ',' + + backgroundColor.blue + ',' + + newAlpha + ')'; + + this._customizedBorder = 'rgba(' + + borderColor.red + ',' + + borderColor.green + ',' + + borderColor.blue + ',' + + borderAlpha + ')'; + + } + + _getDefaultColors() { + // Prevent shell crash if the actor is not on the stage. + // It happens enabling/disabling repeatedly the extension + if (!this._dash._container.get_stage()) + return [null, null]; + + // Remove custom style + let oldStyle = this._dash._container.get_style(); + this._dash._container.set_style(null); + + let themeNode = this._dash._container.get_theme_node(); + this._dash._container.set_style(oldStyle); + + let backgroundColor = themeNode.get_background_color(); + + // Just in case the theme has different border colors .. + // We want to find the inside border-color of the dock because it is + // the side most visible to the user. We do this by finding the side + // opposite the position + let position = Utils.getPosition(); + let side = position + 2; + if (side > 3) + side = Math.abs(side - 4); + + let borderColor = themeNode.get_border_color(side); + + return [backgroundColor, borderColor]; + } + + _updateDashColor() { + // Retrieve the color. If needed we will adjust it before passing it to + // this._transparency. + let [backgroundColor, borderColor] = this._getDefaultColors(); + + if (backgroundColor==null) + return; + + let settings = Docking.DockManager.settings; + + if (settings.get_boolean('custom-background-color')) { + // When applying a custom color, we need to check the alpha value, + // if not the opacity will always be overridden by the color below. + // Note that if using 'dynamic' transparency modes, + // the opacity will be set by the opaque/transparent styles anyway. + let newAlpha = Math.round(backgroundColor.alpha/2.55)/100; + if (settings.get_enum('transparency-mode') == TransparencyMode.FIXED) + newAlpha = settings.get_double('background-opacity'); + + backgroundColor = Clutter.color_from_string(settings.get_string('background-color'))[1]; + this._customizedBackground = 'rgba(' + + backgroundColor.red + ',' + + backgroundColor.green + ',' + + backgroundColor.blue + ',' + + newAlpha + ')'; + + this._customizedBorder = this._customizedBackground; + } + this._transparency.setColor(backgroundColor); + } + + _updateCustomStyleClasses() { + let settings = Docking.DockManager.settings; + + if (settings.get_boolean('apply-custom-theme')) + this._actor.add_style_class_name('dashtodock'); + else + this._actor.remove_style_class_name('dashtodock'); + + if (settings.get_boolean('custom-theme-shrink')) + this._actor.add_style_class_name('shrink'); + else + this._actor.remove_style_class_name('shrink'); + + if (settings.get_enum('running-indicator-style') !== 0) + this._actor.add_style_class_name('running-dots'); + else + this._actor.remove_style_class_name('running-dots'); + + // If not the built-in theme option is not selected + if (!settings.get_boolean('apply-custom-theme')) { + if (settings.get_boolean('force-straight-corner')) + this._actor.add_style_class_name('straight-corner'); + else + this._actor.remove_style_class_name('straight-corner'); + } else { + this._actor.remove_style_class_name('straight-corner'); + } + } + + updateCustomTheme() { + this._updateCustomStyleClasses(); + this._updateDashOpacity(); + this._updateDashColor(); + this._adjustTheme(); + this._dash._redisplay(); + } + + /** + * Reimported back and adapted from atomdock + */ + _adjustTheme() { + // Prevent shell crash if the actor is not on the stage. + // It happens enabling/disabling repeatedly the extension + if (!this._dash._container.get_stage()) + return; + + let settings = Docking.DockManager.settings; + + // Remove prior style edits + this._dash._container.set_style(null); + this._transparency.disable(); + + // If built-in theme is enabled do nothing else + if (settings.get_boolean('apply-custom-theme')) + return; + + let newStyle = ''; + let position = Utils.getPosition(settings); + + // obtain theme border settings + let themeNode = this._dash._container.get_theme_node(); + let borderColor = themeNode.get_border_color(St.Side.TOP); + let borderWidth = themeNode.get_border_width(St.Side.TOP); + let borderRadius = themeNode.get_border_radius(St.Corner.TOPRIGHT); + + // We're copying border and corner styles to left border and top-left + // corner, also removing bottom border and bottom-right corner styles + let borderInner = ''; + let borderRadiusValue = ''; + let borderMissingStyle = ''; + + if (this._rtl && (position != St.Side.RIGHT)) + borderMissingStyle = 'border-right: ' + borderWidth + 'px solid ' + + borderColor.to_string() + ';'; + else if (!this._rtl && (position != St.Side.LEFT)) + borderMissingStyle = 'border-left: ' + borderWidth + 'px solid ' + + borderColor.to_string() + ';'; + + switch (position) { + case St.Side.LEFT: + borderInner = 'border-left'; + borderRadiusValue = '0 ' + borderRadius + 'px ' + borderRadius + 'px 0;'; + break; + case St.Side.RIGHT: + borderInner = 'border-right'; + borderRadiusValue = borderRadius + 'px 0 0 ' + borderRadius + 'px;'; + break; + case St.Side.TOP: + borderInner = 'border-top'; + borderRadiusValue = '0 0 ' + borderRadius + 'px ' + borderRadius + 'px;'; + break; + case St.Side.BOTTOM: + borderInner = 'border-bottom'; + borderRadiusValue = borderRadius + 'px ' + borderRadius + 'px 0 0;'; + break; + } + + newStyle = borderInner + ': none;' + + 'border-radius: ' + borderRadiusValue + + borderMissingStyle; + + // I do call set_style possibly twice so that only the background gets the transition. + // The transition-property css rules seems to be unsupported + this._dash._container.set_style(newStyle); + + // Customize background + let fixedTransparency = settings.get_enum('transparency-mode') == TransparencyMode.FIXED; + let defaultTransparency = settings.get_enum('transparency-mode') == TransparencyMode.DEFAULT; + if (!defaultTransparency && !fixedTransparency) { + this._transparency.enable(); + } + else if (!defaultTransparency || settings.get_boolean('custom-background-color')) { + newStyle = newStyle + 'background-color:'+ this._customizedBackground + '; ' + + 'border-color:'+ this._customizedBorder + '; ' + + 'transition-delay: 0s; transition-duration: 0.250s;'; + this._dash._container.set_style(newStyle); + } + } + + _bindSettingsChanges() { + let keys = ['transparency-mode', + 'customize-alphas', + 'min-alpha', + 'max-alpha', + 'background-opacity', + 'custom-background-color', + 'background-color', + 'apply-custom-theme', + 'custom-theme-shrink', + 'custom-theme-running-dots', + 'extend-height', + 'force-straight-corner']; + + keys.forEach(function(key) { + this._signalsHandler.add([ + Docking.DockManager.settings, + 'changed::' + key, + this.updateCustomTheme.bind(this) + ]); + }, this); + } +}; + +/** + * The following class is based on the following upstream commit: + * https://git.gnome.org/browse/gnome-shell/commit/?id=447bf55e45b00426ed908b1b1035f472c2466956 + * Transparency when free-floating + */ +var Transparency = class DashToDock_Transparency { + + constructor(dock) { + this._dash = dock.dash; + this._actor = this._dash._container; + this._dockActor = dock; + this._dock = dock; + this._panel = Main.panel; + this._position = Utils.getPosition(); + + // All these properties are replaced with the ones in the .dummy-opaque and .dummy-transparent css classes + this._backgroundColor = '0,0,0'; + this._transparentAlpha = '0.2'; + this._opaqueAlpha = '1'; + this._transparentAlphaBorder = '0.1'; + this._opaqueAlphaBorder = '0.5'; + this._transparentTransition = '0ms'; + this._opaqueTransition = '0ms'; + this._base_actor_style = ""; + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._injectionsHandler = new Utils.InjectionsHandler(); + this._trackedWindows = new Map(); + } + + enable() { + // ensure I never double-register/inject + // although it should never happen + this.disable(); + + this._base_actor_style = this._actor.get_style(); + if (this._base_actor_style == null) { + this._base_actor_style = ""; + } + + this._signalsHandler.addWithLabel('transparency', [ + global.window_group, + 'actor-added', + this._onWindowActorAdded.bind(this) + ], [ + global.window_group, + 'actor-removed', + this._onWindowActorRemoved.bind(this) + ], [ + global.window_manager, + 'switch-workspace', + this._updateSolidStyle.bind(this) + ], [ + Main.overview, + 'hiding', + this._updateSolidStyle.bind(this) + ], [ + Main.overview, + 'showing', + this._updateSolidStyle.bind(this) + ]); + + // Window signals + global.window_group.get_children().filter(function(child) { + // An irrelevant window actor ('Gnome-shell') produces an error when the signals are + // disconnected, therefore do not add signals to it. + return child instanceof Meta.WindowActor && + child.get_meta_window().get_wm_class() !== 'Gnome-shell'; + }).forEach(function(win) { + this._onWindowActorAdded(null, win); + }, this); + + if (this._actor.get_stage()) + this._updateSolidStyle(); + + this._updateStyles(); + this._updateSolidStyle(); + + this.emit('transparency-enabled'); + } + + disable() { + // ensure I never double-register/inject + // although it should never happen + this._signalsHandler.removeWithLabel('transparency'); + + for (let key of this._trackedWindows.keys()) + this._trackedWindows.get(key).forEach(id => { + key.disconnect(id); + }); + this._trackedWindows.clear(); + + this.emit('transparency-disabled'); + } + + destroy() { + this.disable(); + this._signalsHandler.destroy(); + this._injectionsHandler.destroy(); + } + + _onWindowActorAdded(container, metaWindowActor) { + let signalIds = []; + ['allocation-changed', 'notify::visible'].forEach(s => { + signalIds.push(metaWindowActor.connect(s, this._updateSolidStyle.bind(this))); + }); + this._trackedWindows.set(metaWindowActor, signalIds); + } + + _onWindowActorRemoved(container, metaWindowActor) { + if (!this._trackedWindows.get(metaWindowActor)) + return; + + this._trackedWindows.get(metaWindowActor).forEach(id => { + metaWindowActor.disconnect(id); + }); + this._trackedWindows.delete(metaWindowActor); + this._updateSolidStyle(); + } + + _updateSolidStyle() { + let isNear = this._dockIsNear(); + if (isNear) { + this._actor.set_style(this._opaque_style); + this._dockActor.remove_style_class_name('transparent'); + this._dockActor.add_style_class_name('opaque'); + } + else { + this._actor.set_style(this._transparent_style); + this._dockActor.remove_style_class_name('opaque'); + this._dockActor.add_style_class_name('transparent'); + } + + this.emit('solid-style-updated', isNear); + } + + _dockIsNear() { + if (this._dockActor.has_style_pseudo_class('overview')) + return false; + /* Get all the windows in the active workspace that are in the primary monitor and visible */ + let activeWorkspace = global.workspace_manager.get_active_workspace(); + let dash = this._dash; + let windows = activeWorkspace.list_windows().filter(function(metaWindow) { + return metaWindow.get_monitor() === dash._monitorIndex && + metaWindow.showing_on_its_workspace() && + metaWindow.get_window_type() != Meta.WindowType.DESKTOP; + }); + + /* Check if at least one window is near enough to the panel. + * If the dock is hidden, we need to account for the space it would take + * up when it slides out. This is avoid an ugly transition. + * */ + let factor = 0; + if (!Docking.DockManager.settings.get_boolean('dock-fixed') && + this._dock.getDockState() == Docking.State.HIDDEN) + factor = 1; + let [leftCoord, topCoord] = this._actor.get_transformed_position(); + let threshold; + if (this._position === St.Side.LEFT) + threshold = leftCoord + this._actor.get_width() * (factor + 1); + else if (this._position === St.Side.RIGHT) + threshold = leftCoord - this._actor.get_width() * factor; + else if (this._position === St.Side.TOP) + threshold = topCoord + this._actor.get_height() * (factor + 1); + else + threshold = topCoord - this._actor.get_height() * factor; + + let scale = St.ThemeContext.get_for_stage(global.stage).scale_factor; + let isNearEnough = windows.some((metaWindow) => { + let coord; + if (this._position === St.Side.LEFT) { + coord = metaWindow.get_frame_rect().x; + return coord < threshold + 5 * scale; + } + else if (this._position === St.Side.RIGHT) { + coord = metaWindow.get_frame_rect().x + metaWindow.get_frame_rect().width; + return coord > threshold - 5 * scale; + } + else if (this._position === St.Side.TOP) { + coord = metaWindow.get_frame_rect().y; + return coord < threshold + 5 * scale; + } + else { + coord = metaWindow.get_frame_rect().y + metaWindow.get_frame_rect().height; + return coord > threshold - 5 * scale; + } + }); + + return isNearEnough; + } + + _updateStyles() { + this._getAlphas(); + + this._transparent_style = this._base_actor_style + + 'background-color: rgba(' + + this._backgroundColor + ', ' + this._transparentAlpha + ');' + + 'border-color: rgba(' + + this._backgroundColor + ', ' + this._transparentAlphaBorder + ');' + + 'transition-duration: ' + this._transparentTransition + 'ms;'; + + this._opaque_style = this._base_actor_style + + 'background-color: rgba(' + + this._backgroundColor + ', ' + this._opaqueAlpha + ');' + + 'border-color: rgba(' + + this._backgroundColor + ',' + this._opaqueAlphaBorder + ');' + + 'transition-duration: ' + this._opaqueTransition + 'ms;'; + + this.emit('styles-updated'); + } + + setColor(color) { + this._backgroundColor = color.red + ',' + color.green + ',' + color.blue; + this._updateStyles(); + } + + _getAlphas() { + // Create dummy object and add to the uiGroup to get it to the stage + let dummyObject = new St.Bin({ + name: 'dashtodockContainer', + }); + Main.uiGroup.add_child(dummyObject); + + dummyObject.add_style_class_name('dummy-opaque'); + let themeNode = dummyObject.get_theme_node(); + this._opaqueAlpha = themeNode.get_background_color().alpha / 255; + this._opaqueAlphaBorder = themeNode.get_border_color(0).alpha / 255; + this._opaqueTransition = themeNode.get_transition_duration(); + + dummyObject.add_style_class_name('dummy-transparent'); + themeNode = dummyObject.get_theme_node(); + this._transparentAlpha = themeNode.get_background_color().alpha / 255; + this._transparentAlphaBorder = themeNode.get_border_color(0).alpha / 255; + this._transparentTransition = themeNode.get_transition_duration(); + + Main.uiGroup.remove_child(dummyObject); + + let settings = Docking.DockManager.settings; + + if (settings.get_boolean('customize-alphas')) { + this._opaqueAlpha = settings.get_double('max-alpha'); + this._opaqueAlphaBorder = this._opaqueAlpha / 2; + this._transparentAlpha = settings.get_double('min-alpha'); + this._transparentAlphaBorder = this._transparentAlpha / 2; + } + } +}; +Signals.addSignalMethods(Transparency.prototype); diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/utils.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/utils.js new file mode 100644 index 00000000..e0281347 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/utils.js @@ -0,0 +1,284 @@ +const Clutter = imports.gi.Clutter; +const Meta = imports.gi.Meta; +const St = imports.gi.St; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Docking = Me.imports.docking; + +var SignalsHandlerFlags = { + NONE: 0, + CONNECT_AFTER: 1 +}; + +/** + * Simplify global signals and function injections handling + * abstract class + */ +const BasicHandler = class DashToDock_BasicHandler { + + constructor() { + this._storage = new Object(); + } + + add(/* unlimited 3-long array arguments */) { + // Convert arguments object to array, concatenate with generic + let args = Array.concat('generic', Array.slice(arguments)); + // Call addWithLabel with ags as if they were passed arguments + this.addWithLabel.apply(this, args); + } + + destroy() { + for( let label in this._storage ) + this.removeWithLabel(label); + } + + addWithLabel(label /* plus unlimited 3-long array arguments*/) { + if (this._storage[label] == undefined) + this._storage[label] = new Array(); + + // Skip first element of the arguments + for (let i = 1; i < arguments.length; i++) { + let item = this._storage[label]; + try { + item.push(this._create(arguments[i])); + } catch (e) { + logError(e); + } + } + } + + removeWithLabel(label) { + if (this._storage[label]) { + for (let i = 0; i < this._storage[label].length; i++) + this._remove(this._storage[label][i]); + + delete this._storage[label]; + } + } + + // Virtual methods to be implemented by subclass + + /** + * Create single element to be stored in the storage structure + */ + _create(item) { + throw new GObject.NotImplementedError(`_create in ${this.constructor.name}`); + } + + /** + * Correctly delete single element + */ + _remove(item) { + throw new GObject.NotImplementedError(`_remove in ${this.constructor.name}`); + } +}; + +/** + * Manage global signals + */ +var GlobalSignalsHandler = class DashToDock_GlobalSignalHandler extends BasicHandler { + + _create(item) { + let object = item[0]; + let event = item[1]; + let callback = item[2] + let flags = item.length > 3 ? item[3] : SignalsHandlerFlags.NONE; + + if (!object) + throw new Error('Impossible to connect to an invalid object'); + + let after = flags == SignalsHandlerFlags.CONNECT_AFTER; + let connector = after ? object.connect_after : object.connect; + + if (!connector) { + throw new Error(`Requested to connect to signal '${event}', ` + + `but no implementation for 'connect${after ? '_after' : ''}' `+ + `found in ${object.constructor.name}`); + } + + let id = connector.call(object, event, callback); + + return [object, id]; + } + + _remove(item) { + item[0].disconnect(item[1]); + } +}; + +/** + * Color manipulation utilities + */ +var ColorUtils = class DashToDock_ColorUtils { + + // Darken or brigthen color by a fraction dlum + // Each rgb value is modified by the same fraction. + // Return "#rrggbb" string + static ColorLuminance(r, g, b, dlum) { + let rgbString = '#'; + + rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(r*(1+dlum), 0), 255)), 2); + rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(g*(1+dlum), 0), 255)), 2); + rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(b*(1+dlum), 0), 255)), 2); + + return rgbString; + } + + // Convert decimal to an hexadecimal string adding the desired padding + static _decimalToHex(d, padding) { + let hex = d.toString(16); + while (hex.length < padding) + hex = '0'+ hex; + return hex; + } + + // Convert hsv ([0-1, 0-1, 0-1]) to rgb ([0-255, 0-255, 0-255]). + // Following algorithm in https://en.wikipedia.org/wiki/HSL_and_HSV + // here with h = [0,1] instead of [0, 360] + // Accept either (h,s,v) independently or {h:h, s:s, v:v} object. + // Return {r:r, g:g, b:b} object. + static HSVtoRGB(h, s, v) { + if (arguments.length === 1) { + s = h.s; + v = h.v; + h = h.h; + } + + let r,g,b; + let c = v*s; + let h1 = h*6; + let x = c*(1 - Math.abs(h1 % 2 - 1)); + let m = v - c; + + if (h1 <=1) + r = c + m, g = x + m, b = m; + else if (h1 <=2) + r = x + m, g = c + m, b = m; + else if (h1 <=3) + r = m, g = c + m, b = x + m; + else if (h1 <=4) + r = m, g = x + m, b = c + m; + else if (h1 <=5) + r = x + m, g = m, b = c + m; + else + r = c + m, g = m, b = x + m; + + return { + r: Math.round(r * 255), + g: Math.round(g * 255), + b: Math.round(b * 255) + }; + } + + // Convert rgb ([0-255, 0-255, 0-255]) to hsv ([0-1, 0-1, 0-1]). + // Following algorithm in https://en.wikipedia.org/wiki/HSL_and_HSV + // here with h = [0,1] instead of [0, 360] + // Accept either (r,g,b) independently or {r:r, g:g, b:b} object. + // Return {h:h, s:s, v:v} object. + static RGBtoHSV(r, g, b) { + if (arguments.length === 1) { + r = r.r; + g = r.g; + b = r.b; + } + + let h,s,v; + + let M = Math.max(r, g, b); + let m = Math.min(r, g, b); + let c = M - m; + + if (c == 0) + h = 0; + else if (M == r) + h = ((g-b)/c) % 6; + else if (M == g) + h = (b-r)/c + 2; + else + h = (r-g)/c + 4; + + h = h/6; + v = M/255; + if (M !== 0) + s = c/M; + else + s = 0; + + return { + h: h, + s: s, + v: v + }; + } +}; + +/** + * Manage function injection: both instances and prototype can be overridden + * and restored + */ +var InjectionsHandler = class DashToDock_InjectionsHandler extends BasicHandler { + + _create(item) { + let object = item[0]; + let name = item[1]; + let injectedFunction = item[2]; + let original = object[name]; + + object[name] = injectedFunction; + return [object, name, injectedFunction, original]; + } + + _remove(item) { + let object = item[0]; + let name = item[1]; + let original = item[3]; + object[name] = original; + } +}; + +/** + * Return the actual position reverseing left and right in rtl + */ +function getPosition() { + let position = Docking.DockManager.settings.get_enum('dock-position'); + if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) { + if (position == St.Side.LEFT) + position = St.Side.RIGHT; + else if (position == St.Side.RIGHT) + position = St.Side.LEFT; + } + return position; +} + +function drawRoundedLine(cr, x, y, width, height, isRoundLeft, isRoundRight, stroke, fill) { + if (height > width) { + y += Math.floor((height - width) / 2.0); + height = width; + } + + height = 2.0 * Math.floor(height / 2.0); + + var leftRadius = isRoundLeft ? height / 2.0 : 0.0; + var rightRadius = isRoundRight ? height / 2.0 : 0.0; + + cr.moveTo(x + width - rightRadius, y); + cr.lineTo(x + leftRadius, y); + if (isRoundLeft) + cr.arcNegative(x + leftRadius, y + leftRadius, leftRadius, -Math.PI/2, Math.PI/2); + else + cr.lineTo(x, y + height); + cr.lineTo(x + width - rightRadius, y + height); + if (isRoundRight) + cr.arcNegative(x + width - rightRadius, y + rightRadius, rightRadius, Math.PI/2, -Math.PI/2); + else + cr.lineTo(x + width, y); + cr.closePath(); + + if (fill != null) { + cr.setSource(fill); + cr.fillPreserve(); + } + if (stroke != null) + cr.setSource(stroke); + cr.stroke(); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/windowPreview.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/windowPreview.js new file mode 100644 index 00000000..a34cb080 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/windowPreview.js @@ -0,0 +1,586 @@ +/* + * Credits: + * This file is based on code from the Dash to Panel extension by Jason DeRose + * and code from the Taskbar extension by Zorin OS + * Some code was also adapted from the upstream Gnome Shell source code. + */ +const Clutter = imports.gi.Clutter; +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const St = imports.gi.St; +const Mainloop = imports.mainloop; +const Main = imports.ui.main; +const Gtk = imports.gi.Gtk; + +const Params = imports.misc.params; +const PopupMenu = imports.ui.popupMenu; +const Workspace = imports.ui.workspace; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Utils = Me.imports.utils; + +const PREVIEW_MAX_WIDTH = 250; +const PREVIEW_MAX_HEIGHT = 150; + +const PREVIEW_ANIMATION_DURATION = 250; + +var WindowPreviewMenu = class DashToDock_WindowPreviewMenu extends PopupMenu.PopupMenu { + + constructor(source) { + let side = Utils.getPosition(); + super(source.actor, 0.5, side); + + // We want to keep the item hovered while the menu is up + this.blockSourceEvents = true; + + this._source = source; + this._app = this._source.app; + let monitorIndex = this._source.monitorIndex; + + this.actor.add_style_class_name('app-well-menu'); + this.actor.set_style('max-width: ' + (Main.layoutManager.monitors[monitorIndex].width - 22) + 'px; ' + + 'max-height: ' + (Main.layoutManager.monitors[monitorIndex].height - 22) + 'px;'); + this.actor.hide(); + + // Chain our visibility and lifecycle to that of the source + this._mappedId = this._source.actor.connect('notify::mapped', () => { + if (!this._source.actor.mapped) + this.close(); + }); + this._destroyId = this._source.actor.connect('destroy', this.destroy.bind(this)); + + Main.uiGroup.add_actor(this.actor); + + // Change the initialized side where required. + this._arrowSide = side; + this._boxPointer._arrowSide = side; + this._boxPointer._userArrowSide = side; + + this.connect('destroy', this._onDestroy.bind(this)); + } + + _redisplay() { + if (this._previewBox) + this._previewBox.destroy(); + this._previewBox = new WindowPreviewList(this._source); + this.addMenuItem(this._previewBox); + this._previewBox._redisplay(); + } + + popup() { + let windows = this._source.getInterestingWindows(); + if (windows.length > 0) { + this._redisplay(); + this.open(); + this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false); + this._source.emit('sync-tooltip'); + } + } + + _onDestroy() { + if (this._mappedId) + this._source.actor.disconnect(this._mappedId); + + if (this._destroyId) + this._source.actor.disconnect(this._destroyId); + } +}; + +var WindowPreviewList = class DashToDock_WindowPreviewList extends PopupMenu.PopupMenuSection { + + constructor(source) { + super(); + this.actor = new St.ScrollView({ name: 'dashtodockWindowScrollview', + hscrollbar_policy: Gtk.PolicyType.NEVER, + vscrollbar_policy: Gtk.PolicyType.NEVER, + enable_mouse_scrolling: true }); + + this.actor.connect('scroll-event', this._onScrollEvent.bind(this)); + + let position = Utils.getPosition(); + this.isHorizontal = position == St.Side.BOTTOM || position == St.Side.TOP; + this.box.set_vertical(!this.isHorizontal); + this.box.set_name('dashtodockWindowList'); + this.actor.add_actor(this.box); + this.actor._delegate = this; + + this._shownInitially = false; + + this._source = source; + this.app = source.app; + + this._redisplayId = Main.initializeDeferredWork(this.actor, this._redisplay.bind(this)); + + this.actor.connect('destroy', this._onDestroy.bind(this)); + this._stateChangedId = this.app.connect('windows-changed', + this._queueRedisplay.bind(this)); + } + + _queueRedisplay () { + Main.queueDeferredWork(this._redisplayId); + } + + _onScrollEvent(actor, event) { + // Event coordinates are relative to the stage but can be transformed + // as the actor will only receive events within his bounds. + let stage_x, stage_y, ok, event_x, event_y, actor_w, actor_h; + [stage_x, stage_y] = event.get_coords(); + [ok, event_x, event_y] = actor.transform_stage_point(stage_x, stage_y); + [actor_w, actor_h] = actor.get_size(); + + // If the scroll event is within a 1px margin from + // the relevant edge of the actor, let the event propagate. + if (event_y >= actor_h - 2) + return Clutter.EVENT_PROPAGATE; + + // Skip to avoid double events mouse + if (event.is_pointer_emulated()) + return Clutter.EVENT_STOP; + + let adjustment, delta; + + if (this.isHorizontal) + adjustment = this.actor.get_hscroll_bar().get_adjustment(); + else + adjustment = this.actor.get_vscroll_bar().get_adjustment(); + + let increment = adjustment.step_increment; + + switch ( event.get_scroll_direction() ) { + case Clutter.ScrollDirection.UP: + delta = -increment; + break; + case Clutter.ScrollDirection.DOWN: + delta = +increment; + break; + case Clutter.ScrollDirection.SMOOTH: + let [dx, dy] = event.get_scroll_delta(); + delta = dy*increment; + delta += dx*increment; + break; + + } + + adjustment.set_value(adjustment.get_value() + delta); + + return Clutter.EVENT_STOP; + } + + _onDestroy() { + this.app.disconnect(this._stateChangedId); + this._stateChangedId = 0; + } + + _createPreviewItem(window) { + let preview = new WindowPreviewMenuItem(window); + return preview; + } + + _redisplay () { + let children = this._getMenuItems().filter(function(actor) { + return actor._window; + }); + + // Windows currently on the menu + let oldWin = children.map(function(actor) { + return actor._window; + }); + + // All app windows with a static order + let newWin = this._source.getInterestingWindows().sort(function(a, b) { + return a.get_stable_sequence() > b.get_stable_sequence(); + }); + + let addedItems = []; + let removedActors = []; + + let newIndex = 0; + let oldIndex = 0; + + while (newIndex < newWin.length || oldIndex < oldWin.length) { + // No change at oldIndex/newIndex + if (oldWin[oldIndex] && + oldWin[oldIndex] == newWin[newIndex]) { + oldIndex++; + newIndex++; + continue; + } + + // Window removed at oldIndex + if (oldWin[oldIndex] && + newWin.indexOf(oldWin[oldIndex]) == -1) { + removedActors.push(children[oldIndex]); + oldIndex++; + continue; + } + + // Window added at newIndex + if (newWin[newIndex] && + oldWin.indexOf(newWin[newIndex]) == -1) { + addedItems.push({ item: this._createPreviewItem(newWin[newIndex]), + pos: newIndex }); + newIndex++; + continue; + } + + // Window moved + let insertHere = newWin[newIndex + 1] && + newWin[newIndex + 1] == oldWin[oldIndex]; + let alreadyRemoved = removedActors.reduce(function(result, actor) { + let removedWin = actor._window; + return result || removedWin == newWin[newIndex]; + }, false); + + if (insertHere || alreadyRemoved) { + addedItems.push({ item: this._createPreviewItem(newWin[newIndex]), + pos: newIndex + removedActors.length }); + newIndex++; + } else { + removedActors.push(children[oldIndex]); + oldIndex++; + } + } + + for (let i = 0; i < addedItems.length; i++) + this.addMenuItem(addedItems[i].item, + addedItems[i].pos); + + for (let i = 0; i < removedActors.length; i++) { + let item = removedActors[i]; + if (this._shownInitially) + item._animateOutAndDestroy(); + else + item.actor.destroy(); + } + + // Skip animations on first run when adding the initial set + // of items, to avoid all items zooming in at once + let animate = this._shownInitially; + + if (!this._shownInitially) + this._shownInitially = true; + + for (let i = 0; i < addedItems.length; i++) + addedItems[i].item.show(animate); + + // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=692744 + // Without it, StBoxLayout may use a stale size cache + this.box.queue_relayout(); + + if (newWin.length < 1) + this._getTopMenu().close(~0); + + // As for upstream: + // St.ScrollView always requests space horizontally for a possible vertical + // scrollbar if in AUTOMATIC mode. Doing better would require implementation + // of width-for-height in St.BoxLayout and St.ScrollView. This looks bad + // when we *don't* need it, so turn off the scrollbar when that's true. + // Dynamic changes in whether we need it aren't handled properly. + let needsScrollbar = this._needsScrollbar(); + let scrollbar_policy = needsScrollbar ? Gtk.PolicyType.AUTOMATIC : Gtk.PolicyType.NEVER; + if (this.isHorizontal) + this.actor.hscrollbar_policy = scrollbar_policy; + else + this.actor.vscrollbar_policy = scrollbar_policy; + + if (needsScrollbar) + this.actor.add_style_pseudo_class('scrolled'); + else + this.actor.remove_style_pseudo_class('scrolled'); + } + + _needsScrollbar() { + let topMenu = this._getTopMenu(); + let topThemeNode = topMenu.actor.get_theme_node(); + if (this.isHorizontal) { + let [topMinWidth, topNaturalWidth] = topMenu.actor.get_preferred_width(-1); + let topMaxWidth = topThemeNode.get_max_width(); + return topMaxWidth >= 0 && topNaturalWidth >= topMaxWidth; + } else { + let [topMinHeight, topNaturalHeight] = topMenu.actor.get_preferred_height(-1); + let topMaxHeight = topThemeNode.get_max_height(); + return topMaxHeight >= 0 && topNaturalHeight >= topMaxHeight; + } + + } + + isAnimatingOut() { + return this.actor.get_children().reduce(function(result, actor) { + return result || actor.animatingOut; + }, false); + } +}; + +var WindowPreviewMenuItem = GObject.registerClass( +class DashToDock_WindowPreviewMenuItem extends PopupMenu.PopupBaseMenuItem { + _init(window, params) { + super._init(params); + + this._window = window; + this._destroyId = 0; + this._windowAddedId = 0; + + // We don't want this: it adds spacing on the left of the item. + this.remove_child(this._ornamentLabel); + this.add_style_class_name('dashtodock-app-well-preview-menu-item'); + + this._cloneBin = new St.Bin(); + this._cloneBin.set_size(PREVIEW_MAX_WIDTH, PREVIEW_MAX_HEIGHT); + + // TODO: improve the way the closebutton is layout. Just use some padding + // for the moment. + this._cloneBin.set_style('padding-bottom: 0.5em'); + + this.closeButton = new St.Button({ style_class: 'window-close', + x_expand: true, + y_expand: true}); + this.closeButton.add_actor(new St.Icon({ icon_name: 'window-close-symbolic' })); + this.closeButton.set_x_align(Clutter.ActorAlign.END); + this.closeButton.set_y_align(Clutter.ActorAlign.START); + + + this.closeButton.opacity = 0; + this.closeButton.connect('clicked', this._closeWindow.bind(this)); + + let overlayGroup = new Clutter.Actor({layout_manager: new Clutter.BinLayout() }); + + overlayGroup.add_actor(this._cloneBin); + overlayGroup.add_actor(this.closeButton); + + let label = new St.Label({ text: window.get_title()}); + label.set_style('max-width: '+PREVIEW_MAX_WIDTH +'px'); + let labelBin = new St.Bin({ child: label, + x_align: St.Align.MIDDLE}); + + this._windowTitleId = this._window.connect('notify::title', () => { + label.set_text(this._window.get_title()); + }); + + let box = new St.BoxLayout({ vertical: true, + reactive:true, + x_expand:true }); + box.add(overlayGroup); + box.add(labelBin); + this.add_actor(box); + + this.connect('enter-event', this._onEnter.bind(this)); + this.connect('leave-event', this._onLeave.bind(this)); + this.connect('key-focus-in', this._onEnter.bind(this)); + this.connect('key-focus-out', this._onLeave.bind(this)); + + this._cloneTexture(window); + + } + + _cloneTexture(metaWin){ + + let mutterWindow = metaWin.get_compositor_private(); + + // Newly-created windows are added to a workspace before + // the compositor finds out about them... + // Moreover sometimes they return an empty texture, thus as a workarounf also check for it size + if (!mutterWindow || !mutterWindow.get_texture() || !mutterWindow.get_size()[0]) { + this._cloneTextureId = Mainloop.idle_add(() => { + // Check if there's still a point in getting the texture, + // otherwise this could go on indefinitely + if (metaWin.get_workspace()) + this._cloneTexture(metaWin); + this._cloneTextureId = 0; + return GLib.SOURCE_REMOVE; + }); + GLib.Source.set_name_by_id(this._cloneTextureId, '[dash-to-dock] this._cloneTexture'); + return; + } + + let [width, height] = mutterWindow.get_size(); + let scale = Math.min(1.0, PREVIEW_MAX_WIDTH/width, PREVIEW_MAX_HEIGHT/height); + let clone = new Clutter.Clone ({ source: mutterWindow, + reactive: true, + width: width * scale, + height: height * scale }); + + // when the source actor is destroyed, i.e. the window closed, first destroy the clone + // and then destroy the menu item (do this animating out) + this._destroyId = mutterWindow.connect('destroy', () => { + clone.destroy(); + this._destroyId = 0; // avoid to try to disconnect this signal from mutterWindow in _onDestroy(), + // as the object was just destroyed + this._animateOutAndDestroy(); + }); + + this._clone = clone; + this._mutterWindow = mutterWindow; + this._cloneBin.set_child(this._clone); + + this._clone.connect('destroy', () => { + if (this._destroyId) { + mutterWindow.disconnect(this._destroyId); + this._destroyId = 0; + } + this._clone = null; + }) + } + + _windowCanClose() { + return this._window.can_close() && + !this._hasAttachedDialogs(); + } + + _closeWindow(actor) { + this._workspace = this._window.get_workspace(); + + // This mechanism is copied from the workspace.js upstream code + // It forces window activation if the windows don't get closed, + // for instance because asking user confirmation, by monitoring the opening of + // such additional confirmation window + this._windowAddedId = this._workspace.connect('window-added', + this._onWindowAdded.bind(this)); + + this.deleteAllWindows(); + } + + deleteAllWindows() { + // Delete all windows, starting from the bottom-most (most-modal) one + //let windows = this._window.get_compositor_private().get_children(); + let windows = this._clone.get_children(); + for (let i = windows.length - 1; i >= 1; i--) { + let realWindow = windows[i].source; + let metaWindow = realWindow.meta_window; + + metaWindow.delete(global.get_current_time()); + } + + this._window.delete(global.get_current_time()); + } + + _onWindowAdded(workspace, win) { + let metaWindow = this._window; + + if (win.get_transient_for() == metaWindow) { + workspace.disconnect(this._windowAddedId); + this._windowAddedId = 0; + + // use an idle handler to avoid mapping problems - + // see comment in Workspace._windowAdded + let activationEvent = Clutter.get_current_event(); + let id = Mainloop.idle_add(() => { + this.emit('activate', activationEvent); + return GLib.SOURCE_REMOVE; + }); + GLib.Source.set_name_by_id(id, '[dash-to-dock] this.emit'); + } + } + + _hasAttachedDialogs() { + // count trasient windows + let n=0; + this._window.foreach_transient(function(){n++;}); + return n>0; + } + + _onEnter() { + this._showCloseButton(); + return Clutter.EVENT_PROPAGATE; + } + + _onLeave() { + if (!this._cloneBin.has_pointer && + !this.closeButton.has_pointer) + this._hideCloseButton(); + + return Clutter.EVENT_PROPAGATE; + } + + _idleToggleCloseButton() { + this._idleToggleCloseId = 0; + + if (!this._cloneBin.has_pointer && + !this.closeButton.has_pointer) + this._hideCloseButton(); + + return GLib.SOURCE_REMOVE; + } + + _showCloseButton() { + + if (this._windowCanClose()) { + this.closeButton.show(); + this.closeButton.remove_all_transitions(); + this.closeButton.ease({ + opacity: 255, + duration: Workspace.WINDOW_OVERLAY_FADE_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD + }); + } + } + + _hideCloseButton() { + this.closeButton.remove_all_transitions(); + this.closeButton.ease({ + opacity: 0, + duration: Workspace.WINDOW_OVERLAY_FADE_TIME, + mode: Clutter.AnimationMode.EASE_IN_QUAD + }); + } + + show(animate) { + let fullWidth = this.get_width(); + + this.opacity = 0; + this.set_width(0); + + let time = animate ? PREVIEW_ANIMATION_DURATION : 0; + this.remove_all_transitions(); + this.ease({ + opacity: 255, + width: fullWidth, + duration: time, + mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD, + }); + } + + _animateOutAndDestroy() { + this.remove_all_transitions(); + this.ease({ + opacity: 0, + duration: PREVIEW_ANIMATION_DURATION, + }); + + this.ease({ + width: 0, + height: 0, + duration: PREVIEW_ANIMATION_DURATION, + delay: PREVIEW_ANIMATION_DURATION, + onComplete: () => this.destroy() + }); + } + + activate() { + this._getTopMenu().close(); + Main.activateWindow(this._window); + } + + _onDestroy() { + super._onDestroy(); + + if (this._cloneTextureId) { + GLib.source_remove(this._cloneTextureId); + this._cloneTextureId = 0; + } + + if (this._windowAddedId > 0) { + this._workspace.disconnect(this._windowAddedId); + this._windowAddedId = 0; + } + + if (this._destroyId > 0) { + this._mutterWindow.disconnect(this._destroyId); + this._destroyId = 0; + } + + if (this._windowTitleId > 0) { + this._window.disconnect(this._windowTitleId); + this._windowTitleId = 0; + } + } +}); diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/extension.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/extension.js new file mode 100644 index 00000000..1de4977c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/extension.js @@ -0,0 +1,35 @@ +'use strict'; + +// User Menu and Volume Indicator +const AggregateMenu = imports.ui.main.panel.statusArea.aggregateMenu; +const VolumeIndicator = AggregateMenu._volume; + +// Scroll Signal Id +var _onScrollEventId = null; + + +function init() { +} + + +function enable() { + // Make the User Menu indicator box reactive so it emits ::scroll-event + AggregateMenu._indicators.reactive = true; + + // Connect the same handler from the volume indicator to ::scroll-event + _onScrollEventId = AggregateMenu._indicators.connect( + 'scroll-event', + VolumeIndicator._onScrollEvent.bind(VolumeIndicator) + ); +} + + +function disable() { + // Undo the above + if (_onScrollEventId) { + AggregateMenu._indicators.reactive = false; + AggregateMenu._indicators.disconnect(_onScrollEventId); + _onScrollEventId = null; + } +} + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/metadata.json b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/metadata.json new file mode 100644 index 00000000..93457e9b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/scrovol@andyholmes.github.io/metadata.json @@ -0,0 +1,13 @@ +{ + "_generated": "Generated by SweetTooth, do not edit", + "description": "Change the volume by scrolling anywhere on the System Tray.\n\nWith this extension, you can scroll over Night Light, WiFi, Volume, Battery or any other icon in the system status tray to change the volume, instead of just the Volume icon.", + "extension-id": "scrovol", + "name": "Scrovol", + "shell-version": [ + "3.28", + "3.30" + ], + "url": "https://github.com/andyholmes/gnome-shell-extension-scrovol/", + "uuid": "scrovol@andyholmes.github.io", + "version": 1 +} \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js new file mode 100644 index 00000000..6d0ec5d8 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js @@ -0,0 +1,484 @@ +/******************************************************************************* + * 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 . + * ***************************************************************************** + * Original Author: Gopi Sankar Karmegam + ******************************************************************************/ +/* jshint moz:true */ + +const Main = imports.ui.main; +const PopupMenu = imports.ui.popupMenu; +const VolumeMenu = imports.ui.status.volume; +const {Atk, St, GObject, GLib} = imports.gi; + +const Gvc = imports.gi.Gvc; +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Lib = Me.imports.convenience; +const Prefs = Me.imports.prefs; +const SignalManager = Lib.SignalManager; + + +var SoundDeviceChooserBase = class SoundDeviceChooserBase{ + + constructor(deviceType) { + Lib.log("SDC: init"); + this.menuItem = new PopupMenu.PopupSubMenuMenuItem ('Extension initialising...', true); + this.deviceType = deviceType; + this._devices = {}; + this._availableDevicesIds = {}; + this._control = VolumeMenu.getMixerControl(); + this._settings = Lib.getSettings(Prefs.SETTINGS_SCHEMA); + Lib.log("Constructor" + deviceType); + + this._setLog(); + this._signalManager = new SignalManager(); + this._signalManager.addSignal(this._settings,"changed::" + Prefs.ENABLE_LOG, this._setLog.bind(this)); + + if(this._control.get_state() == Gvc.MixerControlState.READY) { + this._onControlStateChanged(); + } + else { + this._controlStateChangeSignal = this._signalManager.addSignal(this._control, "state-changed", this._onControlStateChanged.bind(this)); + } + } + + _setLog(){ Lib.setLog(this._settings.get_boolean(Prefs.ENABLE_LOG));} + + _onControlStateChanged() { + if(this._control.get_state() == Gvc.MixerControlState.READY) { + if(!this._initialised) { + this._initialised = true; + + this._signalManager.addSignal(this._control, this.deviceType + "-added", this._deviceAdded.bind(this)); + this._signalManager.addSignal(this._control, this.deviceType + "-removed", this._deviceRemoved.bind(this)); + this._signalManager.addSignal(this._control, "active-" + this.deviceType + "-update", this._deviceActivated.bind(this)); + + this._signalManager.addSignal(this._settings,"changed::" + Prefs.HIDE_ON_SINGLE_DEVICE,this._setChooserVisibility.bind(this) ); + this._signalManager.addSignal(this._settings,"changed::" + Prefs.SHOW_PROFILES , this._setProfileVisibility.bind(this)); + this._signalManager.addSignal(this._settings,"changed::" + Prefs.ICON_THEME , this._setIcons.bind(this)); + this._signalManager.addSignal(this._settings,"changed::" + Prefs.HIDE_MENU_ICONS , this._setIcons.bind(this)); + this._signalManager.addSignal(this._settings,"changed::" + Prefs.PORT_SETTINGS , this._resetDevices.bind(this)); + + this._show_device_signal = Prefs["SHOW_" + this.deviceType.toUpperCase() + "_DEVICES"]; + + this._signalManager.addSignal(this._settings,"changed::" + this._show_device_signal, this._setVisibility.bind(this)); + + this._portsSettings = JSON.parse(this._settings.get_string(Prefs.PORT_SETTINGS)); + + /** + * There is no direct way to get all the UI devices from + * mixercontrol. When enabled after shell loads, the signals + * will not be emitted, a simple hack to look for ids, until any + * uidevice is not found. The UI devices are always serialed + * from from 1 to n + */ + + let id = 0; + let maxId = -1; + let dummyDevice = new Gvc.MixerUIDevice(); + maxId = dummyDevice.get_id(); + Lib.log("Max Id:" + maxId); + + let defaultDevice = this.getDefaultDevice(); + while(++id < maxId) { + let uidevice = this._deviceAdded(this._control, id); + if(uidevice) { + let stream = this._control.get_stream_from_device(uidevice); + if(stream) { + let stream_port = stream.get_port(); + let uidevice_port = uidevice.get_port(); + + if(((!stream_port && !uidevice_port) || + (stream_port && stream_port.port === uidevice_port)) && + stream == defaultDevice) { + this._deviceActivated(this._control, id); + } + } + } + } + + this.activeProfileTimeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, + this._setActiveProfile.bind(this)); + + if(this._controlStateChangeSignal) { + this._controlStateChangeSignal.disconnect(); + delete this._controlStateChangeSignal; + } + this._setVisibility(); + } + } + } + + _deviceAdded(control, id, dontcheck) { + let obj = this._devices[id]; + let uidevice = null; + + if(!obj) { + uidevice = this.lookupDeviceById(id); + if(!uidevice) { + return null; + } + obj = new Object(); + obj.uidevice = uidevice; + obj.text = uidevice.description; + if(uidevice.origin != "") + obj.text += " (" + uidevice.origin + ")"; + + /* + * obj.item = this.menu.addAction( obj.text, function() { + * this.changeDevice(uidevice); }.bind(this)); let icon = + * uidevice.get_icon_name(); if(icon == null || icon.trim() == "") + * icon = this.getDefaultIcon(); obj.item._icon = new St.Icon({ + * style_class: 'popup-menu-icon', icon_name: this._getIcon(icon)}); + * obj.item.actor.insert_child_at_index(obj.item._icon,1); + */ + + let icon = uidevice.get_icon_name(); + if(icon == null || icon.trim() == "") + icon = this.getDefaultIcon(); + let icon_name = this._getIcon(icon); + + obj.item = this.menuItem.menu.addAction( obj.text, function() { + this.changeDevice(uidevice); + }.bind(this), icon_name); + + if(!obj.profiles) { + obj.profiles = Lib.getProfiles(control, uidevice); + } + + if(!obj.profilesitems) { + obj.profilesitems = []; + } + this._devices[id] = obj; + } + else { + uidevice = obj.uidevice; + } + + Lib.log(obj.text); + + if (obj.profiles) { + for (let profile of obj.profiles) { + Lib.log(profile.name) + } + } + + if(obj.active) { + return uidevice; + } + + Lib.log("Added: " + id + ":" + uidevice.description + ":" + uidevice.port_name); + if(!this._availableDevicesIds[id]){ + this._availableDevicesIds[id] = 0; + } + this._availableDevicesIds[id] ++; + + obj.active = true; + obj.activeProfile = uidevice.get_active_profile(); + let showProfiles = this._settings.get_boolean(Prefs.SHOW_PROFILES); + if (obj.profiles) { + for (let profile of obj.profiles) { + let profileItem = obj.profilesitems[profile.name]; + if(!profileItem) { + let profileName = profile.name; + profileItem = this.menuItem.menu.addAction( "Profile: " + profile.human_name, function() { + Lib.log("i am setting profile, " + profile.human_name + ":" + uidevice.description + ":" + uidevice.port_name); + if(this._activeDevice && this._activeDevice.uidevice !== uidevice) { + Lib.log("Changing active device to " + uidevice.description + ":" + uidevice.port_name); + this.changeDevice(uidevice); + } + this._control.change_profile_on_selected_device(uidevice, profileName); + this._setDeviceActiveProfile(obj); + }.bind(this)); + + obj.profilesitems[profileName] = profileItem; + profileItem.setProfileActive = function(active) { + if(active) { + // this._ornamentLabel.text = "\u2727"; + this._ornamentLabel.text = "\t\u266A"; + if(this.add_style_pseudo_class) { + this.add_style_pseudo_class('checked'); + this.remove_style_pseudo_class('insensitive'); + } + else { + this.actor.add_style_pseudo_class('checked'); + this.actor.remove_style_pseudo_class('insensitive'); + } + } + else { + this._ornamentLabel.text = "\t"; + if(this.add_style_pseudo_class) { + this.remove_style_pseudo_class('checked'); + this.add_style_pseudo_class('insensitive'); + } + else { + this.actor.remove_style_pseudo_class('checked'); + this.actor.add_style_pseudo_class('insensitive'); + } + } + }; + // profileItem._ornamentLabel.width = "500em"; + profileItem._ornamentLabel.set_style("min-width: 3em;"); + } + profileItem.setProfileActive(obj.activeProfile == profile.name); + } + } + if (!dontcheck && !this._canShowDevice(uidevice, uidevice.port_available)) { + this._deviceRemoved(control, id, true); + } + this._setChooserVisibility(); + this._setVisibility(); + return uidevice; + } + + _deviceRemoved(control, id, dontcheck) { + let obj = this._devices[id]; + if(obj && obj.active) { + Lib.log("Removed: " + id); + if(!dontcheck && this._canShowDevice(obj.uidevice, false)) { + Lib.log('Device removed, but not hiding as its set to be shown always'); + return; + } + delete this._availableDevicesIds[id] ; + obj.item.actor.visible = false; + obj.active = false; + if (obj.profiles) { + for (let profile of obj.profiles) { + let profileItem = obj.profilesitems[profile.name]; + if(profileItem) { + profileItem.actor.visible = false; + } + } + } + + if(this.deviceRemovedTimout) { + GLib.source_remove(this.deviceRemovedTimout); + this.deviceRemovedTimout = null; + } + /** + * If the active uidevice is removed, then need to activate the + * first available uidevice. However for some cases like Headphones, + * when the uidevice is removed, Speakers are automatically + * activated. So, lets wait for sometime before activating. + */ + this.deviceRemovedTimout = GLib.timeout_add(GLib.PRIORITY_DEFAULT,1500, function() { + if (obj === this._activeDevice) { + for ( let id in this._devices) { + let device = this._devices[id]; + if(device.active == true) { + this.changeDevice(device.uidevice); + break; + } + } + } + this.deviceRemovedTimout = null; + return false; + }.bind(this)); + this._setChooserVisibility(); + this._setVisibility(); + } + } + + _deviceActivated(control, id) { + let obj = this._devices[id]; + if(obj && obj !== this._activeDevice) { + Lib.log("Activated: " + id); + if(this._activeDevice) { + this._activeDevice.item.setOrnament(PopupMenu.Ornament.NONE); + if(this._activeDevice.item.remove_style_pseudo_class) { + this._activeDevice.item.remove_style_pseudo_class('checked'); + } + else { + this._activeDevice.item.actor.remove_style_pseudo_class('checked'); + } + } + this._activeDevice = obj; + obj.item.setOrnament(PopupMenu.Ornament.CHECK); + if(obj.item.add_style_pseudo_class) { + obj.item.add_style_pseudo_class('checked'); + } + else { + obj.item.actor.add_style_pseudo_class('checked'); + } + + obj.item._ornamentLabel.text = '\u266B'; + this.menuItem.label.text = obj.text; + + if (!this._settings.get_boolean(Prefs.HIDE_MENU_ICONS)) { + let icon = obj.uidevice.get_icon_name(); + if(icon == null || icon.trim() == "") + icon = this.getDefaultIcon(); + this.menuItem.icon.icon_name = this._getIcon(icon); + } else { + this.menuItem.icon.icon_name = "blank"; + } + } + } + + _setActiveProfile() { + for (let id in this._devices) { + let device = this._devices[id]; + if(device.active) { + this._setDeviceActiveProfile(device); + } + } + return true; + } + + _setDeviceActiveProfile(device) { + if (!device.uidevice.port_name) { + return; + } + let activeProfile = device.uidevice.get_active_profile(); + if(activeProfile && device.activeProfile != activeProfile) { + device.activeProfile = activeProfile; + for (let profile of device.profiles) { + device.profilesitems[profile.name].setProfileActive(profile.name == device.activeProfile); + } + } + } + + _getDeviceVisibility() { + let hideChooser = this._settings.get_boolean(Prefs.HIDE_ON_SINGLE_DEVICE); + if (hideChooser) { + return (Object.keys(this._availableDevicesIds).length > 1); + } + else { + return true; + } + } + + _setChooserVisibility() { + let visibility = this._getDeviceVisibility(); + for (let id in this._availableDevicesIds) { + this._devices[id].item.actor.visible = visibility; + } + this.menuItem._triangleBin.visible = visibility; + this._setProfileVisibility(); + } + + _setProfileVisibility() { + let visibility = this._settings.get_boolean(Prefs.SHOW_PROFILES); + for (let id in this._availableDevicesIds) { + let device = this._devices[id]; + if ( device.profiles ) { + for (let profile of device.profiles) { + device.profilesitems[profile.name].actor.visible = + (visibility && device.item.actor.visible && Object.keys(device.profilesitems).length > 1); + } + } + } + } + + _getIcon(name) { + let iconsType = this._settings.get_string(Prefs.ICON_THEME); + switch (iconsType) { + case Prefs.ICON_THEME_COLORED: + return name; + case Prefs.ICON_THEME_MONOCHROME: + return name + "-symbolic"; + default: + return "none"; + } + } + + _setIcons() { + // Set the icons in the selection list + for (let id in this._devices) { + let device = this._devices[id]; + let icon = device.uidevice.get_icon_name(); + if(icon == null || icon.trim() == "") + icon = this.getDefaultIcon(); + // device.item._icon.icon_name = this._getIcon(icon); + device.item.setIcon(this._getIcon(icon)); + } + + // These indicate the active device, which is displayed directly in the + // Gnome menu, not in the list. + if (!this._settings.get_boolean(Prefs.HIDE_MENU_ICONS)) { + let icon = this._activeDevice.uidevice.get_icon_name(); + if(icon == null || icon.trim() == "") + icon = this.getDefaultIcon(); + + this.menuItem.icon.icon_name = this._getIcon(icon); + } else { + this.menuItem.icon.icon_name = "blank"; + } + } + + + _canShowDevice(uidevice, defaultValue) { + if(!uidevice || !this._portsSettings || uidevice.port_name == null || uidevice.description == null) { + return defaultValue; + } + + for (let port of this._portsSettings) { + if(port && port.name == uidevice.port_name && port.human_name == uidevice.description) { + switch(port.display_option) { + case 1: + return true; + + case 2: + return false; + + default: + return defaultValue; + } + } + } + return defaultValue; + } + + _resetDevices() { + this._portsSettings = JSON.parse(this._settings.get_string(Prefs.PORT_SETTINGS)); + for (let id in this._devices) { + let device = this._devices[id]; + let uidevice = device.uidevice; + if(uidevice.port_name == null || uidevice.description == null) { + continue; + } + switch(this._canShowDevice(uidevice, uidevice.port_available)) { + case true: + this._deviceAdded(this._control, uidevice.get_id(), true); + break; + case false: + this._deviceRemoved(this._control, uidevice.get_id(), true); + break; + } + } + } + + _setVisibility () { + if (!this._settings.get_boolean(this._show_device_signal)) + this.menuItem.actor.visible = false; + else + // if setting says to show device, check for any device, otherwise + // hide the "actor" + this.menuItem.actor.visible = (Object.keys(this._availableDevicesIds).length > 0); + } + + destroy() { + this._signalManager.disconnectAll(); + if(this.deviceRemovedTimout) { + GLib.source_remove(this.deviceRemovedTimout); + this.deviceRemovedTimout = null; + } + if(this.activeProfileTimeout) { + GLib.source_remove(this.activeProfileTimeout); + this.activeProfileTimeout = null; + } + this.menuItem.destroy(); + } +}; + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js new file mode 100644 index 00000000..aa34f397 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js @@ -0,0 +1,292 @@ +/******************************************************************************* + * 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 . + * ***************************************************************************** + * Original Author: Gopi Sankar Karmegam + ******************************************************************************/ +/* jshint moz:true */ + +const ByteArray = imports.byteArray; +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const ExtensionUtils = imports.misc.extensionUtils; + +const Me = ExtensionUtils.getCurrentExtension(); +const Prefs = Me.imports.prefs; + +var DEBUG = false; + +/** + * getSettings: + * + * @schema: (optional): the GSettings schema id Builds and return a GSettings + * schema for + * @schema, using schema files in extensions dir/schemas. If + * @schema is not provided, it is taken from metadata['settings-schema']. + */ +function getSettings(schema) { + let extension = ExtensionUtils.getCurrentExtension(); + + schema = schema || extension.metadata['settings-schema']; + + const GioSSS = Gio.SettingsSchemaSource; + + // check if this extension was built with "make zip-file", and thus + // has the schema files in a sub-folder + // otherwise assume that extension has been installed in the + // same prefix as gnome-shell (and therefore schemas are available + // in the standard folders) + let schemaDir = extension.dir.get_child('schemas'); + let schemaSource; + if (schemaDir.query_exists(null)) + schemaSource = GioSSS.new_from_directory(schemaDir.get_path(),GioSSS.get_default(),false); + else + schemaSource = GioSSS.get_default(); + + let schemaObj = schemaSource.lookup(schema, true); + if (!schemaObj) + throw new Error('Schema ' + schema + ' could not be found for extension ' + + extension.metadata.uuid + '. Please check your installation.'); + + let _settings = new Gio.Settings({ settings_schema: schemaObj }); + return _settings; +} + +let cards; +function getProfiles(control, uidevice) +{ + let stream = control.lookup_stream_id(uidevice.get_stream_id()); + if(stream) { + if(!cards || Object.keys(cards).length == 0 || !cards[stream.card_index]) { + refreshCards(); + } + + if(cards && cards[stream.card_index]) { + log("Getting profile form stream id " + uidevice.port_name ); + return getProfilesForPort(uidevice.port_name, cards[stream.card_index]); + } + } + else + { + /* Device is not active device, lets try match with port name */ + refreshCards(); + for (let id in cards) { + let profiles; + log("Getting profile from cards " + uidevice.port_name + " for card id " + id); + if((profiles = getProfilesForPort(uidevice.port_name, cards[id]))) + { + return profiles; + } + } + } + + return null; +} + +let ports; +function getPorts(refresh) { + if(!ports || ports.length == 0 || refresh) { + refreshCards(); + } + return ports; +} + +function refreshCards() { + cards = {}; + ports = []; + // if(_settings == null) {getSettings(Prefs.SETTINGS_SCHEMA);} + let _settings = getSettings(Prefs.SETTINGS_SCHEMA); + let error = false; + if(_settings.get_boolean(Prefs.NEW_PROFILE_ID)) { + log("New logic"); + let pyLocation = Me.dir.get_child('utils/pa_helper.py').get_path(); + try { + let [result, out, err, exit_code] = GLib.spawn_command_line_sync('python ' + pyLocation); + // log("result" + result +" out"+out + " exit_code" + exit_code + " + // err" +err); + if(result && !exit_code) { + if (out instanceof Uint8Array) { + out = ByteArray.toString(out); + } + let obj = JSON.parse(out); + cards = obj['cards']; + ports = obj['ports']; + } + } + catch(e) { + error = true; + log('ERROR: Python execution failed. fallback to default mode'); + _settings.set_boolean(Prefs.NEW_PROFILE_ID, false); + Gio.Settings.sync(); + } + } + + if(!_settings.get_boolean(Prefs.NEW_PROFILE_ID) || error){ + try { + let [result, out, err, exit_code] = GLib.spawn_command_line_sync('pactl list cards'); + if(result && !exit_code) { + parseOutput(out); + } + } + catch(e) { + log('ERROR: pactl execution failed. No ports/profiles will be displayed'); + } + } +// log(JSON.stringify(cards)); +// log(JSON.stringify(ports)); + +} + +function parseOutput(out) { + let lines; + if (out instanceof Uint8Array) { + lines = ByteArray.toString(out).split('\n'); + } else { + lines = out.toString().split('\n'); + } + + let cardIndex; + let parseSection = "CARDS"; + let port; + let matches; + // log("Unmatched line:" + out); + while(lines.length > 0) { + let line = lines.shift(); + + if( (matches = /^Card\s#(\d+)$/.exec(line) )) { + cardIndex = matches[1]; + if(!cards[cardIndex]) { + cards[cardIndex] = {'index':cardIndex,'profiles':[], 'ports':[]}; + } + } + else if (line.match(/^\t*Profiles:$/) ) { + parseSection = "PROFILES"; + } + else if (line.match(/^\t*Ports:$/)) { + parseSection = "PORTS"; + } + else if(cards[cardIndex]) { + switch(parseSection) { + case "PROFILES": + if((matches = /.*?((?:output|input)[^+]*?):\s(.*?)\s\(sinks:/.exec(line))) { + cards[cardIndex].profiles.push({'name': matches[1], 'human_name': matches[2]}); + } + break; + case "PORTS": + if((matches = /\t*(.*?):\s(.*?)\s\(priority:/.exec(line))) { + port = {'name' : matches[1], 'human_name' : matches[2]}; + cards[cardIndex].ports.push(port); + ports.push({'name' : matches[1], 'human_name' : matches[2]}); + } + else if( port && (matches = /\t*Part of profile\(s\):\s(.*)/.exec(line))) { + let profileStr = matches[1]; + port.profiles = profileStr.split(', '); + port = null; + } + break; + } + } + } +} + +var Signal = class Signal { + + constructor(signalSource, signalName, callback) { + this._signalSource = signalSource; + this._signalName = signalName; + this._signalCallback = callback; + } + + connect() { + this._signalId = this._signalSource.connect(this._signalName, this._signalCallback); + } + + disconnect() { + if(this._signalId) { + this._signalSource.disconnect(this._signalId); + this._signalId = null; + } + } +} + +var SignalManager = class SignalManager { + constructor() { + this._signals = []; + this._signalsBySource = {}; + } + + addSignal(signalSource, signalName, callback) { + let obj = null; + if(signalSource && signalName && callback) { + obj = new Signal(signalSource, signalName, callback); + obj.connect(); + this._signals.push(obj); + let sourceSignals = this._signalsBySource[signalSource] + if(!sourceSignals) { + sourceSignals = []; + this._signalsBySource[signalSource] = sourceSignals; + } + // this._signalsBySource[signalSource].push(obj) + sourceSignals.push(obj); + } + return obj; + } + + disconnectAll() { + for (let signal of this._signals){ + signal.disconnect(); + } + } + + disconnectBySource(signalSource) { + if(this._signalsBySource[signalSource]) { + for (let signal of this._signalsBySource[signalSource]) { + signal.disconnect(); + } + } + } +} + + +function getProfilesForPort(portName, card) { + if(card.ports) { + for (let port of card.ports) { + if(portName === port.name) { + let profiles = []; + if (port.profiles) { + for (let profile of port.profiles) { + if(profile.indexOf('+input:') == -1) { + for (let cardProfile of card.profiles) { + if(profile === cardProfile.name) { + profiles.push(cardProfile); + } + } + } + } + } + return profiles; + } + } + } + return null; +} + +function setLog(value) { + DEBUG = value; +} + +function log(msg) { + if ( DEBUG == true ) { + global.log("SDC Debug: " + msg); + } +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js new file mode 100644 index 00000000..30f69151 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js @@ -0,0 +1,170 @@ +/******************************************************************************* + * 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 . + * ***************************************************************************** + * Original Author: Gopi Sankar Karmegam + ******************************************************************************/ +/* jshint moz:true */ + +const {GObject} = imports.gi; +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Base = Me.imports.base; +const Lib = Me.imports.convenience; +const SignalManager = Lib.SignalManager; +const Prefs = Me.imports.prefs; +const Main = imports.ui.main; + +var SoundOutputDeviceChooser = class SoundOutputDeviceChooser +extends Base.SoundDeviceChooserBase { + constructor() { + super("output"); + } + lookupDeviceById(id) { + return this._control.lookup_output_id(id); + } + changeDevice(uidevice) { + this._control.change_output(uidevice); + } + getDefaultDevice() { + return this._control.get_default_sink(); + } + getDefaultIcon() { + return "audio-card"; + } +}; + +var SoundInputDeviceChooser = class SoundInputDeviceChooser +extends Base.SoundDeviceChooserBase { + constructor() { + super("input"); + } + lookupDeviceById(id) { + return this._control.lookup_input_id(id); + } + changeDevice(uidevice) { + this._control.change_input(uidevice); + } + getDefaultDevice() { + return this._control.get_default_source(); + } + getDefaultIcon() { + return "audio-input-microphone"; + } +}; + +var InputSliderInstance = class InputSliderInstance { + constructor(volumeMenu, settings ) { + this._input = volumeMenu._input; + this._settings = settings; + this._signalManager = new SignalManager(); + this._signalManager.addSignal(this._settings, "changed::" + + Prefs.SHOW_INPUT_SLIDER, this._setSliderVisiblity.bind(this)); + this._overrideFunction(); + this._setSliderVisiblity(); + } + _overrideFunction() { + this._input._shouldBeVisibleOriginal = this._input._shouldBeVisible; + this._input._shouldBeVisibleCustom = function() { + return this._stream != null; + }; + } + _setSliderVisiblity() { + if (this._settings.get_boolean(Prefs.SHOW_INPUT_SLIDER)) { + this._input._shouldBeVisible = this._input._shouldBeVisibleCustom; + } else { + this._input._shouldBeVisible = this._input._shouldBeVisibleOriginal; + } + this._input._maybeShowInput(); + } + destroy() { + this._signalManager.disconnectAll(); + this._input._shouldBeVisible = this._input._shouldBeVisibleOriginal; + this._input._maybeShowInput(); + delete this._input['_shouldBeVisibleOriginal']; + delete this._input['_shouldBeVisibleCustom']; + } +}; + +var SDCInstance = class SDCInstance { + constructor(){ + this._settings = Lib.getSettings(Prefs.SETTINGS_SCHEMA); + this._aggregateMenu = Main.panel.statusArea.aggregateMenu; + this._volumeMenu = this._aggregateMenu._volume._volumeMenu; + this._aggregateLayout = this._aggregateMenu.menu.box.get_layout_manager(); + } + + enable(){ + if (this._outputInstance == null) { + this._outputInstance = new SoundOutputDeviceChooser(); + } + if (this._inputInstance == null) { + this._inputInstance = new SoundInputDeviceChooser(); + } + + if (this._inputSliderInstance == null) { + this._inputSliderInstance = new InputSliderInstance(this._volumeMenu, this._settings); + } + + this._addMenuItem(this._volumeMenu, this._volumeMenu._output.item, this._outputInstance.menuItem); + this._addMenuItem(this._volumeMenu, this._volumeMenu._input.item, this._inputInstance.menuItem); + + this._expSignalId = this._settings.connect("changed::" + Prefs.EXPAND_VOL_MENU, this._expandVolMenu.bind(this)); + + this._expandVolMenu(); + } + + _addMenuItem(_volumeMenu, checkItem, menuItem){ + let menuItems = _volumeMenu._getMenuItems(); + let i = 0; + for (; i < menuItems.length; i++) { + if (menuItems[i] === checkItem) { + break; + } + } + _volumeMenu.addMenuItem(menuItem, ++i); + } + + _expandVolMenu() { + if (this._settings.get_boolean(Prefs.EXPAND_VOL_MENU)) { + this._aggregateLayout.addSizeChild(this._volumeMenu.actor); + } else { + this._revertVolMenuChanges(); + } + } + + _revertVolMenuChanges() { + this._aggregateLayout._sizeChildren = this._aggregateLayout._sizeChildren.filter(item => item !== this._volumeMenu.actor); + this._aggregateLayout.layout_changed(); + } + + disable(){ + this._revertVolMenuChanges(); + this._outputInstance.destroy(); + this._outputInstance = null; + this._inputInstance.destroy(); + this._inputInstance = null; + this._inputSliderInstance.destroy(); + this._inputSliderInstance = null; + if(this._expSignalId) { + this._settings.disconnect(this._expSignalId); + this._expSignalId = null; + } + } +}; + +function init(extensionMeta) { + let theme = imports.gi.Gtk.IconTheme.get_default(); + theme.append_search_path(extensionMeta.path + "/icons"); + return new SDCInstance(); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/icons/blank.png b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/icons/blank.png new file mode 100644 index 00000000..23568c66 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/icons/blank.png differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/license b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/license new file mode 100644 index 00000000..94a9ed02 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/license @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/metadata.json b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/metadata.json new file mode 100644 index 00000000..39f42916 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/metadata.json @@ -0,0 +1,13 @@ +{ + "_generated": "Generated by SweetTooth, do not edit", + "description": "Shows a list of sound output and input devices (similar to gnome sound settings) in the status menu below the volume slider. Various active ports like HDMI , Speakers etc. of the same device are also displayed for selection. V20+ needs python as dependency. If you want to continue with the old method without Python, use options to switch off New Port identification. But it works with only English", + "name": "Sound Input & Output Device Chooser", + "original-author": "GopI", + "shell-version": [ + "3.34", + "3.32" + ], + "url": "https://github.com/kgshank/gse-sound-output-device-chooser", + "uuid": "sound-output-device-chooser@kgshank.net", + "version": 25 +} \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/prefs.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/prefs.js new file mode 100644 index 00000000..d5d131da --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/prefs.js @@ -0,0 +1,224 @@ +/******************************************************************************* + * 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 . + * + * Original Author: Gopi Sankar Karmegam + ******************************************************************************/ +/* jshint moz:true */ + +const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; +const Gio = imports.gi.Gio; +const Gtk = imports.gi.Gtk; +// const Lang = imports.lang; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); +const Lib = Me.imports.convenience; +const SignalManager = Lib.SignalManager; + +var SETTINGS_SCHEMA = "org.gnome.shell.extensions.sound-output-device-chooser"; +var HIDE_ON_SINGLE_DEVICE = "hide-on-single-device"; +var HIDE_MENU_ICONS = "hide-menu-icons"; +var SHOW_PROFILES = "show-profiles"; +var PORT_SETTINGS = "ports-settings"; +var SHOW_INPUT_SLIDER = "show-input-slider"; +var SHOW_INPUT_DEVICES = "show-input-devices"; +var SHOW_OUTPUT_DEVICES = "show-output-devices"; +var ENABLE_LOG = "enable-log"; +var NEW_PROFILE_ID = "new-profile-indentification"; +var EXPAND_VOL_MENU = "expand-volume-menu"; + +var ICON_THEME = "icon-theme"; +var ICON_THEME_COLORED = "colored"; +var ICON_THEME_MONOCHROME = "monochrome"; +var ICON_THEME_NONE = "none"; + +function init(){} + + +const SDCSettingsWidget = new GObject.Class({ + Name: 'SDC.Prefs.Widget', + GTypeName: 'SDCSettingsWidget', + Extends: Gtk.Box, + + _init: function(params) { + this.parent(params); + this.orientation = Gtk.Orientation.VERTICAL; + this.spacing = 0; + + // creates the settings + this._settings = Lib.getSettings(SETTINGS_SCHEMA); + + Lib.setLog(this._settings.get_boolean(ENABLE_LOG)); + + // creates the ui builder and add the main resource file + let uiFilePath = Me.path + "/ui/prefs-dialog.gtkbuilder"; + let builder = new Gtk.Builder(); + + if (builder.add_from_file(uiFilePath) == 0) { + Lib.log("JS LOG: could not load the ui file: %s".format(uiFilePath)); + + let label = new Gtk.Label({ + label: _("Could not load the preferences UI file"), + vexpand: true + }); + + this.pack_start(label, true, true, 0); + } else { + Lib.log('JS LOG:_UI file receive and load: '+uiFilePath); + + let mainContainer = builder.get_object("main-container"); + + this.pack_start(mainContainer, true, true, 0); + + this._signalManager = new SignalManager(); + + let showProfileSwitch = builder.get_object("show-profile"); + let volMenuSwitch = builder.get_object(EXPAND_VOL_MENU); + let singleDeviceSwitch = builder.get_object("single-device"); + let showInputSliderSwitch = builder.get_object("show-input-slider"); + let showInputDevicesSwitch = builder.get_object("show-input-devices"); + let showOutputDevicesSwitch = builder.get_object("show-output-devices"); + let hideMenuIconsSwitch = builder.get_object("hide-menu-icons"); + let iconThemeCombo = builder.get_object("icon-theme"); + let logSwitch = builder.get_object("enable-log"); + let newProfileIdSwitch = builder.get_object("new-profile-identification"); + + this._settings.bind(HIDE_ON_SINGLE_DEVICE, singleDeviceSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(SHOW_PROFILES, showProfileSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(EXPAND_VOL_MENU, volMenuSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(SHOW_INPUT_SLIDER, showInputSliderSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(SHOW_INPUT_DEVICES, showInputDevicesSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(SHOW_OUTPUT_DEVICES, showOutputDevicesSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(HIDE_MENU_ICONS, hideMenuIconsSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(ENABLE_LOG, logSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(NEW_PROFILE_ID, newProfileIdSwitch, "active", Gio.SettingsBindFlags.DEFAULT); + this._settings.bind(ICON_THEME, iconThemeCombo, "active-id", Gio.SettingsBindFlags.DEFAULT); + + + let showAlwaysToggleRender = builder.get_object("ShowAlwaysToggleRender"); + let hideAlwaysToggleRender = builder.get_object("HideAlwaysToggleRender"); + let showActiveToggleRender = builder.get_object("ShowActiveToggleRender"); + + this._signalManager.addSignal(showAlwaysToggleRender, "toggled", this._showAlwaysToggleRenderCallback.bind(this)); + this._signalManager.addSignal(hideAlwaysToggleRender, "toggled", this._hideAlwaysToggleRenderCallback.bind(this)); + this._signalManager.addSignal(showActiveToggleRender, "toggled", this._showActiveToggleRenderCallback.bind(this)); + + this._portsStore = builder.get_object("ports-store"); + + this._populatePorts(); + this._restorePortsFromSettings(); + } + }, + + _populatePorts: function (){ + let ports = Lib.getPorts(true); + for (let port of ports) + { + this._portsStore.set(this._portsStore.append(),[0,1,2,3,4,5],[port.human_name, false, false, true, port.name,3]); + } + }, + + _showAlwaysToggleRenderCallback: function(widget, path) { + this._toggleCallback(widget, path, 1, [2, 3]); + }, + + _hideAlwaysToggleRenderCallback: function(widget, path) { + this._toggleCallback(widget, path, 2, [1, 3]); + }, + + _showActiveToggleRenderCallback: function(widget, path) { + this._toggleCallback(widget, path, 3, [1, 2]); + }, + + _toggleCallback: function(widget, path, activeCol, inactiveCols) { + let active = !widget.active; + if(!active) + { + return; + } + let [success, iter] = this._portsStore.get_iter_from_string(path); + if (!success) { + return; + } + this._portsStore.set_value(iter, activeCol, active); + this._portsStore.set_value(iter, 5, activeCol); + for (let col of inactiveCols) + { + this._portsStore.set_value(iter, col, !active); + } + this._commitSettings(); + }, + + _commitSettings: function() { + let ports = []; + let [success, iter] = this._portsStore.get_iter_first(); + + while (iter && success) { + if(!this._portsStore.get_value(iter,3)) { + ports.push({ + human_name: this._portsStore.get_value(iter, 0), + name: this._portsStore.get_value(iter, 4), + display_option: this._portsStore.get_value(iter, 5) + }); + } + success = this._portsStore.iter_next(iter); + } + + this._settings.set_string(PORT_SETTINGS, JSON.stringify(ports)); + }, + + _restorePortsFromSettings: function() { + let ports = JSON.parse(this._settings.get_string(PORT_SETTINGS)); + + let found; + for (let port of ports) { + found = false; + if (!port || !port.human_name || !port.name) { + continue; + } + + let [success, iter] = this._portsStore.get_iter_first(); + + while (iter && success) { + let human_name = this._portsStore.get_value(iter, 0); + let name = this._portsStore.get_value(iter, 4); + + if(port.name == name && port.human_name == human_name) { + this._portsStore.set_value(iter, 3, false); + this._portsStore.set_value(iter, port.display_option, true); + this._portsStore.set_value(iter, 5, port.display_option); + found = true; + break; + } + success = this._portsStore.iter_next(iter); + } + + if(!found){ + iter = this._portsStore.append(); + this._portsStore.set(iter, [0,1,2,3,4,5], + [port.human_name, false, false, false, port.name,port.display_option]); + this._portsStore.set_value(iter, port.display_option, true); + } + } + } +}); + + +function buildPrefsWidget() { + let _settingsWidget = new SDCSettingsWidget(); + _settingsWidget.show_all(); + + return _settingsWidget; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/gschemas.compiled b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/gschemas.compiled new file mode 100644 index 00000000..a76d3bec Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/gschemas.compiled differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/org.gnome.shell.extensions.sound-output-device-chooser.gschema.xml b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/org.gnome.shell.extensions.sound-output-device-chooser.gschema.xml new file mode 100644 index 00000000..37e5a426 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/schemas/org.gnome.shell.extensions.sound-output-device-chooser.gschema.xml @@ -0,0 +1,78 @@ + + + + + + false + Preference to show the chooser when only one device is available + Value set to false hides the device chooser when only one device is available + + + + true + Preference to show the available profiles for all devices + Value set to true displays the individual available profiles for each device + + + + true + Preference to expand volume menu to fit the name of the sound devices + Value set to true expands the volume menu to fit the names of sound devices displayed in the selector + + + + true + Preference to use monochrome icons instead of default icons + Value set to true uses monochrome icons + + + + true + Preference to show input slider always + Value set to true displays the slider control for input device volume + + + + true + Preference to show input device chooser + Value set to true displays the device chooser for input devices + + + + true + Preference to show output device chooser + Value set to true displays the device chooser for output devices + + + + "[]" + Preference to hide/show different ports always + + + + + "monochrome" + Preference indicating the type of icons used by the extension + Value can be "colored", "monochrome", "none", etc. + + + + false + Preference indicating whether the icons are hidden in the drop-down menu (but are visible in the expanded list). + + + + + false + Preference indicating log messages should be written to console + + + + + true + Preference to enable new logic to identify port profiles + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.gtkbuilder b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.gtkbuilder new file mode 100644 index 00000000..5dc2f8e1 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/ui/prefs-dialog.gtkbuilder @@ -0,0 +1,829 @@ + + + + + + + + + + + + + + monochrome + Monochrome + + + colored + Colored + + + none + None + + + + + + + + + + + + + + + + + + + + + False + 6 + 6 + 6 + 6 + vertical + 2 + + + True + False + True + True + True + + + True + False + 12 + 6 + 12 + 12 + vertical + 12 + + + True + False + 0 + out + + + True + False + + + True + False + none + + + 100 + True + True + + + True + False + 6 + 6 + + + True + False + start + 5 + Hide selector if there's only one device + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + 100 + True + True + + + True + False + 6 + 6 + + + True + False + start + 5 + Display audio profiles for selection + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + 100 + True + True + + + True + False + 6 + 6 + + + True + False + start + 5 + 20 + Extend Volume Menu to fit device names + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + + + + + True + False + General Settings + + + + + + + + False + True + 0 + + + + + True + False + 0 + out + + + True + False + + + True + False + + + 100 + True + True + + + True + False + center + 6 + 6 + + + True + False + start + 5 + Show output devices + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + + + + + True + False + Output Devices + + + + + + + + False + True + 1 + + + + + True + False + 0 + out + + + True + False + + + True + False + none + + + 100 + True + True + True + + + True + False + center + 6 + 6 + + + True + False + start + 5 + Show input devices + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + 100 + True + True + center + + + True + False + 6 + 6 + + + True + False + start + 5 + Show volume control for default device + + + True + True + 0 + + + + + True + True + end + 5 + + + False + True + 1 + + + + + + + + + + + + + True + False + Input Devices + + + + + + + + False + True + 2 + + + + + True + False + 0 + in + + + True + False + + + True + False + none + + + 100 + True + True + + + 6 + True + False + 6 + 6 + + + True + False + start + 5 + Icon Theme + + + True + True + 0 + + + + + 100 + True + False + 5 + icon-theme-store + 0 + + + + 1 + + + + + False + True + 1 + + + + + + + + + 100 + True + True + + + True + False + 6 + 6 + + + True + False + start + 5 + Display icons only in selection list + + + True + True + 0 + + + + + True + True + 5 + + + False + True + 1 + + + + + + + + + + + + + True + False + Icons + + + + + + + + False + True + 3 + + + + + True + False + 0 + in + + + True + False + + + True + False + none + + + 100 + True + True + + + 6 + True + False + 6 + 6 + + + True + False + start + 5 + Enable Log messages + + + True + True + 0 + + + + + True + True + + + False + True + 1 + + + + + + + + + 100 + True + True + + + True + False + 6 + 6 + + + True + False + start + 5 + Enable new profile identification + + + True + True + 0 + + + + + True + True + True + + + False + True + 1 + + + + + + + + + + + + + True + False + Miscellaneous + + + + + + + + False + True + 4 + + + + + False + True + 0 + + + + + True + False + 6 + 12 + 12 + 12 + vertical + + + True + False + True + 0 + out + + + True + False + 4 + 4 + 4 + True + vertical + + + True + True + 0.99999999865889544 + True + True + queue + in + + + True + True + True + ports-store + + + + + + True + autosize + 100 + Name + True + descending + + + + 0 + + + + + + + autosize + Show + + + True + + + 1 + + + + + + + autosize + Hide + + + True + + + 2 + + + + + + + autosize + Default + + + True + + + 3 + + + + + + + + + False + True + 1 + + + + + + + True + False + Port Settings + + + + + + + + False + True + 0 + + + + + False + True + 1 + + + + + False + True + 1 + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py new file mode 100644 index 00000000..e8a614de --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py @@ -0,0 +1,531 @@ +# This file is generated using clang2py script. The following files are used +# '/usr/include/pulse/introspect.h' '/usr/include/pulse/mainloop.h' '/usr/include/pulse/context.h' +# Refer additional licensing requirements for the files included +# sample commands used +# python3 /usr/local/bin/clang2py --clang-args="-I/usr/include/clang/6.0/include -I/usr/include/pulse" -l /usr/lib/x86_64-linux-gnu/libpulse.so '/usr/include/pulse/introspect.h' '/usr/include/pulse/mainloop.h' +# python3 /usr/local/bin/clang2py --clang-args="-I/usr/include/clang/6.0/include -I/usr/include/pulse" -l /usr/lib/x86_64-linux-gnu/libpulse.so '/usr/include/pulse/context.h' +################################################################################ +# # 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 . +# # +# # Original Author: Gopi Sankar Karmegam +# ############################################################################## +# -#- coding: utf-8 -#- +# +# TARGET arch is: ['-I/usr/include/clang/6.0/include', '-I/usr/include/pulse'] +# WORD_SIZE is: 8 +# POINTER_SIZE is: 8 +# LONGDOUBLE_SIZE is: 16 +# + +# Updated to determine libpulse.so location +import ctypes + + + + + + +c_int128 = ctypes.c_ubyte*16 +c_uint128 = c_int128 +void = None +if ctypes.sizeof(ctypes.c_longdouble) == 16: + c_long_double_t = ctypes.c_longdouble +else: + c_long_double_t = ctypes.c_ubyte*16 + +# if local wordsize is same as target, keep ctypes pointer function. +if ctypes.sizeof(ctypes.c_void_p) == 8: + POINTER_T = ctypes.POINTER +else: + # required to access _ctypes + import _ctypes + # Emulate a pointer class using the approriate c_int32/c_int64 type + # The new class should have : + # ['__module__', 'from_param', '_type_', '__dict__', '__weakref__', '__doc__'] + # but the class should be submitted to a unique instance for each base type + # to that if A == B, POINTER_T(A) == POINTER_T(B) + ctypes._pointer_t_type_cache = {} + def POINTER_T(pointee): + # a pointer should have the same length as LONG + fake_ptr_base_type = ctypes.c_uint64 + # specific case for c_void_p + if pointee is None: # VOID pointer type. c_void_p. + pointee = type(None) # ctypes.c_void_p # ctypes.c_ulong + clsname = 'c_void' + else: + clsname = pointee.__name__ + if clsname in ctypes._pointer_t_type_cache: + return ctypes._pointer_t_type_cache[clsname] + # make template + class _T(_ctypes._SimpleCData,): + _type_ = 'L' + _subtype_ = pointee + def _sub_addr_(self): + return self.value + def __repr__(self): + return '%s(%d)'%(clsname, self.value) + def contents(self): + raise TypeError('This is not a ctypes pointer.') + def __init__(self, **args): + raise TypeError('This is not a ctypes pointer. It is not instanciable.') + _class = type('LP_%d_%s'%(8, clsname), (_T,),{}) + ctypes._pointer_t_type_cache[clsname] = _class + return _class + +_libraries = {} +import os.path +if os.path.isfile('/usr/lib/x86_64-linux-gnu/libpulse.so'): + _libraries['libpulse.so'] = ctypes.CDLL('/usr/lib/x86_64-linux-gnu/libpulse.so') +else: + _libraries['libpulse.so'] = ctypes.CDLL('/usr/lib/libpulse.so') + +uint32_t = ctypes.c_uint32 + +size_t = ctypes.c_uint64 +class struct_pa_context(ctypes.Structure): + pass + +pa_context = struct_pa_context +pa_context_notify_cb_t = ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_context), POINTER_T(None)) +pa_context_success_cb_t = POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_context), ctypes.c_int32, POINTER_T(None))) + +class struct_pa_proplist(ctypes.Structure): + pass + +pa_context_event_cb_t = POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_context), ctypes.c_char_p, POINTER_T(struct_pa_proplist), POINTER_T(None))) +class struct_pa_mainloop_api(ctypes.Structure): + pass + +pa_context_new = _libraries['libpulse.so'] .pa_context_new +pa_context_new.restype = POINTER_T(struct_pa_context) +pa_context_new.argtypes = [POINTER_T(struct_pa_mainloop_api), ctypes.c_char_p] + +# pa_context_new_with_proplist = _libraries['libpulse.so'] .pa_context_new_with_proplist +# pa_context_new_with_proplist.restype = POINTER_T(struct_pa_context) +# pa_context_new_with_proplist.argtypes = [POINTER_T(struct_pa_mainloop_api), ctypes.c_char_p, POINTER_T(struct_pa_proplist)] + +pa_context_unref = _libraries['libpulse.so'] .pa_context_unref +pa_context_unref.restype = None +pa_context_unref.argtypes = [POINTER_T(struct_pa_context)] + +# pa_context_ref = _libraries['libpulse.so'] .pa_context_ref +# pa_context_ref.restype = POINTER_T(struct_pa_context) +# pa_context_ref.argtypes = [POINTER_T(struct_pa_context)] + +pa_context_set_state_callback = _libraries['libpulse.so'] .pa_context_set_state_callback +pa_context_set_state_callback.restype = None +pa_context_set_state_callback.argtypes = [POINTER_T(struct_pa_context), pa_context_notify_cb_t, POINTER_T(None)] +# +# pa_context_set_event_callback = _libraries['libpulse.so'] .pa_context_set_event_callback +# pa_context_set_event_callback.restype = None +# pa_context_set_event_callback.argtypes = [POINTER_T(struct_pa_context), pa_context_event_cb_t, POINTER_T(None)] +# +# pa_context_errno = _libraries['libpulse.so'] .pa_context_errno +# pa_context_errno.restype = ctypes.c_int32 +# pa_context_errno.argtypes = [POINTER_T(struct_pa_context)] +# +# pa_context_is_pending = _libraries['libpulse.so'] .pa_context_is_pending +# pa_context_is_pending.restype = ctypes.c_int32 +# pa_context_is_pending.argtypes = [POINTER_T(struct_pa_context)] + + + +# values for enumeration 'pa_context_state' +pa_context_state__enumvalues = { + 0: 'PA_CONTEXT_UNCONNECTED', + 1: 'PA_CONTEXT_CONNECTING', + 2: 'PA_CONTEXT_AUTHORIZING', + 3: 'PA_CONTEXT_SETTING_NAME', + 4: 'PA_CONTEXT_READY', + 5: 'PA_CONTEXT_FAILED', + 6: 'PA_CONTEXT_TERMINATED', +} + +PA_CONTEXT_UNCONNECTED = 0 +PA_CONTEXT_CONNECTING = 1 +PA_CONTEXT_AUTHORIZING = 2 +PA_CONTEXT_SETTING_NAME = 3 +PA_CONTEXT_READY = 4 +PA_CONTEXT_FAILED = 5 +PA_CONTEXT_TERMINATED = 6 + +pa_context_state = ctypes.c_int # enum +pa_context_state_t = pa_context_state +pa_context_state_t__enumvalues = pa_context_state__enumvalues + +pa_context_get_state = _libraries['libpulse.so'] .pa_context_get_state +pa_context_get_state.restype = pa_context_state_t +pa_context_get_state.argtypes = [POINTER_T(struct_pa_context)] + +# values for enumeration 'pa_context_flags' +pa_context_flags__enumvalues = { + 0: 'PA_CONTEXT_NOFLAGS', + 1: 'PA_CONTEXT_NOAUTOSPAWN', + 2: 'PA_CONTEXT_NOFAIL', +} +PA_CONTEXT_NOFLAGS = 0 +PA_CONTEXT_NOAUTOSPAWN = 1 +PA_CONTEXT_NOFAIL = 2 +pa_context_flags = ctypes.c_int # enum +pa_context_flags_t = pa_context_flags +pa_context_flags_t__enumvalues = pa_context_flags__enumvalues +class struct_pa_spawn_api(ctypes.Structure): + pass + +pa_context_connect = _libraries['libpulse.so'] .pa_context_connect +pa_context_connect.restype = ctypes.c_int32 +pa_context_connect.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p, pa_context_flags_t, POINTER_T(struct_pa_spawn_api)] +pa_context_disconnect = _libraries['libpulse.so'] .pa_context_disconnect +pa_context_disconnect.restype = None +pa_context_disconnect.argtypes = [POINTER_T(struct_pa_context)] + +class struct_pa_operation(ctypes.Structure): + pass + +# pa_context_drain = _libraries['libpulse.so'] .pa_context_drain +# pa_context_drain.restype = POINTER_T(struct_pa_operation) +# pa_context_drain.argtypes = [POINTER_T(struct_pa_context), pa_context_notify_cb_t, POINTER_T(None)] +# pa_context_exit_daemon = _libraries['libpulse.so'] .pa_context_exit_daemon +# pa_context_exit_daemon.restype = POINTER_T(struct_pa_operation) +# pa_context_exit_daemon.argtypes = [POINTER_T(struct_pa_context), pa_context_success_cb_t, POINTER_T(None)] +# pa_context_set_default_sink = _libraries['libpulse.so'] .pa_context_set_default_sink +# pa_context_set_default_sink.restype = POINTER_T(struct_pa_operation) +# pa_context_set_default_sink.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p, pa_context_success_cb_t, POINTER_T(None)] +# pa_context_set_default_source = _libraries['libpulse.so'] .pa_context_set_default_source +# pa_context_set_default_source.restype = POINTER_T(struct_pa_operation) +# pa_context_set_default_source.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p, pa_context_success_cb_t, POINTER_T(None)] +# pa_context_is_local = _libraries['libpulse.so'] .pa_context_is_local +# pa_context_is_local.restype = ctypes.c_int32 +# pa_context_is_local.argtypes = [POINTER_T(struct_pa_context)] +# pa_context_set_name = _libraries['libpulse.so'] .pa_context_set_name +# pa_context_set_name.restype = POINTER_T(struct_pa_operation) +# pa_context_set_name.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p, pa_context_success_cb_t, POINTER_T(None)] +# pa_context_get_server = _libraries['libpulse.so'] .pa_context_get_server +# pa_context_get_server.restype = ctypes.c_char_p +# pa_context_get_server.argtypes = [POINTER_T(struct_pa_context)] + +# pa_context_get_protocol_version = _libraries['libpulse.so'] .pa_context_get_protocol_version +# pa_context_get_protocol_version.restype = uint32_t +# pa_context_get_protocol_version.argtypes = [POINTER_T(struct_pa_context)] +# pa_context_get_server_protocol_version = _libraries['libpulse.so'] .pa_context_get_server_protocol_version +# pa_context_get_server_protocol_version.restype = uint32_t +# pa_context_get_server_protocol_version.argtypes = [POINTER_T(struct_pa_context)] +class struct_pa_card_profile_info(ctypes.Structure): + _pack_ = True # source:False + _fields_ = [ + ('name', ctypes.c_char_p), + ('description', ctypes.c_char_p), + ('n_sinks', ctypes.c_uint32), + ('n_sources', ctypes.c_uint32), + ('priority', ctypes.c_uint32), + ('PADDING_0', ctypes.c_ubyte * 4), + ] + +pa_card_profile_info = struct_pa_card_profile_info +class struct_pa_card_profile_info2(ctypes.Structure): + _pack_ = True # source:False + _fields_ = [ + ('name', ctypes.c_char_p), + ('description', ctypes.c_char_p), + ('n_sinks', ctypes.c_uint32), + ('n_sources', ctypes.c_uint32), + ('priority', ctypes.c_uint32), + ('available', ctypes.c_int32), + ] + +pa_card_profile_info2 = struct_pa_card_profile_info2 +class struct_pa_card_port_info(ctypes.Structure): + _pack_ = True # source:False + _fields_ = [ + ('name', ctypes.c_char_p), + ('description', ctypes.c_char_p), + ('priority', ctypes.c_uint32), + ('available', ctypes.c_int32), + ('direction', ctypes.c_int32), + ('n_profiles', ctypes.c_uint32), + ('profiles', POINTER_T(POINTER_T(struct_pa_card_profile_info))), + ('proplist', POINTER_T(struct_pa_proplist)), + ('latency_offset', ctypes.c_int64), + ('profiles2', POINTER_T(POINTER_T(struct_pa_card_profile_info2))), + ] + +pa_card_port_info = struct_pa_card_port_info +class struct_pa_card_info(ctypes.Structure): + _pack_ = True # source:False + _fields_ = [ + ('index', ctypes.c_uint32), + ('PADDING_0', ctypes.c_ubyte * 4), + ('name', ctypes.c_char_p), + ('owner_module', ctypes.c_uint32), + ('PADDING_1', ctypes.c_ubyte * 4), + ('driver', ctypes.c_char_p), + ('n_profiles', ctypes.c_uint32), + ('PADDING_2', ctypes.c_ubyte * 4), + ('profiles', POINTER_T(struct_pa_card_profile_info)), + ('active_profile', POINTER_T(struct_pa_card_profile_info)), + ('proplist', POINTER_T(struct_pa_proplist)), + ('n_ports', ctypes.c_uint32), + ('PADDING_3', ctypes.c_ubyte * 4), + ('ports', POINTER_T(POINTER_T(struct_pa_card_port_info))), + ('profiles2', POINTER_T(POINTER_T(struct_pa_card_profile_info2))), + ('active_profile2', POINTER_T(struct_pa_card_profile_info2)), + ] + +pa_card_info = struct_pa_card_info +pa_card_info_cb_t = ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_context), POINTER_T(struct_pa_card_info), ctypes.c_int32, POINTER_T(None)) +pa_context_get_card_info_by_index = _libraries['libpulse.so'].pa_context_get_card_info_by_index +pa_context_get_card_info_by_index.restype = POINTER_T(struct_pa_operation) +pa_context_get_card_info_by_index.argtypes = [POINTER_T(struct_pa_context), uint32_t, pa_card_info_cb_t, POINTER_T(None)] + + +pa_context_get_card_info_list = _libraries['libpulse.so'].pa_context_get_card_info_list +pa_context_get_card_info_list.restype = POINTER_T(struct_pa_operation) +pa_context_get_card_info_list.argtypes = [POINTER_T(struct_pa_context), pa_card_info_cb_t, POINTER_T(None)] + + +# values for enumeration 'pa_update_mode' +# pa_update_mode__enumvalues = { +# 0: 'PA_UPDATE_SET', +# 1: 'PA_UPDATE_MERGE', +# 2: 'PA_UPDATE_REPLACE', +# } +# PA_UPDATE_SET = 0 +# PA_UPDATE_MERGE = 1 +# PA_UPDATE_REPLACE = 2 +# pa_update_mode = ctypes.c_int # enum +# pa_update_mode_t = pa_update_mode +# pa_update_mode_t__enumvalues = pa_update_mode__enumvalues +# pa_context_proplist_update = _libraries['libpulse.so'] .pa_context_proplist_update +# pa_context_proplist_update.restype = POINTER_T(struct_pa_operation) +# pa_context_proplist_update.argtypes = [POINTER_T(struct_pa_context), pa_update_mode_t, POINTER_T(struct_pa_proplist), pa_context_success_cb_t, POINTER_T(None)] +# pa_context_proplist_remove = _libraries['libpulse.so'] .pa_context_proplist_remove +# pa_context_proplist_remove.restype = POINTER_T(struct_pa_operation) +# pa_context_proplist_remove.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p * 0, pa_context_success_cb_t, POINTER_T(None)] +# pa_context_get_index = _libraries['libpulse.so'] .pa_context_get_index +# pa_context_get_index.restype = uint32_t +# pa_context_get_index.argtypes = [POINTER_T(struct_pa_context)] +class struct_pa_time_event(ctypes.Structure): + pass + +# pa_usec_t = ctypes.c_uint64 +class struct_timeval(ctypes.Structure): + pass +# +# pa_time_event_cb_t = POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_time_event), POINTER_T(struct_timeval), POINTER_T(None))) +# pa_context_rttime_new = _libraries['libpulse.so'] .pa_context_rttime_new +# pa_context_rttime_new.restype = POINTER_T(struct_pa_time_event) +# pa_context_rttime_new.argtypes = [POINTER_T(struct_pa_context), pa_usec_t, pa_time_event_cb_t, POINTER_T(None)] +# pa_context_rttime_restart = _libraries['libpulse.so'] .pa_context_rttime_restart +# pa_context_rttime_restart.restype = None +# pa_context_rttime_restart.argtypes = [POINTER_T(struct_pa_context), POINTER_T(struct_pa_time_event), pa_usec_t] +class struct_pa_sample_spec(ctypes.Structure): + pass + +# pa_context_get_tile_size = _libraries['libpulse.so'] .pa_context_get_tile_size +# pa_context_get_tile_size.restype = size_t +# pa_context_get_tile_size.argtypes = [POINTER_T(struct_pa_context), POINTER_T(struct_pa_sample_spec)] +# pa_context_load_cookie_from_file = _libraries['libpulse.so'] .pa_context_load_cookie_from_file +# pa_context_load_cookie_from_file.restype = ctypes.c_int32 +# pa_context_load_cookie_from_file.argtypes = [POINTER_T(struct_pa_context), ctypes.c_char_p] +# struct_pa_spawn_api._pack_ = True # source:False +# struct_pa_spawn_api._fields_ = [ +# ('prefork', POINTER_T(ctypes.CFUNCTYPE(None))), +# ('postfork', POINTER_T(ctypes.CFUNCTYPE(None))), +# ('atfork', POINTER_T(ctypes.CFUNCTYPE(None))), +# ] +# + +# values for enumeration 'pa_io_event_flags' +pa_io_event_flags__enumvalues = { + 0: 'PA_IO_EVENT_NULL', + 1: 'PA_IO_EVENT_INPUT', + 2: 'PA_IO_EVENT_OUTPUT', + 4: 'PA_IO_EVENT_HANGUP', + 8: 'PA_IO_EVENT_ERROR', +} +PA_IO_EVENT_NULL = 0 +PA_IO_EVENT_INPUT = 1 +PA_IO_EVENT_OUTPUT = 2 +PA_IO_EVENT_HANGUP = 4 +PA_IO_EVENT_ERROR = 8 +pa_io_event_flags = ctypes.c_int # enum +class struct_pa_io_event(ctypes.Structure): + pass + +class struct_pa_defer_event(ctypes.Structure): + pass + +struct_pa_mainloop_api._pack_ = True # source:False +struct_pa_mainloop_api._fields_ = [ + ('userdata', POINTER_T(None)), + ('io_new', POINTER_T(ctypes.CFUNCTYPE(POINTER_T(struct_pa_io_event), POINTER_T(struct_pa_mainloop_api), ctypes.c_int32, pa_io_event_flags, POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_io_event), ctypes.c_int32, pa_io_event_flags, POINTER_T(None))), POINTER_T(None)))), + ('io_enable', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_io_event), pa_io_event_flags))), + ('io_free', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_io_event)))), + ('io_set_destroy', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_io_event), POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_io_event), POINTER_T(None)))))), + ('time_new', POINTER_T(ctypes.CFUNCTYPE(POINTER_T(struct_pa_time_event), POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_timeval), POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_time_event), POINTER_T(struct_timeval), POINTER_T(None))), POINTER_T(None)))), + ('time_restart', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_time_event), POINTER_T(struct_timeval)))), + ('time_free', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_time_event)))), + ('time_set_destroy', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_time_event), POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_time_event), POINTER_T(None)))))), + ('defer_new', POINTER_T(ctypes.CFUNCTYPE(POINTER_T(struct_pa_defer_event), POINTER_T(struct_pa_mainloop_api), POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_defer_event), POINTER_T(None))), POINTER_T(None)))), + ('defer_enable', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_defer_event), ctypes.c_int32))), + ('defer_free', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_defer_event)))), + ('defer_set_destroy', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_defer_event), POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), POINTER_T(struct_pa_defer_event), POINTER_T(None)))))), + ('quit', POINTER_T(ctypes.CFUNCTYPE(None, POINTER_T(struct_pa_mainloop_api), ctypes.c_int32))), +] + +class struct_pollfd(ctypes.Structure): + pass + +class struct_pa_mainloop(ctypes.Structure): + pass + +pa_mainloop = struct_pa_mainloop +pa_mainloop_new = _libraries['libpulse.so'] .pa_mainloop_new +pa_mainloop_new.restype = POINTER_T(struct_pa_mainloop) +pa_mainloop_new.argtypes = [] +pa_mainloop_free = _libraries['libpulse.so'] .pa_mainloop_free +pa_mainloop_free.restype = None +pa_mainloop_free.argtypes = [POINTER_T(struct_pa_mainloop)] + +# pa_mainloop_prepare = _libraries['libpulse.so'] .pa_mainloop_prepare +# pa_mainloop_prepare.restype = ctypes.c_int32 +# pa_mainloop_prepare.argtypes = [POINTER_T(struct_pa_mainloop), ctypes.c_int32] +# pa_mainloop_poll = _libraries['libpulse.so'] .pa_mainloop_poll +# pa_mainloop_poll.restype = ctypes.c_int32 +# pa_mainloop_poll.argtypes = [POINTER_T(struct_pa_mainloop)] +# pa_mainloop_dispatch = _libraries['libpulse.so'] .pa_mainloop_dispatch +# pa_mainloop_dispatch.restype = ctypes.c_int32 +# pa_mainloop_dispatch.argtypes = [POINTER_T(struct_pa_mainloop)] +# pa_mainloop_get_retval = _libraries['libpulse.so'] .pa_mainloop_get_retval +# pa_mainloop_get_retval.restype = ctypes.c_int32 +# pa_mainloop_get_retval.argtypes = [POINTER_T(struct_pa_mainloop)] + +pa_mainloop_iterate = _libraries['libpulse.so'] .pa_mainloop_iterate +pa_mainloop_iterate.restype = ctypes.c_int32 +pa_mainloop_iterate.argtypes = [POINTER_T(struct_pa_mainloop), ctypes.c_int32, POINTER_T(ctypes.c_int32)] + +# pa_mainloop_run = _libraries['libpulse.so'] .pa_mainloop_run +# pa_mainloop_run.restype = ctypes.c_int32 +# pa_mainloop_run.argtypes = [POINTER_T(struct_pa_mainloop), POINTER_T(ctypes.c_int32)] +pa_mainloop_get_api = _libraries['libpulse.so'] .pa_mainloop_get_api +pa_mainloop_get_api.restype = POINTER_T(struct_pa_mainloop_api) +pa_mainloop_get_api.argtypes = [POINTER_T(struct_pa_mainloop)] +# pa_mainloop_quit = _libraries['libpulse.so'] .pa_mainloop_quit +# pa_mainloop_quit.restype = None +# pa_mainloop_quit.argtypes = [POINTER_T(struct_pa_mainloop), ctypes.c_int32] +# pa_mainloop_wakeup = _libraries['libpulse.so'] .pa_mainloop_wakeup +# pa_mainloop_wakeup.restype = None +# pa_mainloop_wakeup.argtypes = [POINTER_T(struct_pa_mainloop)] +# pa_poll_func = POINTER_T(ctypes.CFUNCTYPE(ctypes.c_int32, POINTER_T(struct_pollfd), ctypes.c_uint64, ctypes.c_int32, POINTER_T(None))) +# pa_mainloop_set_poll_func = _libraries['libpulse.so'] .pa_mainloop_set_poll_func +# pa_mainloop_set_poll_func.restype = None +# pa_mainloop_set_poll_func.argtypes = [POINTER_T(struct_pa_mainloop), pa_poll_func, POINTER_T(None)] + +pa_operation_unref = _libraries['libpulse.so'] .pa_operation_unref +pa_operation_unref.restype = None +pa_operation_unref.argtypes = [POINTER_T(struct_pa_operation)] + +# values for enumeration 'pa_sample_format' +# pa_sample_format__enumvalues = { +# 0: 'PA_SAMPLE_U8', +# 1: 'PA_SAMPLE_ALAW', +# 2: 'PA_SAMPLE_ULAW', +# 3: 'PA_SAMPLE_S16LE', +# 4: 'PA_SAMPLE_S16BE', +# 5: 'PA_SAMPLE_FLOAT32LE', +# 6: 'PA_SAMPLE_FLOAT32BE', +# 7: 'PA_SAMPLE_S32LE', +# 8: 'PA_SAMPLE_S32BE', +# 9: 'PA_SAMPLE_S24LE', +# 10: 'PA_SAMPLE_S24BE', +# 11: 'PA_SAMPLE_S24_32LE', +# 12: 'PA_SAMPLE_S24_32BE', +# 13: 'PA_SAMPLE_MAX', +# -1: 'PA_SAMPLE_INVALID', +# } +# PA_SAMPLE_U8 = 0 +# PA_SAMPLE_ALAW = 1 +# PA_SAMPLE_ULAW = 2 +# PA_SAMPLE_S16LE = 3 +# PA_SAMPLE_S16BE = 4 +# PA_SAMPLE_FLOAT32LE = 5 +# PA_SAMPLE_FLOAT32BE = 6 +# PA_SAMPLE_S32LE = 7 +# PA_SAMPLE_S32BE = 8 +# PA_SAMPLE_S24LE = 9 +# PA_SAMPLE_S24BE = 10 +# PA_SAMPLE_S24_32LE = 11 +# PA_SAMPLE_S24_32BE = 12 +# PA_SAMPLE_MAX = 13 +# PA_SAMPLE_INVALID = -1 +# pa_sample_format = ctypes.c_int # enum +# struct_pa_sample_spec._pack_ = True # source:False +# struct_pa_sample_spec._fields_ = [ +# ('format', pa_sample_format), +# ('rate', ctypes.c_uint32), +# ('channels', ctypes.c_ubyte), +# ('PADDING_0', ctypes.c_ubyte * 3), +# ] +# +# struct_timeval._pack_ = True # source:False +# struct_timeval._fields_ = [ +# ('tv_sec', ctypes.c_int64), +# ('tv_usec', ctypes.c_int64), +# ] + +__all__ = \ + ['PA_CONTEXT_AUTHORIZING', 'PA_CONTEXT_CONNECTING', + 'PA_CONTEXT_FAILED', 'PA_CONTEXT_NOAUTOSPAWN', + 'PA_CONTEXT_NOFAIL', 'PA_CONTEXT_NOFLAGS', 'PA_CONTEXT_READY', + 'PA_CONTEXT_SETTING_NAME', 'PA_CONTEXT_TERMINATED', + 'PA_CONTEXT_UNCONNECTED', 'PA_IO_EVENT_ERROR', + 'PA_IO_EVENT_HANGUP', 'PA_IO_EVENT_INPUT', 'PA_IO_EVENT_NULL', + 'PA_IO_EVENT_OUTPUT', 'PA_SAMPLE_ALAW', 'PA_SAMPLE_FLOAT32BE', + 'PA_SAMPLE_FLOAT32LE', 'PA_SAMPLE_INVALID', 'PA_SAMPLE_MAX', + 'PA_SAMPLE_S16BE', 'PA_SAMPLE_S16LE', 'PA_SAMPLE_S24BE', + 'PA_SAMPLE_S24LE', 'PA_SAMPLE_S24_32BE', 'PA_SAMPLE_S24_32LE', + 'PA_SAMPLE_S32BE', 'PA_SAMPLE_S32LE', 'PA_SAMPLE_U8', + 'PA_SAMPLE_ULAW', 'PA_UPDATE_MERGE', 'PA_UPDATE_REPLACE', + 'PA_UPDATE_SET', 'pa_context', 'pa_context_connect', + 'pa_context_disconnect', 'pa_context_drain', 'pa_context_errno', + 'pa_context_event_cb_t', 'pa_context_exit_daemon', + 'pa_context_flags', 'pa_context_flags_t', + 'pa_context_flags_t__enumvalues', 'pa_context_get_index', + 'pa_context_get_protocol_version', 'pa_context_get_server', + 'pa_context_get_server_protocol_version', 'pa_context_get_state', + 'pa_context_get_tile_size', 'pa_context_is_local', + 'pa_context_is_pending', 'pa_context_load_cookie_from_file', + 'pa_context_new', 'pa_context_new_with_proplist', + 'pa_context_notify_cb_t', 'pa_context_proplist_remove', + 'pa_context_proplist_update', 'pa_context_ref', + 'pa_context_rttime_new', 'pa_context_rttime_restart', + 'pa_context_set_default_sink', 'pa_context_set_default_source', + 'pa_context_set_event_callback', 'pa_context_set_name', + 'pa_context_set_state_callback', 'pa_context_state', + 'pa_context_state_t', 'pa_context_state_t__enumvalues', + 'pa_context_success_cb_t', 'pa_context_unref', + 'pa_io_event_flags', 'pa_mainloop', 'pa_mainloop_dispatch', + 'pa_mainloop_free', 'pa_mainloop_get_api', + 'pa_mainloop_get_retval', 'pa_mainloop_iterate', + 'pa_mainloop_new', 'pa_mainloop_poll', 'pa_mainloop_prepare', + 'pa_mainloop_quit', 'pa_mainloop_run', + 'pa_mainloop_set_poll_func', 'pa_mainloop_wakeup', 'pa_poll_func', + 'pa_sample_format', 'pa_time_event_cb_t', 'pa_update_mode', + 'pa_update_mode_t', 'pa_update_mode_t__enumvalues', 'pa_usec_t', + 'size_t', 'struct_pa_context', 'struct_pa_defer_event', + 'struct_pa_io_event', 'struct_pa_mainloop', + 'struct_pa_mainloop_api', 'struct_pa_operation', + 'struct_pa_proplist', 'struct_pa_sample_spec', + 'struct_pa_spawn_api', 'struct_pa_time_event', 'struct_pollfd', + 'struct_timeval', 'uint32_t'] \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/pa_helper.py b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/pa_helper.py new file mode 100644 index 00000000..d1291860 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/utils/pa_helper.py @@ -0,0 +1,134 @@ +#!/usr/bin/python +############################################################################### + # 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 . + # + # Original Author: Gopi Sankar Karmegam + ############################################################################## + +import libpulse_introspect as pa +import sys +from ctypes import c_int,byref +import time +from json import dumps + +class PAHelper(): + + _error = { + 'success': False, + 'error': None, + } + _card_op_done = None + _pa_state = pa.PA_CONTEXT_UNCONNECTED + + + def __init__(self): + self._ports = [] + self._cards = {} + self.mainloop = pa.pa_mainloop_new() + self._context = pa.pa_context_new( pa.pa_mainloop_get_api(self.mainloop), b'PAHelper') + self._pa_context_notify_cb_t = pa.pa_context_notify_cb_t(self.pa_context_notify_cb_t) + pa.pa_context_set_state_callback(self._context, self._pa_context_notify_cb_t , None) + pa.pa_context_connect(self._context, None, 0, None) + self._opn_completed = False + + def print_card_info(self, index = None): + operation = None + retVal = c_int() + counter = 0 + + while counter < 10000 and self._opn_completed == False: + counter += 1 + if self._pa_state == pa.PA_CONTEXT_READY and operation == None: + self._pa_card_info_cb_t = pa.pa_card_info_cb_t(self.pa_card_info_cb) +# operation = pa.pa_context_get_card_info_by_index(self._context, +# index, self._pa_card_info_cb_t , None) + operation = pa.pa_context_get_card_info_list(self._context, + self._pa_card_info_cb_t , None) + + pa.pa_mainloop_iterate(self.mainloop, 0, byref(retVal)) + +# print(dumps(self._ports, indent = 5)) + print(dumps({'cards': self._cards, 'ports':self._ports}, indent = 5)) + + try: + if operation: + pa.pa_operation_unref(operation) + + pa.pa_context_disconnect(self._context) + pa.pa_context_unref(self._context) + pa.pa_mainloop_free(self.mainloop) + except: + pass + + def pa_card_info_cb(self, context, card_info, eol, whatever): + + if not card_info or not card_info[0]: + return + + card = card_info[0] + #print (card.index) + card_obj = {} + card_obj['index'] = str(card.index) + self._cards[card.index] = card_obj + card_obj['profiles'] = [] + for k in range(0, card.n_profiles): + if(card.profiles2[k]): + profile = card.profiles2[k].contents + pobj = {} + pobj['name'] = profile.name.decode('utf8') if profile.name else '' + pobj['human_name'] = profile.description.decode('utf8') if profile.description else '' + pobj['available'] = profile.available + card_obj['profiles'].append(pobj) + + card_obj['ports'] = [] + for i in range(0, card.n_ports): + port = card.ports[i].contents +# print ("Port name "+ str(port.name)) + obj = {} + obj['name'] = port.name.decode('utf8') if port.name else '' + obj['human_name'] = port.description.decode('utf8') if port.description else '' + obj['direction'] = port.direction + obj['available'] = port.available + obj['n_profiles'] = port.n_profiles + obj['profiles'] = [] + for j in range(0, port.n_profiles): + if(port.profiles2[j]): + profile = port.profiles2[j].contents +# pobj = {} +# pobj['name'] = profile.name.decode('utf8') if profile.name else '' +# pobj['human_name'] = profile.description.decode('utf8') if profile.description else '' +# pobj['available'] = profile.available +# obj['profiles'].append(pobj) + if profile.name: + obj['profiles'].append(profile.name.decode('utf8')) + + self._ports.append(obj) + card_obj['ports'].append(obj) + + + + self._opn_completed = True + + + def pa_context_notify_cb_t(self, context, userdata): + try: + self._pa_state = pa.pa_context_get_state(context) + + except Exception: + self._pa_state = pa.PA_CONTEXT_FAILED + + +PAHelper().print_card_info() + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/buttons.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/buttons.js new file mode 100644 index 00000000..16332bc9 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/buttons.js @@ -0,0 +1,126 @@ +const GObject = imports.gi.GObject +const St = imports.gi.St +const Clutter = imports.gi.Clutter +const Main = imports.ui.main +const AppMenu = Main.panel.statusArea.appMenu +const PanelMenu = imports.ui.panelMenu + +var DesktopLabel = GObject.registerClass( + class UniteDesktopLabel extends PanelMenu.Button { + _init(text) { + super._init(0.0, null, true) + + this._label = new St.Label({ y_align: Clutter.ActorAlign.CENTER }) + this.add_actor(this._label) + + this.reactive = false + this.label_actor = this._label + + this.setText(text || 'Desktop') + } + + setText(text) { + this._label.set_text(text) + } + + setVisible(visible) { + this.container.visible = visible + AppMenu.container.visible = !visible + } + } +) + +var TrayIndicator = GObject.registerClass( + class UniteTrayIndicator extends PanelMenu.Button { + _init(size) { + this._size = size || 20 + this._icons = [] + + super._init(0.0, null, true) + + this._indicators = new St.BoxLayout({ style_class: 'panel-status-indicators-box' }) + this.add_child(this._indicators) + + this._sync() + } + + get size() { + const context = St.ThemeContext.get_for_stage(global.stage) + return this._size * context.scale_factor + } + + _sync() { + this.visible = this._icons.length + } + + addIcon(icon) { + this._icons.push(icon) + + const mask = St.ButtonMask.ONE | St.ButtonMask.TWO | St.ButtonMask.THREE + const ibtn = new St.Button({ child: icon, button_mask: mask }) + + this._indicators.add_child(ibtn) + + icon.connect('destroy', () => { ibtn.destroy() }) + ibtn.connect('button-release-event', (actor, event) => { icon.click(event) }) + + icon.set_reactive(true) + icon.set_size(this.size, this.size) + + this._sync() + } + + removeIcon(icon) { + const actor = icon.get_parent() || icon + actor.destroy() + + const index = this._icons.indexOf(icon) + this._icons.splice(index, 1) + + this._sync() + } + + forEach(callback) { + this._icons.forEach(icon => { callback.call(null, icon) }) + } + } +) + +var WindowControls = GObject.registerClass( + class UniteWindowControls extends PanelMenu.Button { + _init() { + super._init(0.0, null, true) + + this._controls = new St.BoxLayout({ style_class: 'window-controls-box' }) + this.add_child(this._controls) + + this.add_style_class_name('window-controls') + } + + _addButton(action) { + const bin = new St.Bin({ style_class: 'icon' }) + const btn = new St.Button({ track_hover: true }) + + btn.add_style_class_name(`window-button ${action}`) + btn.add_actor(bin) + + btn.connect('clicked', () => { + const target = global.unite.focusWindow + const method = target && target[action] + + method && method.call(target) + }) + + this._controls.add_child(btn) + } + + addButtons(buttons) { + this._controls.destroy_all_children() + buttons.forEach(this._addButton.bind(this)) + } + + setVisible(visible) { + this.container.visible = visible + } + } +) diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/convenience.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/convenience.js new file mode 100644 index 00000000..9e701c83 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/convenience.js @@ -0,0 +1,124 @@ +const Gettext = imports.gettext +const GObject = imports.gi.GObject +const Gio = imports.gi.Gio +const Config = imports.misc.config +const Unite = imports.misc.extensionUtils.getCurrentExtension() + +var SettingsManager = GObject.registerClass( + class UniteSettings extends Gio.Settings { + get DEFAULT_BINDING() { + return Gio.SettingsBindFlags.DEFAULT + } + + get _types() { + return { + 'autofocus-windows': 'boolean', + 'hide-activities-button': 'enum', + 'show-window-title': 'enum', + 'show-desktop-name': 'boolean', + 'desktop-name-text': 'string', + 'extend-left-box': 'boolean', + 'notifications-position': 'enum', + 'use-system-fonts': 'boolean', + 'show-legacy-tray': 'boolean', + 'greyscale-tray-icons': 'boolean', + 'show-window-buttons': 'enum', + 'window-buttons-theme': 'enum', + 'hide-window-titlebars': 'enum', + 'window-buttons-placement': 'select', + 'hide-dropdown-arrows': 'boolean', + 'hide-aggregate-menu-arrow': 'boolean', + 'hide-app-menu-arrow': 'boolean', + 'hide-app-menu-icon': 'boolean', + 'reduce-panel-spacing': 'boolean', + 'restrict-to-primary-screen': 'boolean' + } + } + + exists(key) { + return Object.keys(this._types).includes(key) + } + + getSettingType(key) { + return this._types[key] || 'invalid' + } + + getTypeSettings(type) { + return Object.keys(this._types).filter(key => this._types[key] == type) + } + + getSetting(key) { + if (!this.exists(key)) return + + let boolean = this.getSettingType(key) == 'boolean' + return boolean ? this.get_boolean(key) : this.get_string(key) + } + } +) + +var PreferencesManager = GObject.registerClass( + class UnitePreferences extends Gio.Settings { + get window_buttons_position() { + let setting = this.get_string('button-layout') + return /(close|minimize|maximize).*:/.test(setting) ? 'left' : 'right' + } + + get window_buttons_layout() { + let setting = this.get_string('button-layout') + return setting.match(/(close|minimize|maximize)/g) + } + + exists(key) { + let fun = key.replace(/-/g, '_') + return (fun in this) || this.list_keys().includes(key) + } + + getSetting(key) { + let fun = key.replace(/-/g, '_') + + if (this.exists(fun)) return this[fun] + if (this.exists(key)) return this.get_string(key) + } + } +) + +function initTranslations(domain) { + let textDomain = domain || Unite.metadata['gettext-domain'] + let localeDir = Unite.dir.get_child('locale') + + if (localeDir.query_exists(null)) + localeDir = localeDir.get_path() + else + localeDir = Config.LOCALEDIR + + Gettext.bindtextdomain(textDomain, localeDir) +} + +function getSettings(schema) { + schema = schema || Unite.metadata['settings-schema'] + + let gioSSS = Gio.SettingsSchemaSource + let schemaDir = Unite.dir.get_child('schemas') + let schemaSource = gioSSS.get_default() + + if (schemaDir.query_exists(null)) { + schemaDir = schemaDir.get_path() + schemaSource = gioSSS.new_from_directory(schemaDir, schemaSource, false) + } + + let schemaObj = schemaSource.lookup(schema, true) + + if (!schemaObj) { + let metaId = Unite.metadata.uuid + let message = `Schema ${schema} could not be found for extension ${metaId}.` + + throw new Error(`${message} Please check your installation.`) + } + + return new SettingsManager({ settings_schema: schemaObj }) +} + +function getPreferences() { + let schemaId = 'org.gnome.desktop.wm.preferences' + return new PreferencesManager({ schema_id: schemaId }) +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/extension.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/extension.js new file mode 100644 index 00000000..5d2b4883 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/extension.js @@ -0,0 +1,46 @@ +const GObject = imports.gi.GObject +const Main = imports.ui.main +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const PanelManager = Unite.imports.panel.PanelManager +const LayoutManager = Unite.imports.layout.LayoutManager +const WindowManager = Unite.imports.window.WindowManager + +var UniteExtension = GObject.registerClass( + class UniteExtension extends GObject.Object { + _init() { + this.panelManager = new PanelManager() + this.layoutManager = new LayoutManager() + this.windowManager = new WindowManager() + } + + get focusWindow() { + return this.windowManager.focusWindow + } + + activate() { + this.panelManager.activate() + this.layoutManager.activate() + this.windowManager.activate() + + Main.panel._addStyleClassName('unite-shell') + } + + destroy() { + this.panelManager.destroy() + this.layoutManager.destroy() + this.windowManager.destroy() + + Main.panel._removeStyleClassName('unite-shell') + } + } +) + +function enable() { + global.unite = new UniteExtension() + global.unite.activate() +} + +function disable() { + global.unite.destroy() + global.unite = null +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/handlers.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/handlers.js new file mode 100644 index 00000000..c61f6def --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/handlers.js @@ -0,0 +1,230 @@ +const Bytes = imports.byteArray +const Gio = imports.gi.Gio +const GLib = imports.gi.GLib +const St = imports.gi.St +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const Convenience = Unite.imports.convenience + +const SETTINGS = Convenience.getSettings() +const WM_PREFS = Convenience.getPreferences() + +const USER_CONFIG = GLib.get_user_config_dir() +const USER_STYLES = `${USER_CONFIG}/gtk-3.0/gtk.css` + +function fileExists(path) { + return GLib.file_test(path, GLib.FileTest.EXISTS) +} + +function getGioFile(path) { + const absPath = GLib.build_filenamev([Unite.path, path]) + + if (fileExists(absPath)) { + return Gio.file_new_for_path(absPath) + } +} + +function getFileContents(path) { + if (fileExists(path)) { + const contents = GLib.file_get_contents(path) + return Bytes.toString(contents[1]) + } else { + return '' + } +} + +function setFileContents(path, contents) { + GLib.file_set_contents(path, contents) +} + +function resetGtkStyles() { + let style = getFileContents(USER_STYLES) + + style = style.replace(/\/\* UNITE ([\s\S]*?) UNITE \*\/\n/g, '') + style = style.replace(/@import.*unite@hardpixel\.eu.*css['"]\);\n/g, '') + + setFileContents(USER_STYLES, style) +} + +var Signals = class Signals { + constructor() { + this.signals = new Map() + } + + registerHandler(object, name, callback) { + const key = `${object}[${name}]` + + if (!this.hasSignal(key)) { + this.signals.set(key, { + object: object, + signalId: object.connect(name, callback) + }) + } + + return key + } + + hasSignal(key) { + return this.signals.has(key) + } + + connect(object, name, callback) { + return this.registerHandler(object, name, callback) + } + + disconnect(key) { + if (this.hasSignal(key)) { + const data = this.signals.get(key) + data.object.disconnect(data.signalId) + + this.signals.delete(key) + } + } + + disconnectMany(keys) { + keys.forEach(this.disconnect.bind(this)) + } + + disconnectAll() { + for (const key of this.signals.keys()) { + this.disconnect(key) + } + } +} + +var Settings = class Settings extends Signals { + getSettingObject(key) { + if (SETTINGS.exists(key)) { + return SETTINGS + } else { + return WM_PREFS + } + } + + connect(name, callback) { + const object = this.getSettingObject(name) + return this.registerHandler(object, `changed::${name}`, callback) + } + + get(key) { + const object = this.getSettingObject(key) + return object.getSetting(key) + } +} + +var ShellStyle = class ShellStyle { + constructor(path) { + this.file = getGioFile(path) + } + + get context() { + return St.ThemeContext.get_for_stage(global.stage) + } + + get theme() { + return this.context.get_theme() + } + + load() { + this.theme.load_stylesheet(this.file) + } + + unload() { + this.theme.unload_stylesheet(this.file) + } +} + +var WidgetStyle = class WidgetStyle { + constructor(widget, style) { + this.widget = widget + this.style = style + } + + get existing() { + return this.widget.get_style() || '' + } + + load() { + const style = this.existing + this.style + this.widget.set_style(style) + } + + unload() { + const style = this.existing.replace(this.style, '') + this.widget.set_style(style) + } +} + +var GtkStyle = class GtkStyle { + constructor(name, contents) { + this.contents = `/* UNITE ${name} */\n${contents}\n/* ${name} UNITE */\n` + } + + get existing() { + return getFileContents(USER_STYLES) + } + + load() { + const style = this.contents + this.existing + setFileContents(USER_STYLES, style) + } + + unload() { + const style = this.existing.replace(this.contents, '') + setFileContents(USER_STYLES, style) + } +} + +var Styles = class Styles { + constructor() { + this.styles = new Map() + } + + hasStyle(name) { + return name && this.styles.has(name) + } + + getStyle(name) { + return name && this.styles.get(name) + } + + setStyle(name, object, ...args) { + if (!this.hasStyle(name)) { + const style = new object(...args) + style.load() + + this.styles.set(name, style) + } + } + + deleteStyle(name) { + if (this.hasStyle(name)) { + const style = this.getStyle(name) + style.unload() + + this.styles.delete(name) + } + } + + addShellStyle(name, path) { + this.deleteStyle(name) + this.setStyle(name, ShellStyle, path) + } + + addWidgetStyle(name, widget, styles) { + this.deleteStyle(name) + this.setStyle(name, WidgetStyle, widget, styles) + } + + addGtkStyle(name, contents) { + this.deleteStyle(name) + this.setStyle(name, GtkStyle, name, contents) + } + + removeAll() { + for (const key of this.styles.keys()) { + this.deleteStyle(key) + } + } +} + +resetGtkStyles() diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/layout.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/layout.js new file mode 100644 index 00000000..d6dba0ec --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/layout.js @@ -0,0 +1,253 @@ +const GObject = imports.gi.GObject +const St = imports.gi.St +const Clutter = imports.gi.Clutter +const GtkSettings = imports.gi.Gtk.Settings.get_default() +const Main = imports.ui.main +const Config = imports.misc.config +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const AppMenu = Main.panel.statusArea.appMenu +const AggMenu = Main.panel.statusArea.aggregateMenu +const Handlers = Unite.imports.handlers + +const VERSION = parseInt(Config.PACKAGE_VERSION.split('.')[1]) + +function actorHasClass(actor, name) { + return actor.has_style_class_name && actor.has_style_class_name(name) +} + +function getWidgetArrow(widget) { + let arrow = widget._arrow + + if (!arrow) { + const last = widget.get_n_children() - 1 + const actor = widget.get_children()[last] + + if (actor) { + if (actorHasClass(actor, 'popup-menu-arrow')) { + arrow = actor + } else { + arrow = getWidgetArrow(actor) + } + } + } + + if (arrow && !widget.hasOwnProperty('_arrow')) { + widget._arrow = arrow + } + + return arrow +} + +function toggleWidgetArrow(widget, hide) { + const arrow = widget && getWidgetArrow(widget) + + if (arrow) { + if (hide && !widget._arrowHandled) { + arrow.visible = false + widget._arrowHandled = true + } + + if (!hide && widget._arrowHandled) { + arrow.visible = true + delete widget._arrowHandled + } + } +} + +var LayoutManager = GObject.registerClass( + class UniteLayoutManager extends GObject.Object { + _init() { + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + this.styles = new Handlers.Styles() + + this.signals.connect( + Main.panel._leftBox, 'actor_added', this._onHideDropdownArrows.bind(this) + ) + + this.signals.connect( + Main.panel._centerBox, 'actor_added', this._onHideDropdownArrows.bind(this) + ) + + this.signals.connect( + Main.panel._rightBox, 'actor_added', this._onHideDropdownArrows.bind(this) + ) + + this.signals.connect( + GtkSettings, 'notify::gtk-font-name', this._onChangeStyles.bind(this) + ) + + this.settings.connect( + 'notifications-position', this._onNotificationsChange.bind(this) + ) + + this.settings.connect( + 'hide-app-menu-icon', this._onHideAppMenuIcon.bind(this) + ) + + this.settings.connect( + 'hide-app-menu-arrow', this._onHideAppMenuArrow.bind(this) + ) + + this.settings.connect( + 'hide-aggregate-menu-arrow', this._onHideAggMenuArrow.bind(this) + ) + + this.settings.connect( + 'hide-dropdown-arrows', this._onHideDropdownArrows.bind(this) + ) + + this.settings.connect( + 'use-system-fonts', this._onChangeStyles.bind(this) + ) + + this.settings.connect( + 'reduce-panel-spacing', this._onChangeStyles.bind(this) + ) + } + + _onNotificationsChange() { + const setting = this.settings.get('notifications-position') + + if (setting != 'center') { + const context = St.ThemeContext.get_for_stage(global.stage) + const banner = Main.messageTray._bannerBin + const mappings = { left: 'START', right: 'END' } + const position = mappings[setting] + + banner.set_x_align(Clutter.ActorAlign[position]) + banner.set_width(390 * context.scale_factor) + } else { + this._resetNotifications() + } + } + + _onHideAppMenuIcon() { + const setting = this.settings.get('hide-app-menu-icon') + + if (setting) { + AppMenu._iconBox.hide() + } else { + this._resetAppMenuIcon() + } + } + + _onHideAppMenuArrow() { + const setting = this.settings.get('hide-app-menu-arrow') + + if (setting) { + toggleWidgetArrow(AppMenu, true) + } else { + this._resetAppMenuArrow() + } + } + + _onHideAggMenuArrow() { + const setting = this.settings.get('hide-aggregate-menu-arrow') + + if (setting) { + toggleWidgetArrow(AggMenu, true) + } else { + this._resetAggMenuArrow() + } + } + + _onHideDropdownArrows() { + const setting = this.settings.get('hide-dropdown-arrows') + + if (setting) { + for (const [name, widget] of Object.entries(Main.panel.statusArea)) { + if (name != 'aggregateMenu' && name != 'appMenu') { + toggleWidgetArrow(widget, true) + } + } + } else { + this._resetDropdownArrows() + } + } + + _onChangeStyles() { + const fonts = this.settings.get('use-system-fonts') + const space = this.settings.get('reduce-panel-spacing') + + this._resetStyles() + + if (fonts) { + const font = GtkSettings.gtk_font_name.replace(/\s\d+$/, '') + this.styles.addWidgetStyle('uiGroup', Main.uiGroup, `font-family: ${font};`) + + Main.panel._addStyleClassName('system-fonts') + } + + if (space) { + Main.panel._addStyleClassName('small-spacing') + } + + if (VERSION < 34) { + Main.panel._addStyleClassName('extra-spacing') + } + + if (fonts || space) { + this.styles.addWidgetStyle('panel', Main.panel, 'font-size: 11.25pt;') + } + } + + _resetNotifications() { + const banner = Main.messageTray._bannerBin + + banner.set_x_align(Clutter.ActorAlign.CENTER) + banner.set_width(-1) + } + + _resetAppMenuIcon() { + AppMenu._iconBox.show() + } + + _resetAppMenuArrow() { + toggleWidgetArrow(AppMenu, false) + } + + _resetAggMenuArrow() { + toggleWidgetArrow(AggMenu, false) + } + + _resetDropdownArrows() { + for (const [name, widget] of Object.entries(Main.panel.statusArea)) { + if (name != 'aggregateMenu' && name != 'appMenu') { + toggleWidgetArrow(widget, false) + } + } + } + + _resetStyles() { + Main.panel._removeStyleClassName('system-fonts') + Main.panel._removeStyleClassName('small-spacing') + Main.panel._removeStyleClassName('extra-spacing') + + this.styles.deleteStyle('uiGroup') + this.styles.deleteStyle('panel') + } + + activate() { + this._onNotificationsChange() + this._onHideAppMenuIcon() + this._onHideAppMenuArrow() + this._onHideAggMenuArrow() + this._onHideDropdownArrows() + this._onChangeStyles() + } + + destroy() { + this._resetNotifications() + this._resetAppMenuIcon() + this._resetAppMenuArrow() + this._resetAggMenuArrow() + this._resetDropdownArrows() + this._resetStyles() + + this.signals.disconnectAll() + this.settings.disconnectAll() + this.styles.removeAll() + } + } +) diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/metadata.json b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/metadata.json new file mode 100644 index 00000000..c6e97892 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/metadata.json @@ -0,0 +1,14 @@ +{ + "_generated": "Generated by SweetTooth, do not edit", + "description": "Unite is a GNOME Shell extension which makes a few layout tweaks to the top panel and removes window decorations to make it look like Ubuntu Unity Shell.\n\n- Adds window buttons to the top panel for maximized windows.\n- Shows current window title in the app menu for maximized windows.\n- Removes titlebars on maximized windows.\n- Hides window controls on maximized windows with headerbars.\n- Moves the date to the right, reduces panel spacing and removes dropdown arrows.\n- Moves legacy tray icons to the top panel.\n- Moves notifications to the right.\n- Hides activities button.\n- Adds desktop name to the top panel.\n\nThis extension depends on some Xorg utilities. To install them:\n- Debian/Ubuntu: apt install x11-utils\n- Fedora/RHEL: dnf install xorg-x11-utils\n- Arch: pacman -S xorg-xprop\n\n*Settings are provided to enable/disable or customize the available tweaks.\n* Since version 2 applications on wayland with client side decorations are supported using CSS.", + "gettext-domain": "unite", + "name": "Unite", + "settings-schema": "org.gnome.shell.extensions.unite", + "shell-version": [ + "3.34", + "3.32" + ], + "url": "https://github.com/hardpixel/unite-shell", + "uuid": "unite@hardpixel.eu", + "version": 36 +} \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/panel.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/panel.js new file mode 100644 index 00000000..a8321432 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/panel.js @@ -0,0 +1,507 @@ +const Gi = imports._gi +const System = imports.system +const GObject = imports.gi.GObject +const Clutter = imports.gi.Clutter +const Shell = imports.gi.Shell +const AppSystem = imports.gi.Shell.AppSystem.get_default() +const WinTracker = imports.gi.Shell.WindowTracker.get_default() +const Main = imports.ui.main +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const AppMenu = Main.panel.statusArea.appMenu +const Activities = Main.panel.statusArea.activities +const Buttons = Unite.imports.buttons +const Handlers = Unite.imports.handlers + +var PanelExtension = class PanelExtension { + constructor(settings, key, callback) { + this.activated = false + + const isActive = () => { + return callback.call(null, settings.get(key)) + } + + const onChange = () => { + const active = isActive() + + if (active && !this.activated) { + this.activated = true + return this._init() + } + + if (!active && this.activated) { + this.activated = false + return this._destroy() + } + } + + this.activate = () => { + settings.connect(key, onChange.bind(this)) + onChange() + } + + this.destroy = () => { + if (this.activated) { + this._destroy() + this.activated = false + } + } + } +} + +var WindowButtons = class WindowButtons extends PanelExtension { + constructor({ settings }) { + const active = val => val != 'never' + super(settings, 'show-window-buttons', active) + } + + _init() { + this.theme = 'default-dark' + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + this.styles = new Handlers.Styles() + this.controls = new Buttons.WindowControls() + + this.signals.connect( + Main.overview, 'showing', this._onOverviewShowing.bind(this) + ) + + this.signals.connect( + Main.overview, 'hiding', this._onOverviewHiding.bind(this) + ) + + this.signals.connect( + WinTracker, 'notify::focus-app', this._onFocusAppChange.bind(this) + ) + + this.settings.connect( + 'window-buttons-layout', this._onLayoutChange.bind(this) + ) + + this.settings.connect( + 'window-buttons-position', this._onPositionChange.bind(this) + ) + + this.settings.connect( + 'window-buttons-placement', this._onPositionChange.bind(this) + ) + + this.settings.connect( + 'window-buttons-theme', this._onThemeChange.bind(this) + ) + + Main.panel.addToStatusArea( + 'uniteWindowControls', this.controls, this.index, this.side + ) + + this.controls.setVisible(false) + + this._onLayoutChange() + this._onPositionChange() + this._onThemeChange() + } + + get position() { + return this.settings.get('window-buttons-position') + } + + get placement() { + return this.settings.get('window-buttons-placement') + } + + get side() { + const sides = { first: 'left', last: 'right', auto: this.position } + return sides[this.placement] || this.placement + } + + get index() { + if (this.placement == 'first') return 0 + if (this.placement == 'last') return -1 + + return null + } + + get sibling() { + if (this.side == 'left') { + return Main.panel.statusArea.appMenu.get_parent() + } else { + return Main.panel.statusArea.aggregateMenu.get_parent() + } + } + + get container() { + if (this.side == 'left') { + return Main.panel._leftBox + } else { + return Main.panel._rightBox + } + } + + _onOverviewShowing() { + this.controls.setVisible(false) + } + + _onOverviewHiding() { + const focused = global.unite.focusWindow + this.controls.setVisible(focused && focused.showButtons) + } + + _onFocusAppChange() { + const focused = AppMenu._targetApp + + if (focused == null || focused.state != Shell.AppState.RUNNING) { + this.controls.setVisible(false) + } + } + + _onLayoutChange() { + const buttons = this.settings.get('window-buttons-layout') + + if (this.side == 'right' && this.position == 'left') { + buttons.reverse() + } + + this.controls.addButtons(buttons) + } + + _onPositionChange() { + const controls = this.controls.container + controls.reparent(this.container) + + if (this.index != null) { + this.container.set_child_at_index(controls, this.index) + } else { + this.container.set_child_below_sibling(controls, this.sibling) + } + + this._onLayoutChange() + } + + _onThemeChange() { + this.controls.remove_style_class_name(this.theme) + + this.theme = this.settings.get('window-buttons-theme') + const path = `themes/${this.theme}/stylesheet.css` + + this.styles.addShellStyle('windowButtons', path) + this.controls.add_style_class_name(this.theme) + } + + _destroy() { + this.controls.destroy() + + this.signals.disconnectAll() + this.settings.disconnectAll() + this.styles.removeAll() + } +} + +var ExtendLeftBox = class ExtendLeftBox extends PanelExtension { + constructor({ settings }) { + const active = val => val == true + super(settings, 'extend-left-box', active) + } + + _init() { + this._default = Main.panel.__proto__.vfunc_allocate + + Main.panel.__proto__[Gi.hook_up_vfunc_symbol]('allocate', (box, flags) => { + Main.panel.vfunc_allocate.call(Main.panel, box, flags) + this._allocate(Main.panel, box, flags) + }) + + Main.panel.queue_relayout() + } + + _allocate(actor, box, flags) { + let leftBox = Main.panel._leftBox + let centerBox = Main.panel._centerBox + let rightBox = Main.panel._rightBox + + let allocWidth = box.x2 - box.x1 + let allocHeight = box.y2 - box.y1 + + let [leftMinWidth, leftNaturalWidth] = leftBox.get_preferred_width(-1) + let [centerMinWidth, centerNaturalWidth] = centerBox.get_preferred_width(-1) + let [rightMinWidth, rightNaturalWidth] = rightBox.get_preferred_width(-1) + + let sideWidth = allocWidth - rightNaturalWidth - centerNaturalWidth + let childBox = new Clutter.ActorBox() + + childBox.y1 = 0 + childBox.y2 = allocHeight + + if (actor.get_text_direction() == Clutter.TextDirection.RTL) { + childBox.x1 = allocWidth - Math.min(Math.floor(sideWidth), leftNaturalWidth) + childBox.x2 = allocWidth + } else { + childBox.x1 = 0 + childBox.x2 = Math.min(Math.floor(sideWidth), leftNaturalWidth) + } + + leftBox.allocate(childBox, flags) + + childBox.y1 = 0 + childBox.y2 = allocHeight + + if (actor.get_text_direction() == Clutter.TextDirection.RTL) { + childBox.x1 = rightNaturalWidth + childBox.x2 = childBox.x1 + centerNaturalWidth + } else { + childBox.x1 = allocWidth - centerNaturalWidth - rightNaturalWidth + childBox.x2 = childBox.x1 + centerNaturalWidth + } + + centerBox.allocate(childBox, flags) + + childBox.y1 = 0 + childBox.y2 = allocHeight + + if (actor.get_text_direction() == Clutter.TextDirection.RTL) { + childBox.x1 = 0 + childBox.x2 = rightNaturalWidth + } else { + childBox.x1 = allocWidth - rightNaturalWidth + childBox.x2 = allocWidth + } + + rightBox.allocate(childBox, flags) + } + + _destroy() { + Main.panel.__proto__[Gi.hook_up_vfunc_symbol]('allocate', this._default) + this._default = null + + Main.panel.queue_relayout() + } +} + +var ActivitiesButton = class ActivitiesButton extends PanelExtension { + constructor({ settings }) { + const active = val => val != 'never' + super(settings, 'hide-activities-button', active) + } + + _init() { + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + + this.signals.connect( + Main.overview, 'showing', this._syncVisible.bind(this) + ) + + this.signals.connect( + Main.overview, 'hiding', this._syncVisible.bind(this) + ) + + this.signals.connect( + AppSystem, 'app-state-changed', this._syncVisible.bind(this) + ) + + this.signals.connect( + WinTracker, 'notify::focus-app', this._syncVisible.bind(this) + ) + + this.settings.connect( + 'show-desktop-name', this._syncVisible.bind(this) + ) + + this._syncVisible() + } + + get hideButton() { + return this.settings.get('hide-activities-button') + } + + get showDesktop() { + return this.settings.get('show-desktop-name') + } + + _syncVisible() { + const button = Activities.container + const overview = Main.overview.visibleTarget + + if (this.hideButton == 'always') { + return button.hide() + } + + if (this.showDesktop) { + button.visible = overview + } else { + button.visible = overview || AppMenu._targetApp == null + } + } + + _destroy() { + Activities.container.show() + + this.signals.disconnectAll() + this.settings.disconnectAll() + } +} + +var DesktopName = class DesktopName extends PanelExtension { + constructor({ settings }) { + const active = val => val == true + super(settings, 'show-desktop-name', active) + } + + _init() { + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + this.label = new Buttons.DesktopLabel() + + this.signals.connect( + Main.overview, 'showing', this._syncVisible.bind(this) + ) + + this.signals.connect( + Main.overview, 'hiding', this._syncVisible.bind(this) + ) + + this.signals.connect( + AppSystem, 'app-state-changed', this._syncVisible.bind(this) + ) + + this.signals.connect( + WinTracker, 'notify::focus-app', this._syncVisible.bind(this) + ) + + this.settings.connect( + 'desktop-name-text', this._onTextChanged.bind(this) + ) + + Main.panel.addToStatusArea( + 'uniteDesktopLabel', this.label, 1, 'left' + ) + + this._onTextChanged() + this._syncVisible() + } + + get visibleWindows() { + const actors = global.get_window_actors() + + return actors.some(({ metaWindow }) => { + const visible = metaWindow.showing_on_its_workspace() + return visible && !metaWindow.skip_taskbar + }) + } + + _syncVisible() { + const overview = Main.overview.visibleTarget + const visible = !overview && AppMenu._targetApp == null + + this.label.setVisible(visible && !this.visibleWindows) + } + + _onTextChanged() { + const text = this.settings.get('desktop-name-text') + this.label.setText(text) + } + + _destroy() { + this.label.destroy() + + this.signals.disconnectAll() + this.settings.disconnectAll() + } +} + +var TrayIcons = class TrayIcons extends PanelExtension { + constructor({ settings }) { + const active = val => val == true + super(settings, 'show-legacy-tray', active) + } + + _init() { + this.tray = new Shell.TrayManager() + this.settings = new Handlers.Settings() + this.indicators = new Buttons.TrayIndicator() + + this.tray.connect( + 'tray-icon-added', this._onIconAdded.bind(this) + ) + + this.tray.connect( + 'tray-icon-removed', this._onIconRemoved.bind(this) + ) + + this.settings.connect( + 'greyscale-tray-icons', this._onGreyscaleChange.bind(this) + ) + + Main.panel.addToStatusArea( + 'uniteTrayIndicator', this.indicators, 0, 'right' + ) + + this.tray.manage_screen(Main.panel) + } + + _desaturateIcon(icon) { + const greyscale = this.settings.get('greyscale-tray-icons') + icon.clear_effects() + + if (greyscale) { + const desEffect = new Clutter.DesaturateEffect({ factor : 1.0 }) + const briEffect = new Clutter.BrightnessContrastEffect({}) + + briEffect.set_brightness(0.2) + briEffect.set_contrast(0.3) + + icon.add_effect_with_name('desaturate', desEffect) + icon.add_effect_with_name('brightness-contrast', briEffect) + } + } + + _onIconAdded(trayManager, icon) { + this.indicators.addIcon(icon) + this._desaturateIcon(icon) + } + + _onIconRemoved(trayManager, icon) { + this.indicators.removeIcon(icon) + } + + _onGreyscaleChange() { + this.indicators.forEach(this._desaturateIcon.bind(this)) + } + + _destroy() { + this.tray = null + System.gc() + + this.indicators.destroy() + this.settings.disconnectAll() + } +} + +var PanelManager = GObject.registerClass( + class UnitePanelManager extends GObject.Object { + _init() { + this.settings = new Handlers.Settings() + this.buttons = new WindowButtons(this) + this.extender = new ExtendLeftBox(this) + this.activities = new ActivitiesButton(this) + this.desktop = new DesktopName(this) + this.tray = new TrayIcons(this) + } + + activate() { + this.buttons.activate() + this.extender.activate() + this.activities.activate() + this.desktop.activate() + this.tray.activate() + } + + destroy() { + this.buttons.destroy() + this.extender.destroy() + this.activities.destroy() + this.desktop.destroy() + this.tray.destroy() + + this.settings.disconnectAll() + } + } +) diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/prefs.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/prefs.js new file mode 100644 index 00000000..6b8ebb11 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/prefs.js @@ -0,0 +1,74 @@ +const GObject = imports.gi.GObject +const Gtk = imports.gi.Gtk +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const Convenience = Unite.imports.convenience + +var PrefsWidget = GObject.registerClass( + class UnitePrefsWidget extends Gtk.Box { + _init(params) { + this._settings = Convenience.getSettings() + super._init(params) + + this._buildable = new Gtk.Builder() + this._buildable.add_from_file(`${Unite.path}/settings.ui`) + + this._container = this._getWidget('prefs_widget') + this.add(this._container) + + this._bindStrings() + this._bindSelects() + this._bindBooleans() + this._bindEnumerations() + } + + _getWidget(name) { + let widgetName = name.replace(/-/g, '_') + return this._buildable.get_object(widgetName) + } + + _bindInput(setting, prop) { + let widget = this._getWidget(setting) + this._settings.bind(setting, widget, prop, this._settings.DEFAULT_BINDING) + } + + _bindEnum(setting) { + let widget = this._getWidget(setting) + widget.set_active(this._settings.get_enum(setting)) + + widget.connect('changed', (combobox) => { + this._settings.set_enum(setting, combobox.get_active()) + }) + } + + _bindStrings() { + let settings = this._settings.getTypeSettings('string') + settings.forEach(setting => { this._bindInput(setting, 'text') }) + } + + _bindSelects() { + let settings = this._settings.getTypeSettings('select') + settings.forEach(setting => { this._bindInput(setting, 'active-id') }) + } + + _bindBooleans() { + let settings = this._settings.getTypeSettings('boolean') + settings.forEach(setting => { this._bindInput(setting, 'active') }) + } + + _bindEnumerations() { + let settings = this._settings.getTypeSettings('enum') + settings.forEach(setting => { this._bindEnum(setting) }) + } + } +) + +function init() { + Convenience.initTranslations() +} + +function buildPrefsWidget() { + let widget = new PrefsWidget() + widget.show_all() + + return widget +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/gschemas.compiled b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/gschemas.compiled new file mode 100644 index 00000000..0fbb1f02 Binary files /dev/null and b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/gschemas.compiled differ diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/org.gnome.shell.extensions.unite.gschema.xml b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/org.gnome.shell.extensions.unite.gschema.xml new file mode 100644 index 00000000..6b8d5f46 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/schemas/org.gnome.shell.extensions.unite.gschema.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + Apply system fonts to shell interface. + + + + true + Extend top bar left box. + + + + true + Legacy tray icons in top bar. + + + + false + Convert legacy tray icons to greyscale. + + + + true + Autofocus windows that demand attention. + + + + true + Show desktop name in top bar. + + + + "GNOME Desktop" + Set the top bar desktop name text. + + + + true + Restrict functionalities to the primary screen. + + + + true + Hide top bar dropdown arrows. + + + + false + Hide aggregate menu dropdown arrow. + + + + true + Hide app menu dropdown arrow. + + + + true + Hide app menu application icon. + + + + true + Reduce top bar items spacing. + + + + "auto" + Top bar window buttons position. + + + + "maximized" + Use window title to replace the app-menu label. + + + + "maximized" + Active window bottons in top bar. + + + + "default-dark" + Top bar window buttons theme. + + + + "maximized" + Select windows state to hide titlebars. + + + + "right" + Select notification messages position. + + + + "auto" + Hide top bar activities button. + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/settings.ui b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/settings.ui new file mode 100644 index 00000000..914000f7 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/settings.ui @@ -0,0 +1,907 @@ + + + + + + True + True + True + False + True + + + True + False + start + 20 + 20 + 20 + 20 + vertical + 15 + True + + + True + False + 50 + + + True + False + center + Extend top bar left box + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + False + 50 + + + True + False + center + Auto focus new windows + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 2 + + + + + True + False + 50 + + + True + False + center + Show system tray in top bar + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 3 + + + + + True + False + 50 + + + True + False + center + Show desktop name in top bar + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 5 + + + + + True + False + 50 + + + True + False + center + Restrict functionalities to the primary screen + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 6 + + + + + True + False + 50 + + + True + False + center + Hide activities button + + + False + True + 0 + + + + + 170 + True + False + 1 + + Never + Auto + Always + + + + False + True + end + 1 + + + + + False + True + 8 + + + + + True + False + 50 + + + True + False + center + Hide window titlebars + + + False + True + 0 + + + + + 170 + True + False + 2 + + Never + Tiled + Maximized + Both + Always + + + + False + True + end + 1 + + + + + False + True + 9 + + + + + True + False + 50 + + + True + False + center + Show window title in app menu + + + False + True + 0 + + + + + 170 + True + False + 2 + + Never + Tiled + Maximized + Both + Always + + + + False + True + end + 1 + + + + + False + True + 10 + + + + + True + False + 50 + + + True + False + center + Show window buttons in top bar + + + False + True + 0 + + + + + 170 + True + False + 2 + + Never + Tiled + Maximized + Both + Always + + + + False + True + end + 1 + + + + + False + True + 11 + + + + + True + False + 50 + + + True + False + center + Notification messages position + + + False + True + 0 + + + + + 170 + True + False + 2 + + Center + Left + Right + + + + False + True + end + 1 + + + + + False + True + 13 + + + + + True + + + + + True + False + General + + + False + + + + + True + False + start + 20 + 20 + 20 + 20 + vertical + 15 + True + + + True + False + 50 + + + True + False + center + Apply system fonts to shell theme + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 0 + + + + + True + False + 50 + + + True + False + center + Convert tray icons to greyscale + + + False + True + 0 + + + + + True + True + center + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + False + 50 + + + True + False + center + Hide top bar dropdown arrows + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 2 + + + + + True + False + 50 + + + True + False + center + Hide aggregate menu dropdown arrow + + + False + True + 0 + + + + + True + True + center + + + False + True + end + 1 + + + + + False + True + 3 + + + + + True + False + 50 + + + True + False + center + Hide app menu dropdown arrow + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 4 + + + + + True + False + 50 + + + True + False + center + Hide app menu application icon + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 5 + + + + + True + False + 50 + + + True + False + center + Reduce top bar items spacing + + + False + True + 0 + + + + + True + True + center + True + + + False + True + end + 1 + + + + + False + True + 6 + + + + + True + False + 50 + + + True + False + center + Top bar desktop name text + + + False + True + 0 + + + + + 170 + True + True + GNOME Desktop + + + False + True + end + 1 + + + + + False + True + 7 + + + + + True + False + True + 50 + + + True + False + center + Top bar window buttons position + + + False + True + 0 + + + + + 170 + True + False + auto + + Auto + Left + Right + First + Last + + + + False + True + end + 1 + + + + + False + True + 8 + + + + + True + False + True + 50 + + + True + False + center + Top bar window buttons theme + + + False + True + 0 + + + + + 170 + True + False + 0 + + Default Dark + Default Light + Ambiance + Radiance + Arc Dark + Arc Light + United Dark + United Light + Materia Dark + Materia Light + OSX Arc + Vertex + Pop Dark + Pop Light + Vimix + Yaru + Arrongin + Telinkrin + Breeze + + + + False + True + end + 1 + + + + + False + True + 9 + + + + + 1 + True + + + + + True + False + Appearance + + + 1 + False + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/always.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/always.css new file mode 100644 index 00000000..c6a1ef5a --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/always.css @@ -0,0 +1,22 @@ +window headerbar, +window .titlebar { + padding-left: 0; +} + +window headerbar ~ headerbar, +window headerbar ~ .titlebar, +window .titlebar ~ .titlebar, +window .titlebar ~ headerbar { + padding-left: 6px; +} + +window headerbar > box.left, +window .titlebar > box.left { + margin: 0 0 0 -200px; + opacity: 0; +} + +window .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/both.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/both.css new file mode 100644 index 00000000..dd8f5ffc --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/both.css @@ -0,0 +1,2 @@ +@import "maximized.css"; +@import "tiled.css"; diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/maximized.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/maximized.css new file mode 100644 index 00000000..a57eb17b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/maximized.css @@ -0,0 +1,22 @@ +.maximized headerbar, +.maximized .titlebar { + padding-left: 0; +} + +.maximized headerbar ~ headerbar, +.maximized headerbar ~ .titlebar, +.maximized .titlebar ~ .titlebar, +.maximized .titlebar ~ headerbar { + padding-left: 6px; +} + +.maximized headerbar > box.left, +.maximized .titlebar > box.left { + margin: 0 0 0 -200px; + opacity: 0; +} + +.maximized .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/tiled.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/tiled.css new file mode 100644 index 00000000..703cca12 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-left/tiled.css @@ -0,0 +1,22 @@ +.tiled headerbar, +.tiled .titlebar { + padding-left: 0; +} + +.tiled headerbar ~ headerbar, +.tiled headerbar ~ .titlebar, +.tiled .titlebar ~ .titlebar, +.tiled .titlebar ~ headerbar { + padding-left: 6px; +} + +.tiled headerbar > box.left, +.tiled .titlebar > box.left { + margin: 0 0 0 -200px; + opacity: 0; +} + +.tiled .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/always.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/always.css new file mode 100644 index 00000000..801de7b4 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/always.css @@ -0,0 +1,20 @@ +window > headerbar, +window > .titlebar, +window > headerbar > headerbar, +window > .titlebar > .titlebar, +window > .titlebar > stack > headerbar, +window headerbar:last-child, +window .titlebar:last-child { + padding-right: 0; +} + +window headerbar > box.right, +window .titlebar > box.right { + margin: 0 -200px 0 0; + opacity: 0; +} + +window .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/both.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/both.css new file mode 100644 index 00000000..dd8f5ffc --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/both.css @@ -0,0 +1,2 @@ +@import "maximized.css"; +@import "tiled.css"; diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/maximized.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/maximized.css new file mode 100644 index 00000000..20b20a29 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/maximized.css @@ -0,0 +1,20 @@ +.maximized > headerbar, +.maximized > .titlebar, +.maximized > headerbar > headerbar, +.maximized > .titlebar > .titlebar, +.maximized > .titlebar > stack > headerbar, +.maximized headerbar:last-child, +.maximized .titlebar:last-child { + padding-right: 0; +} + +.maximized headerbar > box.right, +.maximized .titlebar > box.right { + margin: 0 -200px 0 0; + opacity: 0; +} + +.maximized .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/tiled.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/tiled.css new file mode 100644 index 00000000..fff4fecb --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/buttons-right/tiled.css @@ -0,0 +1,20 @@ +.tiled > headerbar, +.tiled > .titlebar, +.tiled > headerbar > headerbar, +.tiled > .titlebar > .titlebar, +.tiled > .titlebar > stack > headerbar, +.tiled headerbar:last-child, +.tiled .titlebar:last-child { + padding-right: 0; +} + +.tiled headerbar > box.right, +.tiled .titlebar > box.right { + margin: 0 -200px 0 0; + opacity: 0; +} + +.tiled .titlebar.default-decoration { + margin: -200px 0 0; + opacity: 0; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/stylesheet.css new file mode 100644 index 00000000..c78b855c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/stylesheet.css @@ -0,0 +1,48 @@ +#panel.small-spacing .panel-button { + -natural-hpadding: 8px; + -minimum-hpadding: 6px; +} + +#panel.small-spacing .panel-button .system-status-icon { + padding: 0; +} + +#panel.small-spacing .panel-button .panel-status-indicators-box { + spacing: 12px; +} + +#panel.small-spacing.extra-spacing .panel-button .panel-status-indicators-box { + spacing: 10px; +} + +#panel.small-spacing.extra-spacing #appMenu { + margin: 0 8px; +} + +#panel .panel-button.window-controls { + -natural-hpadding: 0px; + -minimum-hpadding: 0px; +} + +#panel .window-controls-box { + spacing: 2px; +} + +#panel .window-controls-box .window-button { + width: 22px; +} + +#panelLeft .window-controls-box:first-child .window-button:first-child { + padding-left: 3px; +} + +#panelRight .window-controls-box:last-child .window-button:last-child { + padding-right: 3px; +} + +#panel .window-controls-box .icon { + background-color: transparent; + border-radius: 0; + box-shadow: none; + border: 0; +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-active.svg new file mode 100644 index 00000000..6670047c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-active.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-hover.svg new file mode 100644 index 00000000..91ab1631 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close-hover.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close.svg new file mode 100644 index 00000000..5a6c3a75 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/close.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-active.svg new file mode 100644 index 00000000..32b0a4fb --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-active.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-hover.svg new file mode 100644 index 00000000..3c15c364 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize-hover.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize.svg new file mode 100644 index 00000000..668ee389 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/maximize.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-active.svg new file mode 100644 index 00000000..cee4dcb8 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-active.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-hover.svg new file mode 100644 index 00000000..6932125b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize-hover.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize.svg new file mode 100644 index 00000000..06bb6a3c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/minimize.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/stylesheet.css new file mode 100644 index 00000000..91029162 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/ambiance/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 19px; + height: 19px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-active.svg new file mode 100644 index 00000000..2c33f879 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-hover.svg new file mode 100644 index 00000000..1f3a7af6 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close.svg new file mode 100644 index 00000000..3d8ab614 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-active.svg new file mode 100644 index 00000000..2c2ac30e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-active.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-hover.svg new file mode 100644 index 00000000..0ca87567 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize.svg new file mode 100644 index 00000000..c629fa13 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-active.svg new file mode 100644 index 00000000..30308a83 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-hover.svg new file mode 100644 index 00000000..c0ca7f43 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize.svg new file mode 100644 index 00000000..d7bb715f --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-dark/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-active.svg new file mode 100644 index 00000000..65f0d56e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-hover.svg new file mode 100644 index 00000000..62fb143b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close.svg new file mode 100644 index 00000000..fb56677f --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-active.svg new file mode 100644 index 00000000..2c2ac30e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-active.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-hover.svg new file mode 100644 index 00000000..1e4b5742 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize.svg new file mode 100644 index 00000000..0a40905c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-active.svg new file mode 100644 index 00000000..30308a83 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-hover.svg new file mode 100644 index 00000000..c3f1cb6e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize.svg new file mode 100644 index 00000000..3a347b9d --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arc-light/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-active.svg new file mode 100644 index 00000000..326b7d62 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-hover.svg new file mode 100644 index 00000000..dca791d5 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close.svg new file mode 100644 index 00000000..8eaf4b1e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-active.svg new file mode 100644 index 00000000..e2dff2e8 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-hover.svg new file mode 100644 index 00000000..77272234 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize.svg new file mode 100644 index 00000000..10f45d52 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/maximize.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-active.svg new file mode 100644 index 00000000..0a73dcd1 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-hover.svg new file mode 100644 index 00000000..380e42d7 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize.svg new file mode 100644 index 00000000..24ddca09 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/minimize.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/stylesheet.css new file mode 100644 index 00000000..0f044fc0 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/arrongin/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 14px; + height: 14px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-active.svg new file mode 100644 index 00000000..1daf9ae1 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-hover.svg new file mode 100644 index 00000000..72d90ecc --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close.svg new file mode 100644 index 00000000..4fd95295 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-active.svg new file mode 100644 index 00000000..b485458c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-hover.svg new file mode 100644 index 00000000..63887f71 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize.svg new file mode 100644 index 00000000..245cd48d --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-active.svg new file mode 100644 index 00000000..9b0905fe --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-hover.svg new file mode 100644 index 00000000..8c1ea6cb --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize.svg new file mode 100644 index 00000000..b50ea6b3 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/breeze/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-active.svg new file mode 100644 index 00000000..66bf354b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-hover.svg new file mode 100644 index 00000000..dba468e4 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close.svg new file mode 100644 index 00000000..592ee7ac --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-active.svg new file mode 100644 index 00000000..dfac382c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-hover.svg new file mode 100644 index 00000000..b8e8704d --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize.svg new file mode 100644 index 00000000..95351854 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-active.svg new file mode 100644 index 00000000..8dde54f4 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-hover.svg new file mode 100644 index 00000000..5a30c9ab --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize.svg new file mode 100644 index 00000000..7c8f96e7 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/stylesheet.css new file mode 100644 index 00000000..5fd65cb9 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-dark/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 16px; + height: 16px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-active.svg new file mode 100644 index 00000000..66bf354b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-hover.svg new file mode 100644 index 00000000..dba468e4 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close.svg new file mode 100644 index 00000000..592ee7ac --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-active.svg new file mode 100644 index 00000000..3e6accab --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-hover.svg new file mode 100644 index 00000000..fd61fd7c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize.svg new file mode 100644 index 00000000..68c0a29d --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-active.svg new file mode 100644 index 00000000..681e3ebb --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-hover.svg new file mode 100644 index 00000000..6766f8fa --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize.svg new file mode 100644 index 00000000..176b6a7a --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/stylesheet.css new file mode 100644 index 00000000..5fd65cb9 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/default-light/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 16px; + height: 16px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-active.svg new file mode 100644 index 00000000..58d8cd0e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-hover.svg new file mode 100644 index 00000000..3b011079 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close.svg new file mode 100644 index 00000000..798cedd9 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-active.svg new file mode 100644 index 00000000..2fe78a41 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-hover.svg new file mode 100644 index 00000000..45eafca3 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize.svg new file mode 100644 index 00000000..66f1da4a --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-active.svg new file mode 100644 index 00000000..fda56049 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-hover.svg new file mode 100644 index 00000000..2e469471 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize.svg new file mode 100644 index 00000000..d61619ad --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-dark/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-active.svg new file mode 100644 index 00000000..fed664d4 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-hover.svg new file mode 100644 index 00000000..92b1e466 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close.svg new file mode 100644 index 00000000..16670425 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-active.svg new file mode 100644 index 00000000..606428f7 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-hover.svg new file mode 100644 index 00000000..4242e449 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize.svg new file mode 100644 index 00000000..fe75189c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-active.svg new file mode 100644 index 00000000..5a22979b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-hover.svg new file mode 100644 index 00000000..da834aed --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize.svg new file mode 100644 index 00000000..73f7204f --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/materia-light/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-active.svg new file mode 100755 index 00000000..633cc5b9 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-active.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-hover.svg new file mode 100755 index 00000000..633cc5b9 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close.svg new file mode 100755 index 00000000..be494f39 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-active.svg new file mode 100755 index 00000000..e577176e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-active.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-hover.svg new file mode 100755 index 00000000..e577176e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize.svg new file mode 100755 index 00000000..65f1a51a --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/maximize.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-active.svg new file mode 100755 index 00000000..003be10a --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-active.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-hover.svg new file mode 100755 index 00000000..003be10a --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize-hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize.svg new file mode 100755 index 00000000..689321d7 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/minimize.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/osx-arc/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-active.svg new file mode 100644 index 00000000..f19c9724 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-hover.svg new file mode 100644 index 00000000..cf63936b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close.svg new file mode 100644 index 00000000..a123cfda --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-active.svg new file mode 100644 index 00000000..018dfbe7 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-hover.svg new file mode 100644 index 00000000..305b1d64 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize.svg new file mode 100644 index 00000000..96cbd94b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-active.svg new file mode 100644 index 00000000..5189da72 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-hover.svg new file mode 100644 index 00000000..fb871054 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize.svg new file mode 100644 index 00000000..7553792d --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-dark/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-active.svg new file mode 100644 index 00000000..b20fd451 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-hover.svg new file mode 100644 index 00000000..6924f6c7 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close.svg new file mode 100644 index 00000000..fc848ab4 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-active.svg new file mode 100644 index 00000000..69d1231f --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-hover.svg new file mode 100644 index 00000000..4222a3b9 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize.svg new file mode 100644 index 00000000..6ad68e6a --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-active.svg new file mode 100644 index 00000000..795bbd1d --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-hover.svg new file mode 100644 index 00000000..4bb5ecbf --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize.svg new file mode 100644 index 00000000..21664706 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/pop-light/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-active.svg new file mode 100644 index 00000000..1d979834 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-active.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-hover.svg new file mode 100644 index 00000000..91fbc708 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close-hover.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close.svg new file mode 100644 index 00000000..14a9bba9 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/close.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-active.svg new file mode 100644 index 00000000..0d162cdd --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-active.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-hover.svg new file mode 100644 index 00000000..74d804ad --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize-hover.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize.svg new file mode 100644 index 00000000..d8ac07a4 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/maximize.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-active.svg new file mode 100644 index 00000000..3f827fd0 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-active.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-hover.svg new file mode 100644 index 00000000..fd24aa74 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize-hover.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize.svg new file mode 100644 index 00000000..6cb1ba4f --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/minimize.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/stylesheet.css new file mode 100644 index 00000000..91029162 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/radiance/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 19px; + height: 19px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-active.svg new file mode 100644 index 00000000..0dba5dda --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-hover.svg new file mode 100644 index 00000000..d16d52f3 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close.svg new file mode 100644 index 00000000..de8bdd12 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-active.svg new file mode 100644 index 00000000..de8bdd12 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-hover.svg new file mode 100644 index 00000000..bc7d02db --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize.svg new file mode 100644 index 00000000..b037440e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/maximize.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-active.svg new file mode 100644 index 00000000..b037440e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-hover.svg new file mode 100644 index 00000000..105f51a3 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize-hover.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize.svg new file mode 100644 index 00000000..d32aa7da --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/minimize.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/stylesheet.css new file mode 100644 index 00000000..0f044fc0 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/telinkrin/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 14px; + height: 14px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-active.svg new file mode 100644 index 00000000..53435178 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-hover.svg new file mode 100644 index 00000000..cd439133 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close.svg new file mode 100644 index 00000000..81fe1496 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-active.svg new file mode 100644 index 00000000..8eb88633 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-hover.svg new file mode 100644 index 00000000..475bf31e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize.svg new file mode 100644 index 00000000..ee76d257 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-active.svg new file mode 100644 index 00000000..fb543b3e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-hover.svg new file mode 100644 index 00000000..f4f26c14 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize.svg new file mode 100644 index 00000000..1f76de1c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/stylesheet.css new file mode 100644 index 00000000..44ac511b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-dark/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 18px; + height: 18px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-active.svg new file mode 100644 index 00000000..53435178 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-hover.svg new file mode 100644 index 00000000..cd439133 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close.svg new file mode 100644 index 00000000..5b29d328 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-active.svg new file mode 100644 index 00000000..8eb88633 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-hover.svg new file mode 100644 index 00000000..475bf31e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize.svg new file mode 100644 index 00000000..db27b667 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-active.svg new file mode 100644 index 00000000..fb543b3e --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-hover.svg new file mode 100644 index 00000000..f4f26c14 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize-hover.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize.svg new file mode 100644 index 00000000..3b68e665 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/stylesheet.css new file mode 100644 index 00000000..44ac511b --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/united-light/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 18px; + height: 18px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-active.svg new file mode 100644 index 00000000..4aa69050 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-active.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-hover.svg new file mode 100644 index 00000000..3463e8a6 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close-hover.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close.svg new file mode 100644 index 00000000..a759cbc0 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/close.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-active.svg new file mode 100644 index 00000000..cf1c85df --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-active.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-hover.svg new file mode 100644 index 00000000..a5aacef3 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize-hover.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize.svg new file mode 100644 index 00000000..a759cbc0 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/maximize.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-active.svg new file mode 100644 index 00000000..aecacc46 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-active.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-hover.svg new file mode 100644 index 00000000..dd298c5a --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize-hover.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize.svg new file mode 100644 index 00000000..a759cbc0 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/minimize.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vertex/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-active.svg new file mode 100644 index 00000000..dbd8e769 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-hover.svg new file mode 100644 index 00000000..236281fd --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close.svg new file mode 100644 index 00000000..d3489c9d --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-active.svg new file mode 100644 index 00000000..c204f983 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-hover.svg new file mode 100644 index 00000000..e4b86e52 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize.svg new file mode 100644 index 00000000..7967be11 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-active.svg new file mode 100644 index 00000000..2b6d0aa5 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-hover.svg new file mode 100644 index 00000000..d9537558 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize.svg new file mode 100644 index 00000000..a9d10d1c --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/vimix/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-active.svg new file mode 100644 index 00000000..8262e591 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-hover.svg new file mode 100644 index 00000000..37c7dff5 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close.svg new file mode 100644 index 00000000..b6d42fc0 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-active.svg new file mode 100644 index 00000000..c0fc0483 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-hover.svg new file mode 100644 index 00000000..26f22e09 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize.svg new file mode 100644 index 00000000..4f120c44 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/maximize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-active.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-active.svg new file mode 100644 index 00000000..ab881907 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-hover.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-hover.svg new file mode 100644 index 00000000..ef5e8450 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize-hover.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize.svg b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize.svg new file mode 100644 index 00000000..bb20c27d --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/minimize.svg @@ -0,0 +1,3 @@ + + + diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/stylesheet.css b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/stylesheet.css new file mode 100644 index 00000000..d1e55ace --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/themes/yaru/stylesheet.css @@ -0,0 +1,40 @@ +.window-button .icon { + width: 24px; + height: 24px; +} + +.close .icon { + background-image: url("close.svg"); +} + +.close:hover .icon { + background-image: url("close-hover.svg"); +} + +.close:active .icon { + background-image: url("close-active.svg"); +} + +.minimize .icon { + background-image: url("minimize.svg"); +} + +.minimize:hover .icon { + background-image: url("minimize-hover.svg"); +} + +.minimize:active .icon { + background-image: url("minimize-active.svg"); +} + +.maximize .icon { + background-image: url("maximize.svg"); +} + +.maximize:hover .icon { + background-image: url("maximize-hover.svg"); +} + +.maximize:active .icon { + background-image: url("maximize-active.svg"); +} diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/window.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/window.js new file mode 100644 index 00000000..b7603a03 --- /dev/null +++ b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/unite@hardpixel.eu/window.js @@ -0,0 +1,444 @@ +const Bytes = imports.byteArray +const GLib = imports.gi.GLib +const GObject = imports.gi.GObject +const Meta = imports.gi.Meta +const Main = imports.ui.main +const Util = imports.misc.util +const Unite = imports.misc.extensionUtils.getCurrentExtension() +const AppMenu = Main.panel.statusArea.appMenu +const Handlers = Unite.imports.handlers + +const VALID_TYPES = [ + Meta.WindowType.NORMAL, + Meta.WindowType.DIALOG, + Meta.WindowType.MODAL_DIALOG, + Meta.WindowType.UTILITY +] + +const UNITE_HINTS = '_UNITE_ORIGINAL_STATE' +const MOTIF_HINTS = '_MOTIF_WM_HINTS' + +const _SHOW_FLAGS = ['0x2', '0x0', '0x1', '0x0', '0x0'] +const _HIDE_FLAGS = ['0x2', '0x0', '0x2', '0x0', '0x0'] + +function isValid(win) { + return win && VALID_TYPES.includes(win.window_type) +} + +function getXid(win) { + const desc = win.get_description() + const match = desc && desc.match(/0x[0-9a-f]+/) + + return match && match[0] +} + +function getHint(xid, name, fallback) { + const result = GLib.spawn_command_line_sync(`xprop -id ${xid} ${name}`) + const string = Bytes.toString(result[1]) + + if (!string.match(/=/)) { + return fallback + } + + return string.split('=')[1].trim().split(',').map(part => { + part = part.trim() + return part.match(/\dx/) ? part : `0x${part}` + }) +} + +function setHint(xid, hint, value) { + value = value.join(', ') + Util.spawn(['xprop', '-id', xid, '-f', hint, '32c', '-set', hint, value]) +} + +function getHints(xid) { + let value = getHint(xid, UNITE_HINTS) + + if (!value) { + value = getHint(xid, MOTIF_HINTS, _SHOW_FLAGS) + setHint(xid, UNITE_HINTS, value) + } + + return value +} + +function isDecorated(hints) { + return hints[2] != '0x2' && hints[2] != '0x0' +} + +var ClientDecorations = class ClientDecorations { + constructor(xid) { + this.xid = xid + } + + show() { + return false + } + + hide() { + return false + } + + reset() { + return false + } +} + +var ServerDecorations = class ServerDecorations { + constructor(xid) { + this.xid = xid + this.initial = getHints(xid) + this.current = this.initial + } + + get decorated() { + return isDecorated(this.current) + } + + get handle() { + return isDecorated(this.initial) + } + + show() { + if (this.handle && !this.decorated) { + this.current = _SHOW_FLAGS + setHint(this.xid, MOTIF_HINTS, _SHOW_FLAGS) + } + } + + hide() { + if (this.handle && this.decorated) { + this.current = _HIDE_FLAGS + setHint(this.xid, MOTIF_HINTS, _HIDE_FLAGS) + } + } + + reset() { + if (this.handle) { + setHint(this.xid, MOTIF_HINTS, this.initial) + } + } +} + +var MetaWindow = GObject.registerClass( + class UniteMetaWindow extends GObject.Object { + _init(win) { + win._uniteShellManaged = true + + this.win = win + this.xid = getXid(win) + + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + + if (this.xid && !this.clientDecorated) { + this.decorations = new ServerDecorations(this.xid) + } else { + this.decorations = new ClientDecorations(this.xid) + } + + this.signals.connect( + win, 'size-changed', this._onStateChanged.bind(this) + ) + + this.signals.connect( + win, 'notify::title', this._onTitleChanged.bind(this) + ) + + this.settings.connect( + 'restrict-to-primary-screen', this.syncComponents.bind(this) + ) + + this.settings.connect( + 'hide-window-titlebars', this.syncDecorations.bind(this) + ) + + this.settings.connect( + 'show-window-buttons', this.syncControls.bind(this) + ) + + this.settings.connect( + 'show-window-title', this.syncAppmenu.bind(this) + ) + + this.syncComponents() + } + + get hasFocus() { + return this.win.has_focus() + } + + get title() { + if (this.showTitle) { + return this.win.get_title() + } else { + return AppMenu._targetApp.get_name() + } + } + + get clientDecorated() { + return this.win.is_client_decorated() + } + + get primaryScreen() { + return this.win.is_on_primary_monitor() + } + + get minimized() { + return this.win.minimized + } + + get maximized() { + return this.win.maximized_horizontally && this.win.maximized_vertically + } + + get tiled() { + if (this.maximized) { + return false + } else { + return this.win.maximized_horizontally || this.win.maximized_vertically + } + } + + get bothMaximized() { + return this.maximized || this.tiled + } + + get restrictToPrimary() { + return this.settings.get('restrict-to-primary-screen') + } + + get handleScreen() { + return this.primaryScreen || !this.restrictToPrimary + } + + get showTitle() { + return this._parseEnumSetting('show-window-title') + } + + get showButtons() { + return this._parseEnumSetting('show-window-buttons') + } + + get hideTitlebars() { + return this._parseEnumSetting('hide-window-titlebars') + } + + minimize() { + if (this.minimized) { + this.win.unminimize() + } else { + this.win.minimize() + } + } + + maximize() { + if (this.maximized) { + this.win.unmaximize(Meta.MaximizeFlags.BOTH) + } else { + this.win.maximize(Meta.MaximizeFlags.BOTH) + } + } + + close() { + const time = global.get_current_time() + time && this.win.delete(time) + } + + syncDecorations() { + if (this.hideTitlebars) { + this.decorations.hide() + } else { + this.decorations.show() + } + } + + syncControls() { + if (this.hasFocus) { + const controls = Main.panel.statusArea.uniteWindowControls + controls && controls.setVisible(this.showButtons) + } + } + + syncAppmenu() { + if (this.hasFocus) { + const current = AppMenu._label.get_text() + current != this.title && AppMenu._label.set_text(this.title) + } + } + + syncComponents() { + this.syncDecorations() + this.syncControls() + this.syncAppmenu() + } + + _parseEnumSetting(name) { + switch (this.settings.get(name)) { + case 'always': return true + case 'never': return false + case 'tiled': return this.handleScreen && this.tiled + case 'maximized': return this.handleScreen && this.maximized + case 'both': return this.handleScreen && this.bothMaximized + } + } + + _onStateChanged() { + this.syncComponents() + } + + _onTitleChanged() { + this.syncAppmenu() + } + + destroy() { + this.decorations.reset() + + this.signals.disconnectAll() + this.settings.disconnectAll() + + this.win._uniteShellManaged = false + } + } +) + +var WindowManager = GObject.registerClass( + class UniteWindowManager extends GObject.Object { + _init() { + this.windows = new Map() + this.signals = new Handlers.Signals() + this.settings = new Handlers.Settings() + this.styles = new Handlers.Styles() + + this.signals.connect( + global.window_manager, 'map', this._onMapWindow.bind(this) + ) + + this.signals.connect( + global.window_manager, 'destroy', this._onDestroyWindow.bind(this) + ) + + this.signals.connect( + global.display, 'notify::focus-window', this._onFocusWindow.bind(this) + ) + + this.signals.connect( + global.display, 'window-demands-attention', this._onAttention.bind(this) + ) + + this.signals.connect( + AppMenu._label, 'notify::text', this._onAppmenuChanged.bind(this) + ) + + this.settings.connect( + 'hide-window-titlebars', this._onStylesChange.bind(this) + ) + + this.settings.connect( + 'window-buttons-position', this._onStylesChange.bind(this) + ) + } + + get focusWindow() { + const win = global.display.get_focus_window() + return this.getWindow(win) + } + + get hideTitlebars() { + return this.settings.get('hide-window-titlebars') + } + + hasWindow(win) { + return win && this.windows.has(`${win}`) + } + + getWindow(win) { + return win && this.windows.get(`${win}`) + } + + setWindow(win) { + if (!this.hasWindow(win)) { + const meta = new MetaWindow(win) + this.windows.set(`${win}`, meta) + } + } + + deleteWindow(win) { + if (this.hasWindow(win)) { + const meta = this.getWindow(win) + meta.destroy() + + this.windows.delete(`${win}`) + } + } + + clearWindows() { + for (const key of this.windows.keys()) { + this.deleteWindow(key) + } + } + + _onMapWindow(shellwm, { meta_window }) { + if (isValid(meta_window)) { + this.setWindow(meta_window) + } + } + + _onDestroyWindow(shellwm, { meta_window }) { + if (isValid(meta_window)) { + this.deleteWindow(meta_window) + } + } + + _onFocusWindow(display) { + if (this.focusWindow) { + this.focusWindow.syncComponents() + } + } + + _onAppmenuChanged() { + const focused = this.focusWindow + const current = AppMenu._label.get_text() + + if (focused && current != focused.title) { + AppMenu._label.set_text(focused.title) + } + } + + _onAttention(actor, win) { + const auto = this.settings.get('autofocus-windows') + const time = global.get_current_time() + + auto && Main.activateWindow(win, time) + } + + _onStylesChange() { + if (this.hideTitlebars != 'never') { + const variant = this.settings.get('window-buttons-position') + const folder = `${Unite.path}/styles/buttons-${variant}` + const content = `@import url('${folder}/${this.hideTitlebars}.css');` + + this.styles.addGtkStyle('windowDecorations', content) + } else { + this.styles.deleteStyle('windowDecorations') + } + } + + activate() { + GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { + const actors = global.get_window_actors() + actors.forEach(actor => this._onMapWindow(null, actor)) + }) + + this._onStylesChange() + } + + destroy() { + this.clearWindows() + + this.signals.disconnectAll() + this.settings.disconnectAll() + this.styles.removeAll() + } + } +) diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/extension.js b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/extension.js deleted file mode 100644 index 83073f48..00000000 --- a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/extension.js +++ /dev/null @@ -1,101 +0,0 @@ -const Main = imports.ui.main; -const Clutter = imports.gi.Clutter; -const Volume = imports.ui.status.volume; -const Gio = imports.gi.Gio; - -const VOL_ICONS = [ - 'audio-volume-muted-symbolic', - 'audio-volume-low-symbolic', - 'audio-volume-medium-symbolic', - 'audio-volume-high-symbolic' -]; - -let panel, - panelBinding, - volumeControl, - volumeStep; - -function init() { - volumeControl = Volume.getMixerControl(); - volumeStep = 500; - - panel = Main.panel; - panelBinding = null; -} - -function enable() { - panel.reactive = true; - if (panelBinding) { - disable(); - } - panelBinding = panel.actor.connect('scroll-event',_onScroll); -} - -function disable() { - if (panelBinding) { - panel.actor.disconnect(panelBinding); - panelBinding = null; - } -} - -/** - * Returns the max volume. - */ -function _getVolumeMax() { - return volumeControl.get_vol_max_norm(); - //return volumeControl.get_vol_max_amplified(); // boost volume (150%) -} - -/** - * Handles panel mouse scroll event. - */ -function _onScroll(actor, event) { - let volume = volumeControl.get_default_sink().volume; - - switch(event.get_scroll_direction()) { - case Clutter.ScrollDirection.UP: - volume += volumeStep; - break; - case Clutter.ScrollDirection.DOWN: - volume -= volumeStep; - break; - default: - return Clutter.EVENT_PROPAGATE; - } - - if (volume > _getVolumeMax()) { - volume = _getVolumeMax(); - } - else if (volume < volumeStep) { - volume = 0; - } - - volumeControl.get_default_sink().volume = volume; - volumeControl.get_default_sink().push_volume(); - - _showVolumeOsd(volume, volume/_getVolumeMax() * 100); - - return Clutter.EVENT_STOP; -} - -/** - * Shows the current volume on OSD. - * - * @see gsd-media-keys-manager.c - */ -function _showVolumeOsd (level, percent) { - let monitor = -1; - let n; - - if (level === 0) { - n = 0; - } else { - n = parseInt(3 * percent / 100 + 1); - n = Math.max(1, n); - n = Math.min(3, n); - } - - let icon = Gio.Icon.new_for_string(VOL_ICONS[n]); - - Main.osdWindowManager.show(monitor, icon, null, percent); -} \ No newline at end of file diff --git a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/metadata.json b/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/metadata.json deleted file mode 100644 index 6799d58f..00000000 --- a/tromjaro/gnome/live-overlay/etc/skel/.local/share/gnome-shell/extensions/volume_scroll@qord.si/metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "_generated": "Generated by SweetTooth, do not edit", - "description": "Scroll anywhere in the top panel to change the audio volume.", - "name": "Volume Scroll", - "shell-version": [ - "3.22.3" - ], - "url": "https://github.com/krizajb/gnome-shell-volume-scroll", - "uuid": "volume_scroll@qord.si", - "version": 1 -} \ No newline at end of file