restructure and improve config
14
.config/awesome/.old-luarc.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"diagnostics.globals": [
|
||||
"awesome",
|
||||
"client",
|
||||
"mouse",
|
||||
"mousegrabber",
|
||||
"root",
|
||||
"screen",
|
||||
"tag"
|
||||
],
|
||||
"workspace.library": [
|
||||
"/usr/share/awesome/lib"
|
||||
]
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M176,32H80A24,24,0,0,0,56,56V224a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V56A24,24,0,0,0,176,32ZM151.16,139.58l-16,32a8,8,0,0,1-14.32-7.16L131.06,144H112a8,8,0,0,1-7.16-11.58l16-32a8,8,0,1,1,14.32,7.16L124.94,128H144a8,8,0,0,1,7.16,11.58ZM88,8a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,8Z"></path></svg>
|
After Width: | Height: | Size: 416 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M88,8a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,8ZM200,56V224a24,24,0,0,1-24,24H80a24,24,0,0,1-24-24V56A24,24,0,0,1,80,32h96A24,24,0,0,1,200,56Zm-16,0a8,8,0,0,0-8-8H80a8,8,0,0,0-8,8V224a8,8,0,0,0,8,8h96a8,8,0,0,0,8-8Z"></path></svg>
|
After Width: | Height: | Size: 347 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M88,8a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,8ZM200,56V224a24,24,0,0,1-24,24H80a24,24,0,0,1-24-24V56A24,24,0,0,1,80,32h96A24,24,0,0,1,200,56Zm-16,0a8,8,0,0,0-8-8H80a8,8,0,0,0-8,8V224a8,8,0,0,0,8,8h96a8,8,0,0,0,8-8Zm-24,8H96a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V72A8,8,0,0,0,160,64Z"></path></svg>
|
After Width: | Height: | Size: 426 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M88,8a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,8Zm72,96H96a8,8,0,0,0-8,8v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V112A8,8,0,0,0,160,104Zm40-48V224a24,24,0,0,1-24,24H80a24,24,0,0,1-24-24V56A24,24,0,0,1,80,32h96A24,24,0,0,1,200,56Zm-16,0a8,8,0,0,0-8-8H80a8,8,0,0,0-8,8V224a8,8,0,0,0,8,8h96a8,8,0,0,0,8-8Z"></path></svg>
|
After Width: | Height: | Size: 426 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M88,8a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,8Zm72,176H96a8,8,0,0,0-8,8v16a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V192A8,8,0,0,0,160,184ZM200,56V224a24,24,0,0,1-24,24H80a24,24,0,0,1-24-24V56A24,24,0,0,1,80,32h96A24,24,0,0,1,200,56Zm-16,0a8,8,0,0,0-8-8H80a8,8,0,0,0-8,8V224a8,8,0,0,0,8,8h96a8,8,0,0,0,8-8Z"></path></svg>
|
After Width: | Height: | Size: 428 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M88,8a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,8ZM200,56V224a24,24,0,0,1-24,24H80a24,24,0,0,1-24-24V56A24,24,0,0,1,80,32h96A24,24,0,0,1,200,56Zm-16,0a8,8,0,0,0-8-8H80a8,8,0,0,0-8,8V224a8,8,0,0,0,8,8h96a8,8,0,0,0,8-8Zm-24,88H96a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V152A8,8,0,0,0,160,144Z"></path></svg>
|
After Width: | Height: | Size: 428 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M88,8a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,8ZM200,56V224a24,24,0,0,1-24,24H80a24,24,0,0,1-24-24V56A24,24,0,0,1,80,32h96A24,24,0,0,1,200,56Zm-80,80a8,8,0,0,0,16,0V96a8,8,0,0,0-16,0Zm20,36a12,12,0,1,0-12,12A12,12,0,0,0,140,172Z"></path></svg>
|
After Width: | Height: | Size: 360 B |
1
.config/awesome/assets/phosphor/caret-right-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"></path></svg>
|
After Width: | Height: | Size: 217 B |
1
.config/awesome/assets/phosphor/circle-bold.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Z"></path></svg>
|
After Width: | Height: | Size: 232 B |
1
.config/awesome/assets/phosphor/circle-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M232,128A104,104,0,1,1,128,24,104.13,104.13,0,0,1,232,128Z"></path></svg>
|
After Width: | Height: | Size: 182 B |
1
.config/awesome/assets/phosphor/cloud-moon-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M164,72a76.35,76.35,0,0,0-12.36,1A71.93,71.93,0,0,0,96.17,9.83a8,8,0,0,0-9.59,9.58A56.45,56.45,0,0,1,88,32,56.06,56.06,0,0,1,32,88a56.45,56.45,0,0,1-12.59-1.42,8,8,0,0,0-9.59,9.59,72.22,72.22,0,0,0,32.29,45.06A52,52,0,0,0,84,224h80a76,76,0,0,0,0-152ZM29.37,104c.87,0,1.75,0,2.63,0a72.08,72.08,0,0,0,72-72c0-.89,0-1.78,0-2.67a55.64,55.64,0,0,1,32,48.05A76.4,76.4,0,0,0,93,120.78a52.38,52.38,0,0,0-9-.78,51.69,51.69,0,0,0-30,9.59A56.22,56.22,0,0,1,29.37,104Z"></path></svg>
|
After Width: | Height: | Size: 580 B |
1
.config/awesome/assets/phosphor/dot-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M128,80a48,48,0,1,0,48,48A48,48,0,0,0,128,80Zm0,60a12,12,0,1,1,12-12A12,12,0,0,1,128,140Z"></path></svg>
|
After Width: | Height: | Size: 213 B |
1
.config/awesome/assets/phosphor/dot-outline-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M156,128a28,28,0,1,1-28-28A28,28,0,0,1,156,128Z"></path></svg>
|
After Width: | Height: | Size: 171 B |
14
.config/awesome/assets/phosphor/init.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
local qfs = require "quarrel.fs"
|
||||
local gfs = require "gears.filesystem"
|
||||
local gsurface = require "gears.surface"
|
||||
|
||||
local icons = {}
|
||||
local phosphor_dir = gfs.get_configuration_dir() .. "assets/phosphor/"
|
||||
|
||||
for _, icon in ipairs(qfs.ls_files(phosphor_dir)) do
|
||||
if icon:match(".+%.(.+)") == "svg" then
|
||||
icons[icon:match("(.+)%..+"):gsub("-", "_")] = gsurface.load_uncached(phosphor_dir .. icon)
|
||||
end
|
||||
end
|
||||
|
||||
return icons
|
1
.config/awesome/assets/phosphor/moon-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z"></path></svg>
|
After Width: | Height: | Size: 312 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M160,32V224a8,8,0,0,1-12.91,6.31L77.25,176H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H77.25l69.84-54.31A8,8,0,0,1,160,32Zm32,64a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V104A8,8,0,0,0,192,96Zm32-16a8,8,0,0,0-8,8v80a8,8,0,0,0,16,0V88A8,8,0,0,0,224,80Z"></path></svg>
|
After Width: | Height: | Size: 363 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M160,32V224a8,8,0,0,1-12.91,6.31L77.25,176H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H77.25l69.84-54.31A8,8,0,0,1,160,32Zm32,64a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V104A8,8,0,0,0,192,96Z"></path></svg>
|
After Width: | Height: | Size: 304 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M155.52,24.81a8,8,0,0,0-8.43.88L77.25,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H77.25l69.84,54.31A7.94,7.94,0,0,0,152,232a8,8,0,0,0,8-8V32A8,8,0,0,0,155.52,24.81Z"></path></svg>
|
After Width: | Height: | Size: 289 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M155.52,24.81a8,8,0,0,0-8.43.88L77.25,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H77.25l69.84,54.31A7.94,7.94,0,0,0,152,232a8,8,0,0,0,8-8V32A8,8,0,0,0,155.52,24.81Z"></path><path d="M227.31,128l18.35-18.34a8,8,0,0,0-11.32-11.32L216,116.69,197.66,98.34a8,8,0,0,0-11.32,11.32L204.69,128l-18.35,18.34a8,8,0,0,0,11.32,11.32L216,139.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"></path></svg>
|
After Width: | Height: | Size: 490 B |
1
.config/awesome/assets/phosphor/sun-dim-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M120,40V32a8,8,0,0,1,16,0v8a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-8-8A8,8,0,0,0,50.34,61.66Zm0,116.68-8,8a8,8,0,0,0,11.32,11.32l8-8a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l8-8a8,8,0,0,0-11.32-11.32l-8,8A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l8,8a8,8,0,0,0,11.32-11.32ZM40,120H32a8,8,0,0,0,0,16h8a8,8,0,0,0,0-16Zm88,88a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-8A8,8,0,0,0,128,208Zm96-88h-8a8,8,0,0,0,0,16h8a8,8,0,0,0,0-16Z"></path></svg>
|
After Width: | Height: | Size: 621 B |
1
.config/awesome/assets/phosphor/sun-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"></path></svg>
|
After Width: | Height: | Size: 656 B |
1
.config/awesome/assets/phosphor/sun-horizon-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M248,160a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H56.45a73.54,73.54,0,0,1-.45-8,72,72,0,0,1,144,0,73.54,73.54,0,0,1-.45,8H240A8,8,0,0,1,248,160Zm-40,32H48a8,8,0,0,0,0,16H208a8,8,0,0,0,0-16ZM80.84,59.58a8,8,0,0,0,14.32-7.16l-8-16a8,8,0,0,0-14.32,7.16ZM20.42,103.16l16,8a8,8,0,1,0,7.16-14.31l-16-8a8,8,0,1,0-7.16,14.31ZM216,112a8,8,0,0,0,3.57-.84l16-8a8,8,0,1,0-7.16-14.31l-16,8A8,8,0,0,0,216,112ZM164.42,63.16a8,8,0,0,0,10.74-3.58l8-16a8,8,0,0,0-14.32-7.16l-8,16A8,8,0,0,0,164.42,63.16Z"></path></svg>
|
After Width: | Height: | Size: 600 B |
1
.config/awesome/assets/phosphor/triangle-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M236.78,211.81A24.34,24.34,0,0,1,215.45,224H40.55a24.34,24.34,0,0,1-21.33-12.19,23.51,23.51,0,0,1,0-23.72L106.65,36.22a24.76,24.76,0,0,1,42.7,0L236.8,188.09A23.51,23.51,0,0,1,236.78,211.81Z"></path></svg>
|
After Width: | Height: | Size: 314 B |
1
.config/awesome/assets/phosphor/wifi-high-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M244.35,92.8l-104,125.43A15.93,15.93,0,0,1,128,224h0a15.93,15.93,0,0,1-12.31-5.77L11.65,92.8A15.65,15.65,0,0,1,8.11,80.91,15.93,15.93,0,0,1,14.28,70.1,186.67,186.67,0,0,1,128,32,186.67,186.67,0,0,1,241.72,70.1a15.93,15.93,0,0,1,6.17,10.81A15.65,15.65,0,0,1,244.35,92.8Z"></path></svg>
|
After Width: | Height: | Size: 393 B |
1
.config/awesome/assets/phosphor/wifi-low-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M247.89,80.91a15.93,15.93,0,0,0-6.17-10.81A186.67,186.67,0,0,0,128,32,186.67,186.67,0,0,0,14.28,70.1,15.93,15.93,0,0,0,8.11,80.91,15.65,15.65,0,0,0,11.65,92.8l104,125.43A15.93,15.93,0,0,0,128,224h0a15.93,15.93,0,0,0,12.31-5.77h0l104-125.43A15.65,15.65,0,0,0,247.89,80.91Zm-77.52,76a75.89,75.89,0,0,0-84.74,0L24.09,82.74A170.76,170.76,0,0,1,128,48,170.76,170.76,0,0,1,231.91,82.74Z"></path></svg>
|
After Width: | Height: | Size: 504 B |
1
.config/awesome/assets/phosphor/wifi-medium-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M247.89,80.91a15.93,15.93,0,0,0-6.17-10.81A186.67,186.67,0,0,0,128,32,186.67,186.67,0,0,0,14.28,70.1,15.93,15.93,0,0,0,8.11,80.91,15.65,15.65,0,0,0,11.65,92.8l104,125.43A15.93,15.93,0,0,0,128,224h0a15.93,15.93,0,0,0,12.31-5.77h0l104-125.43A15.65,15.65,0,0,0,247.89,80.91Zm-46.77,38.94a124,124,0,0,0-146.24,0L24.09,82.74A170.76,170.76,0,0,1,128,48,170.76,170.76,0,0,1,231.91,82.74Z"></path></svg>
|
After Width: | Height: | Size: 504 B |
1
.config/awesome/assets/phosphor/wifi-none-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M247.89,80.91a15.93,15.93,0,0,0-6.17-10.81A186.67,186.67,0,0,0,128,32,186.67,186.67,0,0,0,14.28,70.1,15.93,15.93,0,0,0,8.11,80.91,15.65,15.65,0,0,0,11.65,92.8l104,125.43A15.93,15.93,0,0,0,128,224h0a15.93,15.93,0,0,0,12.31-5.77h0l104-125.43A15.65,15.65,0,0,0,247.89,80.91ZM128,208,24.09,82.74A170.76,170.76,0,0,1,128,48,170.76,170.76,0,0,1,231.91,82.74Z"></path></svg>
|
After Width: | Height: | Size: 476 B |
1
.config/awesome/assets/phosphor/wifi-x-fill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="#000000" viewBox="0 0 256 256"><path d="M229.51,98.13a8.21,8.21,0,0,1,.61,11.1,8,8,0,0,1-11.72.43L200.05,91.31l-18.34,18.35a8,8,0,0,1-11.72-.43,8.21,8.21,0,0,1,.61-11.1L188.74,80,170.63,61.89a8.21,8.21,0,0,1-.41-11.37,8,8,0,0,1,11.49-.18l18.34,18.35L218.4,50.34a8,8,0,0,1,11.49.18,8.21,8.21,0,0,1-.41,11.37L211.37,80ZM212,124.71a23.89,23.89,0,0,1-4.86-3.74l-4.21-4.2a4,4,0,0,0-5.65,0L193,121a24,24,0,0,1-34.21-.26c-9.19-9.48-8.69-24.73.65-34.06l3.81-3.82a4,4,0,0,0,0-5.66L159.06,73a24,24,0,0,1,.06-34h0a2.78,2.78,0,0,0-1.52-4.71A191.86,191.86,0,0,0,128,32,186.77,186.77,0,0,0,14.28,70.1,15.93,15.93,0,0,0,8.11,80.91,15.65,15.65,0,0,0,11.65,92.8L115.72,218.23A15.93,15.93,0,0,0,128,224h0a16,16,0,0,0,12.31-5.77l72.6-87.5A4,4,0,0,0,212,124.71Z"></path></svg>
|
After Width: | Height: | Size: 825 B |
19
.config/awesome/misc/autostart.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
local awful = require "awful"
|
||||
local quarrel = require "quarrel"
|
||||
|
||||
if quarrel.is_restart() then return end
|
||||
|
||||
local programs = {
|
||||
"picom -b",
|
||||
"sxhkd",
|
||||
"clipcatd",
|
||||
"wezterm",
|
||||
"wezterm start --class code_term",
|
||||
"firefox",
|
||||
"discord",
|
||||
"spotify"
|
||||
}
|
||||
|
||||
for _, program in ipairs(programs) do
|
||||
awful.spawn(program)
|
||||
end
|
|
@ -1,4 +0,0 @@
|
|||
local awful = require "awful"
|
||||
local gfs = require "gears.filesystem"
|
||||
|
||||
awful.spawn.once("bash " .. gfs.get_configuration_dir() .. "/misc/autostart/programs.sh")
|
|
@ -1,22 +0,0 @@
|
|||
function exe () {
|
||||
local cmd=$@
|
||||
if ! pgrep -x $(echo $cmd | cut -d " " -f1); then
|
||||
$cmd &
|
||||
fi
|
||||
}
|
||||
|
||||
function exe_lax () {
|
||||
local cmd=$@
|
||||
if ! pgrep $(echo $cmd | cut -d " " -f1); then
|
||||
$cmd &
|
||||
fi
|
||||
}
|
||||
|
||||
exe "picom -b"
|
||||
exe sxhkd
|
||||
exe clipcatd
|
||||
exe_lax wezterm
|
||||
exe_lax "wezterm start --class code_term"
|
||||
exe firefox
|
||||
exe spotify
|
||||
exe discord
|
|
@ -1,121 +0,0 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local xresources = require "beautiful.xresources"
|
||||
local n = require "naughty".notification
|
||||
local dpi = xresources.apply_dpi
|
||||
local vars = require "misc.vars"
|
||||
local wibox = require "wibox"
|
||||
|
||||
local h = {}
|
||||
|
||||
-- utils
|
||||
|
||||
function h.debug(message)
|
||||
n { message = tostring(message) }
|
||||
end
|
||||
|
||||
function h.map(t, f)
|
||||
local nt = {}
|
||||
for k,v in pairs(t) do
|
||||
nt[k] = f(v)
|
||||
end
|
||||
return nt
|
||||
end
|
||||
|
||||
function h.filter(t, f, dict)
|
||||
local nt = {}
|
||||
for k,v in pairs(t) do
|
||||
if not f(v) then goto continue end
|
||||
if dict then
|
||||
nt[k] = v
|
||||
else
|
||||
table.insert(nt, v)
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
return nt
|
||||
end
|
||||
|
||||
-- This is taken from http://lua-users.org/wiki/SortedIteration
|
||||
-- This version is stripped of comments and empty lines + some stuff is renamed
|
||||
|
||||
local function __gen_oindex( t )
|
||||
local oindex = {}
|
||||
for key in pairs(t) do
|
||||
table.insert(oindex, key)
|
||||
end
|
||||
table.sort(oindex)
|
||||
return oindex
|
||||
end
|
||||
|
||||
local function onext(t, state)
|
||||
local key = nil
|
||||
if state == nil then
|
||||
t.__oindex = __gen_oindex(t)
|
||||
key = t.__oindex[1]
|
||||
else
|
||||
for i = 1,#t.__oindex do
|
||||
if t.__oindex[i] == state then
|
||||
key = t.__oindex[i+1]
|
||||
end
|
||||
end
|
||||
end
|
||||
if key then
|
||||
return key, t[key]
|
||||
end
|
||||
t.__oindex = nil
|
||||
end
|
||||
|
||||
function h.opairs(t)
|
||||
return onext, t, nil
|
||||
end
|
||||
|
||||
-- markup
|
||||
|
||||
function h.markup_fg(color, text)
|
||||
return "<span color=\"" .. color .. "\">" .. text .. "</span>"
|
||||
end
|
||||
|
||||
function h.markup_bg(color, text)
|
||||
return "<span bgcolor=\"" .. color .. "\">" .. text .. "</span>"
|
||||
end
|
||||
|
||||
-- ui
|
||||
|
||||
function h.font(factor)
|
||||
return vars.text_font .. " " .. vars.font_size * (factor or 1)
|
||||
end
|
||||
|
||||
function h.symbol_font(factor)
|
||||
return vars.symbol_font .. " " .. vars.font_size * (factor or 1)
|
||||
end
|
||||
|
||||
function h.styled(target)
|
||||
return gears.table.crush({
|
||||
bg = vars.colors.bg,
|
||||
border_color = vars.colors.bright.black,
|
||||
border_width = vars.border_width,
|
||||
shape = vars.shape
|
||||
}, target)
|
||||
end
|
||||
|
||||
function h.popup(args)
|
||||
args.widget = {
|
||||
widget = wibox.container.margin,
|
||||
margins = vars.big_padding,
|
||||
args.widget
|
||||
}
|
||||
|
||||
return awful.popup(h.styled(args))
|
||||
end
|
||||
|
||||
function h.tooltip(objects, callback)
|
||||
awful.tooltip(h.styled {
|
||||
objects = objects,
|
||||
timer_function = callback,
|
||||
margin_leftright = vars.padding,
|
||||
margin_topbottom = vars.padding
|
||||
})
|
||||
end
|
||||
|
||||
return h
|
|
@ -1,5 +1,3 @@
|
|||
require "misc.setup"
|
||||
require "misc.signals"
|
||||
require "misc.keys"
|
||||
require "misc.rules"
|
||||
require "misc.autostart"
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local gtimer = require "gears.timer"
|
||||
local naughty = require "naughty"
|
||||
local cfg = require "misc.cfg"
|
||||
local qbind = require "quarrel.bind"
|
||||
local insightful = require "ui.insightful"
|
||||
local archaic = require "ui.archaic"
|
||||
local fresnel = require "ui.fresnel"
|
||||
local vars = require "misc.vars"
|
||||
local btn = awful.button.names
|
||||
local flashy = require "ui.flashy"
|
||||
local qvars = require "quarrel.vars"
|
||||
|
||||
local recording = { false, "" }
|
||||
|
||||
client.connect_signal("request::default_mousebindings", function()
|
||||
awful.mouse.append_client_mousebindings {
|
||||
insightful:bind {
|
||||
mods = {},
|
||||
triggers = btn.LEFT,
|
||||
qbind:new {
|
||||
triggers = qvars.btns.left,
|
||||
press = function (c)
|
||||
c:activate {
|
||||
context = "mouse_click"
|
||||
|
@ -23,9 +23,9 @@ client.connect_signal("request::default_mousebindings", function()
|
|||
group = "client",
|
||||
desc = "raise client"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
triggers = btn.LEFT,
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = qvars.btns.left,
|
||||
press = function (c)
|
||||
c:activate {
|
||||
context = "mouse_click",
|
||||
|
@ -35,9 +35,9 @@ client.connect_signal("request::default_mousebindings", function()
|
|||
group = "client",
|
||||
desc = "move client"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
triggers = btn.RIGHT,
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = qvars.btns.right,
|
||||
press = function (c)
|
||||
c:activate {
|
||||
context = "mouse_click",
|
||||
|
@ -50,35 +50,82 @@ client.connect_signal("request::default_mousebindings", function()
|
|||
}
|
||||
end)
|
||||
|
||||
local globalkeys = gears.table.join(
|
||||
insightful:bind {
|
||||
mods = vars.mods.MC,
|
||||
client.connect_signal("request::default_keybindings", function()
|
||||
awful.keyboard.append_client_keybindings {
|
||||
qbind:new {
|
||||
mods = qvars.mods.MC,
|
||||
triggers = "q",
|
||||
press = function(c)
|
||||
c:kill()
|
||||
end,
|
||||
group = "client",
|
||||
desc = "close"
|
||||
},
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = "m",
|
||||
press = function(c)
|
||||
c.maximized = not c.maximized
|
||||
end,
|
||||
group = "client",
|
||||
desc = "(un)maximize"
|
||||
},
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = "n",
|
||||
press = function(c)
|
||||
gtimer.delayed_call(function()
|
||||
c.minimized = true
|
||||
end)
|
||||
end,
|
||||
group = "client",
|
||||
desc = "minimize"
|
||||
},
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = "f",
|
||||
press = function(c)
|
||||
c.fullscreen = not c.fullscreen
|
||||
end,
|
||||
group = "client",
|
||||
desc = "toggle fullscreen"
|
||||
}
|
||||
}
|
||||
end)
|
||||
|
||||
awful.keyboard.append_global_keybindings {
|
||||
qbind:new {
|
||||
mods = qvars.mods.MC,
|
||||
triggers = "r",
|
||||
press = awesome.restart,
|
||||
group = "awesome",
|
||||
desc = "restart awesome"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.MC,
|
||||
triggers = "s",
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = "F1",
|
||||
press = function()
|
||||
insightful:toggle()
|
||||
end,
|
||||
group = "awesome",
|
||||
desc = "toggle insightful"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.MC,
|
||||
qbind:new {
|
||||
mods = qvars.mods.MC,
|
||||
triggers = "a",
|
||||
press = function()
|
||||
archaic:toggle()
|
||||
if flashy._widget.visible then
|
||||
flashy:hide()
|
||||
else
|
||||
flashy:show()
|
||||
end
|
||||
end,
|
||||
group = "awesome",
|
||||
desc = "toggle notification center"
|
||||
desc = "toggle flashy"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
triggers = " ",
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = "space",
|
||||
press = function()
|
||||
fresnel:show()
|
||||
end,
|
||||
|
@ -86,7 +133,7 @@ local globalkeys = gears.table.join(
|
|||
desc = "toggle fresnel"
|
||||
},
|
||||
|
||||
insightful:bind {
|
||||
qbind:new {
|
||||
mods = {},
|
||||
triggers = "XF86AudioMute",
|
||||
press = function()
|
||||
|
@ -95,7 +142,7 @@ local globalkeys = gears.table.join(
|
|||
group = "audio",
|
||||
desc = "mute"
|
||||
},
|
||||
insightful:bind {
|
||||
qbind:new {
|
||||
mods = {},
|
||||
triggers = {
|
||||
{ "XF86AudioRaiseVolume", true },
|
||||
|
@ -111,7 +158,7 @@ local globalkeys = gears.table.join(
|
|||
group = "audio",
|
||||
desc = "increase/decrease volume"
|
||||
},
|
||||
insightful:bind {
|
||||
qbind:new {
|
||||
mods = {},
|
||||
triggers = {
|
||||
{ "XF86AudioNext", true },
|
||||
|
@ -127,7 +174,7 @@ local globalkeys = gears.table.join(
|
|||
group = "audio",
|
||||
desc = "previous/next song"
|
||||
},
|
||||
insightful:bind {
|
||||
qbind:new {
|
||||
mods = {},
|
||||
triggers = "XF86AudioPlay",
|
||||
press = function()
|
||||
|
@ -137,7 +184,7 @@ local globalkeys = gears.table.join(
|
|||
desc = "(un)pause song"
|
||||
},
|
||||
|
||||
insightful:bind {
|
||||
qbind:new {
|
||||
mods = {},
|
||||
triggers = {
|
||||
{ "XF86MonBrightnessUp", true },
|
||||
|
@ -154,8 +201,8 @@ local globalkeys = gears.table.join(
|
|||
desc = "increase/decrease brightness"
|
||||
},
|
||||
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = "Return",
|
||||
press = function()
|
||||
awful.spawn(cfg.terminal)
|
||||
|
@ -164,94 +211,35 @@ local globalkeys = gears.table.join(
|
|||
desc = "launch terminal"
|
||||
},
|
||||
|
||||
insightful:bind {
|
||||
mods = vars.mods.MC,
|
||||
triggers = "q",
|
||||
press = function()
|
||||
local c = client.focus
|
||||
if c then
|
||||
c:kill()
|
||||
end
|
||||
end,
|
||||
group = "client",
|
||||
desc = "close"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
triggers = "m",
|
||||
press = function()
|
||||
local c = client.focus
|
||||
if c then
|
||||
c.maximized = not c.maximized
|
||||
end
|
||||
end,
|
||||
group = "client",
|
||||
desc = "(un)maximize"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
triggers = "n",
|
||||
press = function()
|
||||
local c = client.focus
|
||||
if c then
|
||||
gears.timer.delayed_call(function()
|
||||
c.minimized = true
|
||||
end)
|
||||
end
|
||||
end,
|
||||
group = "client",
|
||||
desc = "minimize"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
triggers = "f",
|
||||
press = function()
|
||||
local c = client.focus
|
||||
if c then
|
||||
c.fullscreen = not c.fullscreen
|
||||
end
|
||||
end,
|
||||
group = "client",
|
||||
desc = "toggle fullscreen"
|
||||
},
|
||||
|
||||
insightful:bind {
|
||||
qbind:new {
|
||||
mods = {},
|
||||
triggers = "Print",
|
||||
press = function()
|
||||
local date = os.date("%Y%m%d_%H%M%S")
|
||||
local path = os.getenv("HOME") .. "/Pictures/" .. date .. ".png"
|
||||
|
||||
awful.spawn.with_shell("maim --hidecursor " .. path .. " && xclip -selection clipboard -t image/png " .. path)
|
||||
naughty.notification {
|
||||
app_name = "Maim",
|
||||
title = "Screenshot taken",
|
||||
message = "Saved at " .. path
|
||||
}
|
||||
-- Can't use naughty.notification cause it gets in the screenshot
|
||||
-- Also can't use easy_async_with_shell cause it's buggy
|
||||
awful.spawn.with_shell("maim --hidecursor " .. path .. " && xclip -selection clipboard -t image/png " .. path .. [[ && notify-send -a "Maim" "Screenshot taken" "Saved at ]] .. path .. [["]])
|
||||
end,
|
||||
group = "screenshot",
|
||||
desc = "take fullscreen screenshot"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.S,
|
||||
qbind:new {
|
||||
mods = qvars.mods.S,
|
||||
triggers = "Print",
|
||||
press = function()
|
||||
local date = os.date("%Y%m%d_%H%M%S")
|
||||
local path = os.getenv("HOME") .. "/Pictures/" .. date .. ".png"
|
||||
|
||||
awful.spawn.with_shell("maim --hidecursor -s " .. path .. " && xclip -selection clipboard -t image/png " .. path .. [[ && notify-send -a "Maim" "Screenshot taken" "Saved at ]] .. path .. [["]])
|
||||
-- naughty.notification {
|
||||
-- app_name = "Maim",r
|
||||
-- title = "Screenshot taken",
|
||||
-- message = "Saved at " .. path
|
||||
-- }
|
||||
end,
|
||||
group = "screenshot",
|
||||
desc = "take region screenshot"
|
||||
},
|
||||
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = "Print",
|
||||
press = function()
|
||||
if recording[1] then
|
||||
|
@ -277,8 +265,8 @@ local globalkeys = gears.table.join(
|
|||
desc = "toggle recording"
|
||||
},
|
||||
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = "k",
|
||||
press = function()
|
||||
awful.spawn("xkblayout-state set +1")
|
||||
|
@ -286,8 +274,8 @@ local globalkeys = gears.table.join(
|
|||
group = "keyboard",
|
||||
desc = "next keyboard layout"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.MS,
|
||||
qbind:new {
|
||||
mods = qvars.mods.MS,
|
||||
triggers = "k",
|
||||
press = function()
|
||||
awful.spawn("xkblayout-state set -1")
|
||||
|
@ -296,23 +284,18 @@ local globalkeys = gears.table.join(
|
|||
desc = "previous keyboard layout"
|
||||
},
|
||||
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = "Up",
|
||||
press = awful.tag.viewprev,
|
||||
group = "tag",
|
||||
desc = "switch to previous"
|
||||
},
|
||||
insightful:bind {
|
||||
mods = vars.mods.M,
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = "Down",
|
||||
press = awful.tag.viewnext,
|
||||
group = "tag",
|
||||
desc = "switch to next"
|
||||
}
|
||||
)
|
||||
|
||||
-- gears.debug.dump(insightful:bind.hottriggerss)
|
||||
|
||||
root.keys(globalkeys)
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
local ruled = require "ruled"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require "awful"
|
||||
local vars = require "misc.vars"
|
||||
|
||||
ruled.client.connect_signal("request::rules", function()
|
||||
ruled.client.append_rule({
|
||||
|
@ -15,9 +14,7 @@ ruled.client.connect_signal("request::rules", function()
|
|||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.centered+awful.placement.no_offscreen,
|
||||
floating = false,
|
||||
-- shape = vars.shape,
|
||||
honor_padding = true
|
||||
-- tag = "1"
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -47,7 +44,7 @@ ruled.client.connect_signal("request::rules", function()
|
|||
ruled.client.append_rule({
|
||||
id = "browser_tag",
|
||||
rule_any = {
|
||||
class = { "firefox" }
|
||||
instance = { "Navigator" }
|
||||
},
|
||||
properties = {
|
||||
screen = 1,
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
local naughty = require "naughty"
|
||||
local beautiful = require "beautiful"
|
||||
-- local notif_overlay = require "ui.notifs"
|
||||
local wicked = require "ui.wicked"
|
||||
local awful = require "awful"
|
||||
local rubato = require "lib.rubato"
|
||||
local vars = require "misc.vars"
|
||||
|
||||
-- naughty.connect_signal("request::display", function(n)
|
||||
-- notif_overlay:notify(n)
|
||||
-- end)
|
||||
|
||||
naughty.connect_signal("request::display", function(n)
|
||||
naughty.layout.box {
|
||||
notification = n,
|
||||
placement = function(d)
|
||||
return awful.placement.right(d, {
|
||||
margins = beautiful.useless_gap * 2
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
-- wicked:.notify(n)
|
||||
end)
|
||||
|
||||
naughty.connect_signal("request::display_error", function(message, startup)
|
||||
naughty.notification {
|
||||
urgency = "critical",
|
||||
title = "Oops, an error happened"..(startup and " during startup!" or "!"),
|
||||
message = message
|
||||
}
|
||||
end)
|
||||
|
||||
-- Taken from https://www.reddit.com/r/awesomewm/comments/syjolb/comment/hy0xy35/
|
||||
|
||||
awesome.connect_signal('exit', function(reason_restart)
|
||||
if not reason_restart then return end
|
||||
|
||||
local file = io.open('/tmp/awesomewm-last-selected-tags', 'w+')
|
||||
|
||||
for s in screen do
|
||||
file:write(s.selected_tag.index, '\n')
|
||||
end
|
||||
|
||||
file:close()
|
||||
end)
|
||||
|
||||
awesome.connect_signal('startup', function()
|
||||
local file = io.open('/tmp/awesomewm-last-selected-tags', 'r')
|
||||
if not file then return end
|
||||
|
||||
local selected_tags = {}
|
||||
|
||||
for line in file:lines() do
|
||||
table.insert(selected_tags, tonumber(line))
|
||||
end
|
||||
|
||||
for s in screen do
|
||||
local i = selected_tags[s.index]
|
||||
local t = s.tags[i]
|
||||
t:view_only()
|
||||
end
|
||||
|
||||
file:close()
|
||||
end)
|
|
@ -1,61 +1,43 @@
|
|||
local xresources = require "beautiful.xresources"
|
||||
local dpi = xresources.apply_dpi
|
||||
|
||||
local g = require("gears")
|
||||
local naughty = require("naughty")
|
||||
|
||||
local vars = require "misc.vars"
|
||||
local qvars = require "quarrel.vars"
|
||||
|
||||
local theme = {}
|
||||
|
||||
theme.font = vars.font
|
||||
theme.font = qvars.font
|
||||
|
||||
theme.bg_normal = vars.colors.bg
|
||||
theme.bg_focus = vars.colors.bg
|
||||
theme.bg_urgent = vars.colors.bg
|
||||
theme.bg_minimize = vars.colors.bg
|
||||
theme.bg_systray = vars.colors.bg
|
||||
theme.bg_normal = qvars.colors.bg
|
||||
theme.bg_focus = qvars.colors.bg
|
||||
theme.bg_urgent = qvars.colors.bg
|
||||
theme.bg_minimize = qvars.colors.bg
|
||||
theme.bg_systray = qvars.colors.bg
|
||||
|
||||
theme.fg_normal = vars.colors.fg
|
||||
theme.fg_focus = vars.colors.fg
|
||||
theme.fg_urgent = vars.colors.fg
|
||||
theme.fg_minimize = vars.colors.fg
|
||||
theme.fg_normal = qvars.colors.fg
|
||||
theme.fg_focus = qvars.colors.fg
|
||||
theme.fg_urgent = qvars.colors.fg
|
||||
theme.fg_minimize = qvars.colors.fg
|
||||
|
||||
theme.useless_gap = dpi(2)
|
||||
theme.border_width = vars.border_width
|
||||
theme.border_normal = vars.colors.bright.black
|
||||
theme.border_focus = vars.colors.bright.black
|
||||
theme.border_marked = vars.colors.bright.black
|
||||
|
||||
theme.titlebar_close_button_normal = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.red, "transparent", 4)
|
||||
theme.titlebar_close_button_focus = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.red, "transparent", 4)
|
||||
theme.titlebar_close_button_normal_hover = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.bright.red, "transparent", 4)
|
||||
theme.titlebar_close_button_focus_hover = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.bright.red, "transparent", 4)
|
||||
|
||||
theme.titlebar_minimize_button_normal = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.yellow, "transparent", 4)
|
||||
theme.titlebar_minimize_button_focus = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.yellow, "transparent", 4)
|
||||
theme.titlebar_minimize_button_normal_hover = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.bright.yellow, "transparent", 4)
|
||||
theme.titlebar_minimize_button_focus_hover = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.bright.yellow, "transparent", 4)
|
||||
|
||||
theme.titlebar_maximized_button_normal_inactive = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.green, "transparent", 4)
|
||||
theme.titlebar_maximized_button_focus_inactive = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.green, "transparent", 4)
|
||||
theme.titlebar_maximized_button_normal_inactive_hover = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.bright.green, "transparent", 4)
|
||||
theme.titlebar_maximized_button_normal_active = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.bright.green, "transparent", 4)
|
||||
theme.titlebar_maximized_button_focus_active = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.bright.green, "transparent", 4)
|
||||
theme.titlebar_maximized_button_normal_active_hover = g.surface.load_from_shape(15, 15, g.shape.rounded_rect, vars.colors.green, "transparent", 4)
|
||||
theme.border_width = qvars.border_width
|
||||
theme.border_normal = qvars.colors.bright.black
|
||||
theme.border_focus = qvars.colors.bright.black
|
||||
theme.border_marked = qvars.colors.bright.black
|
||||
|
||||
theme.notification_icon_size = dpi(32)
|
||||
theme.notification_border_width = vars.border_width
|
||||
theme.notification_border_width = qvars.border_width
|
||||
theme.notification_border_color = theme.border_normal
|
||||
theme.notification_shape = vars.shape
|
||||
theme.notification_shape = qvars.shape
|
||||
theme.notification_spacing = theme.useless_gap * 2
|
||||
|
||||
naughty.config.presets.critical.bg = theme.bg_normal
|
||||
naughty.config.presets.critical.timeout = 3
|
||||
naughty.config.presets.critical.fg = theme.fg_normal
|
||||
naughty.config.presets.critical.border_color = vars.colors.red
|
||||
naughty.config.presets.critical.border_color = qvars.colors.red
|
||||
naughty.config.defaults.position = "bottom_right"
|
||||
naughty.config.defaults.border_width = vars.border_width
|
||||
naughty.config.defaults.border_width = qvars.border_width
|
||||
|
||||
theme.tasklist_plain_task_name = true
|
||||
theme.enable_spawn_cursor = false
|
||||
|
|
61
.config/awesome/quarrel/bind.lua
Normal file
|
@ -0,0 +1,61 @@
|
|||
local awful = require "awful"
|
||||
local gtable = require "gears.table"
|
||||
local insightful = require "ui.insightful"
|
||||
|
||||
local qbind = {}
|
||||
|
||||
local function get_binding_function(trigger)
|
||||
if type(trigger) == "number" and trigger <= 5 and trigger > 0 then
|
||||
return "button"
|
||||
elseif type(trigger) == "string" then
|
||||
return "key"
|
||||
end
|
||||
error("trigger can only be a mouse button or a key", 2)
|
||||
end
|
||||
|
||||
local function translate_binding(binding, trigger, multiple)
|
||||
local value = nil
|
||||
if multiple then
|
||||
value = trigger[2]
|
||||
trigger = trigger[1]
|
||||
end
|
||||
|
||||
local awful_binding = {
|
||||
modifiers = binding.mods,
|
||||
[get_binding_function(trigger)] = trigger,
|
||||
on_press = multiple and function(...) binding.press(value, ...) end or binding.press
|
||||
}
|
||||
|
||||
if binding.desc then
|
||||
awful_binding.description = binding.desc
|
||||
end
|
||||
if binding.group then
|
||||
awful_binding.group = binding.group
|
||||
end
|
||||
|
||||
return awful[get_binding_function(trigger)](awful_binding)
|
||||
end
|
||||
|
||||
function qbind:new(binding)
|
||||
if not binding.hidden then table.insert(insightful._bindings, binding) end
|
||||
binding.mods = binding.mods or {}
|
||||
|
||||
local awful_bindings = {}
|
||||
|
||||
if type(binding.triggers) == "table" then
|
||||
for _, trigger in ipairs(binding.triggers) do
|
||||
table.insert(awful_bindings, translate_binding(binding, trigger, true))
|
||||
end
|
||||
elseif type(binding.triggers) == "string" or type(binding.triggers) == "number" then
|
||||
return translate_binding(binding, binding.triggers, false)
|
||||
else
|
||||
error("binding.triggers can only be a string or a table")
|
||||
end
|
||||
|
||||
-- for some reason multi-trigger bindings only work if i do this
|
||||
-- i spent a day debugging this
|
||||
-- thanks awesome
|
||||
return gtable.join(table.unpack(awful_bindings))
|
||||
end
|
||||
|
||||
return qbind
|
29
.config/awesome/quarrel/fs.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
local GFile = require "lgi".Gio.File
|
||||
|
||||
local qfs = {}
|
||||
|
||||
function qfs.read(path, format)
|
||||
local f = assert(io.open(path, "r"))
|
||||
local c = f:read(format or "a")
|
||||
f:close()
|
||||
return c
|
||||
end
|
||||
|
||||
function qfs.ls_files(path, absolute)
|
||||
local files = GFile.new_for_path(path):enumerate_children("standard::*", 0)
|
||||
local files_filtered = {}
|
||||
|
||||
if not files then return {} end
|
||||
|
||||
for file in function() return files:next_file() end do
|
||||
if file:get_file_type() == "REGULAR" then
|
||||
local file_name = file:get_display_name()
|
||||
file_name = absolute and (path:gsub("[/]*$", "") .. "/" .. file_name) or file_name
|
||||
table.insert(files_filtered, file_name)
|
||||
end
|
||||
end
|
||||
|
||||
return files_filtered
|
||||
end
|
||||
|
||||
return qfs
|
17
.config/awesome/quarrel/init.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
local n = require "naughty".notification
|
||||
|
||||
local quarrel = {}
|
||||
|
||||
function quarrel.debug(message)
|
||||
n { message = tostring(message) }
|
||||
end
|
||||
|
||||
function quarrel.is_restart()
|
||||
awesome.register_xproperty("is_restart", "boolean")
|
||||
local restart_detected = awesome.get_xproperty("is_restart") ~= nil
|
||||
awesome.set_xproperty("is_restart", true)
|
||||
|
||||
return restart_detected
|
||||
end
|
||||
|
||||
return quarrel
|
19
.config/awesome/quarrel/math.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
local qmath = {}
|
||||
|
||||
function qmath.step_value(value, steps)
|
||||
for i, step in ipairs(steps) do
|
||||
if step[1] <= value and value <= steps[i + 1][1] then
|
||||
return step[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function qmath.translate_range(value, in_min, in_max, out_min, out_max)
|
||||
return out_min + ((out_max - out_min) / (in_max - in_min)) * (value - in_min)
|
||||
end
|
||||
|
||||
function qmath.clamp(value, min, max)
|
||||
return math.max(math.min(value, max), min)
|
||||
end
|
||||
|
||||
return qmath
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "lenses"
|
||||
name = "qnative"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
|
@ -7,8 +7,10 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
freedesktop_entry_parser = "1.3.0"
|
||||
meval = "0.2.0"
|
||||
# meval = "0.2.0"
|
||||
cpc = "1.9.1"
|
||||
mlua = { version = "0.8.7", features = [ "module", "lua54", "serialize" ] }
|
||||
palette = { version = "0.6.1", default-features = false, features = [ "std" ] }
|
||||
parking_lot = "0.12.1"
|
||||
rayon = "1.6.1"
|
||||
serde = { version = "1.0.152", features = [ "derive" ] }
|
6
.config/awesome/quarrel/native/init.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
local old_cpath = package.cpath
|
||||
local cfg = require("gears.filesystem").get_configuration_dir()
|
||||
package.cpath = package.cpath .. ";" .. cfg .. "quarrel/native/lib?.so"
|
||||
local qnative = require "qnative"
|
||||
package.cpath = old_cpath
|
||||
return qnative
|
1
.config/awesome/quarrel/native/libqnative.so
Symbolic link
|
@ -0,0 +1 @@
|
|||
target/debug/libqnative.so
|
|
@ -9,12 +9,12 @@ use parking_lot::Mutex;
|
|||
use rayon::prelude::*;
|
||||
use url::Url;
|
||||
|
||||
use crate::entry::{
|
||||
use crate::lenses::entry::{
|
||||
entries_to_lua_table,
|
||||
Entry,
|
||||
};
|
||||
|
||||
fn parse_entry<'a>(entry: fd::Entry, path: PathBuf) -> Result<Entry, ()> {
|
||||
fn parse_entry(entry: &fd::Entry, path: &PathBuf) -> Result<Entry, ()> {
|
||||
let section = entry.section("Desktop Entry");
|
||||
let name = section.attr("Name").ok_or(())?.to_string();
|
||||
|
||||
|
@ -22,31 +22,24 @@ fn parse_entry<'a>(entry: fd::Entry, path: PathBuf) -> Result<Entry, ()> {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
match section.attr("OnlyShowIn") {
|
||||
Some(_) => return Err(()),
|
||||
None => {}
|
||||
}
|
||||
|
||||
match section.attr("Hidden") {
|
||||
Some(_) => return Err(()),
|
||||
None => {}
|
||||
}
|
||||
|
||||
match section.attr("NoDisplay") {
|
||||
Some(_) => return Err(()),
|
||||
None => {}
|
||||
if section.attr("OnlyShowIn").is_some()
|
||||
|| section.attr("Hidden").is_some()
|
||||
|| section.attr("NoDisplay").is_some()
|
||||
{
|
||||
return Err(());
|
||||
}
|
||||
|
||||
let exec = section.attr("Exec").ok_or(())?.to_string();
|
||||
let mut new_exec = exec.clone();
|
||||
for (index, _) in exec.match_indices("%") {
|
||||
for (index, _) in exec.match_indices('%') {
|
||||
match exec.chars().nth(index + 1).unwrap().to_ascii_lowercase() {
|
||||
'i' => match section.attr("Icon") {
|
||||
Some(icon) => new_exec.replace_range(index..index + 2, &format!("--icon {}", icon)),
|
||||
None => {}
|
||||
},
|
||||
'i' => {
|
||||
if let Some(icon) = section.attr("Icon") {
|
||||
new_exec.replace_range(index..index + 2, &format!("--icon {icon}"));
|
||||
}
|
||||
}
|
||||
'c' => new_exec.replace_range(index..index + 2, &name),
|
||||
'k' => new_exec.replace_range(index..index + 2, Url::from_file_path(&path)?.as_str()),
|
||||
'k' => new_exec.replace_range(index..index + 2, Url::from_file_path(path)?.as_str()),
|
||||
|
||||
'f' | 'u' | 'v' | 'm' | 'd' | 'n' => new_exec.replace_range(index..index + 2, ""),
|
||||
_ => continue,
|
||||
|
@ -75,23 +68,18 @@ pub fn query(lua: &Lua, input: String) -> LuaResult<LuaTable> {
|
|||
|
||||
let entries = entries
|
||||
.into_iter()
|
||||
.filter(|e| match e.extension() {
|
||||
Some(ext) if ext == "desktop" => true,
|
||||
None | _ => false,
|
||||
})
|
||||
.filter(|e| matches!(e.extension(), Some(ext) if ext == "desktop"))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let mut parsed_entries: Mutex<Vec<Entry>> = Mutex::new(Vec::new());
|
||||
|
||||
entries.into_par_iter().for_each(|path| {
|
||||
let entry = match fd::parse_entry(&path) {
|
||||
Ok(entry) => entry,
|
||||
Err(_) => return,
|
||||
let Ok(entry) = fd::parse_entry(&path) else {
|
||||
return
|
||||
};
|
||||
|
||||
match parse_entry(entry, path) {
|
||||
Ok(parsed_entry) => parsed_entries.lock().push(parsed_entry),
|
||||
Err(_) => return,
|
||||
if let Ok(parsed_entry) = parse_entry(&entry, &path) {
|
||||
parsed_entries.lock().push(parsed_entry);
|
||||
}
|
||||
});
|
||||
|
36
.config/awesome/quarrel/native/src/lenses/calculator.rs
Normal file
|
@ -0,0 +1,36 @@
|
|||
// use meval::eval_str;
|
||||
use cpc::{
|
||||
eval,
|
||||
units::Unit,
|
||||
};
|
||||
use mlua::prelude::*;
|
||||
|
||||
use crate::lenses::entry::{
|
||||
entries_to_lua_table,
|
||||
Entry,
|
||||
};
|
||||
|
||||
pub fn query<'a>(lua: &Lua, input: String) -> LuaResult<LuaTable> {
|
||||
let result = match eval(input.trim(), true, Unit::Celsius, false) {
|
||||
Ok(result) => {
|
||||
format!(
|
||||
"{}{}",
|
||||
result.value,
|
||||
match result.unit {
|
||||
Unit::NoUnit => "".to_owned(),
|
||||
_ => format!(" {:?}", result.unit),
|
||||
}
|
||||
)
|
||||
}
|
||||
Err(_) => return lua.create_table(),
|
||||
};
|
||||
|
||||
Ok(entries_to_lua_table(
|
||||
vec![Entry {
|
||||
message: result,
|
||||
exec: None,
|
||||
provider: "Calculator".to_string(),
|
||||
}],
|
||||
lua,
|
||||
))
|
||||
}
|
|
@ -8,7 +8,6 @@ use serde::Serialize;
|
|||
pub struct Entry {
|
||||
pub message: String,
|
||||
pub exec: Option<(String, bool)>,
|
||||
// pub icon: char,
|
||||
pub provider: String,
|
||||
}
|
||||
|
3
.config/awesome/quarrel/native/src/lenses/mod.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
pub mod application;
|
||||
pub mod calculator;
|
||||
pub mod entry;
|
15
.config/awesome/quarrel/native/src/lib.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
mod lenses;
|
||||
|
||||
use mlua::prelude::*;
|
||||
|
||||
#[mlua::lua_module]
|
||||
fn qnative(lua: &Lua) -> LuaResult<LuaTable> {
|
||||
let lenses = lua.create_table()?;
|
||||
lenses.set("1", lua.create_function(lenses::calculator::query)?)?;
|
||||
lenses.set("2", lua.create_function(lenses::application::query)?)?;
|
||||
|
||||
let exports = lua.create_table()?;
|
||||
exports.set("lenses", lenses)?;
|
||||
|
||||
Ok(exports)
|
||||
}
|
59
.config/awesome/quarrel/table.lua
Normal file
|
@ -0,0 +1,59 @@
|
|||
local qtable = {}
|
||||
|
||||
function qtable.map(t, f)
|
||||
local nt = {}
|
||||
for k,v in pairs(t) do
|
||||
nt[k] = f(v)
|
||||
end
|
||||
return nt
|
||||
end
|
||||
|
||||
function qtable.filter(t, f, dict)
|
||||
local nt = {}
|
||||
for k,v in pairs(t) do
|
||||
if not f(v) then goto continue end
|
||||
if dict then
|
||||
nt[k] = v
|
||||
else
|
||||
table.insert(nt, v)
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
return nt
|
||||
end
|
||||
|
||||
-- This is taken from http://lua-users.org/wiki/SortedIteration
|
||||
-- This version is stripped of comments and empty lines + some stuff is renamed
|
||||
|
||||
local function __gen_oindex(t)
|
||||
local oindex = {}
|
||||
for key in pairs(t) do
|
||||
table.insert(oindex, key)
|
||||
end
|
||||
table.sort(oindex)
|
||||
return oindex
|
||||
end
|
||||
|
||||
function qtable.onext(t, state)
|
||||
local key = nil
|
||||
if state == nil then
|
||||
t.__oindex = __gen_oindex(t)
|
||||
key = t.__oindex[1]
|
||||
else
|
||||
for i = 1,#t.__oindex do
|
||||
if t.__oindex[i] == state then
|
||||
key = t.__oindex[i+1]
|
||||
end
|
||||
end
|
||||
end
|
||||
if key then
|
||||
return key, t[key]
|
||||
end
|
||||
t.__oindex = nil
|
||||
end
|
||||
|
||||
function qtable.opairs(t)
|
||||
return qtable.onext, t, nil
|
||||
end
|
||||
|
||||
return qtable
|
52
.config/awesome/quarrel/ui.lua
Normal file
|
@ -0,0 +1,52 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
|
||||
local qui = {}
|
||||
|
||||
function qui.markup_fg(color, text)
|
||||
return "<span color=\"" .. color .. "\">" .. text .. "</span>"
|
||||
end
|
||||
|
||||
function qui.markup_bg(color, text)
|
||||
return "<span bgcolor=\"" .. color .. "\">" .. text .. "</span>"
|
||||
end
|
||||
|
||||
function qui.font(factor)
|
||||
return qvars.text_font .. " " .. qvars.font_size * (factor or 1)
|
||||
end
|
||||
|
||||
function qui.symbol_font(factor)
|
||||
return qvars.symbol_font .. " " .. qvars.font_size * (factor or 1)
|
||||
end
|
||||
|
||||
function qui.styled(target)
|
||||
return gears.table.crush({
|
||||
bg = qvars.colors.bg,
|
||||
border_color = qvars.colors.bright.black,
|
||||
border_width = qvars.border_width,
|
||||
shape = qvars.shape
|
||||
}, target)
|
||||
end
|
||||
|
||||
function qui.popup(args)
|
||||
args.widget = {
|
||||
widget = wibox.container.margin,
|
||||
margins = qvars.big_padding,
|
||||
args.widget
|
||||
}
|
||||
|
||||
return awful.popup(qui.styled(args))
|
||||
end
|
||||
|
||||
function qui.tooltip(objects, callback)
|
||||
awful.tooltip(qui.styled {
|
||||
objects = objects,
|
||||
timer_function = callback,
|
||||
margin_leftright = qvars.padding,
|
||||
margin_topbottom = qvars.padding
|
||||
})
|
||||
end
|
||||
|
||||
return qui
|
|
@ -1,43 +1,45 @@
|
|||
local btns = require "awful".button.names
|
||||
local gears = require "gears"
|
||||
local xresources = require "beautiful.xresources"
|
||||
local x_col = xresources.get_current_theme()
|
||||
local dpi = xresources.apply_dpi
|
||||
local wibox = require "wibox"
|
||||
|
||||
local v = {}
|
||||
local qvars = {}
|
||||
|
||||
v.notif_timeout = 3
|
||||
qvars.anim_duration = 0.15
|
||||
qvars.anim_intro = qvars.anim_duration / 4
|
||||
|
||||
v.anim_duration = 0.15
|
||||
v.anim_intro = v.anim_duration / 2
|
||||
qvars.notif_timeout = 3 + qvars.anim_duration * 2
|
||||
|
||||
function v.shape(cr,w,h)
|
||||
function qvars.shape(cr,w,h)
|
||||
gears.shape.rounded_rect(cr,w,h,dpi(4))
|
||||
end
|
||||
|
||||
v.border_width = dpi(1.5)
|
||||
qvars.border_width = dpi(1.5)
|
||||
|
||||
v.padding = dpi(4)
|
||||
v.big_padding = dpi(8)
|
||||
qvars.padding = dpi(4)
|
||||
qvars.big_padding = dpi(8)
|
||||
|
||||
v.text_font = "Fira Code Nerd Font Mono Medium"
|
||||
v.symbol_font = "Symbols Nerd Font:style=1000-em"
|
||||
v.font_size = 8
|
||||
v.font = v.text_font .. " " .. v.font_size
|
||||
qvars.text_font = "Fira Code Nerd Font Mono Medium"
|
||||
qvars.symbol_font = "Symbols Nerd Font:style=1000-em"
|
||||
qvars.font_size = 8
|
||||
qvars.font = qvars.text_font .. " " .. qvars.font_size
|
||||
|
||||
local char_width, char_height = wibox.widget {
|
||||
widget = wibox.widget.textbox,
|
||||
text = "a"
|
||||
}:get_preferred_size_at_dpi(screen[1].dpi)
|
||||
|
||||
v.char_height = char_height
|
||||
v.char_width = char_width
|
||||
qvars.char_height = char_height
|
||||
qvars.char_width = char_width
|
||||
|
||||
v.bar_size = dpi(16)
|
||||
-- qvars.bar_size = dpi(16)
|
||||
qvars.bar_size = dpi(24) + qvars.big_padding * 2
|
||||
qvars.icon_size = qvars.char_height
|
||||
qvars.button_size = dpi(12)
|
||||
|
||||
v.button_size = dpi(12)
|
||||
|
||||
v.colors = {
|
||||
qvars.colors = {
|
||||
fg = x_col.foreground,
|
||||
bg = x_col.background,
|
||||
|
||||
|
@ -68,7 +70,7 @@ v.colors = {
|
|||
}
|
||||
|
||||
-- taken from https://github.com/bew/dotfiles/blob/ab9bb1935783f7a31ef777b1d7e26d53f35df864/gui/wezterm/cfg_utils.lua
|
||||
v.mods = setmetatable({ _SHORT_MAP = { C = "Control", S = "Shift", A = "Mod1", M = "Mod4" } }, {
|
||||
qvars.mods = setmetatable({ _SHORT_MAP = { C = "Control", S = "Shift", A = "Mod1", M = "Mod4" } }, {
|
||||
__index = function(self, key)
|
||||
local resolved_mods = {}
|
||||
for i = 1, #key do
|
||||
|
@ -78,4 +80,12 @@ v.mods = setmetatable({ _SHORT_MAP = { C = "Control", S = "Shift", A = "Mod1", M
|
|||
end
|
||||
})
|
||||
|
||||
return v
|
||||
qvars.btns = {
|
||||
left = btns.LEFT,
|
||||
right = btns.RIGHT,
|
||||
middle = btns.MIDDLE,
|
||||
up = btns.SCROLL_UP,
|
||||
down = btns.SCROLL_DOWN
|
||||
}
|
||||
|
||||
return qvars
|
|
@ -10,8 +10,9 @@ pcall(require, "luarocks.loader")
|
|||
--
|
||||
--=-=-=-=-=-=-=-=-=-=-=-= A colorful and comfy AWM theme =-=-=-=-=-=-=-=-=-=-=-=--
|
||||
|
||||
local beautiful = require "beautiful"
|
||||
beautiful.init(require("gears").filesystem.get_configuration_dir() .. "/prismite.lua")
|
||||
require("beautiful").init(require("gears.filesystem").get_configuration_dir() .. "/prismite.lua")
|
||||
|
||||
require "signals"
|
||||
require "services"
|
||||
require "misc"
|
||||
require "ui"
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
date=$(date +%Y%m%d_%H%M%S)
|
||||
path=~/Pictures/Screenshot_$date.png
|
||||
rootid=$(xwininfo -root -int | grep -iPo --color=never "(?<=id:\s)[0-9]*?\s")
|
||||
|
||||
if [[ $1 -eq 1 ]]
|
||||
then
|
||||
# fullscreen
|
||||
maim $path && xclip -selection clipboard -t image/png $path
|
||||
notify-send -a "Maim" "Screenshot taken" "Saved at $path"
|
||||
elif [[ $1 -eq 2 ]]
|
||||
then
|
||||
# region
|
||||
maim -s $path && xclip -selection clipboard -t image/png $path
|
||||
if [[ $? -eq 0 ]]
|
||||
then
|
||||
notify-send -a "Maim" "Screenshot taken" "Saved at $path"
|
||||
fi
|
||||
elif [[ $1 -eq 3 ]]
|
||||
then
|
||||
# current window
|
||||
maim -i $(xdotool getactivewindow) $path && xclip -selection clipboard -t image/png $path
|
||||
fi
|
||||
|
||||
|
14
.config/awesome/services/battery.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
local gtimer = require "gears.timer"
|
||||
local qfs = require "quarrel.fs"
|
||||
|
||||
gtimer {
|
||||
timeout = 1,
|
||||
call_now = true,
|
||||
autostart = true,
|
||||
callback = function()
|
||||
local capacity = qfs.read("/sys/class/power_supply/BAT0/capacity", "n")
|
||||
local status = qfs.read("/sys/class/power_supply/BAT0/status", "l")
|
||||
|
||||
awesome.emit_signal("services::battery", capacity, status)
|
||||
end
|
||||
}
|
13
.config/awesome/services/brightness.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
local gtimer = require "gears.timer"
|
||||
local qfs = require "quarrel.fs"
|
||||
|
||||
gtimer {
|
||||
timeout = 1,
|
||||
call_now = true,
|
||||
autostart = true,
|
||||
callback = function()
|
||||
local brightness = qfs.read("/sys/class/backlight/amdgpu_bl0/actual_brightness", "n")
|
||||
|
||||
awesome.emit_signal("services::brightness", brightness)
|
||||
end
|
||||
}
|
3
.config/awesome/services/init.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
require "services.battery"
|
||||
require "services.brightness"
|
||||
require "services.wifi"
|
23
.config/awesome/services/wifi.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
local gtimer = require "gears.timer"
|
||||
|
||||
gtimer {
|
||||
timeout = 1,
|
||||
call_now = true,
|
||||
autostart = true,
|
||||
callback = function()
|
||||
local lines = {}
|
||||
|
||||
for line in io.lines("/proc/net/wireless") do
|
||||
table.insert(lines, line)
|
||||
end
|
||||
|
||||
if not lines[3] then
|
||||
awesome.emit_signal("services::wifi", 0, false)
|
||||
return
|
||||
end
|
||||
|
||||
local strength = lines[3]:match("^%s*(.*)"):match("^.-%s+.-%s+.-(%S+)%.")
|
||||
|
||||
awesome.emit_signal("services::wifi", math.floor(tonumber(strength) * 10 / 7), true)
|
||||
end
|
||||
}
|
32
.config/awesome/signals/awesome.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
-- Taken from https://www.reddit.com/r/awesomewm/comments/syjolb/comment/hy0xy35/
|
||||
|
||||
awesome.connect_signal('exit', function(reason_restart)
|
||||
if not reason_restart then return end
|
||||
|
||||
local file = io.open('/tmp/awesomewm-last-selected-tags', 'w+')
|
||||
|
||||
for s in screen do
|
||||
file:write(s.selected_tag.index, '\n')
|
||||
end
|
||||
|
||||
file:close()
|
||||
end)
|
||||
|
||||
awesome.connect_signal('startup', function()
|
||||
local file = io.open('/tmp/awesomewm-last-selected-tags', 'r')
|
||||
if not file then return end
|
||||
|
||||
local selected_tags = {}
|
||||
|
||||
for line in file:lines() do
|
||||
table.insert(selected_tags, tonumber(line))
|
||||
end
|
||||
|
||||
for s in screen do
|
||||
local i = selected_tags[s.index]
|
||||
local t = s.tags[i]
|
||||
t:view_only()
|
||||
end
|
||||
|
||||
file:close()
|
||||
end)
|
34
.config/awesome/signals/client.lua
Normal file
|
@ -0,0 +1,34 @@
|
|||
local qvars = require "quarrel.vars"
|
||||
local rectangle = require "gears.shape".rectangle
|
||||
|
||||
-- io.popen spams logs, don't use
|
||||
-- client.connect_signal("property::name", function(c)
|
||||
-- if not c.pid then return end
|
||||
-- local out = io.popen("readlink /proc/" .. c.pid .. "/exe")
|
||||
-- local name = c.name
|
||||
-- if out ~= nil then
|
||||
-- name = out:read("*a"):sub(0, -2):match("[^\\/]+$") or name
|
||||
-- end
|
||||
-- c.name = string.lower(name)
|
||||
-- end)
|
||||
|
||||
client.connect_signal("request::manage", function (c)
|
||||
c.shape = qvars.shape
|
||||
if c.maximized then
|
||||
c.maximized = false
|
||||
c.maximized = true
|
||||
end
|
||||
end)
|
||||
|
||||
local function handle_corners(c)
|
||||
if c.maximized then
|
||||
c.shape = rectangle
|
||||
c.border_width = 0
|
||||
else
|
||||
c.shape = qvars.shape
|
||||
c.border_width = qvars.border_width
|
||||
end
|
||||
end
|
||||
|
||||
client.connect_signal("property::maximized", handle_corners)
|
||||
client.connect_signal("property::fullscreen", handle_corners)
|
5
.config/awesome/signals/init.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
require "signals.awesome"
|
||||
require "signals.naughty"
|
||||
require "signals.screen"
|
||||
require "signals.client"
|
||||
|
54
.config/awesome/signals/naughty.lua
Normal file
|
@ -0,0 +1,54 @@
|
|||
local naughty = require "naughty"
|
||||
local awful = require "awful"
|
||||
local beautiful = require "beautiful"
|
||||
local wibox = require "wibox"
|
||||
local qvars = require "quarrel.vars"
|
||||
|
||||
naughty.connect_signal("request::display", function(n)
|
||||
naughty.layout.box {
|
||||
notification = n,
|
||||
placement = function(d)
|
||||
return awful.placement.right(d, {
|
||||
margins = beautiful.useless_gap * 2
|
||||
})
|
||||
end,
|
||||
widget_template = {
|
||||
widget = wibox.container.margin,
|
||||
margins = qvars.big_padding,
|
||||
{
|
||||
{
|
||||
widget = naughty.widget.icon,
|
||||
notification = n
|
||||
},
|
||||
{
|
||||
widget = wibox.container.place,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
{
|
||||
{
|
||||
widget = naughty.widget.title,
|
||||
notification = n
|
||||
},
|
||||
{
|
||||
widget = naughty.widget.message,
|
||||
notification = n
|
||||
},
|
||||
-- spacing = 4,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
},
|
||||
fill_space = true,
|
||||
spacing = n.icon and qvars.big_padding or 0,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
}
|
||||
}
|
||||
end)
|
||||
|
||||
naughty.connect_signal("request::display_error", function(message, startup)
|
||||
naughty.notification {
|
||||
urgency = "critical",
|
||||
title = "Oops, an error happened"..(startup and " during startup!" or "!"),
|
||||
message = message
|
||||
}
|
||||
end)
|
|
@ -1,37 +1,4 @@
|
|||
local vars = require "misc.vars"
|
||||
local awful = require "awful"
|
||||
local rectangle = require "gears.shape".rectangle
|
||||
local bling = require "lib.bling"
|
||||
|
||||
client.connect_signal("property::name", function(c)
|
||||
local out = io.popen("readlink /proc/" .. c.pid .. "/exe")
|
||||
local name = c.name
|
||||
if out ~= nil then
|
||||
name = out:read("*a"):sub(0, -2):match("[^\\/]+$") or name
|
||||
end
|
||||
c.name = string.lower(name)
|
||||
end)
|
||||
|
||||
client.connect_signal("request::manage", function (c)
|
||||
c.shape = vars.shape
|
||||
if c.maximized then
|
||||
c.maximized = false
|
||||
c.maximized = true
|
||||
end
|
||||
end)
|
||||
|
||||
local function handle_corners(c)
|
||||
if c.maximized then
|
||||
c.shape = rectangle
|
||||
c.border_width = 0
|
||||
else
|
||||
c.shape = vars.shape
|
||||
c.border_width = vars.border_width
|
||||
end
|
||||
end
|
||||
|
||||
client.connect_signal("property::maximized", handle_corners)
|
||||
client.connect_signal("property::fullscreen", handle_corners)
|
||||
|
||||
screen.connect_signal("request::desktop_decoration", function(s)
|
||||
awful.tag.add(
|
|
@ -2,41 +2,40 @@ local awful = require "awful"
|
|||
local btn = awful.button.names
|
||||
local gc = require "gears.color"
|
||||
local gs = require "gears.surface"
|
||||
local vars = require "misc.vars"
|
||||
local h = require "misc.helpers"
|
||||
local qvars = require "quarrel.vars"
|
||||
local qui = require "quarrel.ui"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local rubato = require "lib.rubato"
|
||||
local playerctl = require "lib.bling.signal.playerctl".lib {
|
||||
-- ignore = "firefox",
|
||||
player = { "spotify", "cmus", "%any" }
|
||||
}
|
||||
|
||||
local height = screen[1].geometry.height - (beautiful.useless_gap * 4 + vars.border_width * 2)
|
||||
local inside_width = vars.bar_size * 20 - (vars.big_padding * 4 + vars.border_width * 4 + vars.bar_size * 4)
|
||||
local height = screen[1].geometry.height - (beautiful.useless_gap * 4 + qvars.border_width * 2)
|
||||
local inside_width = qvars.bar_size * 20 - (qvars.big_padding * 4 + qvars.border_width * 4 + qvars.bar_size * 4)
|
||||
|
||||
local cover = wibox.widget {
|
||||
{
|
||||
widget = wibox.widget.imagebox,
|
||||
clip_shape = vars.shape,
|
||||
forced_width = vars.bar_size * 4,
|
||||
forced_height = vars.bar_size * 4,
|
||||
clip_shape = qvars.shape,
|
||||
forced_width = qvars.bar_size * 4,
|
||||
forced_height = qvars.bar_size * 4,
|
||||
visible = false,
|
||||
id = "cover"
|
||||
},
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
forced_width = vars.bar_size * 4,
|
||||
forced_height = vars.bar_size * 4,
|
||||
bg = vars.colors.black,
|
||||
fg = vars.colors.dim.fg,
|
||||
shape = vars.shape,
|
||||
forced_width = qvars.bar_size * 4,
|
||||
forced_height = qvars.bar_size * 4,
|
||||
bg = qvars.colors.black,
|
||||
fg = qvars.colors.dim.fg,
|
||||
shape = qvars.shape,
|
||||
{
|
||||
widget = wibox.container.place,
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = "",
|
||||
font = h.font(4)
|
||||
font = qui.font(4)
|
||||
}
|
||||
},
|
||||
id = "no_cover"
|
||||
|
@ -52,15 +51,15 @@ local song = wibox.widget {
|
|||
|
||||
local artist = wibox.widget {
|
||||
widget = wibox.widget.textbox,
|
||||
markup = h.markup_fg(vars.colors.dim.fg, "Nothing Playing "),
|
||||
font = h.font(0.8),
|
||||
markup = qui.markup_fg(qvars.colors.dim.fg, "Nothing Playing "),
|
||||
font = qui.font(0.8),
|
||||
}
|
||||
|
||||
local back = wibox.widget {
|
||||
widget = wibox.widget.textbox,
|
||||
text = "",
|
||||
font = h.symbol_font(1.5),
|
||||
forced_height = beautiful.get_font_height(h.symbol_font(0.5))
|
||||
font = qui.symbol_font(1.5),
|
||||
forced_height = beautiful.get_font_height(qui.symbol_font(0.5))
|
||||
}
|
||||
back:add_button(awful.button {
|
||||
modifiers = {},
|
||||
|
@ -73,8 +72,8 @@ back:add_button(awful.button {
|
|||
local play_pause = wibox.widget {
|
||||
widget = wibox.widget.textbox,
|
||||
text = "",
|
||||
font = h.font(1.5),
|
||||
forced_height = beautiful.get_font_height(h.font(0.5))
|
||||
font = qui.font(1.5),
|
||||
forced_height = beautiful.get_font_height(qui.font(0.5))
|
||||
}
|
||||
play_pause:add_button(awful.button {
|
||||
modifiers = {},
|
||||
|
@ -94,8 +93,8 @@ end)
|
|||
local forward = wibox.widget {
|
||||
widget = wibox.widget.textbox,
|
||||
text = "",
|
||||
font = h.font(1.5),
|
||||
forced_height = beautiful.get_font_height(h.font(0.5))
|
||||
font = qui.font(1.5),
|
||||
forced_height = beautiful.get_font_height(qui.font(0.5))
|
||||
}
|
||||
forward:add_button(awful.button {
|
||||
|
||||
|
@ -110,16 +109,16 @@ local progress_bar = wibox.widget {
|
|||
widget = wibox.widget.progressbar,
|
||||
max_value = 1,
|
||||
value = 0,
|
||||
shape = vars.shape,
|
||||
bar_shape = vars.shape,
|
||||
forced_height = beautiful.get_font_height(h.font(0.5)),
|
||||
forced_width = inside_width - (vars.padding * 2 + vars.big_padding + back:get_preferred_size_at_dpi(screen[1].dpi) * 3),
|
||||
color = vars.colors.yellow,
|
||||
background_color = vars.colors.black
|
||||
shape = qvars.shape,
|
||||
bar_shape = qvars.shape,
|
||||
forced_height = beautiful.get_font_height(qui.font(0.5)),
|
||||
forced_width = inside_width - (qvars.padding * 2 + qvars.big_padding + back:get_preferred_size_at_dpi(screen[1].dpi) * 3),
|
||||
color = qvars.colors.yellow,
|
||||
background_color = qvars.colors.black
|
||||
}
|
||||
local progress_smoothing = rubato.timed {
|
||||
duration = vars.anim_duration,
|
||||
intro = vars.anim_intro,
|
||||
duration = qvars.anim_duration,
|
||||
intro = qvars.anim_intro,
|
||||
pos = 0,
|
||||
subscribed = function(pos)
|
||||
progress_bar.value = pos
|
||||
|
@ -135,23 +134,23 @@ local archaic = {}
|
|||
|
||||
archaic.playerctl = playerctl
|
||||
|
||||
archaic.widget = h.popup {
|
||||
archaic.widget = qui.popup {
|
||||
placement = function(d)
|
||||
return awful.placement.right(d, {
|
||||
margins = beautiful.useless_gap * 2
|
||||
})
|
||||
end,
|
||||
ontop = true,
|
||||
minimum_width = vars.bar_size * 20,
|
||||
maximum_width = vars.bar_size * 20,
|
||||
minimum_width = qvars.bar_size * 20,
|
||||
maximum_width = qvars.bar_size * 20,
|
||||
minimum_height = height,
|
||||
maximum_height = height,
|
||||
widget = {
|
||||
h.styled {
|
||||
qui.styled {
|
||||
widget = wibox.container.background,
|
||||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = vars.big_padding,
|
||||
margins = qvars.big_padding,
|
||||
{
|
||||
cover,
|
||||
{
|
||||
|
@ -183,8 +182,8 @@ archaic.widget = h.popup {
|
|||
stops = {
|
||||
{ 0, "#0000000" },
|
||||
{ 0.95, "#0000000" },
|
||||
{ 0.95, vars.colors.bg .. "1a" },
|
||||
{ 1, vars.colors.bg }
|
||||
{ 0.95, qvars.colors.bg .. "1a" },
|
||||
{ 1, qvars.colors.bg }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -198,15 +197,15 @@ archaic.widget = h.popup {
|
|||
play_pause,
|
||||
forward,
|
||||
|
||||
spacing = vars.padding,
|
||||
spacing = qvars.padding,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
spacing = vars.big_padding,
|
||||
spacing = qvars.big_padding,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
layout = wibox.layout.align.vertical
|
||||
},
|
||||
spacing = vars.big_padding - vars.border_width, -- for some reason awesome adds border_width here
|
||||
spacing = qvars.big_padding - qvars.border_width, -- for some reason awesome adds border_width here
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +218,7 @@ playerctl:connect_signal("metadata", function(_, _song, _artist, _cover)
|
|||
-- n { message = "sus" }
|
||||
song:set_text(_song .. " ")
|
||||
-- ic.widget:emit_signal("widget::redraw_needed")
|
||||
artist:set_markup(h.markup_fg(vars.colors.dim.fg, _artist .. " "))
|
||||
artist:set_markup(qui.markup_fg(qvars.colors.dim.fg, _artist .. " "))
|
||||
if _cover == "" then
|
||||
cover.cover.visible = false
|
||||
cover.no_cover.visible = true
|
||||
|
|
26
.config/awesome/ui/conductor/init.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
local awful = require "awful"
|
||||
local qui = require "quarrel.ui"
|
||||
local q = require "quarrel"
|
||||
local qvars = require "quarrel.vars"
|
||||
|
||||
awful.keygrabber {
|
||||
keybindings = {
|
||||
awful.key {
|
||||
modifiers = qvars.mods.A,
|
||||
key = "Tab",
|
||||
on_press = awful.client.focus.history.previous
|
||||
},
|
||||
awful.key {
|
||||
modifiers = qvars.mods.AS,
|
||||
key = "Tab",
|
||||
on_press = awful.client.focus.history.next
|
||||
},
|
||||
},
|
||||
-- Note that it is using the key name and not the modifier name.
|
||||
stop_key = "Mod1",
|
||||
stop_event = "release",
|
||||
-- start_callback = awful.client.focus.history.disable_tracking,
|
||||
stop_callback = awful.client.focus.history.enable_tracking,
|
||||
export_keybindings = true,
|
||||
autostart = true
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
local awful = require "awful"
|
||||
local vars = require "misc.vars"
|
||||
local qvars = require "quarrel.vars"
|
||||
local gears = require "gears"
|
||||
local wibox = require "wibox"
|
||||
local rubato = require "lib.rubato"
|
||||
|
@ -8,10 +8,10 @@ local cfg = require "misc.cfg"
|
|||
local function button(color, color_focus, callback)
|
||||
local widget = wibox.widget {
|
||||
widget = wibox.container.background,
|
||||
forced_height = vars.button_size,
|
||||
forced_width = vars.button_size,
|
||||
forced_height = qvars.button_size,
|
||||
forced_width = qvars.button_size,
|
||||
bg = color,
|
||||
shape = vars.shape,
|
||||
shape = qvars.shape,
|
||||
buttons = { callback }
|
||||
}
|
||||
|
||||
|
@ -19,13 +19,13 @@ local function button(color, color_focus, callback)
|
|||
local timed = rubato.timed {
|
||||
duration = 0.1,
|
||||
intro = 0.05,
|
||||
pos = vars.button_size,
|
||||
pos = qvars.button_size,
|
||||
subscribed = function(pos)
|
||||
widget.forced_width = pos
|
||||
end
|
||||
}
|
||||
|
||||
timed.target = vars.button_size * 2
|
||||
timed.target = qvars.button_size * 2
|
||||
widget.bg = color_focus
|
||||
end)
|
||||
|
||||
|
@ -33,13 +33,13 @@ local function button(color, color_focus, callback)
|
|||
local timed = rubato.timed {
|
||||
duration = 0.1,
|
||||
intro = 0.05,
|
||||
pos = vars.button_size * 2,
|
||||
pos = qvars.button_size * 2,
|
||||
subscribed = function(pos)
|
||||
widget.forced_width = pos
|
||||
end
|
||||
}
|
||||
|
||||
timed.target = vars.button_size
|
||||
timed.target = qvars.button_size
|
||||
widget.bg = color
|
||||
end)
|
||||
|
||||
|
@ -51,31 +51,31 @@ client.connect_signal("request::titlebars", function(c)
|
|||
|
||||
local titlebar = awful.titlebar(c, {
|
||||
position = "top",
|
||||
size = vars.button_size + vars.padding * 2
|
||||
size = qvars.button_size + qvars.padding * 2
|
||||
})
|
||||
|
||||
awful.titlebar.enable_tooltip = false
|
||||
|
||||
titlebar.widget = {
|
||||
widget = wibox.container.margin,
|
||||
margins = vars.padding,
|
||||
margins = qvars.padding,
|
||||
{
|
||||
nil,
|
||||
nil,
|
||||
{
|
||||
button(vars.colors.green, vars.colors.bright.green, awful.button({}, 1, function()
|
||||
button(qvars.colors.green, qvars.colors.bright.green, awful.button({}, 1, function()
|
||||
c.maximized = not c.maximized
|
||||
end)),
|
||||
button(vars.colors.yellow, vars.colors.bright.yellow, awful.button({}, 1, function()
|
||||
button(qvars.colors.yellow, qvars.colors.bright.yellow, awful.button({}, 1, function()
|
||||
gears.timer.delayed_call(function()
|
||||
c.minimized = true
|
||||
end)
|
||||
end)),
|
||||
button(vars.colors.red, vars.colors.bright.red, awful.button({}, 1, function()
|
||||
button(qvars.colors.red, qvars.colors.bright.red, awful.button({}, 1, function()
|
||||
c:kill()
|
||||
end)),
|
||||
|
||||
spacing = vars.padding,
|
||||
spacing = qvars.padding,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
layout = wibox.layout.align.horizontal
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
local wallpaper = require "awful.wallpaper"
|
||||
local wibox = require "wibox"
|
||||
local vars = require "misc.vars"
|
||||
local h = require "misc.helpers"
|
||||
local qvars = require "quarrel.vars"
|
||||
local qui = require "quarrel.ui"
|
||||
|
||||
screen.connect_signal("request::wallpaper", function(s)
|
||||
wallpaper {
|
||||
bg = vars.colors.dim.bg,
|
||||
bg = qvars.colors.dim.bg,
|
||||
screen = s,
|
||||
widget = {
|
||||
widget = wibox.container.place,
|
||||
|
@ -13,14 +13,14 @@ screen.connect_signal("request::wallpaper", function(s)
|
|||
halign = "center",
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
font = h.font(1.5),
|
||||
font = qui.font(1.5),
|
||||
markup = table.concat({
|
||||
h.markup_fg(vars.colors.red, " ___"),
|
||||
h.markup_fg(vars.colors.green, " /\\ \\"),
|
||||
h.markup_fg(vars.colors.yellow, " /::\\ \\"),
|
||||
h.markup_fg(vars.colors.blue, "/::\\:\\__\\"),
|
||||
h.markup_fg(vars.colors.pink, "\\/\\::/ /"),
|
||||
h.markup_fg(vars.colors.cyan, " \\/__/")
|
||||
qui.markup_fg(qvars.colors.red, " ___"),
|
||||
qui.markup_fg(qvars.colors.green, " /\\ \\"),
|
||||
qui.markup_fg(qvars.colors.yellow, " /::\\ \\"),
|
||||
qui.markup_fg(qvars.colors.blue, "/::\\:\\__\\"),
|
||||
qui.markup_fg(qvars.colors.pink, "\\/\\::/ /"),
|
||||
qui.markup_fg(qvars.colors.cyan, " \\/__/")
|
||||
}, "\n")
|
||||
}
|
||||
}
|
||||
|
|
74
.config/awesome/ui/flashy/init.lua
Normal file
|
@ -0,0 +1,74 @@
|
|||
local awful = require "awful"
|
||||
local gtable = require "gears.table"
|
||||
local gdebug = require "gears.debug"
|
||||
local gcolor = require "gears.color"
|
||||
local qui = require "quarrel.ui"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
local phosphor = require "assets.phosphor"
|
||||
local beautiful = require "beautiful"
|
||||
local rubato = require "lib.rubato"
|
||||
|
||||
local flashy = {}
|
||||
flashy._timeout_timer = {}
|
||||
|
||||
flashy._widget = qui.popup {
|
||||
placement = awful.placement.centered,
|
||||
ontop = true,
|
||||
minimum_width = qvars.button_size * 15,
|
||||
maximum_width = qvars.button_size * 15,
|
||||
minimum_height = qvars.button_size * 15,
|
||||
maximum_height = qvars.button_size * 15,
|
||||
visible = false,
|
||||
widget = {
|
||||
{
|
||||
widget = wibox.container.place,
|
||||
valign = "center",
|
||||
haligh = "center",
|
||||
-- widget = wibox.container.margin,
|
||||
-- margins = qvars.big_padding * 8,
|
||||
{
|
||||
widget = wibox.widget.imagebox,
|
||||
image = gcolor.recolor_image(phosphor.battery_warning, qvars.colors.fg),
|
||||
-- image = phosphor["battery_warning"],
|
||||
forced_width = qvars.button_size * 15 - (qvars.border_width * 2 + qvars.big_padding * 2),
|
||||
forced_height = qvars.button_size * 14 - (qvars.border_width * 2 + qvars.big_padding * 2)
|
||||
}
|
||||
},
|
||||
{
|
||||
widget = wibox.widget.progressbar,
|
||||
max_value = 100,
|
||||
value = 50,
|
||||
forced_height = qvars.button_size;
|
||||
shape = qvars.shape,
|
||||
color = qvars.colors.yellow,
|
||||
background_color = qvars.colors.black
|
||||
},
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
}
|
||||
|
||||
flashy._timed = rubato.timed {
|
||||
duration = qvars.anim_duration,
|
||||
intro = qvars.anim_intro,
|
||||
pos = 0,
|
||||
subscribed = function(pos)
|
||||
flashy._widget.opacity = pos
|
||||
|
||||
if pos == 0 then
|
||||
flashy._widget.visible = false
|
||||
else
|
||||
flashy._widget.visible = true
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
function flashy:show()
|
||||
self._timed.target = 1
|
||||
end
|
||||
|
||||
function flashy:hide()
|
||||
self._timed.target = 0
|
||||
end
|
||||
|
||||
return flashy
|
|
@ -1,19 +1,16 @@
|
|||
local awful = require "awful"
|
||||
local gtable = require "gears.table"
|
||||
local gdebug = require "gears.debug"
|
||||
local gfs = require "gears.filesystem"
|
||||
local h = require "misc.helpers"
|
||||
local qui = require "quarrel.ui"
|
||||
local qtable = require "quarrel.table"
|
||||
local qnative = require "quarrel.native"
|
||||
local cfg = require "misc.cfg"
|
||||
local vars = require "misc.vars"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local rubato = require "lib.rubato"
|
||||
local al_prompt = require "lib.bling.widget.app_launcher.prompt"
|
||||
local btn = awful.button.names
|
||||
|
||||
package.cpath = package.cpath .. ";" .. gfs.get_configuration_dir() .. "ui/fresnel/lenses/target/debug/lib?.so"
|
||||
|
||||
local lenses = require "lenses"
|
||||
local max_entries = 10
|
||||
|
||||
local fresnel = {}
|
||||
|
@ -27,7 +24,7 @@ fresnel._selected_index = 1
|
|||
|
||||
function fresnel:_exec_entry(entry_index)
|
||||
local exec = self._entries_exec[entry_index]
|
||||
if type(exec) ~= "userdata" then
|
||||
if type(exec) ~= "userdata" and type(exec) ~= "nil" then
|
||||
awful.spawn((exec[2] and cfg.terminal .. " -e " or "") .. exec[1])
|
||||
end
|
||||
end
|
||||
|
@ -49,7 +46,7 @@ function fresnel:_update(query, scrolled)
|
|||
self._entries_exec = {}
|
||||
layout:reset()
|
||||
|
||||
for _, provider in h.opairs(lenses) do
|
||||
for _, provider in qtable.opairs(qnative.lenses) do
|
||||
local entries = provider(query)
|
||||
|
||||
table.sort(entries, function(a, b)
|
||||
|
@ -70,18 +67,18 @@ function fresnel:_update(query, scrolled)
|
|||
|
||||
local entry_widget = wibox.widget {
|
||||
widget = wibox.container.background,
|
||||
shape = vars.shape,
|
||||
shape = qvars.shape,
|
||||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = vars.padding,
|
||||
margins = qvars.padding,
|
||||
{
|
||||
widget = wibox.container.constraint,
|
||||
strategy = "max",
|
||||
height = vars.char_height,
|
||||
height = qvars.char_height,
|
||||
{
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
fg = vars.colors.dim.fg,
|
||||
fg = qvars.colors.dim.fg,
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = entry.provider .. " | "
|
||||
|
@ -91,7 +88,7 @@ function fresnel:_update(query, scrolled)
|
|||
widget = wibox.widget.textbox,
|
||||
text = entry.message
|
||||
},
|
||||
spacing = vars.padding,
|
||||
spacing = qvars.padding,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
}
|
||||
|
@ -110,17 +107,17 @@ function fresnel:_update(query, scrolled)
|
|||
|
||||
if self._selected_index + self._entries_offset == i then
|
||||
entry_widget._selected = true
|
||||
entry_widget.bg = vars.colors.black
|
||||
entry_widget.bg = qvars.colors.black
|
||||
end
|
||||
|
||||
entry_widget:connect_signal("mouse::enter", function()
|
||||
if entry_widget._selected == true then return end
|
||||
entry_widget.bg = vars.colors.black
|
||||
entry_widget.bg = qvars.colors.black
|
||||
end)
|
||||
|
||||
entry_widget:connect_signal("mouse::leave", function()
|
||||
if entry_widget._selected == true then return end
|
||||
entry_widget.bg = vars.colors.bg
|
||||
entry_widget.bg = qvars.colors.bg
|
||||
end)
|
||||
|
||||
layout:add(entry_widget)
|
||||
|
@ -138,7 +135,7 @@ fresnel._prompt = al_prompt {
|
|||
prompt = "",
|
||||
reset_on_stop = true,
|
||||
ul_cursor = "low",
|
||||
bg_cursor = vars.colors.black,
|
||||
bg_cursor = qvars.colors.black,
|
||||
changed_callback = function(text)
|
||||
if fresnel._text == text then return end
|
||||
if fresnel._toggled == false then return end
|
||||
|
@ -177,7 +174,7 @@ fresnel._prompt = al_prompt {
|
|||
end
|
||||
}
|
||||
|
||||
fresnel._widget = h.popup {
|
||||
fresnel._widget = qui.popup {
|
||||
visible = false,
|
||||
ontop = true,
|
||||
placement = function(d)
|
||||
|
@ -192,12 +189,12 @@ fresnel._widget = h.popup {
|
|||
widget = {
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
bg = vars.colors.black,
|
||||
fg = vars.colors.dim.fg,
|
||||
shape = vars.shape,
|
||||
bg = qvars.colors.black,
|
||||
fg = qvars.colors.dim.fg,
|
||||
shape = qvars.shape,
|
||||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = vars.padding,
|
||||
margins = qvars.padding,
|
||||
{
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
|
@ -206,16 +203,16 @@ fresnel._widget = h.popup {
|
|||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = {
|
||||
left = vars.padding,
|
||||
right = vars.padding
|
||||
left = qvars.padding,
|
||||
right = qvars.padding
|
||||
},
|
||||
{
|
||||
widget = wibox.container.constraint,
|
||||
strategy = "max",
|
||||
height = vars.char_height,
|
||||
height = qvars.char_height,
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
fg = vars.colors.fg,
|
||||
fg = qvars.colors.fg,
|
||||
fresnel._prompt.textbox
|
||||
}
|
||||
}
|
||||
|
@ -232,10 +229,10 @@ fresnel._widget = h.popup {
|
|||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = {
|
||||
top = vars.padding
|
||||
top = qvars.padding
|
||||
},
|
||||
{
|
||||
spacing = vars.padding,
|
||||
spacing = qvars.padding,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
id = "entry_layout"
|
||||
}
|
||||
|
@ -243,7 +240,7 @@ fresnel._widget = h.popup {
|
|||
layout = wibox.layout.align.vertical
|
||||
}
|
||||
}
|
||||
fresnel._widget.maximum_height = vars.big_padding * 2 + (vars.padding * 2 + vars.char_height) * (1 + 10) + vars.padding + vars.padding * 9
|
||||
fresnel._widget.maximum_height = qvars.big_padding * 2 + (qvars.padding * 2 + qvars.char_height) * (1 + 10) + qvars.padding + qvars.padding * 9
|
||||
|
||||
function fresnel:show()
|
||||
self._toggled = true
|
||||
|
@ -259,8 +256,8 @@ function fresnel:hide()
|
|||
end
|
||||
|
||||
fresnel._timed = rubato.timed {
|
||||
duration = vars.anim_duration,
|
||||
intro = vars.anim_intro,
|
||||
duration = qvars.anim_duration,
|
||||
intro = qvars.anim_intro,
|
||||
pos = 0,
|
||||
subscribed = function(pos)
|
||||
fresnel._widget.opacity = pos
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
target/liblenses.so
|
|
@ -1,25 +0,0 @@
|
|||
use meval::eval_str;
|
||||
use mlua::prelude::*;
|
||||
|
||||
use crate::entry::{
|
||||
entries_to_lua_table,
|
||||
Entry,
|
||||
};
|
||||
|
||||
pub fn query(lua: &Lua, input: String) -> LuaResult<LuaTable> {
|
||||
println!("{:?}", input);
|
||||
let result = match eval_str(input.trim()) {
|
||||
Ok(ok) => ok.to_string(),
|
||||
Err(_) => return Ok(lua.create_table()?),
|
||||
};
|
||||
|
||||
Ok(entries_to_lua_table(
|
||||
vec![Entry {
|
||||
message: result,
|
||||
exec: None,
|
||||
// icon: '',
|
||||
provider: "Calculator".to_string(),
|
||||
}],
|
||||
lua,
|
||||
))
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
mod application;
|
||||
mod calculator;
|
||||
mod entry;
|
||||
|
||||
use mlua::prelude::*;
|
||||
|
||||
#[mlua::lua_module]
|
||||
fn lenses(lua: &Lua) -> LuaResult<LuaTable> {
|
||||
let exports = lua.create_table()?;
|
||||
// lua.create_fun
|
||||
// exports.push(application::query)?;
|
||||
exports.set("1", lua.create_function(calculator::query)?)?;
|
||||
exports.set("2", lua.create_function(application::query)?)?;
|
||||
|
||||
Ok(exports)
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
local awful = require "awful"
|
||||
local vars = require "misc.vars"
|
||||
local wibox = require "wibox"
|
||||
local obj = require "gears.object"
|
||||
local debug = require "gears.debug"
|
||||
local naughty = require "naughty"
|
||||
local xresources = require "beautiful.xresources"
|
||||
local dpi = xresources.apply_dpi
|
|
@ -1,4 +1,5 @@
|
|||
-- require "ui.window_switcher"
|
||||
-- require "ui.conductor"
|
||||
require "ui.statusbar"
|
||||
-- require "ui.info_center"
|
||||
require "ui.decorations"
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
local awful = require "awful"
|
||||
local gtable = require "gears.table"
|
||||
local h = require "misc.helpers"
|
||||
local vars = require "misc.vars"
|
||||
local qui = require "quarrel.ui"
|
||||
local qtable = require "quarrel.table"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
local rubato = require "lib.rubato"
|
||||
local beautiful = require "beautiful"
|
||||
local btn = awful.button.names
|
||||
|
||||
local first_time = true
|
||||
|
@ -14,44 +16,45 @@ local insightful = {}
|
|||
insightful._toggled = false
|
||||
insightful._bindings = {}
|
||||
insightful._selected_group = ""
|
||||
insightful._selected_group_index = 1
|
||||
|
||||
insightful._keymap = {
|
||||
Control = "Control",
|
||||
Mod1 = "Alt",
|
||||
Control = "Control",
|
||||
Mod1 = "Alt",
|
||||
ISO_Level3_Shift = "Alt Gr",
|
||||
Mod4 = "Super",
|
||||
Insert = "Insert",
|
||||
Delete = "Delete",
|
||||
Next = "Page Up",
|
||||
Prior = "Page Down",
|
||||
Left = "",
|
||||
Up = "",
|
||||
Right = "",
|
||||
Down = "",
|
||||
KP_End = "1",
|
||||
KP_Down = "#2",
|
||||
KP_Next = "#3",
|
||||
KP_Left = "#4",
|
||||
KP_Begin = "#5",
|
||||
KP_Right = "#6",
|
||||
KP_Home = "#7",
|
||||
KP_Up = "#8",
|
||||
KP_Prior = "#9",
|
||||
KP_Insert = "#0",
|
||||
KP_Delete = "#.",
|
||||
KP_Divide = "#/",
|
||||
KP_Multiply = "#*",
|
||||
KP_Subtract = "#-",
|
||||
KP_Add = "#+",
|
||||
KP_Enter = "#Enter",
|
||||
Escape = "Esc",
|
||||
Tab = "Tab",
|
||||
space = "Space",
|
||||
Return = "Enter",
|
||||
dead_acute = "´",
|
||||
dead_circumflex = "^",
|
||||
dead_grave = "`",
|
||||
XF86MonBrightnessUp = "🔆+",
|
||||
Mod4 = "Super",
|
||||
Insert = "Insert",
|
||||
Delete = "Delete",
|
||||
Next = "Page Up",
|
||||
Prior = "Page Down",
|
||||
Left = "",
|
||||
Up = "",
|
||||
Right = "",
|
||||
Down = "",
|
||||
KP_End = "1",
|
||||
KP_Down = "#2",
|
||||
KP_Next = "#3",
|
||||
KP_Left = "#4",
|
||||
KP_Begin = "#5",
|
||||
KP_Right = "#6",
|
||||
KP_Home = "#7",
|
||||
KP_Up = "#8",
|
||||
KP_Prior = "#9",
|
||||
KP_Insert = "#0",
|
||||
KP_Delete = "#.",
|
||||
KP_Divide = "#/",
|
||||
KP_Multiply = "#*",
|
||||
KP_Subtract = "#-",
|
||||
KP_Add = "#+",
|
||||
KP_Enter = "#Enter",
|
||||
Escape = "Esc",
|
||||
Tab = "Tab",
|
||||
space = "Space",
|
||||
Return = "Enter",
|
||||
dead_acute = "´",
|
||||
dead_circumflex = "^",
|
||||
dead_grave = "`",
|
||||
XF86MonBrightnessUp = "🔆+",
|
||||
XF86MonBrightnessDown = "🔅-",
|
||||
XF86AudioRaiseVolume = "ﱛ",
|
||||
XF86AudioLowerVolume = "ﱜ",
|
||||
|
@ -65,15 +68,21 @@ insightful._keymap = {
|
|||
[tostring(btn.RIGHT)] = mouse .. "Right"
|
||||
}
|
||||
|
||||
insightful._widget = h.popup {
|
||||
insightful._widget = qui.popup {
|
||||
visible = false,
|
||||
ontop = true,
|
||||
placement = awful.placement.centered,
|
||||
placement = function(d)
|
||||
awful.placement.top(d, {
|
||||
margins = {
|
||||
top = beautiful.useless_gap * 2
|
||||
}
|
||||
})
|
||||
end,
|
||||
minimum_height = screen[1].geometry.height / 2,
|
||||
minimum_width = screen[1].geometry.width / 2,
|
||||
widget = {
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
spacing = vars.big_padding,
|
||||
spacing = qvars.big_padding,
|
||||
id = "layout_container"
|
||||
}
|
||||
}
|
||||
|
@ -97,9 +106,9 @@ function insightful:_generate()
|
|||
})
|
||||
end
|
||||
|
||||
for group, keybinds in h.opairs(grouped_binds) do
|
||||
for group, keybinds in qtable.opairs(grouped_binds) do
|
||||
local group_layout = {
|
||||
spacing = vars.padding,
|
||||
spacing = qvars.padding,
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
|
||||
|
@ -116,13 +125,13 @@ function insightful:_generate()
|
|||
}
|
||||
|
||||
for _, mod in ipairs(keybind.mods) do
|
||||
table.insert(key_layout, 1, h.styled {
|
||||
table.insert(key_layout, 1, qui.styled {
|
||||
widget = wibox.container.background,
|
||||
bg = vars.colors.bright.black,
|
||||
bg = qvars.colors.bright.black,
|
||||
border_width = 0,
|
||||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = vars.padding,
|
||||
margins = qvars.padding,
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = insightful._keymap[mod] or mod
|
||||
|
@ -154,7 +163,7 @@ function insightful:_generate()
|
|||
if keybind.desc then
|
||||
key_and_desc_layout[3] = {
|
||||
widget = wibox.container.background,
|
||||
fg = vars.colors.dim.fg,
|
||||
fg = qvars.colors.dim.fg,
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = keybind.desc
|
||||
|
@ -171,12 +180,12 @@ function insightful:_generate()
|
|||
{
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
bg = vars.colors.yellow,
|
||||
fg = vars.colors.bg,
|
||||
shape = vars.shape,
|
||||
bg = qvars.colors.yellow,
|
||||
fg = qvars.colors.bg,
|
||||
shape = qvars.shape,
|
||||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = vars.padding,
|
||||
margins = qvars.padding,
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = group
|
||||
|
@ -187,15 +196,15 @@ function insightful:_generate()
|
|||
layout = wibox.layout.align.horizontal
|
||||
},
|
||||
group_layout,
|
||||
spacing = vars.padding,
|
||||
spacing = qvars.padding,
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
local timed = rubato.timed {
|
||||
duration = vars.anim_duration,
|
||||
intro = vars.anim_intro,
|
||||
duration = qvars.anim_duration,
|
||||
intro = qvars.anim_intro,
|
||||
pos = 0,
|
||||
subscribed = function(pos)
|
||||
insightful._widget.opacity = pos
|
||||
|
@ -210,7 +219,7 @@ local timed = rubato.timed {
|
|||
|
||||
function insightful:toggle()
|
||||
if first_time then
|
||||
insightful:_generate_widget()
|
||||
insightful:_generate()
|
||||
first_time = false
|
||||
end
|
||||
|
||||
|
@ -218,56 +227,4 @@ function insightful:toggle()
|
|||
insightful._toggled = not insightful._toggled
|
||||
end
|
||||
|
||||
local function get_binding_function(trigger)
|
||||
if type(trigger) == "number" and trigger <= 5 and trigger > 0 then
|
||||
return "button"
|
||||
elseif type(trigger) == "string" then
|
||||
return "key"
|
||||
end
|
||||
error("trigger can only be a mouse button or a key", 2)
|
||||
end
|
||||
|
||||
local function translate_binding(binding, trigger, multiple)
|
||||
local value = nil
|
||||
if multiple then
|
||||
value = trigger[2]
|
||||
trigger = trigger[1]
|
||||
end
|
||||
|
||||
local awful_binding = {
|
||||
modifiers = binding.mods,
|
||||
[get_binding_function(trigger)] = trigger,
|
||||
on_press = multiple and function(...) binding.press(value, ...) end or binding.press
|
||||
}
|
||||
|
||||
if binding.desc then
|
||||
awful_binding.description = binding.desc
|
||||
end
|
||||
if binding.group then
|
||||
awful_binding.group = binding.group
|
||||
end
|
||||
|
||||
return awful[get_binding_function(trigger)](awful_binding)
|
||||
end
|
||||
|
||||
function insightful:bind(binding)
|
||||
local awful_bindings = {}
|
||||
table.insert(self._bindings, binding)
|
||||
|
||||
if type(binding.triggers) == "table" then
|
||||
for _, trigger in ipairs(binding.triggers) do
|
||||
table.insert(awful_bindings, translate_binding(binding, trigger, true))
|
||||
end
|
||||
elseif type(binding.triggers) == "string" or type(binding.triggers) == "number" then
|
||||
return translate_binding(binding, binding.triggers, false)
|
||||
else
|
||||
error("binding.triggers can only be a string or a table")
|
||||
end
|
||||
|
||||
-- for some reason multi-trigger bindings only work if i do this
|
||||
-- i spent a day debugging this
|
||||
-- thanks awesome
|
||||
return gtable.join(table.unpack(awful_bindings))
|
||||
end
|
||||
|
||||
return insightful
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
local awful = require "awful"
|
||||
local beautiful = require "beautiful"
|
||||
local xresources = require "beautiful.xresources"
|
||||
local dpi = xresources.apply_dpi
|
||||
local vars = require "misc.vars"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
local h = require "misc.helpers"
|
||||
local qui = require "quarrel.ui"
|
||||
local gcolor = require "gears.color"
|
||||
local gdebug = require "gears.debug"
|
||||
local phosphor = require "assets.phosphor"
|
||||
local qbind = require "quarrel.bind"
|
||||
local q = require "quarrel"
|
||||
local rubato = require "lib.rubato"
|
||||
|
||||
local taglist = require "ui.statusbar.widgets.taglist"
|
||||
local clock = require "ui.statusbar.widgets.clock"
|
||||
|
@ -14,62 +18,148 @@ local brightness = require "ui.statusbar.widgets.brightness"
|
|||
local keyboardlayout = require "ui.statusbar.widgets.keyboardlayout"
|
||||
|
||||
screen.connect_signal("request::desktop_decoration", function(s)
|
||||
local bar = h.popup {
|
||||
local expand_button = wibox.widget {
|
||||
widget = wibox.container.place,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
{
|
||||
widget = wibox.widget.imagebox,
|
||||
image = gcolor.recolor_image(phosphor.caret_right_fill, qvars.colors.fg),
|
||||
forced_width = qvars.icon_size,
|
||||
forced_height = qvars.icon_size
|
||||
},
|
||||
_expanded = false
|
||||
}
|
||||
|
||||
local bar = qui.popup {
|
||||
placement = function(d)
|
||||
local place = awful.placement.left
|
||||
return place(d, {
|
||||
margins = beautiful.useless_gap * 2
|
||||
})
|
||||
end,
|
||||
-- ontop = true,
|
||||
minimum_width = vars.bar_size,
|
||||
maximum_width = vars.bar_size * 20,
|
||||
minimum_height = s.geometry.height - (beautiful.useless_gap * 4 + vars.border_width * 2),
|
||||
minimum_height = s.geometry.height - (beautiful.useless_gap * 4 + qvars.border_width * 2),
|
||||
widget = {
|
||||
{
|
||||
nil,
|
||||
{
|
||||
widget = wibox.container.place,
|
||||
valign = "top",
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = "",
|
||||
font = h.font(1.5)
|
||||
}
|
||||
},
|
||||
taglist,
|
||||
{
|
||||
widget = wibox.container.place,
|
||||
valign = "bottom",
|
||||
{
|
||||
expand_button,
|
||||
taglist,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
spacing = vars.padding * 2,
|
||||
brightness,
|
||||
battery,
|
||||
wifi,
|
||||
keyboardlayout,
|
||||
clock
|
||||
spacing = qvars.padding * 2,
|
||||
},
|
||||
nil,
|
||||
{
|
||||
widget = wibox.container.place,
|
||||
valign = "bottom",
|
||||
{
|
||||
brightness,
|
||||
battery,
|
||||
wifi,
|
||||
{
|
||||
widget = wibox.container.place,
|
||||
keyboardlayout
|
||||
},
|
||||
clock,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
spacing = qvars.padding * 2
|
||||
},
|
||||
},
|
||||
layout = wibox.layout.align.vertical,
|
||||
expand = "outside",
|
||||
},
|
||||
layout = wibox.layout.align.vertical,
|
||||
expand = "outside",
|
||||
nil,
|
||||
layout = wibox.layout.align.horizontal
|
||||
},
|
||||
-- {
|
||||
-- widget = wibox.container.background,
|
||||
-- bg = vars.colors.fg,
|
||||
-- fg = vars.colors.bg,
|
||||
-- visible = false,
|
||||
-- {
|
||||
-- widget = wibox.widget.textbox,
|
||||
-- text = "this is gay"
|
||||
-- }
|
||||
-- },
|
||||
-- spacing = vars.big_padding,
|
||||
spacing = nil,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
nil,
|
||||
nil,
|
||||
layout = wibox.layout.align.horizontal,
|
||||
}
|
||||
}
|
||||
|
||||
local bar_width = bar.width
|
||||
|
||||
bar:struts {
|
||||
left = dpi(16) + vars.big_padding * 2 + beautiful.useless_gap * 4
|
||||
-- left = qvars.bar_size + qvars.big_padding * 2 + beautiful.useless_gap * 4
|
||||
-- left = qvars.bar_size + qvars.border_width * 2 + beautiful.useless_gap * 4
|
||||
left = bar_width + qvars.border_width * 2 + beautiful.useless_gap * 4
|
||||
}
|
||||
|
||||
local timed = rubato.timed {
|
||||
duration = qvars.anim_duration,
|
||||
intro = qvars.anim_intro,
|
||||
pos = bar_width,
|
||||
subscribed = function(pos)
|
||||
if pos ~= bar_width and expand_button._expanded then
|
||||
bar.widget.widget.third = wibox.widget {
|
||||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = {
|
||||
left = qvars.big_padding
|
||||
}
|
||||
},
|
||||
{
|
||||
widget = wibox.container.constraint,
|
||||
width = qvars.bar_size * 6,
|
||||
strategy = "min",
|
||||
{
|
||||
{
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
bg = qvars.colors.black,
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
bg = qvars.colors.black,
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = "2"
|
||||
}
|
||||
},
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
bg = qvars.colors.black,
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = "3"
|
||||
}
|
||||
},
|
||||
spacing = qvars.padding,
|
||||
layout = wibox.layout.flex.horizontal
|
||||
},
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
},
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
bar.ontop = true
|
||||
elseif pos == bar_width and not expand_button._expanded then
|
||||
bar.widget.widget.third = nil
|
||||
bar.ontop = false
|
||||
end
|
||||
|
||||
bar.maximum_width = pos
|
||||
end
|
||||
}
|
||||
|
||||
expand_button.buttons = {
|
||||
qbind:new {
|
||||
triggers = qvars.btns.left,
|
||||
press = function()
|
||||
if expand_button._expanded then
|
||||
timed.target = bar_width
|
||||
else
|
||||
timed.target = bar_width + qvars.bar_size * 6
|
||||
end
|
||||
|
||||
expand_button._expanded = not expand_button._expanded
|
||||
end,
|
||||
hidden = true
|
||||
}
|
||||
}
|
||||
end)
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
local awful = require "awful"
|
||||
local wibox = require "wibox"
|
||||
local vars = require "misc.vars"
|
||||
local h = require "misc.helpers"
|
||||
|
||||
|
|
@ -1,67 +1,37 @@
|
|||
local awful = require "awful"
|
||||
local xresources = require "beautiful.xresources"
|
||||
local vars = require "misc.vars"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
local h = require "misc.helpers"
|
||||
|
||||
local battery_inner = awful.widget.watch("cat /sys/class/power_supply/BAT0/capacity", 1, function(widget, stdout)
|
||||
local icon = ""
|
||||
local color = vars.colors.red
|
||||
|
||||
if io.popen("cat /sys/class/power_supply/BAT0/status"):read("*a"):sub(0, -2) == "Charging" then
|
||||
icon = ""
|
||||
color = vars.colors.green
|
||||
widget:set_markup("<span color=\"" .. color .. "\">" .. icon .. "</span>")
|
||||
return
|
||||
end
|
||||
|
||||
local percent = tonumber(stdout)
|
||||
|
||||
if percent <= 5 then
|
||||
icon = ""
|
||||
color = vars.colors.red
|
||||
elseif percent <= 10 then
|
||||
icon = ""
|
||||
color = vars.colors.red
|
||||
elseif percent <= 20 then
|
||||
icon = ""
|
||||
color = vars.colors.red
|
||||
elseif percent <= 30 then
|
||||
icon = ""
|
||||
color = vars.colors.yellow
|
||||
elseif percent <= 40 then
|
||||
icon = ""
|
||||
color = vars.colors.yellow
|
||||
elseif percent <= 50 then
|
||||
icon = ""
|
||||
color = vars.colors.yellow
|
||||
elseif percent <= 60 then
|
||||
icon = ""
|
||||
color = vars.colors.yellow
|
||||
elseif percent <= 70 then
|
||||
icon = ""
|
||||
color = vars.colors.yellow
|
||||
elseif percent <= 80 then
|
||||
icon = ""
|
||||
color = vars.colors.green
|
||||
elseif percent <= 90 then
|
||||
icon = ""
|
||||
color = vars.colors.green
|
||||
elseif percent <= 100 then
|
||||
icon = ""
|
||||
color = vars.colors.green
|
||||
end
|
||||
|
||||
widget:set_markup("<span color=\"" .. color .. "\">" .. icon .. "</span>")
|
||||
end)
|
||||
local qmath = require "quarrel.math"
|
||||
local gcolor = require "gears.color"
|
||||
local phosphor = require "assets.phosphor"
|
||||
|
||||
local battery = wibox.widget {
|
||||
widget = wibox.container.place,
|
||||
battery_inner
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
{
|
||||
widget = wibox.widget.imagebox,
|
||||
image = gcolor.recolor_image(phosphor.battery_warning_vertical_fill, qvars.colors.red),
|
||||
forced_width = qvars.icon_size,
|
||||
forced_height = qvars.icon_size
|
||||
}
|
||||
}
|
||||
|
||||
h.tooltip({ battery }, function()
|
||||
return io.popen("cat /sys/class/power_supply/BAT0/capacity"):read("*a"):sub(0, -2) .. "%"
|
||||
awesome.connect_signal("services::battery", function(capacity, status)
|
||||
if status == "Charging" then
|
||||
battery.widget.image = gcolor.recolor_image(phosphor.battery_charging_vertical_fill, qvars.colors.green)
|
||||
return
|
||||
end
|
||||
|
||||
local icon_data = qmath.step_value(capacity, {
|
||||
{ 0, { "empty", "red" } },
|
||||
{ 20, { "low", "red" } },
|
||||
{ 40, { "medium", "yellow" } },
|
||||
{ 60, { "high", "green" } },
|
||||
{ 80, { "full", "green" } },
|
||||
{ 100 }
|
||||
})
|
||||
|
||||
battery.widget.image = gcolor.recolor_image(phosphor["battery_vertical_" .. icon_data[1] .. "_fill"], qvars.colors[icon_data[2]])
|
||||
end)
|
||||
|
||||
return battery
|
||||
|
|
|
@ -1,18 +1,32 @@
|
|||
local vars = require "misc.vars"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
local h = require "misc.helpers"
|
||||
local qmath = require "quarrel.math"
|
||||
local gcolor = require "gears.color"
|
||||
local phosphor = require "assets.phosphor"
|
||||
|
||||
local brightness = wibox.widget {
|
||||
widget = wibox.container.place,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
font = vars.font,
|
||||
text = ""
|
||||
},
|
||||
widget = wibox.widget.imagebox,
|
||||
image = gcolor.recolor_image(phosphor.moon_fill, qvars.colors.fg),
|
||||
forced_width = qvars.icon_size,
|
||||
forced_height = qvars.icon_size
|
||||
}
|
||||
}
|
||||
|
||||
h.tooltip({ brightness }, function()
|
||||
return math.floor(tonumber(io.popen("brightnessctl g"):read("*a"):sub(0, -2)) / 255 * 100) .. "%"
|
||||
awesome.connect_signal("services::brightness", function(value)
|
||||
local icon_data = qmath.step_value(value, {
|
||||
{ 0, "cloud_moon" },
|
||||
{ 51, "moon" },
|
||||
{ 102, "sun_horizon" },
|
||||
{ 153, "sun_dim" },
|
||||
{ 204, "sun" },
|
||||
{ 255 }
|
||||
})
|
||||
|
||||
brightness.widget.image = gcolor.recolor_image(phosphor[icon_data .. "_fill"], qvars.colors.fg)
|
||||
end)
|
||||
|
||||
return brightness
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
local vars = require "misc.vars"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
local h = require "misc.helpers"
|
||||
local qui = require "quarrel.ui"
|
||||
|
||||
local clock = wibox.widget {
|
||||
widget = wibox.container.place,
|
||||
{
|
||||
format = "%H\n%M",
|
||||
widget = wibox.widget.textclock,
|
||||
font = vars.font
|
||||
font = qvars.font
|
||||
},
|
||||
}
|
||||
|
||||
h.tooltip({ clock }, function()
|
||||
qui.tooltip({ clock }, function()
|
||||
return os.date("%a %d/%m/%y")
|
||||
end)
|
||||
|
||||
|
|
|
@ -1,89 +1,82 @@
|
|||
local awful = require "awful"
|
||||
local vars = require "misc.vars"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
local timed = require "lib.rubato".timed
|
||||
local gcolor = require "gears.color"
|
||||
local phosphor = require "assets.phosphor"
|
||||
local qbind = require "quarrel.bind"
|
||||
|
||||
return awful.widget.taglist({
|
||||
return awful.widget.taglist {
|
||||
screen = screen[1],
|
||||
filter = awful.widget.taglist.filter.all,
|
||||
style = {
|
||||
shape = vars.shape
|
||||
},
|
||||
layout = {
|
||||
spacing = vars.padding,
|
||||
spacing = qvars.padding,
|
||||
layout = wibox.layout.fixed.vertical
|
||||
},
|
||||
widget_template = {
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
bg = vars.colors.bright.black,
|
||||
shape = vars.shape,
|
||||
forced_height = vars.button_size,
|
||||
forced_width = vars.button_size,
|
||||
id = "indicator_role"
|
||||
},
|
||||
widget = wibox.container.place,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
{
|
||||
widget = wibox.widget.imagebox,
|
||||
image = gcolor.recolor_image(phosphor.circle_bold, qvars.colors.fg),
|
||||
forced_width = qvars.icon_size,
|
||||
forced_height = qvars.icon_size,
|
||||
icon = phosphor.dot_fill
|
||||
},
|
||||
create_callback = function(self, tag)
|
||||
local indicator = self:get_children_by_id("indicator_role")[1]
|
||||
|
||||
self._anim = timed {
|
||||
duration = vars.anim_duration,
|
||||
intro = vars.anim_intro,
|
||||
pos = indicator.height,
|
||||
subscribed = function(pos)
|
||||
indicator.forced_height = pos
|
||||
end
|
||||
}
|
||||
|
||||
if tag.selected then
|
||||
indicator.bg = vars.colors.yellow
|
||||
self._anim.target = vars.button_size * 2
|
||||
elseif next(tag:clients()) then
|
||||
indicator.bg = vars.colors.bright.black
|
||||
self._anim.target = vars.button_size * 1.5
|
||||
else
|
||||
self._anim.target = vars.button_size
|
||||
end
|
||||
-- self.widget.icon = phosphor[next(tag:clients()) and "circle_fill" or "circle_bold"]
|
||||
|
||||
self:connect_signal("mouse::enter", function()
|
||||
if tag.selected then return end
|
||||
|
||||
indicator.bg = vars.colors.yellow
|
||||
self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.yellow)
|
||||
end)
|
||||
|
||||
self:connect_signal("mouse::leave", function()
|
||||
if tag.selected then return end
|
||||
|
||||
if next(tag:clients()) then
|
||||
indicator.bg = vars.colors.bright.black
|
||||
return
|
||||
end
|
||||
|
||||
indicator.bg = vars.colors.bright.black
|
||||
self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.fg)
|
||||
end)
|
||||
end,
|
||||
update_callback = function(self, tag)
|
||||
local indicator = self:get_children_by_id("indicator_role")[1]
|
||||
|
||||
if tag.selected then
|
||||
indicator.bg = vars.colors.yellow
|
||||
self._anim.target = vars.button_size * 2
|
||||
elseif next(tag:clients()) then
|
||||
indicator.bg = vars.colors.bright.black
|
||||
self._anim.target = vars.button_size * 1.5
|
||||
self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.yellow)
|
||||
return
|
||||
end
|
||||
|
||||
self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.fg)
|
||||
end,
|
||||
update_callback = function(self, tag)
|
||||
-- self.widget.icon = phosphor[next(tag:clients()) and "circle_fill" or "circle_bold"]
|
||||
|
||||
if tag.selected then
|
||||
self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.yellow)
|
||||
else
|
||||
indicator.bg = vars.colors.bright.black
|
||||
self._anim.target = vars.button_size
|
||||
self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.fg)
|
||||
end
|
||||
end
|
||||
},
|
||||
buttons = {
|
||||
awful.button({ }, 1, function(t) t:view_only() end),
|
||||
awful.button(vars.mods.M, 1, function(t)
|
||||
if client.focus then
|
||||
client.focus:move_to_tag(t)
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 3, awful.tag.viewtoggle),
|
||||
qbind:new {
|
||||
triggers = qvars.btns.left,
|
||||
press = function(t)
|
||||
t:view_only()
|
||||
end,
|
||||
hidden = true
|
||||
},
|
||||
qbind:new {
|
||||
mods = qvars.mods.M,
|
||||
triggers = qvars.btns.left,
|
||||
press = function(t)
|
||||
if client.focus then
|
||||
client.focus:move_to_tag(t)
|
||||
end
|
||||
end,
|
||||
hidden = true
|
||||
},
|
||||
qbind:new {
|
||||
triggers = qvars.btns.right,
|
||||
press = awful.tag.viewtoggle,
|
||||
hidden = true
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,48 +1,36 @@
|
|||
local awful = require "awful"
|
||||
local vars = require "misc.vars"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
local h = require "misc.helpers"
|
||||
|
||||
local wifi_inner = awful.widget.watch("awk 'NR==3 {printf(\"%.0f\", $3*10/7)}' /proc/net/wireless", 1, function(widget, stdout)
|
||||
widget.font = "DejaVu Sans Mono wifi ramp Normal 8"
|
||||
local icon = ""
|
||||
local color = vars.colors.red
|
||||
|
||||
if stdout == "" then
|
||||
widget:set_markup("<span color=\"" .. color .. "\">" .. icon .. "</span>")
|
||||
return
|
||||
end
|
||||
|
||||
local percent = tonumber(stdout)
|
||||
|
||||
if percent <= 20 then
|
||||
icon = ""
|
||||
color = vars.colors.red
|
||||
elseif percent <= 40 then
|
||||
icon = ""
|
||||
color = vars.colors.yellow
|
||||
elseif percent <= 60 then
|
||||
icon = ""
|
||||
color = vars.colors.yellow
|
||||
elseif percent <= 80 then
|
||||
icon = ""
|
||||
color = vars.colors.green
|
||||
elseif percent <= 100 then
|
||||
icon = ""
|
||||
color = vars.colors.green
|
||||
end
|
||||
|
||||
|
||||
widget:set_markup("<span color=\"" .. color .. "\">" .. icon .. "</span>")
|
||||
end)
|
||||
local qmath = require "quarrel.math"
|
||||
local gcolor = require "gears.color"
|
||||
local phosphor = require "assets.phosphor"
|
||||
|
||||
local wifi = wibox.widget {
|
||||
widget = wibox.container.place,
|
||||
wifi_inner
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
{
|
||||
widget = wibox.widget.imagebox,
|
||||
image = gcolor.recolor_image(phosphor.wifi_x_fill, qvars.colors.red),
|
||||
forced_width = qvars.icon_size,
|
||||
forced_height = qvars.icon_size
|
||||
}
|
||||
}
|
||||
|
||||
h.tooltip({ wifi }, function()
|
||||
return io.popen("iwgetid -r"):read("*a"):sub(0, -2)
|
||||
awesome.connect_signal("services::wifi", function(strength, connected)
|
||||
if not connected then
|
||||
wifi.widget.image = gcolor.recolor_image(phosphor.wifi_x_fill, qvars.colors.red)
|
||||
return
|
||||
end
|
||||
|
||||
local icon_data = qmath.step_value(strength, {
|
||||
{ 0, { "none", "red" } },
|
||||
{ 25, { "low", "yellow" } },
|
||||
{ 50, { "medium", "yellow" } },
|
||||
{ 75, { "high", "green" } },
|
||||
{ 100 }
|
||||
})
|
||||
|
||||
wifi.widget.image = gcolor.recolor_image(phosphor["wifi_" .. icon_data[1] .. "_fill"], qvars.colors[icon_data[2]])
|
||||
end)
|
||||
|
||||
return wifi
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
local awful = require "awful"
|
||||
local vars = require "misc.vars"
|
||||
local qvars = require "quarrel.vars"
|
||||
local wibox = require "wibox"
|
||||
local debug = require "gears.debug"
|
||||
local gtimer = require "gears.timer"
|
||||
local naughty = require "naughty"
|
||||
-- local rubato = require "lib.rubato"
|
||||
local default = require "ui.wicked._default"
|
||||
local h = require "misc.helpers"
|
||||
|
||||
local beautiful = require "beautiful"
|
||||
local xresources = require "beautiful.xresources"
|
||||
local dpi = xresources.apply_dpi
|
||||
local qui = require "quarrel.ui"
|
||||
|
||||
local wicked = {}
|
||||
|
||||
|
@ -18,7 +14,7 @@ wicked._active_notififcations = {}
|
|||
|
||||
function wicked:notify(n)
|
||||
-- local notif = wibox.widget {
|
||||
local notif = h.popup {
|
||||
local notif = qui.popup {
|
||||
-- widget = {
|
||||
-- {
|
||||
-- {
|
||||
|
@ -26,7 +22,7 @@ function wicked:notify(n)
|
|||
-- notification = n,
|
||||
-- forced_height = 0,
|
||||
-- forced_width = 0,
|
||||
-- clip_shape = vars.shape,
|
||||
-- clip_shape = qvars.shape,
|
||||
-- id = "icon_role"
|
||||
-- },
|
||||
-- {
|
||||
|
@ -41,10 +37,10 @@ function wicked:notify(n)
|
|||
-- layout = wibox.layout.fixed.vertical
|
||||
-- },
|
||||
-- layout = wibox.layout.fixed.horizontal,
|
||||
-- spacing = vars.padding
|
||||
-- spacing = qvars.padding
|
||||
-- },
|
||||
-- widget = wibox.container.margin,
|
||||
-- margins = vars.padding
|
||||
-- margins = qvars.padding
|
||||
-- },
|
||||
widget = {
|
||||
-- {
|
||||
|
@ -82,7 +78,7 @@ function wicked:notify(n)
|
|||
}
|
||||
|
||||
gtimer {
|
||||
timeout = vars.notif_timeout,
|
||||
timeout = qvars.notif_timeout,
|
||||
autostart = true,
|
||||
callback = function()
|
||||
notif.visible = false
|
||||
|
|
|
@ -1,172 +0,0 @@
|
|||
local awful = require "awful"
|
||||
local vars = require "misc.vars"
|
||||
local wibox = require "wibox"
|
||||
local obj = require "gears.object"
|
||||
local debug = require "gears.debug"
|
||||
local naughty = require "naughty"
|
||||
local xresources = require "beautiful.xresources"
|
||||
local dpi = xresources.apply_dpi
|
||||
|
||||
|
||||
local ws = obj {
|
||||
enable_properties = true,
|
||||
enable_auto_signals = true
|
||||
}
|
||||
|
||||
ws.selected = 1
|
||||
ws.max = 0
|
||||
|
||||
local widget = awful.popup {
|
||||
widget = {
|
||||
{
|
||||
widget = awful.widget.tasklist {
|
||||
screen = screen[1],
|
||||
filter = awful.widget.tasklist.filter.allscreen,
|
||||
style = {
|
||||
shape = vars.shape,
|
||||
},
|
||||
layout = {
|
||||
forced_num_rows = 1,
|
||||
layout = wibox.layout.grid.vertical,
|
||||
spacing = vars.padding
|
||||
},
|
||||
widget_template = {
|
||||
{
|
||||
layout = wibox.layout.align.horizontal,
|
||||
{
|
||||
widget = wibox.container.place,
|
||||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = dpi(6),
|
||||
{
|
||||
id = "text_role",
|
||||
widget = wibox.widget.textbox,
|
||||
}
|
||||
}
|
||||
},
|
||||
nil,
|
||||
{
|
||||
widget = wibox.container.place,
|
||||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = dpi(6),
|
||||
{
|
||||
id = "tag_role",
|
||||
widget = wibox.widget.textbox,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
forced_width = dpi(screen[1].geometry.width / 8),
|
||||
bg = vars.colors.black,
|
||||
border_width = vars.border_width,
|
||||
border_color = vars.colors.black,
|
||||
shape = vars.shape,
|
||||
widget = wibox.container.background,
|
||||
create_callback = function(self, client, i)
|
||||
-- self:get_children_by_id("name_role")[1].text = client.name
|
||||
self:get_children_by_id("tag_role")[1].text = client.first_tag.name
|
||||
|
||||
ws:connect_signal("property::selected", function(selected)
|
||||
naughty.notification {
|
||||
urgency = "critical",
|
||||
message = tostring(selected) .. " | " .. tostring(i)
|
||||
}
|
||||
|
||||
if selected == i then
|
||||
self.border_color = vars.colors.yellow
|
||||
else
|
||||
self.border_color = vars.colors.black
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- update_callback = function(self, _, i)
|
||||
-- if ws.selected == i then
|
||||
-- self.border_color = vars.colors.yellow
|
||||
-- else
|
||||
-- self.border_color = vars.colors.black
|
||||
-- end
|
||||
-- end
|
||||
}
|
||||
},
|
||||
id = "tasklist"
|
||||
},
|
||||
widget = wibox.container.margin,
|
||||
margins = vars.padding
|
||||
},
|
||||
border_color = vars.colors.bright.black,
|
||||
border_width = vars.border_width,
|
||||
ontop = true,
|
||||
placement = awful.placement.centered,
|
||||
bg = vars.colors.bg,
|
||||
shape = vars.shape,
|
||||
visible = false
|
||||
}
|
||||
|
||||
ws.widget = widget
|
||||
|
||||
ws.max = ws.widget.widget.tasklist.count
|
||||
|
||||
|
||||
|
||||
-- ws.widget:connect_signal("property::count", function(self)
|
||||
-- naughty.notification {
|
||||
-- urgency = "critical",
|
||||
-- message = tostring(ws.max)
|
||||
-- }
|
||||
-- ws.max = self.count
|
||||
-- end)
|
||||
|
||||
awful.keygrabber {
|
||||
keybindings = {
|
||||
awful.key {
|
||||
modifiers = { "Mod1" },
|
||||
key = "Tab",
|
||||
on_press = function()
|
||||
-- naughty.notification {
|
||||
-- urgency = "critical",
|
||||
-- message = tostring(WS.widget)
|
||||
-- }
|
||||
naughty.notification {
|
||||
urgency = "critical",
|
||||
message = tostring(ws.selected)
|
||||
}
|
||||
-- local file = io.open("/home/delta/.cache/awesome/tasklist_dump.txt", "w+")
|
||||
-- file:write(debug.dump_return(WS.widget, "tasklist"))
|
||||
-- file:close()
|
||||
-- ws.widget:emit_signal_recursive("widget::layout_changed")
|
||||
-- WS.widget:emit_signal("widget::redraw_needed")
|
||||
if ws.selected + 1 > ws.max then
|
||||
ws.selected = 1
|
||||
return
|
||||
end
|
||||
ws.selected = ws.selected + 1
|
||||
end
|
||||
},
|
||||
awful.key {
|
||||
modifiers = { "Mod1", "Shift" },
|
||||
key = "Tab",
|
||||
on_press = function()
|
||||
ws.widget:emit_signal("widget::layout_changed")
|
||||
if ws.selected - 1 == 0 then
|
||||
ws.selected = ws.max
|
||||
return
|
||||
end
|
||||
ws.selected = ws.selected - 1
|
||||
end
|
||||
},
|
||||
},
|
||||
stop_key = "Mod1",
|
||||
stop_event = "release",
|
||||
start_callback = function()
|
||||
ws.widget.visible = true
|
||||
naughty.notification {
|
||||
urgency = "critical",
|
||||
message = tostring(ws.max)
|
||||
}
|
||||
end,
|
||||
stop_callback = function()
|
||||
ws.widget.visible = false
|
||||
end,
|
||||
autostart = false
|
||||
}
|
|
@ -1,3 +1,7 @@
|
|||
if not status is-interactive
|
||||
exit
|
||||
end
|
||||
|
||||
# fish
|
||||
set -gx FISH_CFG $XDG_CONFIG_HOME/fish
|
||||
set -g fish_greeting
|
||||
|
@ -18,6 +22,7 @@ set -gx BAT_THEME "ansi"
|
|||
set -gx PNPM_HOME "$HOME/.local/share/pnpm"
|
||||
set -gx GTK_USE_PORTAL 1
|
||||
set -gx LITE_SCALE 1.3
|
||||
set -gx RANGER_LOAD_DEFAULT_RC "FALSE"
|
||||
|
||||
# $PATH
|
||||
source $FISH_CFG/path.fish
|
||||
|
@ -37,6 +42,7 @@ abbr -a projects cd ~/DesktopTemp/RealProjects
|
|||
abbr -a gc git commit -m
|
||||
abbr -a ga git add
|
||||
abbr -a gcl git clone
|
||||
alias imgcat="wezterm imgcat"
|
||||
alias dots="git --git-dir=$HOME/.dots --work-tree=$HOME"
|
||||
alias sudo="doas"
|
||||
alias ls="ls --color=auto"
|
||||
|
|