rewritten and it's not terrible now

This commit is contained in:
Izaya 2022-08-26 13:18:13 +10:00
parent 2a617909b6
commit d155461729
4 changed files with 813 additions and 0 deletions

325
default.svg Normal file
View File

@ -0,0 +1,325 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
width="512"
height="512"
viewBox="0 0 128 128"
id="svg4081">
<defs
id="defs4083">
<linearGradient
x1="0.85715157"
y1="5.7142859"
x2="0.85715157"
y2="44.858185"
id="linearGradient3132"
xlink:href="#linearGradient3851"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.6410256,0,0,2.6410256,109.652,-63.02564)" />
<linearGradient
id="linearGradient3851">
<stop
id="stop3853"
style="stop-color:#000000;stop-opacity:0.43200001"
offset="0" />
<stop
id="stop3855"
style="stop-color:#000000;stop-opacity:0.627451"
offset="1" />
</linearGradient>
<linearGradient
x1="64.230865"
y1="-28.825758"
x2="64.230865"
y2="34.457344"
id="linearGradient4125"
xlink:href="#linearGradient4113"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,-1,-5.6302223e-7,6.031954)" />
<linearGradient
id="linearGradient4113">
<stop
id="stop4115"
style="stop-color:#000000;stop-opacity:1"
offset="0" />
<stop
id="stop4117"
style="stop-color:#000000;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
x1="64.230865"
y1="-28.825758"
x2="64.230865"
y2="34.457344"
id="linearGradient4119"
xlink:href="#linearGradient4113"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0.00442744,0.015966)" />
<linearGradient
x1="19.927404"
y1="44.949184"
x2="19.927404"
y2="4.9969058"
id="linearGradient3141-7"
xlink:href="#linearGradient3707-319-631-407-324-616-4"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.625,0,0,2.625,1.2115735,-62.169156)" />
<linearGradient
id="linearGradient3707-319-631-407-324-616-4">
<stop
id="stop3246-6"
style="stop-color:#505050;stop-opacity:1"
offset="0" />
<stop
id="stop3248-7"
style="stop-color:#8e8e8e;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
x1="23.99999"
y1="4.999989"
x2="23.99999"
y2="43"
id="linearGradient3128-361"
xlink:href="#linearGradient3924-776"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.7297298,0,0,2.7297298,-1.513512,-62.513486)" />
<linearGradient
id="linearGradient3924-776">
<stop
id="stop3124"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop3126"
style="stop-color:#ffffff;stop-opacity:0.23529412"
offset="0.06316455" />
<stop
id="stop3128"
style="stop-color:#ffffff;stop-opacity:0.15686275"
offset="0.95056331" />
<stop
id="stop3130"
style="stop-color:#ffffff;stop-opacity:0.39215687"
offset="1" />
</linearGradient>
<radialGradient
cx="7.4956832"
cy="8.4497671"
r="19.99999"
fx="7.4956832"
fy="8.4497671"
id="radialGradient3171-717"
xlink:href="#linearGradient2867-449-88-871-390-598-476-591-434-148-57-177-80"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(5.0812921e-8,6.1121285,-6.4659031,-1.1260873e-7,118.63568,-92.29102)" />
<linearGradient
id="linearGradient2867-449-88-871-390-598-476-591-434-148-57-177-80">
<stop
id="stop3108"
style="stop-color:#c7c7c7;stop-opacity:1"
offset="0" />
<stop
id="stop3110"
style="stop-color:#a6a6a6;stop-opacity:1"
offset="0.26238" />
<stop
id="stop3112"
style="stop-color:#7b7b7b;stop-opacity:1"
offset="0.704952" />
<stop
id="stop3114"
style="stop-color:#595959;stop-opacity:1"
offset="1" />
</linearGradient>
<radialGradient
cx="4.9929786"
cy="43.5"
r="2.5"
fx="4.9929786"
fy="43.5"
id="radialGradient2455-1"
xlink:href="#linearGradient3688-166-749-5"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.003784,0,0,1.4,27.98813,-17.4)" />
<linearGradient
id="linearGradient3688-166-749-5">
<stop
id="stop2883-0"
style="stop-color:#181818;stop-opacity:1"
offset="0" />
<stop
id="stop2885-5"
style="stop-color:#181818;stop-opacity:0"
offset="1" />
</linearGradient>
<radialGradient
cx="4.9929786"
cy="43.5"
r="2.5"
fx="4.9929786"
fy="43.5"
id="radialGradient2457-5"
xlink:href="#linearGradient3688-464-309-8"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.003784,0,0,1.4,-20.01187,-104.4)" />
<linearGradient
id="linearGradient3688-464-309-8">
<stop
id="stop2889-9"
style="stop-color:#181818;stop-opacity:1"
offset="0" />
<stop
id="stop2891-4"
style="stop-color:#181818;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
x1="25.058096"
y1="47.027729"
x2="25.058096"
y2="39.999443"
id="linearGradient2459-7"
xlink:href="#linearGradient3702-501-757-0"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3702-501-757-0">
<stop
id="stop2895-0"
style="stop-color:#181818;stop-opacity:0"
offset="0" />
<stop
id="stop2897-2"
style="stop-color:#181818;stop-opacity:1"
offset="0.5" />
<stop
id="stop2899-6"
style="stop-color:#181818;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient3811">
<stop
id="stop3813"
style="stop-color:#000000;stop-opacity:1"
offset="0" />
<stop
id="stop3815"
style="stop-color:#000000;stop-opacity:0"
offset="1" />
</linearGradient>
<radialGradient
cx="-4.0287771"
cy="93.467628"
r="35.338131"
fx="-4.0287771"
fy="93.467628"
id="radialGradient4079"
xlink:href="#linearGradient3811"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.43648207,0,52.670685)" />
</defs>
<metadata
id="metadata4086">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(0,64)"
id="layer1">
<path
d="m 31.309354,93.467628 a 35.338131,15.42446 0 1 1 -70.676262,0 35.338131,15.42446 0 1 1 70.676262,0 z"
transform="matrix(1.5563924,0,0,0.38899254,70.270358,17.64179)"
id="path3041"
style="opacity:0.2;color:#000000;fill:url(#radialGradient4079);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<g
transform="matrix(2.6999989,0,0,0.55555607,-0.80000186,30.888882)"
id="g2036"
style="display:inline">
<g
transform="matrix(1.052632,0,0,1.285713,-1.263158,-13.42854)"
id="g3712"
style="opacity:0.4">
<rect
width="5"
height="7"
x="38"
y="40"
id="rect2801"
style="fill:url(#radialGradient2455-1);fill-opacity:1;stroke:none" />
<rect
width="5"
height="7"
x="-10"
y="-47"
transform="scale(-1,-1)"
id="rect3696"
style="fill:url(#radialGradient2457-5);fill-opacity:1;stroke:none" />
<rect
width="28"
height="7.0000005"
x="10"
y="40"
id="rect3700"
style="fill:url(#linearGradient2459-7);fill-opacity:1;stroke:none" />
</g>
</g>
<rect
width="102"
height="102"
rx="5.5"
ry="5.5"
x="13"
y="-48"
id="rect5505-21"
style="color:#000000;fill:url(#radialGradient3171-717);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<rect
width="101"
height="101"
rx="5"
ry="5"
x="13.5"
y="-47.5"
id="rect6741-7"
style="opacity:0.5;fill:none;stroke:url(#linearGradient3128-361);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<path
d="m 60.000002,-27.999989 c -0.554,0 -1,0.446 -1,1 l 0,7.53125 c -2.917284,0.61801 -5.610077,1.770601 -8.03125,3.34375 l -5.34375,-5.34375 c -0.195869,-0.195869 -0.463131,-0.28125 -0.71875,-0.28125 -0.255619,0 -0.522881,0.08538 -0.71875,0.28125 l -5.65625,5.65625 c -0.391737,0.391737 -0.391739,1.045762 0,1.4375 l 5.34375,5.343751 c -1.573149,2.421173 -2.72574,5.113966 -3.34375,8.03125 l -7.53125,0 c -0.554,0 -1,0.446 -1,1 l 0,8 c 0,0.554 0.446,1 1,1 l 7.53125,0 c 0.61801,2.917283 1.770601,5.610076 3.34375,8.031249 l -5.34375,5.34375 c -0.391737,0.391737 -0.391739,1.04576 0,1.4375 l 5.65625,5.65625 c 0.391737,0.391737 1.045761,0.391736 1.4375,0 l 5.34375,-5.34375 c 2.421173,1.573149 5.113966,2.72574 8.03125,3.34375 l 0,7.53125 c 0,0.554 0.446,1 1,1 l 8,0 c 0.554,0 1,-0.446 1,-1 l 0,-7.53125 c 2.917284,-0.61801 5.610077,-1.770601 8.03125,-3.34375 l 5.34375,5.34375 c 0.391737,0.391737 1.04576,0.391736 1.4375,0 l 5.65625,-5.65625 c 0.391737,-0.391737 0.391736,-1.045765 0,-1.4375 l -5.34375,-5.34375 c 1.573149,-2.421173 2.72574,-5.113966 3.34375,-8.031249 l 7.53125,0 c 0.554,0 1,-0.446 1,-1 l 0,-8 c 0,-0.554 -0.446,-1 -1,-1 l -7.53125,0 c -0.61801,-2.917284 -1.770601,-5.610077 -3.34375,-8.03125 l 5.34375,-5.343751 c 0.391737,-0.391737 0.391735,-1.045762 0,-1.4375 l -5.65625,-5.65625 c -0.391737,-0.391737 -1.045765,-0.391738 -1.4375,0 l -5.34375,5.34375 c -2.421173,-1.573149 -5.113966,-2.72574 -8.03125,-3.34375 l 0,-7.53125 c 0,-0.554 -0.446,-1 -1,-1 l -8,0 z m 4,21.000001 c 6.072,0 11,4.928 11,11 0,6.072 -4.928,10.999999 -11,10.999999 -6.072,0 -11,-4.927999 -11,-10.999999 0,-6.072 4.928,-11 11,-11 z"
id="path2502"
style="opacity:0.3;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
d="m 60.000002,-28.999989 c -0.554,0 -1,0.446 -1,1 l 0,7.53125 c -2.917284,0.61801 -5.610077,1.770601 -8.03125,3.34375 l -5.34375,-5.34375 c -0.195869,-0.195869 -0.463131,-0.28125 -0.71875,-0.28125 -0.255619,0 -0.522881,0.08538 -0.71875,0.28125 l -5.65625,5.65625 c -0.391737,0.391737 -0.391739,1.045762 0,1.4375 l 5.34375,5.34375 c -1.573149,2.421174 -2.72574,5.113967 -3.34375,8.031251 l -7.53125,0 c -0.554,0 -1,0.446 -1,1 l 0,8 c 0,0.554 0.446,1 1,1 l 7.53125,0 c 0.61801,2.917283 1.770601,5.610076 3.34375,8.031249 l -5.34375,5.34375 c -0.391737,0.391737 -0.391739,1.04576 0,1.4375 l 5.65625,5.65625 c 0.391737,0.391737 1.045761,0.391736 1.4375,0 l 5.34375,-5.34375 c 2.421173,1.573149 5.113966,2.72574 8.03125,3.34375 l 0,7.53125 c 0,0.554 0.446,1 1,1 l 8,0 c 0.554,0 1,-0.446 1,-1 l 0,-7.53125 c 2.917284,-0.61801 5.610077,-1.770601 8.03125,-3.34375 l 5.34375,5.34375 c 0.391737,0.391737 1.04576,0.391736 1.4375,0 l 5.65625,-5.65625 c 0.391737,-0.391737 0.391736,-1.045765 0,-1.4375 l -5.34375,-5.34375 c 1.573149,-2.421173 2.72574,-5.113966 3.34375,-8.031249 l 7.53125,0 c 0.554,0 1,-0.446 1,-1 l 0,-8 c 0,-0.554 -0.446,-1 -1,-1 l -7.53125,0 c -0.61801,-2.917284 -1.770601,-5.610077 -3.34375,-8.031251 l 5.34375,-5.34375 c 0.391737,-0.391737 0.391735,-1.045762 0,-1.4375 l -5.65625,-5.65625 c -0.391737,-0.391737 -1.045765,-0.391738 -1.4375,0 l -5.34375,5.34375 c -2.421173,-1.573149 -5.113966,-2.72574 -8.03125,-3.34375 l 0,-7.53125 c 0,-0.554 -0.446,-1 -1,-1 l -8,0 z m 4,21.000001 c 6.072,0 11,4.928 11,11 0,6.072 -4.928,10.999999 -11,10.999999 -6.072,0 -11,-4.927999 -11,-10.999999 0,-6.072 4.928,-11 11,-11 z"
id="rect2484"
style="color:#000000;fill:url(#linearGradient3141-7);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
d="m 60.004428,-28.296534 c -0.67793,0.806584 -0.14094,2.289468 -0.3125,3.371798 -0.0897,1.61171 0.17194,3.294613 -0.1158,4.867286 -1.80939,0.957711 -4.14855,1.062037 -5.94315,2.231518 -1.0656,0.144568 -2.05742,1.955076 -3.1598,1.216898 -1.87056,-1.78828 -3.60797,-3.773234 -5.5625,-5.4375 -2.05874,1.768369 -3.90024,3.857601 -5.875,5.75 0.10261,1.053427 1.51843,1.714583 2.16325,2.60075 1.08047,1.210011 2.46752,2.218408 3.37436,3.543981 -0.6089,1.943968 -2.18196,3.653378 -2.63864,5.731866 -0.66849,0.858105 -0.0795,2.875736 -1.39897,3.123403 -2.5794,0.05886 -5.203843,-0.117947 -7.754987,0.08876 -0.206156,2.707499 -0.0303,5.488009 -0.08876,8.223736 0.806584,0.677935 2.289468,0.140943 3.371797,0.3125 1.61171,0.08975 3.29461,-0.171944 4.86729,0.115803 0.95771,1.80939 1.06203,4.148544 2.23152,5.943144 0.14456,1.065602 1.95507,2.057423 1.21689,3.159803 -1.78505,1.871074 -3.77766,3.604917 -5.43187,5.562499 1.75831,2.061794 3.85521,3.899728 5.74437,5.875001 1.05343,-0.102606 1.71459,-1.518435 2.60075,-2.16325 1.21001,-1.080466 2.21841,-2.467521 3.54398,-3.374358 1.94397,0.608901 3.65338,2.181954 5.73187,2.638639 0.8581,0.668492 2.87574,0.07951 3.1234,1.398969 0.0589,2.5794 -0.11794,5.203843 0.0888,7.754987 2.7075,0.206156 5.48801,0.0303 8.22374,0.08876 0.67793,-0.806584 0.14094,-2.289468 0.3125,-3.371798 0.0898,-1.61171 -0.17194,-3.294613 0.1158,-4.867286 1.80939,-0.957711 4.14855,-1.062037 5.94315,-2.231518 1.0656,-0.144568 2.05742,-1.955076 3.1598,-1.216898 1.87107,1.78505 3.60492,3.777665 5.5625,5.431869 2.06179,-1.758302 3.89973,-3.855202 5.875,-5.744369 -0.10261,-1.05343 -1.51844,-1.714583 -2.16325,-2.60075 -1.08047,-1.210011 -2.46752,-2.218408 -3.37436,-3.543981 0.6089,-1.943968 2.18196,-3.653378 2.63864,-5.731866 0.66849,-0.858105 0.0795,-2.875736 1.39897,-3.123403 2.5794,-0.05886 5.20384,0.117947 7.75499,-0.08876 0.20615,-2.707496 0.0303,-5.488006 0.0888,-8.223733 -0.80659,-0.677935 -2.28947,-0.140943 -3.3718,-0.3125 -1.61171,-0.08975 -3.29461,0.171944 -4.86729,-0.115803 -0.95771,-1.80939 -1.06203,-4.148544 -2.23152,-5.943144 -0.14456,-1.065601 -1.95507,-2.057423 -1.21689,-3.159803 1.78505,-1.871074 3.77767,-3.604915 5.43187,-5.562499 -1.7583,-2.061795 -3.8552,-3.899727 -5.74437,-5.875001 -1.05343,0.102609 -1.71458,1.518435 -2.60075,2.16325 -1.21001,1.080466 -2.21841,2.467521 -3.54398,3.374358 -1.94397,-0.608901 -3.65338,-2.181954 -5.73187,-2.638639 -0.8581,-0.668492 -2.87573,-0.07951 -3.1234,-1.398969 -0.0589,-2.5794 0.11795,-5.203843 -0.0888,-7.754987 -2.69978,-0.206063 -5.49531,-0.03035 -8.22374,-0.08876 z"
id="path4123"
style="opacity:0.1;fill:none;stroke:url(#linearGradient4119);stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
d="M 64,14.719454 C 70.90718,14.939715 76.822128,8.048783 75.552696,1.253392 74.727538,-5.370638 67.498552,-10.147689 61.081031,-8.287237 54.578165,-6.804703 50.541724,0.847955 53.02234,7.048204 54.62178,11.56752 59.199227,14.786665 64,14.719454 z"
id="path4110"
style="opacity:0.1;fill:none;stroke:url(#linearGradient4125);stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<rect
width="103"
height="103"
rx="6"
ry="6"
x="12.5"
y="-48.5"
id="rect5505-21-6"
style="color:#000000;fill:none;stroke:url(#linearGradient3132);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

