🔀 Merge pull request #11 from Schneegans/feature/matrix

This commit is contained in:
Simon Schneegans
2021-12-25 13:47:36 +01:00
committed by GitHub
11 changed files with 1241 additions and 84 deletions
+374
View File
@@ -0,0 +1,374 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="512"
height="512"
viewBox="0 0 135.46666 135.46667"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="matrixFont.svg"
inkscape:export-filename="/home/simon/Linux-Projects/Burn-My-Windows/resources/img/matrixFont.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#000000"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="1"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="true"
units="px"
inkscape:zoom="3.2650549"
inkscape:cx="194.33058"
inkscape:cy="126.49098"
inkscape:window-width="1920"
inkscape:window-height="1131"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<inkscape:grid
type="xygrid"
id="grid8183"
empspacing="2"
spacingx="4.2333333"
spacingy="4.2333333"
color="#cbcbff"
opacity="0.1254902"
empcolor="#ffffff"
empopacity="0.25098039" />
</sodipodi:namedview>
<defs
id="defs2">
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter972"
x="-0.014295474"
y="-0.01399304"
width="1.0285909"
height="1.0279861">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.78384108"
id="feGaussianBlur970" />
</filter>
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter974"
x="-0.024387008"
y="-0.023871079"
width="1.048774"
height="1.0477422">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.3371742"
id="feGaussianBlur976" />
</filter>
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<text
xml:space="preserve"
style="font-weight:300;font-size:7.60522px;line-height:1.112;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light';letter-spacing:3.89202px;opacity:1;mix-blend-mode:normal;stroke-width:0.190131;filter:url(#filter972)"
x="1.7241572"
y="6.4795361"
id="text968"
inkscape:export-filename="/home/simon/Linux-Projects/Burn-My-Windows/resources/img/text3003.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="6.4795361"
id="tspan934">ABCDEFGHIJKLMNOP</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="14.946301"
id="tspan936">QRSTUVWXYZabcdef</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="23.413067"
id="tspan938">ghijklmnopqrstuv</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="31.879831"
id="tspan940">wxyzÀÁÂÃÄÅÆÇÈÉÊË</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="40.346596"
id="tspan942">ÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="48.813362"
id="tspan944">ÝÞßàáâãäåæçèéêëì</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="57.280125"
id="tspan946">íîïðΑαΒβΓγΔδΕεΖζ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="65.746887"
id="tspan948">ΗηΘθΙιΚκΛλΜμΝνΞξ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="74.213654"
id="tspan950">ΟοΠπΡρΣσΤτΥυΦφΧχ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="82.68042"
id="tspan952">ΨψΩω1234567890Аа</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="91.147186"
id="tspan954">БбВвГгДдЕеЖжЗзИи</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="99.613953"
id="tspan956">ЙйКкЛлМмНнОоПпРр</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="108.08072"
id="tspan958">СсТтУуФфХхЦцЧчШш</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="116.54748"
id="tspan960">ЩщЬьЭэЮюЯя!&quot;#$%&amp;</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="125.01424"
id="tspan962">()*+,-/:;&lt;=&gt;?@©§</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="133.48102"
id="tspan964">[\]{|}~ªº¿®¬½¼¡¶</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="141.94777"
id="tspan966" /></text>
<text
xml:space="preserve"
style="font-weight:300;font-size:7.60522px;line-height:1.112;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light';letter-spacing:3.89202px;opacity:1;stroke-width:0.190131"
x="1.7241572"
y="6.4795361"
id="text94444"><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="6.4795361"
id="tspan94410">ABCDEFGHIJKLMNOP</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="14.946301"
id="tspan94412">QRSTUVWXYZabcdef</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="23.413067"
id="tspan94414">ghijklmnopqrstuv</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="31.879831"
id="tspan94416">wxyzÀÁÂÃÄÅÆÇÈÉÊË</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="40.346596"
id="tspan94418">ÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="48.813362"
id="tspan94420">ÝÞßàáâãäåæçèéêëì</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="57.280125"
id="tspan94422">íîïðΑαΒβΓγΔδΕεΖζ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="65.746887"
id="tspan94424">ΗηΘθΙιΚκΛλΜμΝνΞξ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="74.213654"
id="tspan94426">ΟοΠπΡρΣσΤτΥυΦφΧχ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="82.68042"
id="tspan94428">ΨψΩω1234567890Аа</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="91.147186"
id="tspan94430">БбВвГгДдЕеЖжЗзИи</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="99.613953"
id="tspan94432">ЙйКкЛлМмНнОоПпРр</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="108.08072"
id="tspan94434">СсТтУуФфХхЦцЧчШш</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="116.54748"
id="tspan94436">ЩщЬьЭэЮюЯя!&quot;#$%&amp;</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="125.01424"
id="tspan94438">()*+,-/:;&lt;=&gt;?@©§</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="133.48102"
id="tspan94440">[\]{|}~ªº¿®¬½¼¡¶</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="141.94777"
id="tspan94442" /></text>
<text
xml:space="preserve"
style="font-weight:300;font-size:7.60522px;line-height:1.112;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light';letter-spacing:3.89202px;opacity:1;mix-blend-mode:normal;stroke-width:0.190131;filter:url(#filter974)"
x="1.7241572"
y="6.4795361"
id="text3003"
inkscape:export-filename="/home/simon/Linux-Projects/Burn-My-Windows/resources/img/text3003.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="6.4795361"
id="tspan30643">ABCDEFGHIJKLMNOP</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="14.946301"
id="tspan40072">QRSTUVWXYZabcdef</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="23.413067"
id="tspan42210">ghijklmnopqrstuv</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="31.879831"
id="tspan43166">wxyzÀÁÂÃÄÅÆÇÈÉÊË</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="40.346596"
id="tspan43762">ÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="48.813362"
id="tspan44946">ÝÞßàáâãäåæçèéêëì</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="57.280125"
id="tspan48062">íîïðΑαΒβΓγΔδΕεΖζ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="65.746887"
id="tspan56533">ΗηΘθΙιΚκΛλΜμΝνΞξ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="74.213654"
id="tspan58635">ΟοΠπΡρΣσΤτΥυΦφΧχ</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="82.68042"
id="tspan61169">ΨψΩω1234567890Аа</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="91.147186"
id="tspan67243">БбВвГгДдЕеЖжЗзИи</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="99.613953"
id="tspan69399">ЙйКкЛлМмНнОоПпРр</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="108.08072"
id="tspan70763">СсТтУуФфХхЦцЧчШш</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="116.54748"
id="tspan72709">ЩщЬьЭэЮюЯя!&quot;#$%&amp;</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="125.01424"
id="tspan77955">()*+,-/:;&lt;=&gt;?@©§</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="133.48102"
id="tspan77957">[\]{|}~ªº¿®¬½¼¡¶</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;fill:#ffffff;fill-opacity:1;stroke-width:0.190131"
x="1.7241572"
y="141.94777"
id="tspan75487" /></text>
<text
xml:space="preserve"
style="font-weight:300;font-size:10.5833px;line-height:1.25;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light';stroke-width:0.264583"
x="169.33333"
y="29.009251"
id="text17385"><tspan
sodipodi:role="line"
id="tspan17383"
style="stroke-width:0.264583"
x="169.33333"
y="29.009251" /></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 21 KiB

+4
View File
@@ -5,9 +5,13 @@
**Release Date:** TBD **Release Date:** TBD
#### New Features #### New Features
* Added a new Matrix shader which dissolves your windows in a shower of green letters. You can switch between the fire and the matrix shader in the settings. Sadly, this effect cannot be available under GNOME 3.3x as it was apparently impossible to set textures for a `Clutter.ShaderEffect` in GJS back then.
#### Other Enhancements #### Other Enhancements
* Refactored the code a lot to make it easier to add new shader effects in the future. * Refactored the code a lot to make it easier to add new shader effects in the future.
* Tweaked timing of the fire shader. Previously, the fire became invisible quite quickly. Due to this new animation timing, the default animation time has been reduced to 1500 ms.
## [Burn My Window 3](https://github.com/schneegans/Burn-My-Windows/releases/tag/v3) ## [Burn My Window 3](https://github.com/schneegans/Burn-My-Windows/releases/tag/v3)
+29 -11
View File
@@ -13,7 +13,7 @@
'use strict'; 'use strict';
const {Clutter, Meta} = imports.gi; const {Clutter, Gio, Meta} = imports.gi;
const Workspace = imports.ui.workspace.Workspace; const Workspace = imports.ui.workspace.Workspace;
const WindowManager = imports.ui.windowManager.WindowManager; const WindowManager = imports.ui.windowManager.WindowManager;
@@ -23,6 +23,7 @@ const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension(); const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.common.utils; const utils = Me.imports.src.common.utils;
const FireShader = Me.imports.src.extension.FireShader.FireShader; const FireShader = Me.imports.src.extension.FireShader.FireShader;
const MatrixShader = Me.imports.src.extension.MatrixShader.MatrixShader;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// This extensions modifies the window-close animation to look like the window was set // // This extensions modifies the window-close animation to look like the window was set //
@@ -39,6 +40,10 @@ class Extension {
// from GNOME Tweaks, when you log in or when the screen is unlocked. // from GNOME Tweaks, when you log in or when the screen is unlocked.
enable() { enable() {
// Load all of our resources.
this._resources = Gio.Resource.load(Me.path + '/resources/burn-my-windows.gresource');
Gio.resources_register(this._resources);
// Store a reference to the settings object. // Store a reference to the settings object.
this._settings = ExtensionUtils.getSettings(); this._settings = ExtensionUtils.getSettings();
@@ -141,17 +146,27 @@ class Extension {
tweakTransition('scale-x', 1); tweakTransition('scale-x', 1);
tweakTransition('scale-y', 1); tweakTransition('scale-y', 1);
// Instead, we add a cool shader to our window actor! let shader = null;
const shader = new FireShader(this._settings);
actor.add_effect(shader);
// Update uniforms at each frame. // Add a cool shader to our window actor!
transition.connect('new-frame', (t) => { const mode = this._settings.get_enum('close-animation');
shader.set_uniform_value('uProgress', t.get_progress()); if (mode == 1) {
shader.set_uniform_value('uTime', 0.001 * t.get_elapsed_time()); shader = new FireShader(this._settings);
shader.set_uniform_value('uSizeX', actor.width); } else if (mode == 2) {
shader.set_uniform_value('uSizeY', actor.height); shader = new MatrixShader(this._settings);
}); }
if (shader) {
actor.add_effect(shader);
// Update uniforms at each frame.
transition.connect('new-frame', (t) => {
shader.set_uniform_value('uProgress', t.get_progress());
shader.set_uniform_value('uTime', 0.001 * t.get_elapsed_time());
shader.set_uniform_value('uSizeX', actor.width);
shader.set_uniform_value('uSizeY', actor.height);
});
}
}); });
} }
@@ -159,6 +174,9 @@ class Extension {
// Tweaks, when you log out or when the screen locks. // Tweaks, when you log out or when the screen locks.
disable() { disable() {
// Unregister our resources.
Gio.resources_unregister(this._resources);
// Restore the original behavior. // Restore the original behavior.
global.window_manager.disconnect(this._destroyConnection); global.window_manager.disconnect(this._destroyConnection);
+42 -17
View File
@@ -43,6 +43,7 @@ var PreferencesDialog = class PreferencesDialog {
this._settings = ExtensionUtils.getSettings(); this._settings = ExtensionUtils.getSettings();
// Bind all properties. // Bind all properties.
this._bindCombobox('close-animation');
this._bindAdjustment('destroy-animation-time'); this._bindAdjustment('destroy-animation-time');
this._bindSwitch('destroy-dialogs'); this._bindSwitch('destroy-dialogs');
this._bindAdjustment('flame-movement-speed'); this._bindAdjustment('flame-movement-speed');
@@ -52,6 +53,10 @@ var PreferencesDialog = class PreferencesDialog {
this._bindColorButton('fire-color-3'); this._bindColorButton('fire-color-3');
this._bindColorButton('fire-color-4'); this._bindColorButton('fire-color-4');
this._bindColorButton('fire-color-5'); this._bindColorButton('fire-color-5');
this._bindAdjustment('matrix-scale');
this._bindAdjustment('matrix-randomness');
this._bindColorButton('matrix-trail-color');
this._bindColorButton('matrix-tip-color');
// The fire-gradient-reset button needs to by bound explicitly. // The fire-gradient-reset button needs to by bound explicitly.
this._builder.get_object('reset-fire-colors').connect('clicked', () => { this._builder.get_object('reset-fire-colors').connect('clicked', () => {
@@ -87,6 +92,12 @@ var PreferencesDialog = class PreferencesDialog {
// ----------------------------------------------------------------------- private stuff // ----------------------------------------------------------------------- private stuff
// Connects a Gtk.ComboBox (or anything else which has an 'active-id' property) to a
// settings key. It also binds the corresponding reset button.
_bindCombobox(settingsKey) {
this._bind(settingsKey, 'active-id');
}
// Connects a Gtk.Adjustment (or anything else which has a 'value' property) to a // Connects a Gtk.Adjustment (or anything else which has a 'value' property) to a
// settings key. It also binds the corresponding reset button. // settings key. It also binds the corresponding reset button.
_bindAdjustment(settingsKey) { _bindAdjustment(settingsKey) {
@@ -100,36 +111,50 @@ var PreferencesDialog = class PreferencesDialog {
} }
// Colors are stored as strings like 'rgb(1, 0.5, 0)'. As Gio.Settings.bind_with_mapping // Colors are stored as strings like 'rgb(1, 0.5, 0)'. As Gio.Settings.bind_with_mapping
// is not available yet, we need to do the color conversion manually. // is not available yet, we need to do the color conversion manually. It also binds the
// corresponding reset button.
_bindColorButton(settingsKey) { _bindColorButton(settingsKey) {
const button = this._builder.get_object(settingsKey); const button = this._builder.get_object(settingsKey);
// Update the settings when the color is modified. if (button) {
button.connect('color-set', () => {
this._settings.set_string(settingsKey, button.get_rgba().to_string());
});
// Update the button state when the settings change. // Update the settings when the color is modified.
const settingSignalHandler = () => { button.connect('color-set', () => {
const rgba = new Gdk.RGBA(); this._settings.set_string(settingsKey, button.get_rgba().to_string());
rgba.parse(this._settings.get_string(settingsKey)); });
button.rgba = rgba;
};
this._settings.connect('changed::' + settingsKey, settingSignalHandler); // Update the button state when the settings change.
const settingSignalHandler = () => {
const rgba = new Gdk.RGBA();
rgba.parse(this._settings.get_string(settingsKey));
button.rgba = rgba;
};
// Initialize the button with the state in the settings. this._settings.connect('changed::' + settingsKey, settingSignalHandler);
settingSignalHandler();
// Initialize the button with the state in the settings.
settingSignalHandler();
}
this._bindResetButton(settingsKey);
} }
// Connects any widget's property to a settings key. The widget must have the same ID as // Connects any widget's property to a settings key. The widget must have the same ID as
// the settings key. It also binds the corresponding reset button. // the settings key. It also binds the corresponding reset button.
_bind(settingsKey, property) { _bind(settingsKey, property) {
this._settings.bind( const object = this._builder.get_object(settingsKey);
settingsKey, this._builder.get_object(settingsKey), property,
Gio.SettingsBindFlags.DEFAULT);
if (object) {
this._settings.bind(settingsKey, object, property, Gio.SettingsBindFlags.DEFAULT);
}
this._bindResetButton(settingsKey);
}
// Searches for a reset button for the given settings key and make it reset the settings
// key when clicked.
_bindResetButton(settingsKey) {
const resetButton = this._builder.get_object('reset-' + settingsKey); const resetButton = this._builder.get_object('reset-' + settingsKey);
if (resetButton) { if (resetButton) {
resetButton.connect('clicked', () => { resetButton.connect('clicked', () => {
Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

+307 -4
View File
@@ -2,6 +2,23 @@
<interface domain="desktop-cube"> <interface domain="desktop-cube">
<requires lib="gtk" version="3.0" /> <requires lib="gtk" version="3.0" />
<object class="GtkListStore" id="animation-mode-list">
<columns>
<column type="gchararray" />
<column type="gchararray" />
</columns>
<data>
<row>
<col id="0">Fire</col>
<col id="1">fire</col>
</row>
<row>
<col id="0">Matrix</col>
<col id="1">matrix</col>
</row>
</data>
</object>
<object class="GtkAdjustment" id="destroy-animation-time"> <object class="GtkAdjustment" id="destroy-animation-time">
<property name="upper">10000</property> <property name="upper">10000</property>
<property name="lower">500</property> <property name="lower">500</property>
@@ -23,6 +40,20 @@
<property name="page-increment">0.1</property> <property name="page-increment">0.1</property>
</object> </object>
<object class="GtkAdjustment" id="matrix-scale">
<property name="upper">50</property>
<property name="lower">5</property>
<property name="step-increment">1</property>
<property name="page-increment">5</property>
</object>
<object class="GtkAdjustment" id="matrix-randomness">
<property name="upper">1</property>
<property name="lower">0</property>
<property name="step-increment">0.01</property>
<property name="page-increment">0.1</property>
</object>
<object class="GtkScrolledWindow" id="settings-widget"> <object class="GtkScrolledWindow" id="settings-widget">
<property name="hscrollbar-policy">never</property> <property name="hscrollbar-policy">never</property>
<property name="min-content-height">200</property> <property name="min-content-height">200</property>
@@ -57,6 +88,58 @@
<object class="GtkListBox"> <object class="GtkListBox">
<property name="selection-mode">none</property> <property name="selection-mode">none</property>
<!-- <child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Close Window Animation</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkComboBox" id="close-animation">
<property name="valign">center</property>
<property name="model">animation-mode-list</property>
<property name="id_column">1</property>
<property name="active_id">fire</property>
<child>
<object class="GtkCellRendererText" />
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkButton" id="reset-close-animation">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child> -->
<child> <child>
<object class="GtkListBoxRow"> <object class="GtkListBoxRow">
<property name="margin-start">10</property> <property name="margin-start">10</property>
@@ -162,7 +245,7 @@
<property name="margin-bottom">10</property> <property name="margin-bottom">10</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Fire Options</property> <property name="label">Fire Animation Options</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="hexpand">1</property> <property name="hexpand">1</property>
<style> <style>
@@ -215,7 +298,7 @@
<property name="spacing">8</property> <property name="spacing">8</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="yes">Flame Scale</property> <property name="label" translatable="yes">Scale</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="valign">center</property> <property name="valign">center</property>
@@ -264,7 +347,7 @@
<property name="spacing">8</property> <property name="spacing">8</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="yes">Flame Movement Speed</property> <property name="label" translatable="yes">Speed</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="valign">center</property> <property name="valign">center</property>
@@ -314,7 +397,7 @@
<property name="spacing">8</property> <property name="spacing">8</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="yes">Fire Gradient</property> <property name="label" translatable="yes">Gradient</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="valign">center</property> <property name="valign">center</property>
@@ -376,6 +459,226 @@
</object> </object>
</child> </child>
<!-- <child>
<object class="GtkBox">
<property name="margin-top">30</property>
<property name="margin-bottom">10</property>
<child>
<object class="GtkLabel">
<property name="label">Matrix Animation Options</property>
<property name="xalign">0</property>
<property name="hexpand">1</property>
<style>
<class name="title-4" />
</style>
</object>
</child>
</object>
</child> -->
<!-- <child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
<class name="rich-list" />
</style>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Scale</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">matrix-scale</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-matrix-scale">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Randomness</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">2</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">matrix-randomness</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-matrix-randomness">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Trail Color</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkColorButton" id="matrix-trail-color">
<property name="use_alpha">1</property>
<property name="show_editor">1</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-matrix-trail-color">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Tip Color</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkColorButton" id="matrix-tip-color">
<property name="use_alpha">1</property>
<property name="show_editor">1</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-matrix-tip-color">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child> -->
</object> </object>
</child> </child>
</object> </object>
+256 -4
View File
@@ -2,6 +2,23 @@
<interface domain="desktop-cube"> <interface domain="desktop-cube">
<requires lib="gtk" version="4.0" /> <requires lib="gtk" version="4.0" />
<object class="GtkListStore" id="animation-mode-list">
<columns>
<column type="gchararray" />
<column type="gchararray" />
</columns>
<data>
<row>
<col id="0">Fire</col>
<col id="1">fire</col>
</row>
<row>
<col id="0">Matrix</col>
<col id="1">matrix</col>
</row>
</data>
</object>
<object class="GtkScrolledWindow" id="settings-widget"> <object class="GtkScrolledWindow" id="settings-widget">
<property name="hscrollbar-policy">never</property> <property name="hscrollbar-policy">never</property>
<property name="min-content-height">200</property> <property name="min-content-height">200</property>
@@ -42,6 +59,48 @@
</style> </style>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Close Window Animation</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkComboBox" id="close-animation">
<property name="valign">center</property>
<property name="model">animation-mode-list</property>
<property name="id_column">1</property>
<property name="active_id">fire</property>
<child>
<object class="GtkCellRendererText" />
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkButton" id="reset-close-animation">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child> <child>
<object class="GtkListBoxRow"> <object class="GtkListBoxRow">
<property name="activatable">0</property> <property name="activatable">0</property>
@@ -134,7 +193,7 @@
<property name="margin-bottom">10</property> <property name="margin-bottom">10</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Fire Options</property> <property name="label">Fire Animation Options</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="hexpand">1</property> <property name="hexpand">1</property>
<style> <style>
@@ -168,7 +227,7 @@
<object class="GtkBox"> <object class="GtkBox">
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="yes">Flame Scale</property> <property name="label" translatable="yes">Scale</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="valign">center</property> <property name="valign">center</property>
@@ -214,7 +273,7 @@
<object class="GtkBox"> <object class="GtkBox">
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="yes">Flame Movement Speed</property> <property name="label" translatable="yes">Speed</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="valign">center</property> <property name="valign">center</property>
@@ -260,7 +319,7 @@
<object class="GtkBox"> <object class="GtkBox">
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label" translatable="yes">Fire Gradient</property> <property name="label" translatable="yes">Gradient</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="valign">center</property> <property name="valign">center</property>
@@ -317,6 +376,199 @@
</object> </object>
</child> </child>
<child>
<object class="GtkBox">
<property name="margin-top">30</property>
<property name="margin-bottom">10</property>
<child>
<object class="GtkLabel">
<property name="label">Matrix Animation Options</property>
<property name="xalign">0</property>
<property name="hexpand">1</property>
<style>
<class name="title-4" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<property name="show-separators">1</property>
<style>
<class name="rich-list" />
</style>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Scale</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="matrix-scale">
<property name="upper">50</property>
<property name="lower">5</property>
<property name="step-increment">1</property>
<property name="page-increment">5</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-matrix-scale">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Randomness</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">2</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="matrix-randomness">
<property name="upper">1.0</property>
<property name="lower">0.0</property>
<property name="step-increment">0.01</property>
<property name="page-increment">0.1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-matrix-randomness">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Trail Color</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkColorButton" id="matrix-trail-color">
<property name="use_alpha">0</property>
<property name="show_editor">1</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-matrix-trail-color">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Tip Color</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkColorButton" id="matrix-tip-color">
<property name="use_alpha">0</property>
<property name="show_editor">1</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-matrix-tip-color">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object> </object>
</child> </child>
@@ -1,10 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schemalist> <schemalist>
<enum id='org.gnome.shell.extensions.burn-my-windows.AnimationType'>
<value value='1' nick='fire' />
<value value='2' nick='matrix' />
</enum>
<schema path="/org/gnome/shell/extensions/burn-my-windows/" id="org.gnome.shell.extensions.burn-my-windows"> <schema path="/org/gnome/shell/extensions/burn-my-windows/" id="org.gnome.shell.extensions.burn-my-windows">
<key name="close-animation" enum="org.gnome.shell.extensions.burn-my-windows.AnimationType">
<default>"fire"</default>
<summary>Close Animation</summary>
<description>The animation used for window closing.</description>
</key>
<key name="destroy-animation-time" type="i"> <key name="destroy-animation-time" type="i">
<default>2000</default> <default>1500</default>
<summary>Destroy Animation Time</summary> <summary>Destroy Animation Time</summary>
<description>The time it takes to burn the windows.</description> <description>The time it takes to burn the windows.</description>
</key> </key>
@@ -57,6 +69,31 @@
<description>The fifth color of the fire gradient.</description> <description>The fifth color of the fire gradient.</description>
</key> </key>
<key name="matrix-scale" type="i">
<default>20</default>
<summary>Matrix Scale</summary>
<description>The size of the matrix letters.</description>
</key>
<key name="matrix-randomness" type="d">
<default>1.0</default>
<summary>Matrix Randomness</summary>
<description>The randomness of the matrix effect.</description>
</key>
<key name="matrix-tip-color" type="s">
<default>"rgb(255, 255, 255)"</default>
<summary>Matrix Tip Color</summary>
<description>The color of the matrix trail tips.</description>
</key>
<key name="matrix-trail-color" type="s">
<default>"rgb(25, 255, 89)"</default>
<summary>Matrix Trail Color</summary>
<description>The color matrix trails.</description>
</key>
</schema> </schema>
</schemalist> </schemalist>
+45 -4
View File
@@ -20,6 +20,10 @@ const Me = imports.misc.extensionUtils.getCurrentExtension();
const shaderSnippets = Me.imports.src.extension.shaderSnippets; const shaderSnippets = Me.imports.src.extension.shaderSnippets;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// The FireShader uses a procedural gray-scale noise texture. This texture is moved //
// vertically over time and mapped to a configurable color gradient. It is faded to //
// transparency towards the edges of the window. In addition, there are a couple of //
// moving gradients which fade-in or fade-out the fire effect. //
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
var FireShader = GObject.registerClass({Properties: {}, Signals: {}}, var FireShader = GObject.registerClass({Properties: {}, Signals: {}},
@@ -38,18 +42,16 @@ var FireShader = GObject.registerClass({Properties: {}, Signals: {}},
color.blue / 255}, ${color.alpha / 255})`); color.blue / 255}, ${color.alpha / 255})`);
} }
this.set_shader_source(` this.set_shader_source(`
// Inject some common shader snippets. // Inject some common shader snippets.
${shaderSnippets.standardUniforms()} ${shaderSnippets.standardUniforms()}
${shaderSnippets.noise()} ${shaderSnippets.noise()}
${shaderSnippets.effectMask()}
// These may be configurable in the future. // These may be configurable in the future.
const float EDGE_FADE = 70; const float EDGE_FADE = 70;
const float FADE_WIDTH = 0.1; const float FADE_WIDTH = 0.1;
const float HIDE_TIME = 0.2; const float HIDE_TIME = 0.3;
const vec2 FIRE_SCALE = vec2(400, 600) * ${settings.get_double('flame-scale')}; const vec2 FIRE_SCALE = vec2(400, 600) * ${settings.get_double('flame-scale')};
const float FIRE_SPEED = ${settings.get_double('flame-movement-speed')}; const float FIRE_SPEED = ${settings.get_double('flame-movement-speed')};
@@ -78,7 +80,46 @@ var FireShader = GObject.registerClass({Properties: {}, Signals: {}},
return colors[4]; return colors[4];
} }
void main(void) { // This method requires the uniforms from standardUniforms() to be available.
// It returns two values: The first is an alpha value which can be used for the window
// texture. This gradually dissolves the window from top to bottom. The second can be used
// to mask any effect, it will be most opaque where the window is currently fading and
// gradually dissolve to zero over time.
// hideTime: A value in [0..1]. It determines the percentage of the animation which
// is spent for hiding the window. 1-hideTime will be spent thereafter for
// dissolving the effect mask.
// fadeWidth: The relative size of the window-hiding gradient in [0..1].
// edgeFadeWidth: The pixel width of the effect fading range at the edges of the window.
vec2 effectMask(float hideTime, float fadeWidth, float edgeFadeWidth) {
float burnProgress = clamp(uProgress/hideTime, 0, 1);
float afterBurnProgress = clamp((uProgress-hideTime)/(1-hideTime), 0, 1);
// Gradient from top to bottom.
float t = cogl_tex_coord_in[0].t * (1 - fadeWidth);
// Visible part of the window. Gradually dissolves towards the bottom.
float windowMask = 1 - clamp((burnProgress - t) / fadeWidth, 0, 1);
// Gradient from top burning window.
float effectMask = clamp(t*(1-windowMask)/burnProgress, 0, 1);
// Fade-out when the window burned down.
if (uProgress > hideTime) {
float fade = cos(afterBurnProgress*3.14159*0.5);
effectMask *= mix(1-t, 1, fade) * fade;
}
// Fade at window borders.
vec2 pos = cogl_tex_coord_in[0].st * vec2(uSizeX, uSizeY);
effectMask *= clamp(pos.x / edgeFadeWidth, 0, 1);
effectMask *= clamp(pos.y / edgeFadeWidth, 0, 1);
effectMask *= clamp((uSizeX - pos.x) / edgeFadeWidth, 0, 1);
effectMask *= clamp((uSizeY - pos.y) / edgeFadeWidth, 0, 1);
return vec2(windowMask, effectMask);
}
void main() {
// Get a noise value which moves vertically in time. // Get a noise value which moves vertically in time.
vec2 uv = cogl_tex_coord_in[0].st * vec2(uSizeX, uSizeY) / FIRE_SCALE; vec2 uv = cogl_tex_coord_in[0].st * vec2(uSizeX, uSizeY) / FIRE_SCALE;
+145
View File
@@ -0,0 +1,145 @@
//////////////////////////////////////////////////////////////////////////////////////////
// ) ( //
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
// |__/ //
// Copyright (c) 2021 Simon Schneegans //
// Released under the GPLv3 or later. See LICENSE file for details. //
//////////////////////////////////////////////////////////////////////////////////////////
'use strict';
const {Clutter, GObject, GdkPixbuf, Cogl} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const shaderSnippets = Me.imports.src.extension.shaderSnippets;
//////////////////////////////////////////////////////////////////////////////////////////
// The MatrixShader multiplies a grid of random letters with some gradients which are //
// moving from top to bottom. The speed of the moving gradients is chosen randomly. //
// Also, there is a random delay making the gradients not drop all at the same time. //
// This effect is not available on GNOME 3.3x, due to the limitation described in the //
// documentation of vfunc_paint_target further down in this file. //
//////////////////////////////////////////////////////////////////////////////////////////
var MatrixShader = GObject.registerClass({Properties: {}, Signals: {}},
class MatrixShader extends Clutter.ShaderEffect {
_init(settings) {
super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER});
// Load the font texture. As the shader is re-created for each window animation, this
// texture is also re-created each time. This could be improved in the future!
const fontData = GdkPixbuf.Pixbuf.new_from_resource('/img/matrixFont.png');
this._fontTexture = new Clutter.Image();
this._fontTexture.set_data(
fontData.get_pixels(),
fontData.has_alpha ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888,
fontData.width, fontData.height, fontData.rowstride);
const trailColor =
Clutter.Color.from_string(settings.get_string('matrix-trail-color'))[1];
const tipColor =
Clutter.Color.from_string(settings.get_string('matrix-tip-color'))[1];
// This is partially based on https://www.shadertoy.com/view/ldccW4 (CC-BY-NC-SA).
this.set_shader_source(`
// Inject some common shader snippets.
${shaderSnippets.standardUniforms()}
${shaderSnippets.noise()}
uniform sampler2D uFontTexture;
// These may be configurable in the future.
const float EDGE_FADE = 30;
const float FADE_WIDTH = 150;
const float TRAIL_LENGTH = 0.2;
const float FINAL_FADE_START_TIME = 0.8;
const float LETTER_TILES = 16.0;
const float LETTER_SIZE = ${settings.get_int('matrix-scale')};
const float LETTER_FLICKER_SPEED = 2.0;
const float RANDOMNESS = ${settings.get_double('matrix-randomness')};
// This returns a flickering grid of random letters.
float getText(vec2 fragCoord) {
vec2 pixelCoords = fragCoord * vec2(uSizeX, uSizeY);
vec2 uv = mod(pixelCoords.xy, LETTER_SIZE)/LETTER_SIZE;
vec2 block = pixelCoords/LETTER_SIZE - uv;
// Choose random letter.
uv += floor(rand2(floor(rand(block)*vec2(12.9898,78.233) + LETTER_FLICKER_SPEED*uTime + 42.254))*LETTER_TILES);
return texture2D(uFontTexture, uv/LETTER_TILES).r;
}
// This returns two values: The first are gradients for the "raindrops" which move
// from top to bottom. This is used for fading the letters. The second value is set
// to one below each drop and to zero above it. This second value is used for fading
// the window texture.
vec2 getRain(vec2 fragCoord) {
vec2 coords = fragCoord * vec2(uSizeX, uSizeY);
coords.x -= mod(coords.x, LETTER_SIZE);
float delay = fract(sin(coords.x)*78.233) * mix(0.0, 1.0, RANDOMNESS);
float speed = fract(cos(coords.x)*12.989) * mix(0.0, 0.3, RANDOMNESS) + 1.5;
float distToDrop = (uProgress*2-delay)*speed - fragCoord.y;
float rainAlpha = distToDrop >= 0 ? exp(-distToDrop/TRAIL_LENGTH) : 0;
float windowAlpha = 1 - clamp(uSizeY*distToDrop, 0, FADE_WIDTH) / FADE_WIDTH;
return vec2(rainAlpha, windowAlpha);
}
void main() {
// Get a cool matrix effect. See comments for those methods above.
vec2 rain = getRain(cogl_tex_coord_in[0].st);
float text = getText(cogl_tex_coord_in[0].st);
// Get the window texture and fade it according to the effect mask.
cogl_color_out = texture2D(uTexture, cogl_tex_coord_in[0].st) * rain.y;
// This is used to fade out the remaining trails in the end.
float finalFade = 1-clamp((uProgress-FINAL_FADE_START_TIME)/
(1-FINAL_FADE_START_TIME), 0, 1);
float rainAlpha = finalFade * rain.x;
// Fade at window borders.
vec2 pos = cogl_tex_coord_in[0].st * vec2(uSizeX, uSizeY);
rainAlpha *= clamp(pos.x / EDGE_FADE, 0, 1);
rainAlpha *= clamp(pos.y / EDGE_FADE, 0, 1);
rainAlpha *= clamp((uSizeX - pos.x) / EDGE_FADE, 0, 1);
rainAlpha *= clamp((uSizeY - pos.y) / EDGE_FADE, 0, 1);
// Add the matrix effect to the window.
vec3 trailColor = vec3(${trailColor.red / 255},
${trailColor.green / 255},
${trailColor.blue / 255});
vec3 tipColor = vec3(${tipColor.red / 255},
${tipColor.green / 255},
${tipColor.blue / 255});
cogl_color_out.rgb += mix(trailColor, tipColor, min(1, pow(rainAlpha+0.1, 4))) * rainAlpha * text;
// These are pretty useful for understanding how this works.
// cogl_color_out = vec4(vec3(text), 1);
// cogl_color_out = vec4(vec3(rain.x), 1);
// cogl_color_out = vec4(vec3(rain.y), 1);
}
`);
};
// This is overridden to bind the font texture for drawing. Sadly, this seems to be
// impossible under GNOME 3.3x as this.get_pipeline() is not available. It was called
// get_target() back then but this is not wrapped in GJS.
// https://gitlab.gnome.org/GNOME/mutter/-/blob/gnome-3-36/clutter/clutter/clutter-offscreen-effect.c#L598
vfunc_paint_target(node, paint_context) {
const pipeline = this.get_pipeline();
pipeline.set_layer_texture(1, this._fontTexture.get_texture());
this.set_uniform_value('uFontTexture', 1);
super.vfunc_paint_target(node, paint_context);
}
});
+1 -43
View File
@@ -37,7 +37,7 @@ function standardUniforms() {
function noise() { function noise() {
return ` return `
float rand(vec2 co) { float rand(vec2 co) {
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); return fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453);
} }
vec2 rand2(vec2 co) { vec2 rand2(vec2 co) {
@@ -81,45 +81,3 @@ function noise() {
} }
`; `;
} }
// This method requires the uniforms from standardUniforms() to be available.
// It returns two values: The first is an alpha value which can be used for the window
// texture. This gradually dissolves the window from top to bottom. The second can be used
// to mask any effect, it will be most opaque where the window is currently fading and
// gradually dissolve to zero over time.
// hideTime: A value in [0..1]. It determines the percentage of the animation which
// is spent for hiding the window. 1-hideTime will be spent thereafter for
// dissolving the effect mask.
// fadeWidth: The relative size of the window-hiding gradient in [0..1].
// edgeFadeWidth: The pixel width of the effect fading range at the edges of the window.
function effectMask() {
return `
vec2 effectMask(float hideTime, float fadeWidth, float edgeFadeWidth) {
float burnProgress = clamp(uProgress/hideTime, 0, 1);
float afterBurnProgress = clamp((uProgress-hideTime)/(1-hideTime), 0, 1);
// Gradient from top to bottom.
float t = cogl_tex_coord_in[0].t * (1 - fadeWidth);
// Visible part of the window. Gradually dissolves towards the bottom.
float windowMask = 1 - clamp((burnProgress - t) / fadeWidth, 0, 1);
// Gradient from top burning window.
float effectMask = clamp(t*(1-windowMask)/burnProgress, 0, 1);
// Fade-out when the window burned down.
if (uProgress > hideTime) {
effectMask *= mix(1, 1-t, afterBurnProgress) * pow(1-afterBurnProgress, 2);
}
// Fade at window borders.
vec2 pos = cogl_tex_coord_in[0].st * vec2(uSizeX, uSizeY);
effectMask *= clamp(pos.x / edgeFadeWidth, 0, 1);
effectMask *= clamp(pos.y / edgeFadeWidth, 0, 1);
effectMask *= clamp((uSizeX - pos.x) / edgeFadeWidth, 0, 1);
effectMask *= clamp((uSizeY - pos.y) / edgeFadeWidth, 0, 1);
return vec2(windowMask, effectMask);
}
`;
}