Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • manjaro-arm/applications/arm-profiles
  • luka177/arm-profiles
  • boredland/arm-profiles
3 results
Show changes
Showing
with 339 additions and 10426 deletions
@define-color accent_color #16a085;
@define-color accent_bg_color #16a085;
@define-color accent_fg_color #eeeeee;
@define-color destructive_color #Cd3f45;
@define-color destructive_bg_color #Cd3f45;
@define-color destructive_fg_color #eeeeee;
@define-color success_color #9fca56;
@define-color success_bg_color #141a1b;
@define-color success_fg_color #eeeeee;
@define-color warning_color #e6cd69;
@define-color warning_bg_color #141a1b;
@define-color warning_fg_color #eeeeee;
@define-color error_color #Cd3f45;
@define-color error_bg_color #141a1b;
@define-color error_fg_color #eeeeee;
@define-color window_bg_color #141a1b;
@define-color window_fg_color #eeeeee;
@define-color view_bg_color #222b2e;
@define-color view_fg_color #eeeeee;
@define-color headerbar_bg_color #141a1b;
@define-color headerbar_fg_color #eeeeee;
@define-color headerbar_border_color #ffffff;
@define-color headerbar_backdrop_color @window_bg_color;
@define-color headerbar_shade_color rgba(0, 0, 0, 0.36);
@define-color card_bg_color #2f3a3e;
@define-color card_fg_color #eeeeee;
@define-color card_shade_color rgba(0, 0, 0, 0.36);
@define-color dialog_bg_color #222b2e;
@define-color dialog_fg_color #eeeeee;
@define-color popover_bg_color #222b2e;
@define-color popover_fg_color #eeeeee;
@define-color shade_color #141a1b;
@define-color scrollbar_outline_color rgba(0, 0, 0, 0.5);
@define-color blue_1 #99c1f1;
@define-color blue_2 #62a0ea;
@define-color blue_3 #3584e4;
@define-color blue_4 #1c71d8;
@define-color blue_5 #1a5fb4;
@define-color green_1 #8ff0a4;
@define-color green_2 #57e389;
@define-color green_3 #33d17a;
@define-color green_4 #2ec27e;
@define-color green_5 #26a269;
@define-color yellow_1 #f9f06b;
@define-color yellow_2 #f8e45c;
@define-color yellow_3 #f6d32d;
@define-color yellow_4 #f5c211;
@define-color yellow_5 #e5a50a;
@define-color orange_1 #ffbe6f;
@define-color orange_2 #ffa348;
@define-color orange_3 #ff7800;
@define-color orange_4 #e66100;
@define-color orange_5 #c64600;
@define-color red_1 #f66151;
@define-color red_2 #ed333b;
@define-color red_3 #e01b24;
@define-color red_4 #c01c28;
@define-color red_5 #a51d2d;
@define-color purple_1 #dc8add;
@define-color purple_2 #c061cb;
@define-color purple_3 #9141ac;
@define-color purple_4 #813d9c;
@define-color purple_5 #613583;
@define-color brown_1 #cdab8f;
@define-color brown_2 #b5835a;
@define-color brown_3 #986a44;
@define-color brown_4 #865e3c;
@define-color brown_5 #63452c;
@define-color light_1 #ffffff;
@define-color light_2 #f6f5f4;
@define-color light_3 #deddda;
@define-color light_4 #c0bfbc;
@define-color light_5 #9a9996;
@define-color dark_1 #77767b;
@define-color dark_2 #5e5c64;
@define-color dark_3 #3d3846;
@define-color dark_4 #241f31;
@define-color dark_5 #000000;
[Settings]
gtk-application-prefer-dark-theme=0
gtk-application-prefer-dark-theme=1
@define-color accent_color #16a085;
@define-color accent_bg_color #16a085;
@define-color accent_fg_color #eeeeee;
@define-color destructive_color #Cd3f45;
@define-color destructive_bg_color #Cd3f45;
@define-color destructive_fg_color #eeeeee;
@define-color success_color #9fca56;
@define-color success_bg_color #141a1b;
@define-color success_fg_color #eeeeee;
@define-color warning_color #e6cd69;
@define-color warning_bg_color #141a1b;
@define-color warning_fg_color #eeeeee;
@define-color error_color #Cd3f45;
@define-color error_bg_color #141a1b;
@define-color error_fg_color #eeeeee;
@define-color window_bg_color #141a1b;
@define-color window_fg_color #eeeeee;
@define-color view_bg_color #222b2e;
@define-color view_fg_color #eeeeee;
@define-color headerbar_bg_color #141a1b;
@define-color headerbar_fg_color #eeeeee;
@define-color headerbar_border_color #ffffff;
@define-color headerbar_backdrop_color @window_bg_color;
@define-color headerbar_shade_color rgba(0, 0, 0, 0.36);
@define-color card_bg_color #2f3a3e;
@define-color card_fg_color #eeeeee;
@define-color card_shade_color rgba(0, 0, 0, 0.36);
@define-color dialog_bg_color #222b2e;
@define-color dialog_fg_color #eeeeee;
@define-color popover_bg_color #222b2e;
@define-color popover_fg_color #eeeeee;
@define-color shade_color #141a1b;
@define-color scrollbar_outline_color rgba(0, 0, 0, 0.5);
@define-color blue_1 #99c1f1;
@define-color blue_2 #62a0ea;
@define-color blue_3 #3584e4;
@define-color blue_4 #1c71d8;
@define-color blue_5 #1a5fb4;
@define-color green_1 #8ff0a4;
@define-color green_2 #57e389;
@define-color green_3 #33d17a;
@define-color green_4 #2ec27e;
@define-color green_5 #26a269;
@define-color yellow_1 #f9f06b;
@define-color yellow_2 #f8e45c;
@define-color yellow_3 #f6d32d;
@define-color yellow_4 #f5c211;
@define-color yellow_5 #e5a50a;
@define-color orange_1 #ffbe6f;
@define-color orange_2 #ffa348;
@define-color orange_3 #ff7800;
@define-color orange_4 #e66100;
@define-color orange_5 #c64600;
@define-color red_1 #f66151;
@define-color red_2 #ed333b;
@define-color red_3 #e01b24;
@define-color red_4 #c01c28;
@define-color red_5 #a51d2d;
@define-color purple_1 #dc8add;
@define-color purple_2 #c061cb;
@define-color purple_3 #9141ac;
@define-color purple_4 #813d9c;
@define-color purple_5 #613583;
@define-color brown_1 #cdab8f;
@define-color brown_2 #b5835a;
@define-color brown_3 #986a44;
@define-color brown_4 #865e3c;
@define-color brown_5 #63452c;
@define-color light_1 #ffffff;
@define-color light_2 #f6f5f4;
@define-color light_3 #deddda;
@define-color light_4 #c0bfbc;
@define-color light_5 #9a9996;
@define-color dark_1 #77767b;
@define-color dark_2 #5e5c64;
@define-color dark_3 #3d3846;
@define-color dark_4 #241f31;
@define-color dark_5 #000000;
[Settings]
gtk-application-prefer-dark-theme=0
gtk-application-prefer-dark-theme=1
theme = "bogster"
[editor]
line-number = "relative"
[mainwindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x1\x7f\0\0\0\x95\0\0\x3\xdc\0\0\x2l\0\0\x1\x82\0\0\0\xb2\0\0\x3\xd9\0\0\x2i\0\0\0\0\0\0\0\0\x5V\0\0\x1\x82\0\0\0\xb2\0\0\x3\xd9\0\0\x2i)
maximized=false
pos=@Point(383 149)
savestate=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x2X\0\0\x1\xb8\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\0)
size=@Size(600 440)
{
"Version" : "1.0.0",
"ServerURL" : "https://manjaro.news/news",
"MaxArticles" : 15,
"AvailableCategories" : [
"Testing Updates",
"Stable Updates",
"Stable Staging Updates",
"Unstable Updates",
"Twitter",
"News",
"Announcements",
"Releases",
"ARM News",
"ARM Releases",
"ARM Stable Updates",
"ARM Testing Updates",
"ARM Unstable Updates"
],
"Categories" : [
"Stable Updates",
"News",
"Announcements",
"Releases"
],
"AddCategoriesBranch" : [
"News",
"Announcements",
"ARM Releases"
],
"RefreshInterval" : 600,
"Autostart" : true,
"ErrorNotifications" : true,
"DelayAfterStart" : 10,
"SetCategoriesFromBranch" : true,
"IconTheme" : "Bright"
}
{
"Version": "1.1.1",
"ServerURL": "http://manjaro.moson.eu:10111/news",
"MaxArticles": 15,
"AvailableCategories": [
"Testing Updates",
"Stable Updates",
"Unstable Updates",
"Announcements",
"Twitter",
"News",
"Releases",
"ARM Announcements",
"ARM Releases",
"ARM Stable Updates",
"ARM Testing Updates"
],
"Categories": [
"ARM Announcements",
"ARM Releases"
],
"AddCategoriesBranch": [
"ARM Announcements",
"ARM Releases"
],
"RefreshInterval": 600,
"HideNoNews": false,
"Autostart": true,
"ErrorNotifications": true,
"DelayAfterStart": 60,
"SetCategoriesFromBranch": true
}
\ No newline at end of file
ao=pulse
# cache=153600
autofit-smaller=90%
autofit-larger=90%
deinterlace=yes
volume-max=400 # 0&9 keys controls the volume
{
"name": "Matcha Dark Sea",
"variables": {
"accent_color": "#16a085",
"accent_bg_color": "#16a085",
"accent_fg_color": "#eeeeee",
"destructive_color": "#Cd3f45",
"destructive_bg_color": "#Cd3f45",
"destructive_fg_color": "#eeeeee",
"success_color": "#9fca56",
"success_bg_color": "#141a1b",
"success_fg_color": "#eeeeee",
"warning_color": "#e6cd69",
"warning_bg_color": "#141a1b",
"warning_fg_color": "#eeeeee",
"error_color": "#Cd3f45",
"error_bg_color": "#141a1b",
"error_fg_color": "#eeeeee",
"window_bg_color": "#141a1b",
"window_fg_color": "#eeeeee",
"view_bg_color": "#222b2e",
"view_fg_color": "#eeeeee",
"headerbar_bg_color": "#141a1b",
"headerbar_fg_color": "#eeeeee",
"headerbar_border_color": "#ffffff",
"headerbar_backdrop_color": "@window_bg_color",
"headerbar_shade_color": "rgba(0, 0, 0, 0.36)",
"card_bg_color": "#2f3a3e",
"card_fg_color": "#eeeeee",
"card_shade_color": "rgba(0, 0, 0, 0.36)",
"dialog_bg_color": "#222b2e",
"dialog_fg_color": "#eeeeee",
"popover_bg_color": "#222b2e",
"popover_fg_color": "#eeeeee",
"shade_color": "#141a1b",
"scrollbar_outline_color": "rgba(0, 0, 0, 0.5)"
},
"palette": {
"blue_": {
"1": "#99c1f1",
"2": "#62a0ea",
"3": "#3584e4",
"4": "#1c71d8",
"5": "#1a5fb4"
},
"green_": {
"1": "#8ff0a4",
"2": "#57e389",
"3": "#33d17a",
"4": "#2ec27e",
"5": "#26a269"
},
"yellow_": {
"1": "#f9f06b",
"2": "#f8e45c",
"3": "#f6d32d",
"4": "#f5c211",
"5": "#e5a50a"
},
"orange_": {
"1": "#ffbe6f",
"2": "#ffa348",
"3": "#ff7800",
"4": "#e66100",
"5": "#c64600"
},
"red_": {
"1": "#f66151",
"2": "#ed333b",
"3": "#e01b24",
"4": "#c01c28",
"5": "#a51d2d"
},
"purple_": {
"1": "#dc8add",
"2": "#c061cb",
"3": "#9141ac",
"4": "#813d9c",
"5": "#613583"
},
"brown_": {
"1": "#cdab8f",
"2": "#b5835a",
"3": "#986a44",
"4": "#865e3c",
"5": "#63452c"
},
"light_": {
"1": "#ffffff",
"2": "#f6f5f4",
"3": "#deddda",
"4": "#c0bfbc",
"5": "#9a9996"
},
"dark_": {
"1": "#77767b",
"2": "#5e5c64",
"3": "#3d3846",
"4": "#241f31",
"5": "#000000"
}
},
"custom_css": {
"gtk4": "",
"gtk3": ""
}
}
\ No newline at end of file
[Appearance]
color_scheme_path=
custom_palette=false
icon_theme=Breeze
icon_theme=Papirus-Dark-Maia
style=kvantum
[Fonts]
......
[[left]]
name = "status"
color.background = "black"
color.foreground = "white"
[[left]]
name = "user"
color.background = "yellow"
color.foreground = "black"
[[left]]
name = "dir"
color.background = "blue"
color.foreground = "black"
[[left]]
name = "git"
color.background = "green"
color.foreground = "black"
[[left]]
name = "cmdtime"
color.background = "magenta"
color.foreground = "black"
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 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.
<signature of Ty Coon>, 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.
<p align="left">
<img src="/media/design/svg/D2P_logo.svg" width="620"/>
</p>
<p align="left">
<img src="/media/design/svg/GitHub_logo.svg" width="120" style="margin-left: 4px"/>
<a href="https://extensions.gnome.org/extension/1160/dash-to-panel/" >
<img src="/media/design/svg/Gnome_logo.svg" width="120px"/>
</a>
</p>
![](media/design/png/dtp-main-p2.png)
### Introduction
Dash to Panel is an icon taskbar for Gnome Shell. This extension moves the dash into the gnome main panel so that the application launchers and system tray are combined into a single panel, similar to that found in KDE Plasma and Windows 7+. A separate dock is no longer needed for easy access to running and favorited applications.
Beyond that, just about every aspect of the panel is fully customizable. From positioning and scaling panel elements to running indicators to multi-monitor display, to window previews and even intellihide, Dash to Panel has everything you need to make your workspace feel like home.
### Features
|Customizable appearance|
|:-----:|
|![screenshot](media/design/gif/customizable.gif)|
|Hide & show panel elements and set their positions, sizes & colors|
##
<table>
<thead>
<tr>
<th colspan=2>Customizable running indicators</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">Metro</td>
<td align="center">Ciliora/Dashes</td>
</tr>
<tr>
<td align="center"><img src="media/design/png/metro.png"/></td>
<td align="center"><img src="media/design/png/ciliora-dashes.png"/></td>
</tr>
<tr>
<td align="center">Ciliora</td>
<td align="center">Squares/Segmented</td>
</tr>
<tr>
<td align="center"><img src="media/design/png/ciliora.png"/></td>
<td align="center"><img src="media/design/png/squares-segments.png"/></td>
</tr>
<tr>
<td align="center">Dashes</td>
<td align="center">Dots/Solid</td>
</tr>
<tr>
<td align="center"><img src="media/design/png/dashes.png"/></td>
<td align="center"><img src="media/design/png/dots-solid.png"/></td>
</tr>
<tr>
<td colspan=2 align="center">Set position, style, weight & color of running indicators to easily and quickly identify focused and unfocused applications</td>
</tr>
</tbody>
</table>
##
|Live Previews on Hover|
|:-----:|
|![screenshot](media/design/gif/previews.gif)|
|Hover over the launcher icon for an open application to get a live window preview|
##
|Launch by Number|
|:-----:|
|![](media/design/png/indicators-num.png.png)|
|Optionally launch your favorite applications via keyboard|
##
|Panel Intellihide|
|:-----:|
|![Intellihide](media/design/gif/Intellihide.gif)|
|Hide and reveal the panel according to your set preferences|
##
|Additional Features|Feature Implemented|
|:-----|:-----:|
|Add "Show Desktop" button to panel|![](media/design/png/done.png)|
|Isolate running apps by workspaces and/or monitors|![](media/design/png/done.png)|
|Custom click behaviors (launch new window, cycle open windows, minimize, etc)|![](media/design/png/done.png)|
|Integrate native Gnome appMenu into right-click secondary menu|![](media/design/png/done.png)|
|Multi-monitor support|![](media/design/png/done.png)|
|Dynamic transparency|![](media/design/png/done.png)|
|Ungroup application windows|![](media/design/png/done.png)|
|Export and import settings|![](media/design/png/done.png)|
##
### Installation
**To install the most recent official release:
[Visit Dash-to-Panel at GNOME Extensions](https://extensions.gnome.org/extension/1160/dash-to-panel/)**
To install a development version from source, please see the [Installation wiki page](https://github.com/jderose9/dash-to-panel/wiki/Installation).
##
### FAQ
How do I embed my bottom left notification drawer into the panel like a system tray? [Top Icons Plus](https://extensions.gnome.org/extension/1031/topicons) or [(K)StatusNotifierItem/AppIndicator Support](https://extensions.gnome.org/extension/615/appindicator-support)
How do I add a traditional start menu? [Arc Menu](https://extensions.gnome.org/extension/1228/arc-menu/)
How do I disable the hot corner? [No Topleft Hot Corner](https://extensions.gnome.org/extension/118/no-topleft-hot-corner)
How do I move the notifications to somewhere other than the top center? [Panel OSD](https://extensions.gnome.org/extension/708/panel-osd)
How do I change workspaces by scrolling the mouse wheel in the empty space? [Top Panel Workspace Scroll](https://extensions.gnome.org/extension/701/top-panel-workspace-scroll/)
How do I display Minimize & Maximize buttons? In the Tweak Tool application, turn on `Windows > Titlebar Buttons > Minimize & Maximize`.
How do I reset the extension to its default settings? `dconf reset -f /org/gnome/shell/extensions/dash-to-panel/`.
Why can't I put the panel vertically on the left or right of the display? Gnome-shell and it's numerous extensions add widgets to the panel. These widgets have been designed using padding and absolute positioning assuming a horizontal layout. At this point in time, I don't think it is possible to allow for a vertical layout and still maintain any sort of reasonable compatibility with many of the other features of Gnome.
##
### Themes
While this extension works well with most popular Gnome Shell themes, the following themes are known to have explicitly added custom styles for this extension:
- [Ciliora Tertia](https://github.com/zagortenay333/ciliora-tertia-shell) / [Ciliora Secunda](https://github.com/zagortenay333/ciliora-secunda-shell)
- [Plano](https://github.com/lassekongo83/plano-theme)
##
### Compatibility
This extension has been tested with Gnome 3.18+.
This extension manipulates the Gnome Main Panel, aka Top Bar. So, most other extensions which operate on the top bar should be compatible.
##
### Donation
Dash-to-Panel is provided free of charge. If it has improved your workflow, or you had a great support experience, feel free to say thanks by making a donation to the developers. (If you would like your donation to go to a specific developer, you may mention it in the note field during payment)
[![Donate via Paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Y5PBB2CRJ6F2W&source=url)
##
### Volunteers needed!
This extension could be even better with your help! Any items in the issue tracker labelled `help wanted` or `good first issue` are up for grabs. For more info, see the [Contributing wiki page](https://github.com/jderose9/dash-to-panel/wiki/Contributing).
##
### Credits
This extension is developed and maintained by [@jderose9](https://github.com/jderose9) and [@charlesg99](https://github.com/charlesg99).
Significant portions of code in this extension were derived from [Dash-to-Dock](https://micheleg.github.io/dash-to-dock/index.html).
Additional credits: This extension leverages the work for [ZorinOS Taskbar](https://github.com/ZorinOS/zorin-taskbar) (used in [ZorinOS](https://zorinos.com/)) to show window previews and allow the dash from [Dash-to-Dock](https://micheleg.github.io/dash-to-dock/index.html) to be embedded in the Gnome main panel.
Code to set anchor position taken from [Thoma5/gnome-shell-extension-bottompanel](https://github.com/Thoma5/gnome-shell-extension-bottompanel).
Pattern for moving panel contents based on [Frippery Move Clock](http://frippery.org/extensions/) by R M Yorston.
Ideas for recursing child actors and assigning inline styles are based on code from the extension [StatusAreaHorizontalSpacing](https://bitbucket.org/mathematicalcoffee/status-area-horizontal-spacing-gnome-shell-extension).
##
#### Thanks to the following people for contributing via pull requests:
- @franglais125 for launching apps by number (w/ overlay), bug fixes, and issue support
- @LinxGem33 and @sbarrett322 for artwork, logos, screenshots and design effort
- @dziku1337 for peek mode in window previews
- @robrobinbin for configuring appMenu on/off in the panel
- @MartinPL for toggling favorites on/off in panel
- @jackwickham for thumbnail middle and right click actions
- @abakkk for centering the taskbar icons in the panel
- @quasoft for changing of font weight of ungrouped application titles
- @jordanribera for using icon's dominant color as running indicator color
#### Bug Fixes:
@imrvelj, @Teslator, @bil-elmoussaoui, @brandon-schumann, @sw9, @rockon999 , @lexruee, @3v1n0, @freeroot, @moqmar, @ArtyomZorin, @lkc0987, @saibotk, @vanillajonathan, @Zkdc, @leebickmtu
#### Translations:
@frnogueira (pt_BR), @zeten30 (cs), @franglais125 (es), @LaurentTreguier / @SolarLiner (fr), @elsieholmes (uk), @hosiet (zh\_CN), @jonnius / @linuxr01 (de), @urbalazs / @pappfer (hu), @crayxt (kk), @pkomur / @MartinPL / @alex4401 (pl), @AlexGluck / @GoodNike / @rjapolov (ru), @sicklylife-jp / @ryonakano (ja), @oltulu / @TeknoMobil / @daenney (tr), @sbadux (it), @OriginCode / @pan93412 (zh\_TW)
##
### License & Terms ![](media/design/png/copyleft-16.png)
Dash to Panel is available under the terms of the GPL-v2 or later license See [`COPYING`](https://github.com/jderose9/dash-to-panel/blob/master/COPYING) for details.
![](https://img.shields.io/badge/Language-JavaScript-yellow.svg) ![](https://img.shields.io/badge/Licence-GPL--2.0-blue.svg)
Source diff could not be displayed: it is too large. Options to address this: view the blob.
/*
* This file is part of the Dash-To-Panel extension for Gnome 3
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Credits:
* This file is based on code from the Dash to Dock extension by micheleg
* 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 Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Signals = imports.signals;
const Lang = imports.lang;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Mainloop = imports.mainloop;
const Config = imports.misc.config;
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 Tweener = imports.ui.tweener;
const Util = imports.misc.util;
const Workspace = imports.ui.workspace;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Utils = Me.imports.utils;
const Panel = Me.imports.panel;
const Taskbar = Me.imports.taskbar;
const _ = imports.gettext.domain(Utils.TRANSLATION_DOMAIN).gettext;
let LABEL_GAP = 5;
let MAX_INDICATORS = 4;
var DEFAULT_PADDING_SIZE = 4;
let DOT_STYLE = {
DOTS: "DOTS",
SQUARES: "SQUARES",
DASHES: "DASHES",
SEGMENTED: "SEGMENTED",
CILIORA: "CILIORA",
METRO: "METRO",
SOLID: "SOLID"
}
let DOT_POSITION = {
TOP: "TOP",
BOTTOM: "BOTTOM",
LEFT: 'LEFT',
RIGHT: 'RIGHT'
}
let recentlyClickedAppLoopId = 0;
let recentlyClickedApp = null;
let recentlyClickedAppWindows = null;
let recentlyClickedAppIndex = 0;
let recentlyClickedAppMonitorIndex;
let tracker = Shell.WindowTracker.get_default();
/**
* Extend AppIcon
*
* - Apply a css class based on the number of windows of each application (#N);
* - Draw a dot for each window of the application based on 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
*
*/
var taskbarAppIcon = Utils.defineClass({
Name: 'DashToPanel.TaskbarAppIcon',
Extends: AppDisplay.AppIcon,
ParentConstrParams: [[0, 'app'], [2]],
_init: function(appInfo, panel, iconParams, previewMenu) {
this.panel = panel;
this._nWindows = 0;
this.window = appInfo.window;
this.isLauncher = appInfo.isLauncher;
this._previewMenu = previewMenu;
// Fix touchscreen issues before the listener is added by the parent constructor.
this._onTouchEvent = function(actor, event) {
if (event.type() == Clutter.EventType.TOUCH_BEGIN) {
// Open the popup menu on long press.
this._setPopupTimeout();
} else if (this._menuTimeoutId != 0 && (event.type() == Clutter.EventType.TOUCH_END || event.type() == Clutter.EventType.TOUCH_CANCEL)) {
// Activate/launch the application.
this.activate(1);
this._removeMenuTimeout();
}
// Disable dragging via touch screen as it's buggy as hell. Not perfect for tablet users, but the alternative is way worse.
// Also, EVENT_PROPAGATE launches applications twice with this solution, so this.activate(1) above must only be called if there's already a window.
return Clutter.EVENT_STOP;
};
// Hack for missing TOUCH_END event.
this._onLeaveEvent = function(actor, event) {
this.actor.fake_release();
if (this._menuTimeoutId != 0) this.activate(1); // Activate/launch the application if TOUCH_END didn't fire.
this._removeMenuTimeout();
};
this.callParent('_init', appInfo.app, iconParams);
Utils.wrapActor(this.icon);
this._dot.set_width(0);
this._isGroupApps = Me.settings.get_boolean('group-apps');
this._container = new St.Widget({ style_class: 'dtp-container', layout_manager: new Clutter.BinLayout() });
this._dotsContainer = new St.Widget({ layout_manager: new Clutter.BinLayout() });
this._dtpIconContainer = new St.Widget({ layout_manager: new Clutter.BinLayout(), style: getIconContainerStyle() });
this.actor.remove_actor(this._iconContainer);
this._dtpIconContainer.add_child(this._iconContainer);
if (appInfo.window) {
let box = new St.BoxLayout();
this._windowTitle = new St.Label({
y_align: Clutter.ActorAlign.CENTER,
x_align: Clutter.ActorAlign.START,
style_class: 'overview-label'
});
this._updateWindowTitle();
this._updateWindowTitleStyle();
this._scaleFactorChangedId = St.ThemeContext.get_for_stage(global.stage).connect('changed', () => this._updateWindowTitleStyle());
box.add_child(this._dtpIconContainer);
box.add_child(this._windowTitle);
this._dotsContainer.add_child(box);
} else {
this._dotsContainer.add_child(this._dtpIconContainer);
}
this._container.add_child(this._dotsContainer);
this.actor.set_child(this._container);
if (Panel.checkIfVertical()) {
this.actor.set_width(panel.geom.w);
}
// 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._setAppIconPadding();
this._showDots();
this._focusWindowChangedId = global.display.connect('notify::focus-window',
Lang.bind(this, this._onFocusAppChanged));
this._windowEnteredMonitorId = this._windowLeftMonitorId = 0;
this._stateChangedId = this.app.connect('windows-changed', Lang.bind(this, this.onWindowsChanged));
if (!this.window) {
if (Me.settings.get_boolean('isolate-monitors')) {
this._windowEnteredMonitorId = Utils.DisplayWrapper.getScreen().connect('window-entered-monitor', this.onWindowEnteredOrLeft.bind(this));
this._windowLeftMonitorId = Utils.DisplayWrapper.getScreen().connect('window-left-monitor', this.onWindowEnteredOrLeft.bind(this));
}
this._titleWindowChangeId = 0;
} else {
this._titleWindowChangeId = this.window.connect('notify::title',
Lang.bind(this, this._updateWindowTitle));
}
this._scrollEventId = this.actor.connect('scroll-event', this._onMouseScroll.bind(this));
this._overviewWindowDragEndId = Main.overview.connect('window-drag-end',
Lang.bind(this, this._onOverviewWindowDragEnd));
this._switchWorkspaceId = global.window_manager.connect('switch-workspace',
Lang.bind(this, this._onSwitchWorkspace));
this._hoverChangeId = this.actor.connect('notify::hover', () => this._onAppIconHoverChanged());
this._dtpSettingsSignalIds = [
Me.settings.connect('changed::dot-position', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-size', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-style-focused', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-style-unfocused', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-dominant', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-override', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-1', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-2', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-3', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-4', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-unfocused-different', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-unfocused-1', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-unfocused-2', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-unfocused-3', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::dot-color-unfocused-4', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::focus-highlight', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::focus-highlight-dominant', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::focus-highlight-color', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::focus-highlight-opacity', Lang.bind(this, this._settingsChangeRefresh)),
Me.settings.connect('changed::group-apps-label-font-size', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-label-font-weight', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-label-font-color', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-label-max-width', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-use-fixed-width', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-underline-unfocused', Lang.bind(this, this._settingsChangeRefresh))
]
this.forcedOverview = false;
this._numberOverlay();
},
shouldShowTooltip: function() {
if (!Me.settings.get_boolean('show-tooltip') ||
(!this.isLauncher && Me.settings.get_boolean("show-window-previews") &&
this.getAppIconInterestingWindows().length > 0)) {
return false;
} else {
return this.actor.hover && !this.window &&
(!this._menu || !this._menu.isOpen) &&
(this._previewMenu.getCurrentAppIcon() !== this);
}
},
_onAppIconHoverChanged: function() {
if (!Me.settings.get_boolean('show-window-previews') ||
(!this.window && !this._nWindows)) {
return;
}
if (this.actor.hover) {
this._previewMenu.requestOpen(this);
} else {
this._previewMenu.requestClose();
}
},
_onDestroy: function() {
this.callParent('_onDestroy');
this._destroyed = true;
this._previewMenu.close(true);
// Disconect global signals
// stateChangedId is already handled by parent)
if(this._overviewWindowDragEndId)
Main.overview.disconnect(this._overviewWindowDragEndId);
if(this._focusWindowChangedId)
global.display.disconnect(this._focusWindowChangedId);
if(this._titleWindowChangeId)
this.window.disconnect(this._titleWindowChangeId);
if (this._windowEnteredMonitorId) {
Utils.DisplayWrapper.getScreen().disconnect(this._windowEnteredMonitorId);
Utils.DisplayWrapper.getScreen().disconnect(this._windowLeftMonitorId);
}
if(this._switchWorkspaceId)
global.window_manager.disconnect(this._switchWorkspaceId);
if(this._scaleFactorChangedId)
St.ThemeContext.get_for_stage(global.stage).disconnect(this._scaleFactorChangedId);
if (this._hoverChangeId) {
this.actor.disconnect(this._hoverChangeId);
}
if (this._scrollEventId) {
this.actor.disconnect(this._scrollEventId);
}
if (this._scrollIconDelayTimeoutId) {
Mainloop.source_remove(this._scrollIconDelayTimeoutId);
this._scrollIconDelayTimeoutId = 0;
}
for (let i = 0; i < this._dtpSettingsSignalIds.length; ++i) {
Me.settings.disconnect(this._dtpSettingsSignalIds[i]);
}
},
onWindowsChanged: function() {
this._updateWindows();
this.updateIcon();
},
onWindowEnteredOrLeft: function() {
if (this._checkIfFocusedApp()) {
this._updateWindows();
this._displayProperIndicator();
}
},
// Update indicator and target for minimization animation
updateIcon: function() {
// 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.window ? [this.window] : this.getAppIconInterestingWindows(true);
windows.forEach(function(w) {
w.set_icon_geometry(rect);
});
},
_onMouseScroll: function(actor, event) {
let scrollAction = Me.settings.get_string('scroll-icon-action');
if (scrollAction === 'PASS_THROUGH') {
return this.panel._onPanelMouseScroll(actor, event);
} else if (scrollAction === 'NOTHING' || (!this.window && !this._nWindows)) {
return;
}
let direction = Utils.getMouseScrollDirection(event);
if (direction && !this._scrollIconDelayTimeoutId) {
this._scrollIconDelayTimeoutId = Mainloop.timeout_add(Me.settings.get_int('scroll-icon-delay'), () => {
this._scrollIconDelayTimeoutId = 0;
});
let windows = this.getAppIconInterestingWindows();
windows.sort(Taskbar.sortWindowsCompareFunction);
Utils.activateSiblingWindow(windows, direction, this.window);
}
},
_showDots: function() {
// Just update style if dots already exist
if (this._focusedDots && this._unfocusedDots) {
this._updateWindows();
return;
}
if (!this._isGroupApps) {
this._focusedDots = new St.Widget({
layout_manager: new Clutter.BinLayout(),
x_expand: true, y_expand: true,
visible: false
});
let mappedId = this.actor.connect('notify::mapped', () => {
this._displayProperIndicator();
this.actor.disconnect(mappedId);
});
} else {
this._focusedDots = new St.DrawingArea(),
this._unfocusedDots = new St.DrawingArea();
this._resetDots();
this._focusedDots.connect('repaint', Lang.bind(this, function() {
if(this._dashItemContainer.animatingOut) {
// don't draw and trigger more animations if the icon is in the middle of
// being added to the panel
return;
}
this._drawRunningIndicator(this._focusedDots, Me.settings.get_string('dot-style-focused'), true);
this._displayProperIndicator();
}));
this._unfocusedDots.connect('repaint', Lang.bind(this, function() {
if(this._dashItemContainer.animatingOut) {
// don't draw and trigger more animations if the icon is in the middle of
// being added to the panel
return;
}
this._drawRunningIndicator(this._unfocusedDots, Me.settings.get_string('dot-style-unfocused'), false);
this._displayProperIndicator();
}));
this._dotsContainer.add_child(this._unfocusedDots);
this._updateWindows();
}
this._dotsContainer.add_child(this._focusedDots);
},
_resetDots: function() {
let position = Me.settings.get_string('dot-position');
let isHorizontalDots = position == DOT_POSITION.TOP || position == DOT_POSITION.BOTTOM;
[this._focusedDots, this._unfocusedDots].forEach(d => {
d._tweeningToSize = null;
d.set_size(-1, -1);
d.x_expand = d.y_expand = false;
d[isHorizontalDots ? 'width' : 'height'] = 1;
d[(isHorizontalDots ? 'y' : 'x') + '_expand'] = true;
});
},
_settingsChangeRefresh: function() {
if (this._isGroupApps) {
this._updateWindows();
this._resetDots();
this._focusedDots.queue_repaint();
this._unfocusedDots.queue_repaint();
}
this._displayProperIndicator(true);
},
_updateWindowTitleStyle: function() {
if (this._windowTitle) {
let useFixedWidth = Me.settings.get_boolean('group-apps-use-fixed-width');
let maxLabelWidth = Me.settings.get_int('group-apps-label-max-width') *
St.ThemeContext.get_for_stage(global.stage).scale_factor;
let fontWeight = Me.settings.get_string('group-apps-label-font-weight');
this._windowTitle[(maxLabelWidth > 0 ? 'show' : 'hide')]();
this._windowTitle.clutter_text.natural_width = useFixedWidth ? maxLabelWidth : 0;
this._windowTitle.clutter_text.natural_width_set = useFixedWidth;
this._windowTitle.set_style('font-size: ' + Me.settings.get_int('group-apps-label-font-size') + 'px;' +
'font-weight: ' + fontWeight + ';' +
(useFixedWidth ? '' : 'max-width: ' + maxLabelWidth + 'px;') +
'color: ' + Me.settings.get_string('group-apps-label-font-color'));
}
},
_updateWindowTitle: function() {
if (this._windowTitle.text != this.window.title) {
this._windowTitle.text = (this.window.title ? this.window.title : this.app.get_name()).replace(/\r?\n|\r/g, '').trim();
if (this._focusedDots) {
this._displayProperIndicator();
}
}
},
_setIconStyle: function(isFocused) {
let inlineStyle = 'margin: 0;';
if(Me.settings.get_boolean('focus-highlight') &&
this._checkIfFocusedApp() && !this.isLauncher &&
(!this.window || isFocused) && !this._isThemeProvidingIndicator() && this._checkIfMonitorHasFocus()) {
let focusedDotStyle = Me.settings.get_string('dot-style-focused');
let isWide = this._isWideDotStyle(focusedDotStyle);
let pos = Me.settings.get_string('dot-position');
let highlightMargin = isWide ? Me.settings.get_int('dot-size') : 0;
if(!this.window) {
let containerWidth = this._dtpIconContainer.get_width() / St.ThemeContext.get_for_stage(global.stage).scale_factor;
let backgroundSize = containerWidth + "px " +
(containerWidth - (pos == DOT_POSITION.BOTTOM ? highlightMargin : 0)) + "px;";
if (focusedDotStyle == DOT_STYLE.CILIORA || focusedDotStyle == DOT_STYLE.SEGMENTED)
highlightMargin += 1;
if (this._nWindows > 1 && focusedDotStyle == DOT_STYLE.METRO) {
let bgSvg = '/img/highlight_stacked_bg';
if (pos == DOT_POSITION.LEFT || pos == DOT_POSITION.RIGHT) {
bgSvg += (Panel.checkIfVertical() ? '_2' : '_3');
}
inlineStyle += "background-image: url('" + Me.path + bgSvg + ".svg');" +
"background-position: 0 " + (pos == DOT_POSITION.TOP ? highlightMargin : 0) + "px;" +
"background-size: " + backgroundSize;
}
}
let highlightColor = this._getFocusHighlightColor();
inlineStyle += "background-color: " + cssHexTocssRgba(highlightColor, Me.settings.get_int('focus-highlight-opacity') * 0.01);
}
if(this._dotsContainer.get_style() != inlineStyle) {
if (!this._isGroupApps) {
//when the apps are ungrouped, set the style synchronously so the icons don't jump around on taskbar redraw
this._dotsContainer.set_style(inlineStyle);
} else {
//graphical glitches if i dont set this on a timeout
Mainloop.timeout_add(0, Lang.bind(this, function() { this._dotsContainer.set_style(inlineStyle); }));
}
}
},
_checkIfFocusedApp: function() {
return tracker.focus_app == this.app;
},
_checkIfMonitorHasFocus: function() {
return global.display.focus_window &&
(!Me.settings.get_boolean('multi-monitors') || // only check same monitor index if multi window is enabled.
!Me.settings.get_boolean('isolate-monitors') ||
global.display.focus_window.get_monitor() === this.panel.monitor.index);
},
_setAppIconPadding: function() {
let padding = getIconPadding();
let margin = Me.settings.get_int('appicon-margin');
this.actor.set_style('padding:' + (Panel.checkIfVertical() ? margin + 'px 0' : '0 ' + margin + 'px;'));
this._iconContainer.set_style('padding: ' + padding + 'px;');
},
popupMenu: function() {
this._removeMenuTimeout();
this.actor.fake_release();
if (this._draggable) {
this._draggable.fakeRelease();
}
if (!this._menu) {
this._menu = new taskbarSecondaryMenu(this);
this._menu.connect('activate-window', Lang.bind(this, function (menu, window) {
this.activateWindow(window, Me.settings);
}));
this._menu.connect('open-state-changed', Lang.bind(this, function (menu, isPoppedUp) {
if (!isPoppedUp)
this._onMenuPoppedDown();
}));
let id = Main.overview.connect('hiding', Lang.bind(this, function () { 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._previewMenu.close(true);
this.actor.set_hover(true);
this._menu.actor.add_style_class_name('dashtopanelSecondaryMenu');
this._menu.popup();
this._menuManager.ignoreRelease();
this.emit('sync-tooltip');
return false;
},
_onFocusAppChanged: function(windowTracker) {
this._displayProperIndicator(true);
},
_onOverviewWindowDragEnd: function(windowTracker) {
Mainloop.timeout_add(0, Lang.bind(this, function () {
this._displayProperIndicator();
return GLib.SOURCE_REMOVE;
}));
},
_onSwitchWorkspace: function(windowTracker) {
if (this._isGroupApps) {
Mainloop.timeout_add(0, Lang.bind(this, function () {
this._displayProperIndicator(true);
return GLib.SOURCE_REMOVE;
}));
} else {
this._displayProperIndicator();
}
},
_displayProperIndicator: function (force) {
let isFocused = this._isFocusedWindow();
let position = Me.settings.get_string('dot-position');
let isHorizontalDots = position == DOT_POSITION.TOP || position == DOT_POSITION.BOTTOM;
this._setIconStyle(isFocused);
if(!this._isGroupApps) {
if (this.window && (Me.settings.get_boolean('group-apps-underline-unfocused') || isFocused)) {
let align = Clutter.ActorAlign[position == DOT_POSITION.TOP || position == DOT_POSITION.LEFT ? 'START' : 'END'];
this._focusedDots.set_size(0, 0);
this._focusedDots[isHorizontalDots ? 'height' : 'width'] = this._getRunningIndicatorSize();
this._focusedDots.y_align = this._focusedDots.x_align = Clutter.ActorAlign.FILL;
this._focusedDots[(isHorizontalDots ? 'y' : 'x') + '_align'] = align;
this._focusedDots.background_color = this._getRunningIndicatorColor(isFocused);
this._focusedDots.show();
} else if (this._focusedDots.visible) {
this._focusedDots.hide();
}
} else {
let sizeProp = isHorizontalDots ? 'width' : 'height';
let containerSize = this._container[sizeProp];
let focusedDotStyle = Me.settings.get_string('dot-style-focused');
let unfocusedDotStyle = Me.settings.get_string('dot-style-unfocused');
let focusedIsWide = this._isWideDotStyle(focusedDotStyle);
let unfocusedIsWide = this._isWideDotStyle(unfocusedDotStyle);
let newFocusedDotsSize = 0;
let newFocusedDotsOpacity = 0;
let newUnfocusedDotsSize = 0;
let newUnfocusedDotsOpacity = 0;
isFocused = this._checkIfFocusedApp() && this._checkIfMonitorHasFocus();
Mainloop.timeout_add(0, () => {
if (!this._destroyed) {
if(isFocused)
this.actor.add_style_class_name('focused');
else
this.actor.remove_style_class_name('focused');
}
});
if(focusedIsWide) {
newFocusedDotsSize = (isFocused && this._nWindows > 0) ? containerSize : 0;
newFocusedDotsOpacity = 255;
} else {
newFocusedDotsSize = containerSize;
newFocusedDotsOpacity = (isFocused && this._nWindows > 0) ? 255 : 0;
}
if(unfocusedIsWide) {
newUnfocusedDotsSize = (!isFocused && this._nWindows > 0) ? containerSize : 0;
newUnfocusedDotsOpacity = 255;
} else {
newUnfocusedDotsSize = containerSize;
newUnfocusedDotsOpacity = (!isFocused && this._nWindows > 0) ? 255 : 0;
}
// Only animate if...
// animation is enabled in settings
// AND (going from a wide style to a narrow style indicator or vice-versa
// OR going from an open app to a closed app or vice versa)
if(Me.settings.get_boolean('animate-app-switch') &&
((focusedIsWide != unfocusedIsWide) ||
(this._focusedDots[sizeProp] != newUnfocusedDotsSize || this._unfocusedDots[sizeProp] != newFocusedDotsSize))) {
this._animateDotDisplay(this._focusedDots, newFocusedDotsSize, this._unfocusedDots, newUnfocusedDotsOpacity, force, sizeProp);
this._animateDotDisplay(this._unfocusedDots, newUnfocusedDotsSize, this._focusedDots, newFocusedDotsOpacity, force, sizeProp);
} else {
this._focusedDots.opacity = newFocusedDotsOpacity;
this._unfocusedDots.opacity = newUnfocusedDotsOpacity;
this._focusedDots[sizeProp] = newFocusedDotsSize;
this._unfocusedDots[sizeProp] = newUnfocusedDotsSize;
}
}
},
_animateDotDisplay: function (dots, newSize, otherDots, newOtherOpacity, force, sizeProp) {
if((dots[sizeProp] != newSize && dots._tweeningToSize !== newSize) || force) {
let tweenOpts = {
time: Taskbar.DASH_ANIMATION_TIME,
transition: 'easeInOutCubic',
onStart: Lang.bind(this, function() {
if(newOtherOpacity == 0)
otherDots.opacity = newOtherOpacity;
}),
onComplete: Lang.bind(this, function() {
if(newOtherOpacity > 0)
otherDots.opacity = newOtherOpacity;
dots._tweeningToSize = null;
})
};
tweenOpts[sizeProp] = newSize;
dots._tweeningToSize = newSize;
Tweener.addTween(dots, tweenOpts);
}
},
_isFocusedWindow: function() {
let focusedWindow = global.display.focus_window;
while (focusedWindow) {
if (focusedWindow == this.window) {
return true;
}
focusedWindow = focusedWindow.get_transient_for();
}
return false;
},
_isWideDotStyle: function(dotStyle) {
return dotStyle == DOT_STYLE.SEGMENTED ||
dotStyle == DOT_STYLE.CILIORA ||
dotStyle == DOT_STYLE.METRO ||
dotStyle == DOT_STYLE.SOLID;
},
_isThemeProvidingIndicator: function () {
// This is an attempt to determine if the theme is providing their own
// running indicator by way of a border image on the icon, for example in
// the theme Ciliora
return (this.icon.actor.get_stage() &&
this.icon.actor.get_theme_node().get_border_image());
},
activate: function(button, handleAsGrouped) {
let event = Clutter.get_current_event();
let modifiers = event ? event.get_state() : 0;
// 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
this.callParent('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;
if (button && button == 2 ) {
if (modifiers & Clutter.ModifierType.SHIFT_MASK)
buttonAction = Me.settings.get_string('shift-middle-click-action');
else
buttonAction = Me.settings.get_string('middle-click-action');
}
else if (button && button == 1) {
if (modifiers & Clutter.ModifierType.SHIFT_MASK)
buttonAction = Me.settings.get_string('shift-click-action');
else
buttonAction = Me.settings.get_string('click-action');
}
let appCount = this.getAppIconInterestingWindows().length;
let previewedAppIcon = this._previewMenu.getCurrentAppIcon();
this._previewMenu.close(Me.settings.get_boolean('window-preview-hide-immediate-click'));
// 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 && appCount > 0;
// We customize the action only when the application is already running
if (appIsRunning && !this.isLauncher) {
if (this.window && !handleAsGrouped) {
//ungrouped applications behaviors
switch (buttonAction) {
case 'RAISE': case 'CYCLE': case 'CYCLE-MIN': case 'MINIMIZE': case 'TOGGLE-SHOWPREVIEW':
if (!Main.overview._shown &&
(buttonAction == 'MINIMIZE' || buttonAction == 'TOGGLE-SHOWPREVIEW' || buttonAction == 'CYCLE-MIN') &&
(this._isFocusedWindow() || (buttonAction == 'MINIMIZE' && (button == 2 || modifiers & Clutter.ModifierType.SHIFT_MASK)))) {
this.window.minimize();
} else {
Main.activateWindow(this.window);
}
break;
case "LAUNCH":
this._launchNewInstance();
break;
case "QUIT":
this.window.delete(global.get_current_time());
break;
}
} else {
//grouped application behaviors
let monitor = this.panel.monitor;
let appHasFocus = this._checkIfFocusedApp() && this._checkIfMonitorHasFocus();
switch (buttonAction) {
case "RAISE":
activateAllWindows(this.app, monitor);
break;
case "LAUNCH":
this._launchNewInstance();
break;
case "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 (appHasFocus || 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 all_windows = (button == 1 && ! modifiers) || event.get_click_count() > 1;
minimizeWindow(this.app, all_windows, monitor);
}
else
activateAllWindows(this.app, monitor);
}
else
this.app.activate();
break;
case "CYCLE":
if (!Main.overview._shown){
if (appHasFocus)
cycleThroughWindows(this.app, false, false, monitor);
else {
activateFirstWindow(this.app, monitor);
}
}
else
this.app.activate();
break;
case "CYCLE-MIN":
if (!Main.overview._shown){
if (appHasFocus || (recentlyClickedApp == this.app && recentlyClickedAppWindows[recentlyClickedAppIndex % recentlyClickedAppWindows.length] == "MINIMIZE"))
cycleThroughWindows(this.app, false, true, monitor);
else {
activateFirstWindow(this.app, monitor);
}
}
else
this.app.activate();
break;
case "TOGGLE-SHOWPREVIEW":
if (!Main.overview._shown) {
if (appCount == 1) {
if (appHasFocus)
minimizeWindow(this.app, false, monitor);
else
activateFirstWindow(this.app, monitor);
} else {
if (event.get_click_count() > 1) {
// minimize all windows if double clicked
minimizeWindow(this.app, true, monitor);
} else if (previewedAppIcon != this) {
this._previewMenu.open(this);
}
this.emit('sync-tooltip');
}
}
else
this.app.activate();
break;
case "QUIT":
closeAllWindows(this.app, monitor);
break;
}
}
}
else {
this._launchNewInstance();
}
Main.overview.hide();
},
_launchNewInstance: function() {
if (this.app.can_open_new_window()) {
let appActions = this.app.get_app_info().list_actions();
let newWindowIndex = appActions.indexOf('new-window');
if(Me.settings.get_boolean('animate-window-launch')) {
this.animateLaunch();
}
if (newWindowIndex < 0) {
this.app.open_new_window(-1);
} else {
this.app.launch_action(appActions[newWindowIndex], global.get_current_time(), -1);
}
} else {
let windows = this.window ? [this.window] : this.app.get_windows();
if (windows.length) {
Main.activateWindow(windows[0]);
} else {
this.app.activate();
}
}
},
_updateWindows: function() {
let windows = [this.window];
if (!this.window) {
windows = this.getAppIconInterestingWindows();
this._nWindows = windows.length;
for (let i = 1; i <= MAX_INDICATORS; i++){
let className = 'running'+i;
if(i != this._nWindows)
this.actor.remove_style_class_name(className);
else
this.actor.add_style_class_name(className);
}
}
this._previewMenu.update(this, windows);
},
_getRunningIndicatorCount: function() {
return Math.min(this._nWindows, MAX_INDICATORS);
},
_getRunningIndicatorSize: function() {
return Me.settings.get_int('dot-size') * St.ThemeContext.get_for_stage(global.stage).scale_factor;
},
_getRunningIndicatorColor: function(isFocused) {
let color;
const fallbackColor = new Clutter.Color({ red: 82, green: 148, blue: 226, alpha: 255 });
if (Me.settings.get_boolean('dot-color-dominant')) {
let dce = new Utils.DominantColorExtractor(this.app);
let palette = dce._getColorPalette();
if (palette) {
color = Clutter.color_from_string(palette.original)[1];
} else { // unable to determine color, fall back to theme
let themeNode = this._dot.get_theme_node();
color = themeNode.get_background_color();
// theme didn't provide one, use a default
if(color.alpha == 0) color = fallbackColor;
}
} else if(Me.settings.get_boolean('dot-color-override')) {
let dotColorSettingPrefix = 'dot-color-';
if(!isFocused && Me.settings.get_boolean('dot-color-unfocused-different'))
dotColorSettingPrefix = 'dot-color-unfocused-';
color = Clutter.color_from_string(Me.settings.get_string(dotColorSettingPrefix + (this._getRunningIndicatorCount() || 1) ))[1];
} else {
// Re-use the style - background color, and border width and color -
// of the default dot
let themeNode = this._dot.get_theme_node();
color = themeNode.get_background_color();
// theme didn't provide one, use a default
if(color.alpha == 0) color = fallbackColor;
}
return color;
},
_getFocusHighlightColor: function() {
if (Me.settings.get_boolean('focus-highlight-dominant')) {
let dce = new Utils.DominantColorExtractor(this.app);
let palette = dce._getColorPalette();
if (palette) return palette.original;
}
return Me.settings.get_string('focus-highlight-color');
},
_drawRunningIndicator: function(area, type, isFocused) {
let n = this._getRunningIndicatorCount();
if (!n) {
return;
}
let position = Me.settings.get_string('dot-position');
let isHorizontalDots = position == DOT_POSITION.TOP || position == DOT_POSITION.BOTTOM;
let bodyColor = this._getRunningIndicatorColor(isFocused);
let [areaWidth, areaHeight] = area.get_surface_size();
let cr = area.get_context();
let size = this._getRunningIndicatorSize();
let areaSize = areaWidth;
let startX = 0;
let startY = 0;
if (isHorizontalDots) {
if (position == DOT_POSITION.BOTTOM) {
startY = areaHeight - size;
}
} else {
areaSize = areaHeight;
if (position == DOT_POSITION.RIGHT) {
startX = areaWidth - size;
}
}
if (type == DOT_STYLE.SOLID || type == DOT_STYLE.METRO) {
if (type == DOT_STYLE.SOLID || n <= 1) {
cr.translate(startX, startY);
Clutter.cairo_set_source_color(cr, bodyColor);
cr.newSubPath();
cr.rectangle.apply(cr, [0, 0].concat(isHorizontalDots ? [areaSize, size] : [size, areaSize]));
cr.fill();
} else {
let blackenedLength = (1 / 48) * areaSize; // need to scale with the SVG for the stacked highlight
let darkenedLength = isFocused ? (2 / 48) * areaSize : (10 / 48) * areaSize;
let blackenedColor = bodyColor.shade(.3);
let darkenedColor = bodyColor.shade(.7);
let solidDarkLength = areaSize - darkenedLength;
let solidLength = solidDarkLength - blackenedLength;
cr.translate(startX, startY);
Clutter.cairo_set_source_color(cr, bodyColor);
cr.newSubPath();
cr.rectangle.apply(cr, [0, 0].concat(isHorizontalDots ? [solidLength, size] : [size, solidLength]));
cr.fill();
Clutter.cairo_set_source_color(cr, blackenedColor);
cr.newSubPath();
cr.rectangle.apply(cr, isHorizontalDots ? [solidLength, 0, 1, size] : [0, solidLength, size, 1]);
cr.fill();
Clutter.cairo_set_source_color(cr, darkenedColor);
cr.newSubPath();
cr.rectangle.apply(cr, isHorizontalDots ? [solidDarkLength, 0, darkenedLength, size] : [0, solidDarkLength, size, darkenedLength]);
cr.fill();
}
} else {
let spacing = Math.ceil(areaSize / 18); // separation between the indicators
let length;
let dist;
let indicatorSize;
let translate;
let preDraw = () => {};
let draw;
let drawDash = (i, dashLength) => {
dist = i * dashLength + i * spacing;
cr.rectangle.apply(cr, (isHorizontalDots ? [dist, 0, dashLength, size] : [0, dist, size, dashLength]));
};
switch (type) {
case DOT_STYLE.CILIORA:
spacing = size;
length = areaSize - (size * (n - 1)) - (spacing * (n - 1));
translate = () => cr.translate(startX, startY);
preDraw = () => {
cr.newSubPath();
cr.rectangle.apply(cr, [0, 0].concat(isHorizontalDots ? [length, size] : [size, length]));
};
draw = i => {
dist = length + (i * spacing) + ((i - 1) * size);
cr.rectangle.apply(cr, (isHorizontalDots ? [dist, 0] : [0, dist]).concat([size, size]));
};
break;
case DOT_STYLE.DOTS:
let radius = size / 2;
translate = () => {
indicatorSize = Math.floor((areaSize - n * size - (n - 1) * spacing) / 2);
cr.translate.apply(cr, isHorizontalDots ? [indicatorSize, startY] : [startX, indicatorSize]);
}
draw = i => {
dist = (2 * i + 1) * radius + i * spacing;
cr.arc.apply(cr, (isHorizontalDots ? [dist, radius] : [radius, dist]).concat([radius, 0, 2 * Math.PI]));
};
break;
case DOT_STYLE.SQUARES:
translate = () => {
indicatorSize = Math.floor((areaSize - n * size - (n - 1) * spacing) / 2);
cr.translate.apply(cr, isHorizontalDots ? [indicatorSize, startY] : [startX, indicatorSize]);
}
draw = i => {
dist = i * size + i * spacing;
cr.rectangle.apply(cr, (isHorizontalDots ? [dist, 0] : [0, dist]).concat([size, size]));
};
break;
case DOT_STYLE.DASHES:
length = Math.floor(areaSize / 4) - spacing;
translate = () => {
indicatorSize = Math.floor((areaSize - n * length - (n - 1) * spacing) / 2);
cr.translate.apply(cr, isHorizontalDots ? [indicatorSize, startY] : [startX, indicatorSize]);
}
draw = i => drawDash(i, length);
break;
case DOT_STYLE.SEGMENTED:
length = Math.ceil((areaSize - ((n - 1) * spacing)) / n);
translate = () => cr.translate(startX, startY);
draw = i => drawDash(i, length);
break;
}
translate();
Clutter.cairo_set_source_color(cr, bodyColor);
preDraw();
for (let i = 0; i < n; i++) {
cr.newSubPath();
draw(i);
}
cr.fill();
}
cr.$dispose();
},
_numberOverlay: function() {
// 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: function() {
// 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: function(number) {
this._numberOverlayOrder = number;
this._numberOverlayLabel.set_text(number.toString());
},
toggleNumberOverlay: function(activate) {
if (activate && this._numberOverlayOrder > -1)
this._numberOverlayBin.show();
else
this._numberOverlayBin.hide();
},
handleDragOver: function(source, actor, x, y, time) {
if (source == Main.xdndHandler) {
this._previewMenu.close(true);
}
return DND.DragMotionResult.CONTINUE;
},
// Disable all DnD methods on gnome-shell 3.34
_onDragBegin: function() {},
_onDragEnd: function() {},
acceptDrop: function() { return false; },
getAppIconInterestingWindows: function(isolateMonitors) {
return getInterestingWindows(this.app, this.panel.monitor, isolateMonitors);
}
});
taskbarAppIcon.prototype.scaleAndFade = taskbarAppIcon.prototype.undoScaleAndFade = () => {};
function getIconContainerStyle() {
let style = 'padding: ';
let isVertical = Panel.checkIfVertical();
if (Me.settings.get_boolean('group-apps')) {
style += (isVertical ? '0;' : '0 ' + DEFAULT_PADDING_SIZE + 'px;');
} else {
style += (isVertical ? '' : '0 ') + DEFAULT_PADDING_SIZE + 'px;';
}
return style;
}
function minimizeWindow(app, param, monitor){
// Param true make all app windows minimize
let windows = getInterestingWindows(app, monitor);
let current_workspace = Utils.DisplayWrapper.getWorkspaceManager().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.
*/
function activateAllWindows(app, monitor){
// First activate first window so workspace is switched if needed,
// then activate all other app windows in the current workspace.
let windows = getInterestingWindows(app, monitor);
let w = windows[0];
Main.activateWindow(w);
let activeWorkspace = Utils.DisplayWrapper.getWorkspaceManager().get_active_workspace_index();
if (windows.length <= 0)
return;
for (let i = windows.length - 1; i >= 0; i--){
if (windows[i].get_workspace().index() == activeWorkspace){
Main.activateWindow(windows[i]);
}
}
}
function activateFirstWindow(app, monitor){
let windows = getInterestingWindows(app, monitor);
Main.activateWindow(windows[0]);
}
function cycleThroughWindows(app, reversed, shouldMinimize, monitor) {
// 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 = getInterestingWindows(app, monitor);
if(shouldMinimize)
app_windows.push("MINIMIZE");
if (recentlyClickedAppLoopId > 0)
Mainloop.source_remove(recentlyClickedAppLoopId);
recentlyClickedAppLoopId = Mainloop.timeout_add(MEMORY_TIME, 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.
if (!recentlyClickedApp ||
recentlyClickedApp.get_id() != app.get_id() ||
recentlyClickedAppWindows.length != app_windows.length ||
recentlyClickedAppMonitorIndex != monitor.index) {
recentlyClickedApp = app;
recentlyClickedAppWindows = app_windows;
recentlyClickedAppIndex = 0;
recentlyClickedAppMonitorIndex = monitor.index;
}
if (reversed) {
recentlyClickedAppIndex--;
if (recentlyClickedAppIndex < 0) recentlyClickedAppIndex = recentlyClickedAppWindows.length - 1;
} else {
recentlyClickedAppIndex++;
}
let index = recentlyClickedAppIndex % recentlyClickedAppWindows.length;
if(recentlyClickedAppWindows[index] === "MINIMIZE")
minimizeWindow(app, true, monitor);
else
Main.activateWindow(recentlyClickedAppWindows[index]);
}
function resetRecentlyClickedApp() {
if (recentlyClickedAppLoopId > 0)
Mainloop.source_remove(recentlyClickedAppLoopId);
recentlyClickedAppLoopId=0;
recentlyClickedApp =null;
recentlyClickedAppWindows = null;
recentlyClickedAppIndex = 0;
recentlyClickedAppMonitorIndex = null;
return false;
}
function closeAllWindows(app, monitor) {
let windows = getInterestingWindows(app, monitor);
for (let i = 0; i < windows.length; i++)
windows[i].delete(global.get_current_time());
}
// Filter out unnecessary windows, for instance
// nautilus desktop window.
function getInterestingWindows(app, monitor, isolateMonitors) {
let windows = app.get_windows().filter(function(w) {
return !w.skip_taskbar;
});
// When using workspace or monitor isolation, we filter out windows
// that are not in the current workspace or on the same monitor as the appicon
if (Me.settings.get_boolean('isolate-workspaces'))
windows = windows.filter(function(w) {
return w.get_workspace().index() == Utils.DisplayWrapper.getWorkspaceManager().get_active_workspace_index();
});
if (monitor && Me.settings.get_boolean('multi-monitors') && (isolateMonitors || Me.settings.get_boolean('isolate-monitors'))) {
windows = windows.filter(function(w) {
return w.get_monitor() == monitor.index;
});
}
return windows;
}
function cssHexTocssRgba(cssHex, opacity) {
var bigint = parseInt(cssHex.slice(1), 16);
var r = (bigint >> 16) & 255;
var g = (bigint >> 8) & 255;
var b = bigint & 255;
return 'rgba(' + [r, g, b].join(',') + ',' + opacity + ')';
}
function getIconPadding() {
let panelSize = Me.settings.get_int('panel-size');
let padding = Me.settings.get_int('appicon-padding');
let availSize = panelSize - Taskbar.MIN_ICON_SIZE - panelSize % 2;
if (padding * 2 > availSize) {
padding = availSize * .5;
}
return padding;
}
/**
* Extend AppIconMenu
*
* - set popup arrow side based on taskbar orientation
* - Add close windows option based on quitfromdash extension
* (https://github.com/deuill/shell-extension-quitfromdash)
*/
var taskbarSecondaryMenu = Utils.defineClass({
Name: 'DashToPanel.SecondaryMenu',
Extends: AppDisplay.AppIconMenu,
ParentConstrParams: [[0]],
_init: function(source) {
// 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
this.callParent('_init', source);
let side = Panel.getPosition();
// Change the initialized side where required.
this._arrowSide = side;
this._boxPointer._arrowSide = side;
this._boxPointer._userArrowSide = side;
},
// helper function for the quit windows abilities
_closeWindowInstance: function(metaWindow) {
metaWindow.delete(global.get_current_time());
},
_redisplay: function() {
this.callParent('_redisplay');
// Remove "Show Details" menu item
if(!Me.settings.get_boolean('secondarymenu-contains-showdetails')) {
let existingMenuItems = this._getMenuItems();
for(let idx in existingMenuItems) {
if(existingMenuItems[idx].actor.label_actor.text == _("Show Details")) {
this.box.remove_child(existingMenuItems[idx].actor);
if(existingMenuItems[idx-1] instanceof PopupMenu.PopupSeparatorMenuItem)
this.box.remove_child(existingMenuItems[idx-1].actor);
break;
}
}
}
// prepend items from the appMenu (for native gnome apps)
if(Me.settings.get_boolean('secondarymenu-contains-appmenu')) {
let appMenu = this._source.app.menu;
if(appMenu) {
let remoteMenu = new imports.ui.remoteMenu.RemoteMenu(this._source.actor, this._source.app.menu, this._source.app.action_group);
let appMenuItems = remoteMenu._getMenuItems();
for(var i = 0, l = appMenuItems.length || 0; i < l; ++i) {
let menuItem = appMenuItems[i];
let labelText = menuItem.actor.label_actor.text;
if(labelText == _("New Window") || labelText == _("Quit"))
continue;
if(menuItem instanceof PopupMenu.PopupSeparatorMenuItem)
continue;
// this ends up getting called multiple times, and bombing due to the signal id's being invalid
// on a 2nd pass. disconnect the base handler and attach our own that wraps the id's in if statements
menuItem.disconnect(menuItem._popupMenuDestroyId)
menuItem._popupMenuDestroyId = menuItem.connect('destroy', Lang.bind(this, function(menuItem) {
if(menuItem._popupMenuDestroyId) {
menuItem.disconnect(menuItem._popupMenuDestroyId);
menuItem._popupMenuDestroyId = 0;
}
if(menuItem._activateId) {
menuItem.disconnect(menuItem._activateId);
menuItem._activateId = 0;
}
if(menuItem._activeChangeId) {
menuItem.disconnect(menuItem._activeChangeId);
menuItem._activeChangeId = 0;
}
if(menuItem._sensitiveChangeId) {
menuItem.disconnect(menuItem._sensitiveChangeId);
menuItem._sensitiveChangeId = 0;
}
this.disconnect(menuItem._parentSensitiveChangeId);
if (menuItem == this._activeMenuItem)
this._activeMenuItem = null;
}));
menuItem.actor.get_parent().remove_child(menuItem.actor);
if(menuItem instanceof PopupMenu.PopupSubMenuMenuItem) {
let newSubMenuMenuItem = new PopupMenu.PopupSubMenuMenuItem(labelText);
let appSubMenuItems = menuItem.menu._getMenuItems();
for(let appSubMenuIdx in appSubMenuItems){
let subMenuItem = appSubMenuItems[appSubMenuIdx];
subMenuItem.actor.get_parent().remove_child(subMenuItem.actor);
newSubMenuMenuItem.menu.addMenuItem(subMenuItem);
}
this.addMenuItem(newSubMenuMenuItem, i);
} else
this.addMenuItem(menuItem, i);
}
if(i > 0) {
let separator = new PopupMenu.PopupSeparatorMenuItem();
this.addMenuItem(separator, i);
}
}
}
// quit menu
let app = this._source.app;
let window = this._source.window;
let count = window ? 1 : getInterestingWindows(app).length;
if ( count > 0) {
this._appendSeparator();
let quitFromTaskbarMenuText = "";
if (count == 1)
quitFromTaskbarMenuText = _("Quit");
else
quitFromTaskbarMenuText = _("Quit") + ' ' + count + ' ' + _("Windows");
this._quitfromTaskbarMenuItem = this._appendMenuItem(quitFromTaskbarMenuText);
this._quitfromTaskbarMenuItem.connect('activate', Lang.bind(this, function() {
let app = this._source.app;
let windows = window ? [window] : app.get_windows();
for (i = 0; i < windows.length; i++) {
this._closeWindowInstance(windows[i])
}
}));
}
}
});
Signals.addSignalMethods(taskbarSecondaryMenu.prototype);
/**
* This function is used for extendDashItemContainer
*/
function ItemShowLabel() {
if (!this._labelText)
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 position = Panel.getPosition();
let labelOffset = node.get_length('-x-offset');
let xOffset = Math.floor((itemWidth - labelWidth) / 2);
let x = stageX + xOffset
let y = stageY + (itemHeight - labelHeight) * .5;
switch(position) {
case St.Side.TOP:
y = stageY + labelOffset + itemHeight;
break;
case St.Side.BOTTOM:
y = stageY - labelHeight - labelOffset;
break;
case St.Side.LEFT:
x = stageX + labelOffset + itemWidth;
break;
case St.Side.RIGHT:
x = stageX - labelWidth - labelOffset;
break;
}
// keep the label inside the screen border
// Only needed for the x coordinate.
// Leave a few pixel gap
let gap = LABEL_GAP;
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.set_position(x, y);
if (Dash.DASH_ITEM_LABEL_SHOW_TIME < 1) {
Tweener.addTween(this.label, {
opacity: 255,
time: Dash.DASH_ITEM_LABEL_SHOW_TIME,
transition: 'easeOutQuad',
});
} else {
this.label.ease({
opacity: 255,
duration: Dash.DASH_ITEM_LABEL_SHOW_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD
});
}
};
/**
* A wrapper class around the ShowAppsIcon class.
*
* - Pass settings to the constructor
* - 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)
*
* I can't subclass the original object because of this: https://bugzilla.gnome.org/show_bug.cgi?id=688973.
* thus use this pattern where the real showAppsIcon object is encaptulated, and a reference to it will be properly wired upon
* use of this class in place of the original showAppsButton.
*
*/
var ShowAppsIconWrapper = Utils.defineClass({
Name: 'DashToPanel.ShowAppsIconWrapper',
_init: function() {
this.realShowAppsIcon = new Dash.ShowAppsIcon();
Utils.wrapActor(this.realShowAppsIcon);
Utils.wrapActor(this.realShowAppsIcon.toggleButton);
/* the variable equivalent to toggleButton has a different name in the appIcon class
(actor): duplicate reference to easily reuse appIcon methods */
this.actor = this.realShowAppsIcon.toggleButton;
this.realShowAppsIcon.show(false);
// Re-use appIcon methods
this._removeMenuTimeout = AppDisplay.AppIcon.prototype._removeMenuTimeout;
this._setPopupTimeout = AppDisplay.AppIcon.prototype._setPopupTimeout;
this._onButtonPress = AppDisplay.AppIcon.prototype._onButtonPress;
this._onKeyboardPopupMenu = AppDisplay.AppIcon.prototype._onKeyboardPopupMenu;
this._onLeaveEvent = AppDisplay.AppIcon.prototype._onLeaveEvent;
this._onTouchEvent = AppDisplay.AppIcon.prototype._onTouchEvent;
this._onMenuPoppedDown = AppDisplay.AppIcon.prototype._onMenuPoppedDown;
// No action on clicked (showing of the appsview is controlled elsewhere)
this._onClicked = Lang.bind(this, function(actor, button) {
this._removeMenuTimeout();
});
this.actor.connect('leave-event', Lang.bind(this, this._onLeaveEvent));
this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
this.actor.connect('touch-event', Lang.bind(this, this._onTouchEvent));
this.actor.connect('clicked', Lang.bind(this, this._onClicked));
this.actor.connect('popup-menu', Lang.bind(this, this._onKeyboardPopupMenu));
this._menu = null;
this._menuManager = new PopupMenu.PopupMenuManager(this.actor);
this._menuTimeoutId = 0;
Taskbar.extendDashItemContainer(this.realShowAppsIcon);
let customIconPath = Me.settings.get_string('show-apps-icon-file');
this.realShowAppsIcon.icon.createIcon = function(size) {
this._iconActor = new St.Icon({ icon_name: 'view' + (Config.PACKAGE_VERSION < '3.20' ? '' : '-app') + '-grid-symbolic',
icon_size: size,
style_class: 'show-apps-icon',
track_hover: true });
if (customIconPath) {
this._iconActor.gicon = new Gio.FileIcon({ file: Gio.File.new_for_path(customIconPath) });
}
return this._iconActor;
};
this._changedShowAppsIconId = Me.settings.connect('changed::show-apps-icon-file', () => {
customIconPath = Me.settings.get_string('show-apps-icon-file');
this.realShowAppsIcon.icon._createIconTexture(this.realShowAppsIcon.icon.iconSize);
});
this._changedAppIconPaddingId = Me.settings.connect('changed::appicon-padding', () => this.setShowAppsPadding());
this._changedAppIconSidePaddingId = Me.settings.connect('changed::show-apps-icon-side-padding', () => this.setShowAppsPadding());
this.setShowAppsPadding();
},
setShowAppsPadding: function() {
let padding = getIconPadding();
let sidePadding = Me.settings.get_int('show-apps-icon-side-padding');
let isVertical = Panel.checkIfVertical();
this.actor.set_style('padding:' + (padding + (isVertical ? sidePadding : 0)) + 'px ' + (padding + (isVertical ? 0 : sidePadding)) + 'px;');
},
popupMenu: function() {
this._removeMenuTimeout();
this.actor.fake_release();
if (!this._menu) {
this._menu = new MyShowAppsIconMenu(this, Me.settings);
this._menu.connect('open-state-changed', Lang.bind(this, function(menu, isPoppedUp) {
if (!isPoppedUp)
this._onMenuPoppedDown();
}));
let id = Main.overview.connect('hiding', Lang.bind(this, function() {
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;
},
shouldShowTooltip: function() {
return Me.settings.get_boolean('show-tooltip') &&
(this.actor.hover && (!this._menu || !this._menu.isOpen));
},
destroy: function() {
Me.settings.disconnect(this._changedShowAppsIconId);
Me.settings.disconnect(this._changedAppIconSidePaddingId);
Me.settings.disconnect(this._changedAppIconPaddingId);
}
});
Signals.addSignalMethods(ShowAppsIconWrapper.prototype);
/**
* A menu for the showAppsIcon
*/
var MyShowAppsIconMenu = Utils.defineClass({
Name: 'DashToPanel.ShowAppsIconMenu',
Extends: taskbarSecondaryMenu,
ParentConstrParams: [[0]],
_redisplay: function() {
this.removeAll();
let powerSettingsMenuItem = this._appendMenuItem(_('Power options'));
powerSettingsMenuItem.connect('activate', function () {
Util.spawn(['gnome-control-center', 'power']);
});
let logsMenuItem = this._appendMenuItem(_('Event logs'));
logsMenuItem.connect('activate', function () {
Util.spawn(['gnome-logs']);
});
let systemSettingsMenuItem = this._appendMenuItem(_('System'));
systemSettingsMenuItem.connect('activate', function () {
Util.spawn(['gnome-control-center', 'info-overview']);
});
let devicesSettingsMenuItem = this._appendMenuItem(_('Device Management'));
devicesSettingsMenuItem.connect('activate', function () {
Util.spawn(['gnome-control-center', 'display']);
});
let disksMenuItem = this._appendMenuItem(_('Disk Management'));
disksMenuItem.connect('activate', function () {
Util.spawn(['gnome-disks']);
});
this._appendSeparator();
let terminalMenuItem = this._appendMenuItem(_('Terminal'));
terminalMenuItem.connect('activate', function () {
Util.spawn(['gnome-terminal']);
});
let systemMonitorMenuItem = this._appendMenuItem(_('System monitor'));
systemMonitorMenuItem.connect('activate', function () {
Util.spawn(['gnome-system-monitor']);
});
let filesMenuItem = this._appendMenuItem(_('Files'));
filesMenuItem.connect('activate', function () {
Util.spawn(['nautilus']);
});
let gsSettingsMenuItem = this._appendMenuItem(_('Settings'));
gsSettingsMenuItem.connect('activate', function () {
Util.spawn(['gnome-control-center', 'wifi']);
});
this._appendSeparator();
let lockTaskbarMenuItem = this._appendMenuItem(Me.settings.get_boolean('taskbar-locked') ? _('Unlock taskbar') : _('Lock taskbar'));
lockTaskbarMenuItem.connect('activate', () => {
Me.settings.set_boolean('taskbar-locked', !Me.settings.get_boolean('taskbar-locked'));
});
let settingsMenuItem = this._appendMenuItem(_('Dash to Panel Settings'));
settingsMenuItem.connect('activate', function () {
Util.spawn(["gnome-shell-extension-prefs", Me.metadata.uuid]);
});
if(this._source._dtpPanel) {
this._appendSeparator();
let item = this._appendMenuItem(this._source._dtpPanel._restoreWindowList ? _('Restore Windows') : _('Show Desktop'));
item.connect('activate', Lang.bind(this._source._dtpPanel, this._source._dtpPanel._onShowDesktopButtonPress));
}
}
});
/*
* This file is part of the Dash-To-Panel extension for Gnome 3
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Credits:
* This file is based on code from the Dash to Dock extension by micheleg
* and code from the Taskbar extension by Zorin OS
* Some code was also adapted from the upstream Gnome Shell source code.
*/
const Config = imports.misc.config;
const ExtensionUtils = imports.misc.extensionUtils;
const Gettext = imports.gettext;
const Gio = imports.gi.Gio;
/**
* initTranslations:
* @domain: (optional): the gettext domain to use
*
* Initialize Gettext to load translations from extensionsdir/locale.
* If @domain is not provided, it will be taken from metadata['gettext-domain']
*/
function initTranslations(domain) {
let extension = ExtensionUtils.getCurrentExtension();
domain = domain || extension.metadata['gettext-domain'];
// Check if this extension was built with "make zip-file", and thus
// has the locale files in a subfolder
// otherwise assume that extension has been installed in the
// same prefix as gnome-shell
let localeDir = extension.dir.get_child('locale');
if (localeDir.query_exists(null))
Gettext.bindtextdomain(domain, localeDir.get_path());
else
Gettext.bindtextdomain(domain, Config.LOCALEDIR);
}
/**
* getSettings:
* @schema: (optional): the GSettings schema id
*
* Builds and return a GSettings schema for @schema, using schema files
* in extensionsdir/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 subfolder
// 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.');
return new Gio.Settings({
settings_schema: schemaObj
});
}
\ No newline at end of file
/*
* Dash-To-Panel extension for Gnome 3
* Copyright 2016 Jason DeRose (jderose9) and Charles Gagnon (charlesg99)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
const Main = imports.ui.main;
const Meta = imports.gi.Meta;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const WindowManager = imports.ui.windowManager;
const ExtensionUtils = imports.misc.extensionUtils;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
const PanelManager = Me.imports.panelManager;
const Utils = Me.imports.utils;
const UBUNTU_DOCK_UUID = 'ubuntu-dock@ubuntu.com';
let panelManager;
let oldDash;
let extensionChangedHandler;
let disabledUbuntuDock;
let extensionSystem = (Main.extensionManager || imports.ui.extensionSystem);
function init() {
Convenience.initTranslations(Utils.TRANSLATION_DOMAIN);
}
function enable() {
// The Ubuntu Dock extension might get enabled after this extension
extensionChangedHandler = extensionSystem.connect('extension-state-changed', (data, extension) => {
if (extension.uuid === UBUNTU_DOCK_UUID && extension.state === 1) {
_enable();
}
});
//create a global object that can emit signals and conveniently expose functionalities to other extensions
global.dashToPanel = {};
Signals.addSignalMethods(global.dashToPanel);
_enable();
}
function _enable() {
let ubuntuDock = Main.extensionManager ?
Main.extensionManager.lookup(UBUNTU_DOCK_UUID) : //gnome-shell >= 3.33.4
ExtensionUtils.extensions[UBUNTU_DOCK_UUID];
if (ubuntuDock && ubuntuDock.stateObj && ubuntuDock.stateObj.dockManager) {
// Disable Ubuntu Dock
let extensionOrder = (extensionSystem.extensionOrder || extensionSystem._extensionOrder);
St.ThemeContext.get_for_stage(global.stage).get_theme().unload_stylesheet(ubuntuDock.stylesheet);
ubuntuDock.stateObj.disable();
disabledUbuntuDock = true;
ubuntuDock.state = 2; //ExtensionState.DISABLED
extensionOrder.splice(extensionOrder.indexOf(UBUNTU_DOCK_UUID), 1);
//reset to prevent conflicts with the ubuntu-dock
if (panelManager) {
disable(true);
}
}
if (panelManager) return; //already initialized
Me.settings = Convenience.getSettings('org.gnome.shell.extensions.dash-to-panel');
Me.desktopSettings = Convenience.getSettings('org.gnome.desktop.interface');
Me.imports.update.init();
panelManager = new PanelManager.dtpPanelManager();
panelManager.enable();
Utils.removeKeybinding('open-application-menu');
Utils.addKeybinding(
'open-application-menu',
new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }),
Lang.bind(this, function() {
if(Me.settings.get_boolean('show-appmenu'))
Main.wm._toggleAppMenu();
else
panelManager.primaryPanel.taskbar.popupFocusedAppSecondaryMenu();
}),
Shell.ActionMode.NORMAL | Shell.ActionMode.POPUP
);
// Pretend I'm the dash: meant to make appgrd swarm animation come from the
// right position of the appShowButton.
oldDash = Main.overview._dash;
Main.overview._dash = panelManager.primaryPanel.taskbar;
}
function disable(reset) {
panelManager.disable();
Main.overview._dash = oldDash;
Me.settings.run_dispose();
Me.desktopSettings.run_dispose();
delete Me.settings;
oldDash = null;
panelManager = null;
Utils.removeKeybinding('open-application-menu');
Utils.addKeybinding(
'open-application-menu',
new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }),
Lang.bind(Main.wm, Main.wm._toggleAppMenu),
Shell.ActionMode.NORMAL | Shell.ActionMode.POPUP
);
if (!reset) {
extensionSystem.disconnect(extensionChangedHandler);
delete global.dashToPanel;
// Re-enable Ubuntu Dock if it was disabled by dash to panel
if (disabledUbuntuDock && Main.sessionMode.allowExtensions) {
extensionSystem.enableExtension(UBUNTU_DOCK_UUID);
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 1">
<g fill="#000000">
<rect x="45" width="1" height="1" opacity="0.5"/>
<rect x="46" width="2" height="1" opacity="0.2"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 48">
<g fill="#000000">
<rect y="45" width="1" height="1" opacity="0.5"/>
<rect y="46" width="1" height="2" opacity="0.2"/>
</g>
</svg>