186
init.lua Normal file
View File

@ -0,0 +1,186 @@
local awful = require("awful")
local wibox = require("wibox")
local gears = require("gears")
local beautiful = require("beautiful")
local menubar = require("menubar")
local naughty = require "naughty"
local cairo = require("lgi").cairo
local Rsvg = require("lgi").Rsvg
local longpress = require("awesome-longpress")
local launcherpopup = {
buttonsize = 128,
spacing = 5,
iconPath = gears.filesystem.get_configuration_dir() .. "/awesome-launcherpopup/",
updateOnSpawn = true,
font = "sans",
fontSize = 15,
applications = {},
allInstances = {}
}
function launcherpopup.update()
naughty.notify({text="started update"})
menubar.menu_gen.generate(function(rv)
launcherpopup.applications = rv
for k,v in pairs(launcherpopup.allInstances) do
if k and v then
w,e = pcall(v.populateMenu)
if not w then naughty.notify{text=e} end
end
end
end)
end
local function tryLoadIcon(icon)
local img = icon
if dentry.icon:match("%.([^%.]+)$") == "svg" then
naughty.notify{text="is svg"}
img = cairo.ImageSurface(cairo.Format.ARGB32,launcherpopup.buttonsize,launcherpopup.buttonsize)
local cr = cairo.Context(img)
Rsvg.Handle.new_from_file(dentry.icon):render_cairo(cr)
end
return img
end
local function getFont(scale)
return string.format("%s %d",launcherpopup.font,launcherpopup.fontSize * (scale or 1))
end
function launcherpopup.new(s)
local menuStart = 1
local launcherWidget = wibox.widget{
layout = wibox.layout.fixed.vertical,
spacing = launcherpopup.spacing
}
local launcher = awful.popup{
layout = wibox.layout.fixed.vertical,
widget = launcherWidget,
border_color = beautiful.border_focus,
border_width = 2,
ontop = true,
placement = awful.placement.centered,
visible = false,
screen = s,
}
local launcherButtons = wibox.widget{
layout = wibox.layout.grid.vertical,
spacing = launcherpopup.spacing
}
local launcherNav = wibox.widget{
layout = wibox.layout.ratio.horizontal,
forced_width = math.floor((s.geometry.width) / (launcherpopup.buttonsize + launcherpopup.spacing * 2)) * (launcherpopup.buttonsize + launcherpopup.spacing)
}
local launcherList = wibox.widget{
layout = wibox.layout.grid,
spacing = launcherpopup.spacing
}
launcherWidget:add(launcherList)
launcherWidget:add(launcherNav)
local launcherNextPage = wibox.widget{
widget = wibox.widget.imagebox,
image = launcherpopup.iconPath .. "/next.svg",
forced_width=launcherpopup.buttonsize * 0.75,
forced_height=launcherpopup.buttonsize * 0.75
}
local launcherPreviousPage = wibox.widget{
widget = wibox.widget.imagebox,
image = launcherpopup.iconPath .. "/previous.svg",
forced_width=launcherpopup.buttonsize * 0.75,
forced_height=launcherpopup.buttonsize * 0.75
}
launcherNav:add(
wibox.container.place(launcherPreviousPage,"left","top"),
wibox.container.place(launcherNextPage,"right","top"))
local function fillMenu()
launcherList:reset()
local maxRows = math.floor(s.geometry.height / (launcherpopup.buttonsize * 1.5 + launcherpopup.spacing * 2)) - 2
local maxColumns = math.floor((s.geometry.width) / (launcherpopup.buttonsize + launcherpopup.spacing * 2))
local maxEntries = maxRows * maxColumns
local x,y = 1,1
for y = 1, maxRows do
for x = 1, maxColumns do
local dentry = launcherpopup.applications[(menuStart - 1) + (y-1)*maxColumns + x]
if not dentry then dentry = {icon="",name=""} end
local mwidget = wibox.widget{
layout = wibox.layout.fixed.vertical
}
local mwicon = wibox.widget{
image = dentry.icon or launcherpopup.iconPath .. "/default.svg",
widget = wibox.widget.imagebox,
forced_width = launcherpopup.buttonsize,
forced_height = launcherpopup.buttonsize
}
mwidget:add(mwicon)
local mwtext = wibox.container.constraint(wibox.widget{
widget = wibox.widget.textbox,
valign = center,
align = center,
font = getFont(),
text = dentry.name
},"exact",launcherpopup.buttonsize,launcherpopup.buttonsize * 0.5)
mwidget:add(mwtext)
longpress.add(mwidget,function()
if dentry.cmdline then
awful.spawn(dentry.cmdline)
launcher:hide()
end
end)
launcherList:add_widget_at(wibox.container.constraint(mwidget,"max",launcherpopup.buttonsize,launcherpopup.buttonsize*1.5),y,x)
end
end
end
local function goToEntry(n)
local maxRows = math.floor(s.geometry.height / (launcherpopup.buttonsize * 1.5 + launcherpopup.spacing * 2)) - 2
local maxColumns = math.floor((s.geometry.width) / (launcherpopup.buttonsize + launcherpopup.spacing * 2))
local maxEntries = maxRows * maxColumns
menuStart = n
if menuStart < 1 then menuStart = (math.floor(#launcherpopup.applications / maxEntries) * maxEntries) + 1 end
if menuStart > #launcherpopup.applications then menuStart = 1 end
fillMenu()
end
longpress.add(launcherNextPage,function()
goToEntry(menuStart + ((math.floor(s.geometry.height / (launcherpopup.buttonsize * 1.5 + launcherpopup.spacing * 2)) - 2) * math.floor((s.geometry.width) / (launcherpopup.buttonsize + launcherpopup.spacing * 2))))
end,
function()
goToEntry(#launcherpopup.applications)
end)
longpress.add(launcherPreviousPage,function()
goToEntry(menuStart - ((math.floor(s.geometry.height / (launcherpopup.buttonsize * 1.5 + launcherpopup.spacing * 2)) - 2) * math.floor((s.geometry.width) / (launcherpopup.buttonsize + launcherpopup.spacing * 2))))
end,
function()
goToEntry(1)
end)
function launcher.populateMenu()
fillMenu()
end
function launcher.addButton(icon, fn)
local newButton = awful.widget.button{
image = launcherpopup.iconPath .. "/" .. icon
}
newButton:set_forced_width(launcherpopup.buttonsize)
newButton:set_forced_height(launcherpopup.buttonsize)
newButton:buttons(gears.table.join(
newButton:buttons(),
awful.button({}, 1, nil, function()
fn()
launcher:hide()
end)
))
launcherButtons:add(newButton)
end
function launcher.show(self)
self.visible = true
end
function launcher.hide(self)
self.visible = false
end
function launcher.toggle(self)
self.visible = not self.visible
end
launcherpopup.allInstances[#launcherpopup.allInstances+1] = launcher
launcherpopup.update()
return launcher
end
return launcherpopup

151
next.svg Normal file
View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
id="svg6"
version="1.1"
viewBox="0 0 48 48"
width="512"
height="512">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10">
<linearGradient
id="linearGradient78">
<stop
id="stop74"
offset="0"
style="stop-color:#9bdb4d;stop-opacity:1" />
<stop
id="stop76"
offset="1"
style="stop-color:#68b723;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient971">
<stop
offset="0"
style="stop-color:#ffffff;stop-opacity:1"
id="stop963" />
<stop
offset="0.51999998"
style="stop-color:#ffffff;stop-opacity:0.23529412"
id="stop965" />
<stop
offset="0.51999998"
style="stop-color:#ffffff;stop-opacity:0.15686275"
id="stop967" />
<stop
offset="1"
style="stop-color:#ffffff;stop-opacity:0.39215687"
id="stop969" />
</linearGradient>
<linearGradient
id="linearGradient4526"
osb:paint="solid">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4528" />
</linearGradient>
<linearGradient
y2="29.957401"
x2="5.0321598"
y1="27.385983"
x1="5.0321598"
gradientTransform="matrix(-2.0176505,0,0,2.3333418,22.391232,-42.900858)"
gradientUnits="userSpaceOnUse"
id="linearGradient1009"
xlink:href="#linearGradient897" />
<linearGradient
id="linearGradient8662-7">
<stop
offset="0"
style="stop-color:#000000;stop-opacity:1"
id="stop8664-0" />
<stop
offset="1"
style="stop-color:#000000;stop-opacity:0"
id="stop8666-1" />
</linearGradient>
<linearGradient
y2="19.998161"
x2="12"
y1="4"
x1="12"
gradientTransform="matrix(2,0,0,2,0.49928,2.0000018)"
gradientUnits="userSpaceOnUse"
id="linearGradient72"
xlink:href="#linearGradient78" />
<linearGradient
y2="35.268829"
x2="-2.5213938"
y1="22.402153"
x1="-2.5213938"
gradientTransform="matrix(-2.009278,0,0,2,21.325456,-32.359258)"
gradientUnits="userSpaceOnUse"
id="linearGradient983-3-2"
xlink:href="#linearGradient971" />
<linearGradient
id="linearGradient897">
<stop
id="stop889"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop891"
style="stop-color:#ffffff;stop-opacity:0.23529412"
offset="0" />
<stop
id="stop893"
style="stop-color:#ffffff;stop-opacity:0.15686275"
offset="0.99999994" />
<stop
id="stop895"
style="stop-color:#ffffff;stop-opacity:0.39215687"
offset="1" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient8662-7"
id="radialGradient4354-6"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.6046512,0,0,0.37205616,-5.302326,31.919314)"
cx="11.25"
cy="19.03125"
fx="11.25"
fy="19.03125"
r="8.0625" />
</defs>
<path
style="display:inline;overflow:visible;visibility:visible;opacity:0.162921;fill:url(#radialGradient4354-6);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.44554;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none"
id="path4346"
d="M 45.000002,39 A 21.000001,2.9997 0 1 1 3,39 21.000001,2.9997 0 1 1 45.000002,39 Z" />
<path
d="m 24.567832,9.0273438 v 0.0078 c 0.32477,0 0.59468,0.12882 0.789062,0.335938 0.0134,0.0148 0.02882,0.02902 0.04298,0.04296 L 41.183594,23.3125 c 0.1818,0.18196 0.289062,0.428212 0.289062,0.699218 0,0.269072 -0.10726,0.501736 -0.289062,0.695314 l -15.78373,13.898436 c -0.0142,0.014 -0.02968,0.02824 -0.04298,0.04296 -0.19438,0.207128 -0.46429,0.335938 -0.789062,0.335938 -0.603434,0 -1.054688,-0.430982 -1.054688,-1.011716 v -8.4746 c 3.78e-4,-0.542016 -0.475494,-0.9961 -1.058594,-0.9961 H 6.5 c -0.571698,0 -1,-0.428302 -1,-1 v -7.005859 c 0,-0.571698 0.428302,-1 1,-1 h 16.052206 c 0.535274,-0.05002 0.961294,-0.482136 0.960938,-0.992182 V 10.02735 c 0,-0.5807322 0.451254,-1.0000062 1.054688,-1.0000062 z"
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:url(#linearGradient72);fill-opacity:1;stroke:#206b00;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.5;stop-color:#000000;stop-opacity:1"
id="path873-5-5" />
<path
id="rect1007"
style="font-variation-settings:normal;opacity:0.6;vector-effect:none;fill:none;fill-opacity:1;stroke:url(#linearGradient1009);stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;stop-color:#000000"
d="M 22,27.500003 H 6.4999957 V 20.499995 H 22" />
<path
id="path873-5-5-2-6-1"
style="font-variation-settings:normal;opacity:0.5;vector-effect:none;fill:none;fill-opacity:1;stroke:url(#linearGradient983-3-2);stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;stop-color:#000000"
d="m 22,27.5 c 1.654476,5.36e-4 2.5,0.5 2.5,2.48412 V 38 l 16,-14 -16,-14 v 8.003906 C 24.5,20 23.654476,20.499459 22,20.499995" />
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB

151
previous.svg Normal file
View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
id="svg6"
version="1.1"
viewBox="0 0 48 48"
width="512"
height="512">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10">
<linearGradient
id="linearGradient78">
<stop
id="stop74"
offset="0"
style="stop-color:#9bdb4d;stop-opacity:1" />
<stop
id="stop76"
offset="1"
style="stop-color:#68b723;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient971">
<stop
offset="0"
style="stop-color:#ffffff;stop-opacity:1"
id="stop963" />
<stop
offset="0.51999998"
style="stop-color:#ffffff;stop-opacity:0.23529412"
id="stop965" />
<stop
offset="0.51999998"
style="stop-color:#ffffff;stop-opacity:0.15686275"
id="stop967" />
<stop
offset="1"
style="stop-color:#ffffff;stop-opacity:0.39215687"
id="stop969" />
</linearGradient>
<linearGradient
id="linearGradient4526"
osb:paint="solid">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4528" />
</linearGradient>
<linearGradient
y2="29.957401"
x2="5.0321598"
y1="27.385983"
x1="5.0321598"
gradientTransform="matrix(2.0176505,0,0,2.3333418,25.60877,-42.900858)"
gradientUnits="userSpaceOnUse"
id="linearGradient1009"
xlink:href="#linearGradient897" />
<linearGradient
id="linearGradient8662-7">
<stop
offset="0"
style="stop-color:#000000;stop-opacity:1"
id="stop8664-0" />
<stop
offset="1"
style="stop-color:#000000;stop-opacity:0"
id="stop8666-1" />
</linearGradient>
<linearGradient
y2="19.998161"
x2="12"
y1="4"
x1="12"
gradientTransform="matrix(-2,0,0,2,47.500722,2.0000018)"
gradientUnits="userSpaceOnUse"
id="linearGradient72"
xlink:href="#linearGradient78" />
<linearGradient
y2="35.268829"
x2="-2.5213938"
y1="22.402153"
x1="-2.5213938"
gradientTransform="matrix(2.009278,0,0,2,26.674546,-32.359258)"
gradientUnits="userSpaceOnUse"
id="linearGradient983-3-2"
xlink:href="#linearGradient971" />
<linearGradient
id="linearGradient897">
<stop
id="stop889"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop891"
style="stop-color:#ffffff;stop-opacity:0.23529412"
offset="0" />
<stop
id="stop893"
style="stop-color:#ffffff;stop-opacity:0.15686275"
offset="0.99999994" />
<stop
id="stop895"
style="stop-color:#ffffff;stop-opacity:0.39215687"
offset="1" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient8662-7"
id="radialGradient4354-6"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-2.6046512,0,0,0.37205616,53.302328,31.919314)"
cx="11.25"
cy="19.03125"
fx="11.25"
fy="19.03125"
r="8.0625" />
</defs>
<path
style="display:inline;overflow:visible;visibility:visible;opacity:0.162921;fill:url(#radialGradient4354-6);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.44554;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none"
id="path4346"
d="M 3,39 A -21.000001,2.9997 0 1 0 45.000002,39 -21.000001,2.9997 0 1 0 3,39 Z" />
<path
d="m 23.43217,9.0273438 v 0.0078 c -0.32477,0 -0.59468,0.12882 -0.789062,0.335938 -0.0134,0.0148 -0.02882,0.02902 -0.04298,0.04296 L 6.816408,23.3125 c -0.1818,0.18196 -0.289062,0.428212 -0.289062,0.699218 0,0.269072 0.10726,0.501736 0.289062,0.695314 l 15.78373,13.898436 c 0.0142,0.014 0.02968,0.02824 0.04298,0.04296 0.19438,0.207128 0.46429,0.335938 0.789062,0.335938 0.603434,0 1.054688,-0.430982 1.054688,-1.011716 v -8.4746 c -3.78e-4,-0.542016 0.475494,-0.9961 1.058594,-0.9961 h 15.95454 c 0.571698,0 1,-0.428302 1,-1 v -7.005859 c 0,-0.571698 -0.428302,-1 -1,-1 H 25.447796 c -0.535274,-0.05002 -0.961294,-0.482136 -0.960938,-0.992182 V 10.02735 c 0,-0.5807322 -0.451254,-1.0000062 -1.054688,-1.0000062 z"
style="font-variation-settings:normal;vector-effect:none;fill:url(#linearGradient72);fill-opacity:1;stroke:#206b00;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.5;stop-color:#000000"
id="path873-5-5" />
<path
id="rect1007"
style="font-variation-settings:normal;opacity:0.6;vector-effect:none;fill:none;fill-opacity:1;stroke:url(#linearGradient1009);stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;stop-color:#000000"
d="M 26.000002,27.500003 H 41.500006 V 20.499995 H 26.000002" />
<path
id="path873-5-5-2-6-1"
style="font-variation-settings:normal;opacity:0.5;vector-effect:none;fill:none;fill-opacity:1;stroke:url(#linearGradient983-3-2);stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;stop-color:#000000"
d="m 26.000002,27.5 c -1.654476,5.36e-4 -2.5,0.5 -2.5,2.48412 V 38 l -16,-14 16,-14 v 8.003906 c 0,1.996094 0.845524,2.495553 2.5,2.496089" />
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB