a lot of stuff
6
.gitmodules
vendored
@@ -10,6 +10,6 @@
|
||||
[submodule "awesome/src/lib/nice"]
|
||||
path = awesome/src/lib/nice
|
||||
url = https://github.com/Crylia/awesome-wm-nice
|
||||
[submodule "awesome/src/lib/lua-dbus_proxy"]
|
||||
path = awesome/src/lib/lua-dbus_proxy
|
||||
url = https://github.com/Crylia/lua-dbus_proxy
|
||||
[submodule "awesome/src/lib/dbus_proxy"]
|
||||
path = awesome/src/lib/dbus_proxy
|
||||
url = git@github.com:Crylia/lua-dbus_proxy.git
|
||||
|
||||
@@ -432,6 +432,8 @@ function inputbox.new(args)
|
||||
--gtable.crush(w, args)
|
||||
gtable.crush(w, inputbox, true)
|
||||
|
||||
w.font = args.font or beautiful.font
|
||||
|
||||
w.keybindings = args.keybindings or {}
|
||||
w.hint_text = args.hint_text
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ tag = tag
|
||||
-- Do not touch as this is used to share some variable settings files
|
||||
Global_config = {}
|
||||
|
||||
require("src.core.error_handling")
|
||||
require("src.theme.user_config")
|
||||
require("src.theme.theme_config")
|
||||
require("src.tools.gio_icon_lookup")
|
||||
require("src.theme.init")
|
||||
require("src.core.error_handling")
|
||||
require("src.tools.hex_to_rgba")
|
||||
require("src.core.signals")
|
||||
require("src.core.notifications")
|
||||
@@ -32,4 +32,6 @@ require("src.core.rules")
|
||||
require("src.bindings.global_buttons")
|
||||
require("src.bindings.bind_to_tags")
|
||||
require("src.modules.init")
|
||||
--require("src.tools.auto_starter")(User_config.autostart)
|
||||
require("src.tools.auto_starter")(User_config.autostart)
|
||||
|
||||
--require("src.config.setup")()
|
||||
|
||||
93
awesome/src/assets/fonts/Comfortaa/OFL.txt
Normal file
@@ -0,0 +1,93 @@
|
||||
Copyright 2011 The Comfortaa Project Authors (https://github.com/alexeiva/comfortaa), with Reserved Font Name "Comfortaa".
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
67
awesome/src/assets/fonts/Comfortaa/README.txt
Normal file
@@ -0,0 +1,67 @@
|
||||
Comfortaa Variable Font
|
||||
=======================
|
||||
|
||||
This download contains Comfortaa as both a variable font and static fonts.
|
||||
|
||||
Comfortaa is a variable font with this axis:
|
||||
wght
|
||||
|
||||
This means all the styles are contained in a single file:
|
||||
Comfortaa-VariableFont_wght.ttf
|
||||
|
||||
If your app fully supports variable fonts, you can now pick intermediate styles
|
||||
that aren’t available as static fonts. Not all apps support variable fonts, and
|
||||
in those cases you can use the static font files for Comfortaa:
|
||||
static/Comfortaa-Light.ttf
|
||||
static/Comfortaa-Regular.ttf
|
||||
static/Comfortaa-Medium.ttf
|
||||
static/Comfortaa-SemiBold.ttf
|
||||
static/Comfortaa-Bold.ttf
|
||||
|
||||
Get started
|
||||
-----------
|
||||
|
||||
1. Install the font files you want to use
|
||||
|
||||
2. Use your app's font picker to view the font family and all the
|
||||
available styles
|
||||
|
||||
Learn more about variable fonts
|
||||
-------------------------------
|
||||
|
||||
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
|
||||
https://variablefonts.typenetwork.com
|
||||
https://medium.com/variable-fonts
|
||||
|
||||
In desktop apps
|
||||
|
||||
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
|
||||
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
|
||||
|
||||
Online
|
||||
|
||||
https://developers.google.com/fonts/docs/getting_started
|
||||
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
|
||||
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
|
||||
|
||||
Installing fonts
|
||||
|
||||
MacOS: https://support.apple.com/en-us/HT201749
|
||||
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
|
||||
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
|
||||
|
||||
Android Apps
|
||||
|
||||
https://developers.google.com/fonts/docs/android
|
||||
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
|
||||
|
||||
License
|
||||
-------
|
||||
Please read the full license text (OFL.txt) to understand the permissions,
|
||||
restrictions and requirements for usage, redistribution, and modification.
|
||||
|
||||
You can use them in your products & projects – print or digital,
|
||||
commercial or otherwise.
|
||||
|
||||
This isn't legal advice, please consider consulting a lawyer and see the full
|
||||
license for all details.
|
||||
BIN
awesome/src/assets/fonts/Comfortaa/static/Comfortaa-Bold.ttf
Normal file
BIN
awesome/src/assets/fonts/Comfortaa/static/Comfortaa-Light.ttf
Normal file
BIN
awesome/src/assets/fonts/Comfortaa/static/Comfortaa-Medium.ttf
Normal file
BIN
awesome/src/assets/fonts/Comfortaa/static/Comfortaa-Regular.ttf
Normal file
BIN
awesome/src/assets/fonts/Comfortaa/static/Comfortaa-SemiBold.ttf
Normal file
93
awesome/src/assets/fonts/Raleway/OFL.txt
Normal file
@@ -0,0 +1,93 @@
|
||||
Copyright 2010 The Raleway Project Authors (impallari@gmail.com), with Reserved Font Name "Raleway".
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
81
awesome/src/assets/fonts/Raleway/README.txt
Normal file
@@ -0,0 +1,81 @@
|
||||
Raleway Variable Font
|
||||
=====================
|
||||
|
||||
This download contains Raleway as both variable fonts and static fonts.
|
||||
|
||||
Raleway is a variable font with this axis:
|
||||
wght
|
||||
|
||||
This means all the styles are contained in these files:
|
||||
Raleway-VariableFont_wght.ttf
|
||||
Raleway-Italic-VariableFont_wght.ttf
|
||||
|
||||
If your app fully supports variable fonts, you can now pick intermediate styles
|
||||
that aren’t available as static fonts. Not all apps support variable fonts, and
|
||||
in those cases you can use the static font files for Raleway:
|
||||
static/Raleway-Thin.ttf
|
||||
static/Raleway-ExtraLight.ttf
|
||||
static/Raleway-Light.ttf
|
||||
static/Raleway-Regular.ttf
|
||||
static/Raleway-Medium.ttf
|
||||
static/Raleway-SemiBold.ttf
|
||||
static/Raleway-Bold.ttf
|
||||
static/Raleway-ExtraBold.ttf
|
||||
static/Raleway-Black.ttf
|
||||
static/Raleway-ThinItalic.ttf
|
||||
static/Raleway-ExtraLightItalic.ttf
|
||||
static/Raleway-LightItalic.ttf
|
||||
static/Raleway-Italic.ttf
|
||||
static/Raleway-MediumItalic.ttf
|
||||
static/Raleway-SemiBoldItalic.ttf
|
||||
static/Raleway-BoldItalic.ttf
|
||||
static/Raleway-ExtraBoldItalic.ttf
|
||||
static/Raleway-BlackItalic.ttf
|
||||
|
||||
Get started
|
||||
-----------
|
||||
|
||||
1. Install the font files you want to use
|
||||
|
||||
2. Use your app's font picker to view the font family and all the
|
||||
available styles
|
||||
|
||||
Learn more about variable fonts
|
||||
-------------------------------
|
||||
|
||||
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
|
||||
https://variablefonts.typenetwork.com
|
||||
https://medium.com/variable-fonts
|
||||
|
||||
In desktop apps
|
||||
|
||||
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
|
||||
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
|
||||
|
||||
Online
|
||||
|
||||
https://developers.google.com/fonts/docs/getting_started
|
||||
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
|
||||
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
|
||||
|
||||
Installing fonts
|
||||
|
||||
MacOS: https://support.apple.com/en-us/HT201749
|
||||
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
|
||||
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
|
||||
|
||||
Android Apps
|
||||
|
||||
https://developers.google.com/fonts/docs/android
|
||||
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
|
||||
|
||||
License
|
||||
-------
|
||||
Please read the full license text (OFL.txt) to understand the permissions,
|
||||
restrictions and requirements for usage, redistribution, and modification.
|
||||
|
||||
You can use them in your products & projects – print or digital,
|
||||
commercial or otherwise.
|
||||
|
||||
This isn't legal advice, please consider consulting a lawyer and see the full
|
||||
license for all details.
|
||||
BIN
awesome/src/assets/fonts/Raleway/Raleway-VariableFont_wght.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-Black.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-BlackItalic.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-Bold.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-BoldItalic.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-ExtraBold.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-ExtraLight.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-Italic.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-Light.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-LightItalic.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-Medium.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-MediumItalic.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-Regular.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-SemiBold.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-Thin.ttf
Normal file
BIN
awesome/src/assets/fonts/Raleway/static/Raleway-ThinItalic.ttf
Normal file
|
Before Width: | Height: | Size: 20 KiB |
3
awesome/src/assets/icons/setup/choose.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||
<path fill="#212121" d="M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 243 B |
4
awesome/src/assets/icons/setup/close.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#00000000">
|
||||
<path d="M0 0h24v24H0z" />
|
||||
<path fill="#ef9a9a" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 273 B |
3
awesome/src/assets/icons/setup/left.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||
<path fill="#F0F0F0" d="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 160 B |
BIN
awesome/src/assets/icons/setup/openweathermap.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
3
awesome/src/assets/icons/setup/right.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||
<path fill="#F0F0F0" d="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 158 B |
BIN
awesome/src/assets/icons/setup/status_bars.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
awesome/src/assets/icons/setup/title_center.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
awesome/src/assets/icons/setup/title_left.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
awesome/src/assets/icons/setup/title_right.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
awesome/src/assets/icons/setup/titlebar.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
awesome/src/assets/icons/setup/titlebar_alt.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
awesome/src/assets/layout/cornerne.png
Normal file
|
After Width: | Height: | Size: 272 B |
BIN
awesome/src/assets/layout/cornernw.png
Normal file
|
After Width: | Height: | Size: 263 B |
BIN
awesome/src/assets/layout/cornerse.png
Normal file
|
After Width: | Height: | Size: 264 B |
BIN
awesome/src/assets/layout/cornersw.png
Normal file
|
After Width: | Height: | Size: 263 B |
BIN
awesome/src/assets/layout/dwindle.png
Normal file
|
After Width: | Height: | Size: 320 B |
BIN
awesome/src/assets/layout/fairh.png
Normal file
|
After Width: | Height: | Size: 245 B |
BIN
awesome/src/assets/layout/fairv.png
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
awesome/src/assets/layout/floating.png
Normal file
|
After Width: | Height: | Size: 282 B |
BIN
awesome/src/assets/layout/fullscreen.png
Normal file
|
After Width: | Height: | Size: 866 B |
BIN
awesome/src/assets/layout/magnifier.png
Normal file
|
After Width: | Height: | Size: 345 B |
BIN
awesome/src/assets/layout/max.png
Normal file
|
After Width: | Height: | Size: 574 B |
BIN
awesome/src/assets/layout/spiral.png
Normal file
|
After Width: | Height: | Size: 328 B |
BIN
awesome/src/assets/layout/tile.png
Normal file
|
After Width: | Height: | Size: 265 B |
BIN
awesome/src/assets/layout/tilebottom.png
Normal file
|
After Width: | Height: | Size: 264 B |
BIN
awesome/src/assets/layout/tileleft.png
Normal file
|
After Width: | Height: | Size: 266 B |
BIN
awesome/src/assets/layout/tiletop.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 318 KiB After Width: | Height: | Size: 305 KiB |
@@ -7,9 +7,6 @@ local ruled = require("ruled")
|
||||
-- Third party libs
|
||||
local json = require("src.lib.json-lua.json-lua")
|
||||
|
||||
-- Own libs
|
||||
local backlight_helper = require("src.tools.helpers.backlight")
|
||||
|
||||
local capi = {
|
||||
awesome = awesome,
|
||||
mousegrabber = mousegrabber,
|
||||
|
||||
@@ -8,7 +8,6 @@ local gears = require("gears")
|
||||
local menubar = require('menubar')
|
||||
local naughty = require("naughty")
|
||||
local wibox = require("wibox")
|
||||
local wtemplate = require("wibox.template")
|
||||
|
||||
local rubato = require("src.lib.rubato")
|
||||
|
||||
@@ -32,9 +31,7 @@ naughty.config.defaults.spacing = Theme_config.notification.spacing
|
||||
|
||||
Theme.notification_spacing = Theme_config.notification.corner_spacing
|
||||
|
||||
naughty.connect_signal(
|
||||
'request::icon',
|
||||
function(n, context, hints)
|
||||
naughty.connect_signal('request::icon', function(n, context, hints)
|
||||
if context ~= 'app_icon' then
|
||||
return
|
||||
end
|
||||
@@ -42,12 +39,9 @@ naughty.connect_signal(
|
||||
if path then
|
||||
n.icon = path
|
||||
end
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
naughty.connect_signal(
|
||||
"request::display",
|
||||
function(n)
|
||||
naughty.connect_signal("request::display", function(n)
|
||||
if User_config.dnd then
|
||||
n:destroy()
|
||||
else
|
||||
@@ -421,8 +415,7 @@ naughty.connect_signal(
|
||||
box.buttons = {}
|
||||
n.buttons = {}
|
||||
end
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
naughty.connect_signal(
|
||||
"destroyed",
|
||||
|
||||
@@ -14,23 +14,15 @@ local capi = {
|
||||
tag = tag
|
||||
}
|
||||
|
||||
capi.screen.connect_signal(
|
||||
"added",
|
||||
function()
|
||||
capi.screen.connect_signal("added", function()
|
||||
capi.awesome.restart()
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
capi.screen.connect_signal(
|
||||
"removed",
|
||||
function()
|
||||
capi.screen.connect_signal("removed", function()
|
||||
capi.awesome.restart()
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
capi.client.connect_signal(
|
||||
"manage",
|
||||
function(c)
|
||||
capi.client.connect_signal("manage", function(c)
|
||||
if capi.awesome.startup and not c.size_hints.user_porition and not c.size_hints.program_position then
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
@@ -47,52 +39,36 @@ capi.client.connect_signal(
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
capi.client.connect_signal(
|
||||
'unmanage',
|
||||
function(c)
|
||||
capi.client.connect_signal('unmanage', function(c)
|
||||
if #awful.screen.focused().clients > 0 then
|
||||
awful.screen.focused().clients[1]:emit_signal(
|
||||
'request::activate',
|
||||
'mouse_enter',
|
||||
{
|
||||
'mouse_enter', {
|
||||
raise = true
|
||||
}
|
||||
)
|
||||
})
|
||||
end
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
capi.tag.connect_signal(
|
||||
'property::selected',
|
||||
function(c)
|
||||
capi.tag.connect_signal('property::selected', function(c)
|
||||
if #awful.screen.focused().clients > 0 then
|
||||
awful.screen.focused().clients[1]:emit_signal(
|
||||
'request::activate',
|
||||
'mouse_enter',
|
||||
{
|
||||
'mouse_enter', {
|
||||
raise = true
|
||||
}
|
||||
)
|
||||
})
|
||||
end
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
-- Sloppy focus
|
||||
--[[ client.connect_signal(
|
||||
"mouse::enter",
|
||||
function(c)
|
||||
--[[ client.connect_signal("mouse::enter", function(c)
|
||||
c:emit_signal(
|
||||
"request::activate",
|
||||
"mouse_enter",
|
||||
{
|
||||
"mouse_enter",{
|
||||
raise = true
|
||||
}
|
||||
)
|
||||
end
|
||||
) ]]
|
||||
})
|
||||
end) ]]
|
||||
|
||||
--- Takes a wibox.container.background and connects four signals to it
|
||||
---@param widget wibox.container.background a background widget
|
||||
|
||||
1
awesome/src/lib/dbus_proxy
Submodule
@@ -18,8 +18,6 @@ local gshape = require('gears.shape')
|
||||
local gobject = require('gears.object')
|
||||
local mousegrabber = mousegrabber
|
||||
|
||||
local rubato = require("src.lib.rubato")
|
||||
|
||||
local overflow = { mt = {} }
|
||||
|
||||
-- Determine the required space to draw the layout's children and, if necessary,
|
||||
@@ -275,7 +273,7 @@ end
|
||||
|
||||
--- Scroll the layout's content by `amount * step`.
|
||||
--
|
||||
-- A positive amount scroll down/right, a negative amount scrolls up/left.
|
||||
-- A positive amount scrolls down/right, a negative amount scrolls up/left.
|
||||
--
|
||||
-- The amount of units scrolled is affected by `step`.
|
||||
--
|
||||
@@ -307,9 +305,6 @@ end
|
||||
-- @tparam number scroll_factor The scroll factor.
|
||||
-- @propemits true false
|
||||
|
||||
overflow.rubato_timed = rubato.timed { duration = 0.2 }
|
||||
|
||||
local first_call = true
|
||||
function overflow:set_scroll_factor(factor)
|
||||
local current = self._private.scroll_factor
|
||||
local interval = self._private.used_in_dir - self._private.avail_in_dir
|
||||
@@ -323,22 +318,10 @@ function overflow:set_scroll_factor(factor)
|
||||
return
|
||||
end
|
||||
|
||||
self._private.scroll_factor = math.min(1, math.max(factor, 0))
|
||||
|
||||
local function update_scroll()
|
||||
self._private.scroll_factor = self.rubato_timed.pos
|
||||
self:emit_signal("widget::layout_changed")
|
||||
self:emit_signal("property::scroll_factor", factor)
|
||||
end
|
||||
|
||||
-- Make sure it only subscribes once
|
||||
if first_call then
|
||||
self.rubato_timed:subscribe(update_scroll)
|
||||
--first_call = false
|
||||
end
|
||||
|
||||
-- Set the target to the new target + remaining target from last scroll. This makes it scroll faster and correctly.
|
||||
self.rubato_timed.target = math.min(1,
|
||||
math.max(factor + (self.rubato_timed.target - self.rubato_timed.pos), 0))
|
||||
end
|
||||
|
||||
function overflow:get_scroll_factor()
|
||||
@@ -486,6 +469,19 @@ function overflow:get_scrollbar_widget()
|
||||
return self._private.scrollbar_widget
|
||||
end
|
||||
|
||||
function overflow:reset()
|
||||
self._private.widgets = {}
|
||||
self._private.scroll_factor = 0
|
||||
|
||||
local scrollbar_widget = separator({ shape = gshape.rectangle })
|
||||
apply_scrollbar_mouse_signal(self, scrollbar_widget)
|
||||
self._private.scrollbar_widget = scrollbar_widget
|
||||
|
||||
self:emit_signal("widget::layout_changed")
|
||||
self:emit_signal("widget::reset")
|
||||
self:emit_signal("widget::reseted")
|
||||
end
|
||||
|
||||
local function new(dir, ...)
|
||||
local ret = fixed[dir](...)
|
||||
|
||||
@@ -538,7 +534,7 @@ end
|
||||
-- widgets exceeds the height available whithin the layout's outer container
|
||||
-- a scrollbar will be added and scrolling behavior enabled.
|
||||
-- @tparam widget ... Widgets that should be added to the layout.
|
||||
-- @constructorfct wibox.layout.overflow.horizontal
|
||||
-- @constructorfct wibox.layout.overflow.vertical
|
||||
function overflow.vertical(...)
|
||||
return new("vertical", ...)
|
||||
end
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
return function(s, w)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
return function(s, w)
|
||||
@@ -56,6 +55,7 @@ return function(s, w)
|
||||
bg = Theme_config.right_bar.bg,
|
||||
visible = true,
|
||||
screen = s,
|
||||
maximum_width = dpi(650),
|
||||
placement = function(c) awful.placement.top_right(c, { margins = dpi(10) }) end
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,6 @@ awful.screen.connect_for_each_screen(function(s)
|
||||
require("src.modules.audio.volume_osd") { screen = s }
|
||||
--require("src.modules.audio.volume_controller") { screen = s }
|
||||
require("src.modules.brightness.brightness_osd") { screen = s }
|
||||
require("src.lib.nice") { titlebar_font = User_config.font.bold,
|
||||
titlebar_items = { left = { "icon" }, right = { "minimize", "maximize", "close" } } }
|
||||
require("src.modules.crylia_bar.init")(s)
|
||||
--require("src.modules.crylia_wibox.init")(s)
|
||||
require("src.modules.notification-center.init")(s)
|
||||
@@ -23,3 +21,8 @@ awful.screen.connect_for_each_screen(function(s)
|
||||
require("src.modules.application_launcher.init") { screen = s }
|
||||
require("src.modules.network_controller.init") { screen = s }
|
||||
end)
|
||||
|
||||
do
|
||||
require("src.lib.nice") { titlebar_font = User_config.font.bold,
|
||||
titlebar_items = { left = { "icon" }, right = { "minimize", "maximize", "close" } } }
|
||||
end
|
||||
|
||||
@@ -59,6 +59,7 @@ network.DeviceState = {
|
||||
|
||||
function network:get_wifi_proxy()
|
||||
local devices = self._private.NetworkManager:GetDevices()
|
||||
if (not devices) or (#devices == 0) then return end
|
||||
for _, path in ipairs(devices) do
|
||||
local NetworkManagerDevice = dbus_proxy.Proxy:new {
|
||||
bus = dbus_proxy.Bus.SYSTEM,
|
||||
@@ -117,6 +118,7 @@ end
|
||||
|
||||
---Scan for access points and create a widget for each one.
|
||||
function network:scan_access_points()
|
||||
if not self._private.NetworkManagerDeviceWireless then return end
|
||||
local ap_list = self:get_children_by_id("wifi_ap_list")[1]
|
||||
ap_list:reset()
|
||||
self._private.NetworkManagerDeviceWireless:RequestScanAsync(function(proxy, context, success, failure)
|
||||
@@ -358,7 +360,7 @@ function network.new(args)
|
||||
|
||||
ret:scan_access_points()
|
||||
|
||||
gtimer.delayed_call(function()
|
||||
--[[ gtimer.delayed_call(function()
|
||||
local active_access_point = ret._private.NetworkManagerDeviceWireless.ActiveAccessPoint
|
||||
if ret._private.NetworkManager.State == network.DeviceState.ACTIVATED and active_access_point ~= "/" then
|
||||
local active_access_point_proxy = dbus_proxy.Proxy:new {
|
||||
@@ -368,7 +370,7 @@ function network.new(args)
|
||||
path = active_access_point,
|
||||
}
|
||||
end
|
||||
end)
|
||||
end) ]]
|
||||
|
||||
--#endregion
|
||||
|
||||
|
||||
@@ -497,7 +497,6 @@ return function()
|
||||
local rubato_timer = rubato.timed {
|
||||
duration = 1,
|
||||
pos = bar.value,
|
||||
easing = rubato.linear,
|
||||
subscribed = function(v)
|
||||
bar.value = v
|
||||
end
|
||||
@@ -594,7 +593,6 @@ return function()
|
||||
local rubato_timer = rubato.timed {
|
||||
duration = 1,
|
||||
pos = bar.value,
|
||||
easing = rubato.linear,
|
||||
subscribed = function(v)
|
||||
bar.value = v
|
||||
end
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
-- ╚██████╗██║ ██║ ██║ ███████╗██║██║ ██║ --
|
||||
-- ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝╚═╝ ╚═╝ --
|
||||
--------------------------------------------------
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
|
||||
@@ -14,9 +13,6 @@ local capi = {
|
||||
screen = screen,
|
||||
}
|
||||
|
||||
require("src.theme.user_config")
|
||||
require("src.theme.theme_config")
|
||||
|
||||
Theme_path = gears.filesystem.get_configuration_dir() .. "/src/theme/"
|
||||
Theme = {}
|
||||
|
||||
@@ -53,9 +49,6 @@ Theme.hotkeys_label_bg = Theme_config.hotkeys.label_bg
|
||||
Theme.hotkeys_label_fg = Theme_config.hotkeys.label_fg
|
||||
--#endregion
|
||||
|
||||
Theme.awesome_icon = Theme_path .. "../assets/icons/ArchLogo.png"
|
||||
Theme.awesome_subicon = Theme_path .. "../assets/icons/ArchLogo.png"
|
||||
|
||||
-- Wallpaper
|
||||
beautiful.wallpaper = User_config.wallpaper
|
||||
capi.screen.connect_signal(
|
||||
|
||||
@@ -93,7 +93,10 @@ Theme_config.kblayout = {
|
||||
|
||||
Theme_config.layout_list = {
|
||||
bg = color["LightBlue200"],
|
||||
fg = color["Grey900"]
|
||||
fg = color["Grey900"],
|
||||
shape = function(cr, width, height)
|
||||
gshape.rounded_rect(cr, width, height, dpi(6))
|
||||
end
|
||||
}
|
||||
|
||||
Theme_config.network = {
|
||||
@@ -672,6 +675,73 @@ Theme_config.context_menu = {
|
||||
icon_color_hover = color["Teal200"]
|
||||
}
|
||||
}
|
||||
|
||||
Theme_config.setup = {
|
||||
bg = color["Grey900"],
|
||||
border_color = color["Grey800"],
|
||||
border_width = dpi(4),
|
||||
wallpaper = {
|
||||
bg = color["Grey900"],
|
||||
fg = color["Grey100"],
|
||||
clip_shape = function(cr, width, height)
|
||||
gshape.rounded_rect(cr, width, height, dpi(12))
|
||||
end,
|
||||
button_bg = color["Yellow200"],
|
||||
button_fg = color["Grey900"],
|
||||
button_shape = function(cr, width, height)
|
||||
gshape.rounded_rect(cr, width, height, dpi(12))
|
||||
end,
|
||||
close_fg = color["Red200"],
|
||||
path_bg = color["Grey800"],
|
||||
path_fg = color["Grey100"],
|
||||
path_border_color = color["Grey700"],
|
||||
path_border_width = dpi(2),
|
||||
path_shape = function(cr, width, height)
|
||||
gshape.rounded_rect(cr, width, height, dpi(12))
|
||||
end,
|
||||
},
|
||||
bar = {
|
||||
shape = gshape.circle,
|
||||
color = color["Green200"],
|
||||
padding = dpi(4),
|
||||
border_width = dpi(2),
|
||||
border_color = color["Grey800"],
|
||||
widget_bg = color["Grey800"],
|
||||
widget_fg = color["Grey100"],
|
||||
widget_border_color = color["Grey700"],
|
||||
widget_border_width = dpi(2),
|
||||
widget_shape = function(cr, width, height)
|
||||
gshape.rounded_rect(cr, width, height, dpi(8))
|
||||
end,
|
||||
widget_toggle_color = color["Blue200"],
|
||||
bar_shape = function(cr, width, height)
|
||||
gshape.rounded_rect(cr, width, height, dpi(8))
|
||||
end,
|
||||
bar_image_shape = function(cr, width, height)
|
||||
gshape.rounded_rect(cr, width, height, dpi(4))
|
||||
end,
|
||||
},
|
||||
notification = {
|
||||
separator_color = color["Grey800"],
|
||||
checkbox_color = color["Purple200"],
|
||||
checkbox_paddings = dpi(4),
|
||||
checkbox_shape = gshape.circle,
|
||||
border_color = color["Grey800"],
|
||||
border_width = dpi(2),
|
||||
shape = function(cr, width, height)
|
||||
gshape.rounded_rect(cr, width, height, dpi(4))
|
||||
end,
|
||||
},
|
||||
layout = {
|
||||
bg = color["Orange200"],
|
||||
border_color = color["Grey800"],
|
||||
border_width = dpi(2),
|
||||
shape = function(cr, width, height)
|
||||
gshape.rounded_rect(cr, width, height, dpi(8))
|
||||
end,
|
||||
border_color_selected = color["DeepOrange200"]
|
||||
}
|
||||
}
|
||||
-- #endregion
|
||||
|
||||
--[[
|
||||
|
||||
@@ -18,11 +18,9 @@ User_config = {
|
||||
]] --
|
||||
autostart = {
|
||||
"picom",
|
||||
"xfce4-power-manager",
|
||||
"light-locker --lock-on-suspend --lock-on-lid &",
|
||||
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1",
|
||||
"setxkbmap -option caps:swapescape",
|
||||
"/home/crylia/.screenlayout/single.sh"
|
||||
"/home/crylia/.screenlayout/double.sh"
|
||||
},
|
||||
|
||||
--[[
|
||||
@@ -45,7 +43,7 @@ User_config = {
|
||||
"MEDIA_PLAYER"
|
||||
More information at: https://lazka.github.io/pgi-docs/UPowerGlib-1.0/enums.html#UPowerGlib.DeviceKind.KEYBOARD
|
||||
]] --
|
||||
battery_kind = "BATTERY",
|
||||
battery_kind = "LINE_POWER",
|
||||
|
||||
--[[
|
||||
If your battery is not found you can specify its path here.
|
||||
@@ -208,8 +206,6 @@ User_config = {
|
||||
"volume",
|
||||
"gpu_temp",
|
||||
"gpu_usage",
|
||||
"battery",
|
||||
"backlight"
|
||||
},
|
||||
|
||||
--[[
|
||||
@@ -267,7 +263,7 @@ User_config = {
|
||||
unit = "metric"
|
||||
},
|
||||
|
||||
web_browser = "brave-browser",
|
||||
web_browser = "firefox",
|
||||
|
||||
--[[
|
||||
You can configure your bar's here, if you leave it empty the bar will not be shown.
|
||||
@@ -305,16 +301,36 @@ User_config = {
|
||||
"Tasklist"
|
||||
},
|
||||
right_bar = {
|
||||
"Battery",
|
||||
"Network",
|
||||
"Bluetooth",
|
||||
"Cpu Frequency",
|
||||
"Cpu Temperature",
|
||||
"Cpu Usage",
|
||||
"Audio",
|
||||
"Keyboard Layout",
|
||||
"Date",
|
||||
"Clock",
|
||||
"Power Button"
|
||||
}
|
||||
},
|
||||
--[[ [2] = {
|
||||
left_bar = {
|
||||
"Tiling Layout",
|
||||
"Systray",
|
||||
"Taglist"
|
||||
},
|
||||
center_bar = {
|
||||
"Tasklist"
|
||||
},
|
||||
right_bar = {
|
||||
"Gpu Temperature",
|
||||
"Gpu Usage",
|
||||
"Ram",
|
||||
"Audio",
|
||||
"Keyboard Layout",
|
||||
"Date",
|
||||
"Clock",
|
||||
"Power Button"
|
||||
}
|
||||
}]]
|
||||
},
|
||||
|
||||
crylia_wibox = {
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
local cairo = require("lgi").cairo
|
||||
local gcolor = require("gears.color")
|
||||
local gdk = require("lgi").Gdk
|
||||
local gsurface = require("gears.surface")
|
||||
local gtable = require("gears.table")
|
||||
|
||||
local color_helper = { mt = {} }
|
||||
color_helper.color_rules = {}
|
||||
|
||||
function color_helper.set_color_rule(c, color)
|
||||
color_helper.color_rules[c.instance] = color
|
||||
end
|
||||
|
||||
function color_helper.get_color_rule(c)
|
||||
return color_helper.color_rules[c.instance]
|
||||
end
|
||||
|
||||
function color_helper.lighten(color, amount)
|
||||
local r, g, b
|
||||
r, g, b = gcolor.parse_color(color)
|
||||
r = 255 * r
|
||||
g = 255 * g
|
||||
b = 255 * b
|
||||
r = r + math.floor(2.55 * amount)
|
||||
g = g + math.floor(2.55 * amount)
|
||||
b = b + math.floor(2.55 * amount)
|
||||
r = r > 255 and 255 or r
|
||||
g = g > 255 and 255 or g
|
||||
b = b > 255 and 255 or b
|
||||
return ("#%02x%02x%02x"):format(r, g, b)
|
||||
end
|
||||
|
||||
function color_helper.duotone_gradient_vertical(color_1, color_2, height, offset_1, offset_2)
|
||||
local fill_pattern = cairo.Pattern.create_linear(0, 0, 0, height)
|
||||
local r, g, b, a
|
||||
r, g, b, a = gcolor.parse_color(color_1)
|
||||
fill_pattern:add_color_stop_rgba(offset_1 or 0, r, g, b, a)
|
||||
r, g, b, a = gcolor.parse_color(color_2)
|
||||
fill_pattern:add_color_stop_rgba(offset_2 or 1, r, g, b, a)
|
||||
return fill_pattern
|
||||
end
|
||||
|
||||
function color_helper.get_dominant_color(client)
|
||||
local color, pb, bytes
|
||||
local tally, content, cgeo = {}, gsurface(client.content), client:geometry()
|
||||
local x_offset, y_offset, x_lim = 2, 2, math.floor(cgeo.width / 2)
|
||||
|
||||
for x_pos = 0, x_lim, 2 do
|
||||
for y_pos = 0, 8, 1 do
|
||||
pb = gdk.pixbuf_get_from_surface(content, x_offset + x_pos, y_offset + y_pos, 1, 1)
|
||||
bytes = pb:get_pixels()
|
||||
color = "#" .. bytes:gsub(".", function(c)
|
||||
return ("%02x"):format(c:byte())
|
||||
end)
|
||||
if not tally[color] then
|
||||
tally[color] = 1
|
||||
else
|
||||
tally[color] = tally[color] + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
local mode
|
||||
local mode_c = 0
|
||||
for k, v in pairs(tally) do
|
||||
if v > mode_c then
|
||||
mode_c = v
|
||||
mode = k
|
||||
end
|
||||
end
|
||||
color = mode
|
||||
color_helper.set_color_rule(client, color)
|
||||
return color
|
||||
end
|
||||
|
||||
function color_helper.new(args)
|
||||
local ret = {}
|
||||
|
||||
gtable.crush(ret, color_helper, true)
|
||||
|
||||
return ret
|
||||
end
|
||||
|
||||
function color_helper.mt:__call(...)
|
||||
return color_helper.new(...)
|
||||
end
|
||||
|
||||
return setmetatable(color_helper, color_helper.mt)
|
||||
@@ -1,146 +0,0 @@
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local dbus_proxy = require("src.lib.lua-dbus_proxy.src.dbus_proxy")
|
||||
local lgi = require("lgi")
|
||||
|
||||
local capi = {
|
||||
awesome = awesome,
|
||||
}
|
||||
|
||||
return function()
|
||||
|
||||
local function get_device_info(object_path)
|
||||
if object_path ~= nil and object_path:match("/org/bluez/hci0/dev") then
|
||||
local device = dbus_proxy.Proxy:new {
|
||||
bus = dbus_proxy.Bus.SYSTEM,
|
||||
name = "org.bluez",
|
||||
interface = "org.bluez.Device1",
|
||||
path = object_path
|
||||
}
|
||||
|
||||
local battery = dbus_proxy.Proxy:new {
|
||||
bus = dbus_proxy.Bus.SYSTEM,
|
||||
name = "org.bluez",
|
||||
interface = "org.bluez.Battery1",
|
||||
path = object_path
|
||||
}
|
||||
|
||||
local device_properties = dbus_proxy.Proxy:new {
|
||||
bus = dbus_proxy.Bus.SYSTEM,
|
||||
name = "org.bluez",
|
||||
interface = "org.freedesktop.DBus.Properties",
|
||||
path = object_path
|
||||
}
|
||||
|
||||
capi.awesome.emit_signal("bluetooth::scan")
|
||||
if (device.Name ~= nil) or (device.Alias ~= nil) then
|
||||
device_properties:connect_signal(function()
|
||||
capi.awesome.emit_signal("bluetooth::device_changed", device, battery)
|
||||
end, "PropertiesChanged")
|
||||
capi.awesome.emit_signal("bluetooth::device_changed", device, battery)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"lsusb | grep Bluetooth",
|
||||
function(stdout)
|
||||
stdout = stdout:gsub("\n", "")
|
||||
if stdout ~= "" or stdout == nil then
|
||||
local ObjectManager = dbus_proxy.Proxy:new {
|
||||
bus = dbus_proxy.Bus.SYSTEM,
|
||||
name = "org.bluez",
|
||||
interface = "org.freedesktop.DBus.ObjectManager",
|
||||
path = "/"
|
||||
}
|
||||
|
||||
local Adapter = dbus_proxy.Proxy:new {
|
||||
bus = dbus_proxy.Bus.SYSTEM,
|
||||
name = "org.bluez",
|
||||
interface = "org.bluez.Adapter1",
|
||||
path = "/org/bluez/hci0"
|
||||
}
|
||||
|
||||
local AdapterProperties = dbus_proxy.Proxy:new {
|
||||
bus = dbus_proxy.Bus.SYSTEM,
|
||||
name = "org.bluez",
|
||||
interface = "org.freedesktop.DBus.Properties",
|
||||
path = "/org/bluez/hci0"
|
||||
}
|
||||
|
||||
ObjectManager:connect_signal(
|
||||
function(interface)
|
||||
get_device_info(interface)
|
||||
end,
|
||||
"InterfacesAdded"
|
||||
)
|
||||
|
||||
ObjectManager:connect_signal(
|
||||
function(interface)
|
||||
capi.awesome.emit_signal("device_removed", interface)
|
||||
end,
|
||||
"InterfacesRemoved"
|
||||
)
|
||||
|
||||
Adapter:connect_signal(
|
||||
function(data)
|
||||
if data.Powered ~= nil then
|
||||
capi.awesome.emit_signal("state", data.Powered)
|
||||
end
|
||||
end,
|
||||
"PropertiesChanged"
|
||||
)
|
||||
|
||||
capi.awesome.connect_signal(
|
||||
"bluetooth::scan",
|
||||
function()
|
||||
Adapter:StartDiscovery()
|
||||
end
|
||||
)
|
||||
|
||||
capi.awesome.connect_signal(
|
||||
"bluetooth::stop",
|
||||
function()
|
||||
Adapter:StopDiscovery()
|
||||
end
|
||||
)
|
||||
|
||||
AdapterProperties:connect_signal(
|
||||
function(data)
|
||||
if data.Powered ~= nil then
|
||||
if data.Powered then
|
||||
Adapter:StartDiscovery()
|
||||
end
|
||||
end
|
||||
end,
|
||||
"PropertiesChanged"
|
||||
)
|
||||
|
||||
capi.awesome.connect_signal("toggle_bluetooth",
|
||||
function()
|
||||
local is_powered = Adapter.Powered
|
||||
Adapter:Set(
|
||||
"org.bluez.Adapter1",
|
||||
"Powered",
|
||||
lgi.GLib.Variant("b", not is_powered)
|
||||
)
|
||||
Adapter.Powered = { signature = "b", value = not is_powered }
|
||||
capi.awesome.emit_signal("state", Adapter.Powered)
|
||||
end)
|
||||
|
||||
gears.timer.delayed_call(
|
||||
function()
|
||||
local objects = ObjectManager:GetManagedObjects()
|
||||
|
||||
for object_path, _ in pairs(objects) do
|
||||
get_device_info(object_path)
|
||||
end
|
||||
|
||||
capi.awesome.emit_signal("state", Adapter.Powered)
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
end
|
||||
@@ -1,165 +0,0 @@
|
||||
local gears = require("gears")
|
||||
local GLib = require("lgi").GLib
|
||||
|
||||
local m = {}
|
||||
|
||||
---Will return every $XDG_DATA_DIRS
|
||||
---@return table
|
||||
local function get_paths()
|
||||
local dirs = {}
|
||||
|
||||
local dir
|
||||
for _, value in ipairs(GLib.get_system_data_dirs()) do
|
||||
dir = GLib.build_filenamev({ value, "applications" })
|
||||
if gears.filesystem.dir_readable(dir) then table.insert(dirs, dir) end
|
||||
end
|
||||
|
||||
dir = GLib.build_filenamev({ GLib.get_user_data_dir(), "applications" })
|
||||
if gears.filesystem.dir_readable(dir) then table.insert(dirs, dir) end
|
||||
|
||||
return dirs
|
||||
end
|
||||
|
||||
---Returns every found .desktop file that has NoDesktop=false or unset
|
||||
---@return table
|
||||
function m.Get_all_visible_desktop()
|
||||
local dirs = get_paths()
|
||||
local desktops = {}
|
||||
for _, dir in ipairs(dirs) do
|
||||
local files = io.popen('find "' .. dir .. '" -type f,l')
|
||||
if files then
|
||||
for file in files:lines() do
|
||||
if gears.filesystem.file_readable(file) then
|
||||
--[[ local symlink = lfs.symlinkattributes(file, "target")
|
||||
if symlink then
|
||||
file = dir .. symlink
|
||||
end ]]
|
||||
local handler = io.open(file, "r")
|
||||
if not handler then
|
||||
return {}
|
||||
end
|
||||
while true do
|
||||
local line = handler:read()
|
||||
if not line then break end
|
||||
if line:match("^%[Desktop Entry%]") then
|
||||
local name, comment, icon, exec, keywords, terminal, categories, nodisplay = "", "", "", "", "", "", "",
|
||||
false
|
||||
while true do
|
||||
local prop = handler:read() or nil
|
||||
if ((not prop) and name ~= "") or prop:match("^%[(.+)%]") then
|
||||
local desktop_table = {
|
||||
name = name or "",
|
||||
comment = comment or "",
|
||||
icon = icon or "",
|
||||
exec = exec or "",
|
||||
keywords = keywords or "",
|
||||
terminal = terminal or false,
|
||||
categories = categories or "",
|
||||
nodisplay = nodisplay or false,
|
||||
file = file
|
||||
}
|
||||
table.insert(desktops, desktop_table)
|
||||
break
|
||||
end
|
||||
|
||||
if prop:match("^Name=") then
|
||||
name = prop:match("Name=(.+)")
|
||||
end
|
||||
if prop:match("^Comment=") then
|
||||
comment = prop:match("Comment=(.+)")
|
||||
end
|
||||
if prop:match("^Icon=") then
|
||||
icon = prop:match("Icon=(.+)")
|
||||
end
|
||||
if prop:match("^Exec=") then
|
||||
exec = prop:match("Exec=(.+)"):gsub("%%u", ""):gsub("%%U", ""):gsub("%%f", ""):gsub("%%F", ""):gsub("%%i"
|
||||
, ""):gsub("%%c", ""):gsub("%%k", "")
|
||||
end
|
||||
if prop:match("^Keywords=") then
|
||||
keywords = prop:match("Keywords=(.+)")
|
||||
end
|
||||
if prop:match("^Terminal=") then
|
||||
terminal = prop:match("Terminal=(.+)")
|
||||
end
|
||||
if prop:match("^Categories=") then
|
||||
categories = prop:match("Categories=(.+)")
|
||||
end
|
||||
if prop:match("^NoDisplay=") then
|
||||
nodisplay = prop:match("NoDisplay=(.+)")
|
||||
if nodisplay == "false" then
|
||||
nodisplay = false
|
||||
else
|
||||
nodisplay = true
|
||||
end
|
||||
end
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
handler:close()
|
||||
end
|
||||
end
|
||||
files:close()
|
||||
end
|
||||
end
|
||||
return desktops
|
||||
end
|
||||
|
||||
---Returns every .desktop file into a table
|
||||
---@param file table .desktop files
|
||||
---@return table
|
||||
function m.Get_desktop_values(file)
|
||||
|
||||
if not file or file == "" then
|
||||
return {}
|
||||
end
|
||||
|
||||
local handler = nil
|
||||
|
||||
for _, dir in ipairs(get_paths()) do
|
||||
handler = io.open(dir .. "/" .. file, "r")
|
||||
if handler then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if not handler then
|
||||
return {}
|
||||
end
|
||||
|
||||
local desktop_table = {}
|
||||
while true do
|
||||
local line = handler:read()
|
||||
|
||||
if not line then
|
||||
break
|
||||
end
|
||||
|
||||
if line:match("^%[Desktop Entry%]") then
|
||||
while true do
|
||||
local property = handler:read()
|
||||
if not property then
|
||||
break
|
||||
end
|
||||
|
||||
if property:match("^%[(.+)%]") then
|
||||
return desktop_table
|
||||
end
|
||||
|
||||
if property:match("^Name=") then
|
||||
desktop_table["Name"] = property:match("Name=(.+)")
|
||||
elseif property:match("^Exec") then
|
||||
-- Second match is to remove the %u, %U and %f, %F some applications use to open a URI/URL. It's not needed here
|
||||
desktop_table["Exec"] = property:match("Exec=(.+)"):gsub("%%u", ""):gsub("%%U", ""):gsub("%%f", ""):gsub("%%F"
|
||||
, ""):gsub("%%i", ""):gsub("%%c", ""):gsub("%%k", "")
|
||||
elseif property:match("^Icon=") then
|
||||
desktop_table["Icon"] = property:match("Icon=(.+)")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
handler:close()
|
||||
return desktop_table
|
||||
end
|
||||
|
||||
return m
|
||||
@@ -1,40 +1,10 @@
|
||||
local awful = require("awful")
|
||||
local aspawn = require("awful.spawn")
|
||||
|
||||
local capi = {
|
||||
awesome = awesome,
|
||||
}
|
||||
|
||||
local lgi = require("lgi")
|
||||
|
||||
|
||||
|
||||
--[[ ctx:connect(nil, function(state)
|
||||
if state == 4 then
|
||||
print("Connection is ready")
|
||||
|
||||
ctx:get_sinks(function(sinks)
|
||||
print(sinks[1])
|
||||
end)
|
||||
end
|
||||
end) ]]
|
||||
|
||||
--local address = pulse.get_address()
|
||||
|
||||
--[[ local connection = pulse.get_connection(address)
|
||||
|
||||
local core = pulse.get_core(connection)
|
||||
|
||||
local sink = pulse.get_device(connection, core:get_sinks()[1])
|
||||
|
||||
sink:set_muted(false)
|
||||
|
||||
--assert(not sink:is_muted())
|
||||
|
||||
sink:set_volume_percent({ 75 }) ]]
|
||||
|
||||
awful.spawn.with_line_callback(
|
||||
[[bash -c "LC_ALL=C pactl subscribe"]],
|
||||
{
|
||||
aspawn.with_line_callback([[bash -c "LC_ALL=C pactl subscribe"]], {
|
||||
stdout = function(line)
|
||||
-- Volume changed
|
||||
if line:match("on sink") or line:match("on source") then
|
||||
@@ -48,25 +18,12 @@ awful.spawn.with_line_callback(
|
||||
end
|
||||
end,
|
||||
output_done = function()
|
||||
-- Kill the pulseaudio subscribe command to prevent it from spawning multiple instances
|
||||
awful.spawn.with_shell("pkill pactl && pkill grep")
|
||||
aspawn.with_shell("pkill pactl && pkill grep")
|
||||
end
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
capi.awesome.connect_signal(
|
||||
"exit",
|
||||
function()
|
||||
awful.spawn.with_shell("pkill pactl && pkill grep")
|
||||
end
|
||||
)
|
||||
|
||||
capi.awesome.connect_signal(
|
||||
"audio::volume_changed",
|
||||
function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"./.config/awesome/src/scripts/vol.sh mute",
|
||||
function(stdout)
|
||||
capi.awesome.connect_signal("audio::volume_changed", function()
|
||||
aspawn.easy_async_with_shell("./.config/awesome/src/scripts/vol.sh mute", function(stdout)
|
||||
if stdout == "" or stdout == nil then
|
||||
return
|
||||
end
|
||||
@@ -74,43 +31,29 @@ capi.awesome.connect_signal(
|
||||
if stdout:match("yes") then
|
||||
muted = true
|
||||
end
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"./.config/awesome/src/scripts/vol.sh volume",
|
||||
function(stdout2)
|
||||
aspawn.easy_async_with_shell("./.config/awesome/src/scripts/vol.sh volume", function(stdout2)
|
||||
if stdout == "" or stdout == nil then
|
||||
return
|
||||
end
|
||||
capi.awesome.emit_signal("audio::get", muted, stdout2:gsub("%%", ""):gsub("\n", "") or 0)
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
capi.awesome.connect_signal(
|
||||
"microphone::volume_changed",
|
||||
function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"./.config/awesome/src/scripts/mic.sh mute",
|
||||
function(stdout)
|
||||
capi.awesome.connect_signal("microphone::volume_changed", function()
|
||||
aspawn.easy_async_with_shell("./.config/awesome/src/scripts/mic.sh mute", function(stdout)
|
||||
local muted = false
|
||||
if stdout:match("yes") then
|
||||
muted = true
|
||||
end
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"./.config/awesome/src/scripts/mic.sh volume",
|
||||
function(stdout2)
|
||||
aspawn.easy_async_with_shell("./.config/awesome/src/scripts/mic.sh volume", function(stdout2)
|
||||
if stdout2 == nil or stdout2 == "awful" then
|
||||
return
|
||||
end
|
||||
capi.awesome.emit_signal("microphone::get", muted, stdout2:gsub("%%", ""):gsub("\n", "") or 0)
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
capi.awesome.emit_signal("audio::volume_changed")
|
||||
capi.awesome.emit_signal("microphone::volume_changed")
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
local lgi = require("lgi")
|
||||
local Gtk = lgi.require("Gtk", "3.0")
|
||||
|
||||
local gtk_theme = Gtk.IconTheme.new()
|
||||
Gtk.IconTheme.set_custom_theme(gtk_theme, User_config.icon_theme)
|
||||
|
||||
function Get_gicon_path(app)
|
||||
local icon_info = gtk_theme:lookup_by_gicon(app, 64, 0)
|
||||
if icon_info then
|
||||
local path = icon_info:get_filename()
|
||||
if path then
|
||||
return path
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
@@ -1,106 +0,0 @@
|
||||
local theme_index = { mt = {} }
|
||||
|
||||
theme_index.new = function(cls, theme, basedirs)
|
||||
local self = {}
|
||||
setmetatable(self, { __index = cls })
|
||||
|
||||
self.icon_theme_name = theme or User_config.icon_theme
|
||||
self.base_dir = nil
|
||||
self["Directories"] = {}
|
||||
self["Inherits"] = {}
|
||||
self.per_directory_keys = {}
|
||||
|
||||
local basedir, handler = nil, nil
|
||||
for _, dir in ipairs(basedirs) do
|
||||
basedir = dir .. "/" .. self.icon_theme_name
|
||||
handler = io.open(basedir .. "/index.theme", "r")
|
||||
if handler then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if not handler then
|
||||
return self
|
||||
end
|
||||
self.base_dir = basedir
|
||||
|
||||
while true do
|
||||
local line = handler:read()
|
||||
|
||||
if not line then
|
||||
break
|
||||
end
|
||||
|
||||
local header = line:match("^%[(.+)%]$")
|
||||
if header then
|
||||
if header == "Icon Theme" then
|
||||
while true do
|
||||
local property = handler:read()
|
||||
|
||||
if not property then
|
||||
break
|
||||
end
|
||||
|
||||
if property:match("^%[(.+)%]$") then
|
||||
handler:seek("cur", -string.len(property) - 1)
|
||||
break
|
||||
end
|
||||
|
||||
local key, value = property:match("^(%w+)=(.*)$")
|
||||
if key == "Directories" or key == "Inherits" then
|
||||
string.gsub(value, "([^,]+),?", function(match)
|
||||
table.insert(self[key], match)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
local keys = {}
|
||||
|
||||
while true do
|
||||
local property = handler:read()
|
||||
if not property then
|
||||
break
|
||||
end
|
||||
|
||||
if property:match("^%[(.+)%]$") then
|
||||
handler:seek("cur", -string.len(property) - 1)
|
||||
break
|
||||
end
|
||||
|
||||
local key, value = property:match("^(%w+)=(%w+)$")
|
||||
if key == "Size" or key == "MinSize" or key == "MaxSize" or key == "Threshold" then
|
||||
keys[key] = tonumber(value)
|
||||
elseif key == "Type" then
|
||||
keys[key] = value
|
||||
end
|
||||
end
|
||||
|
||||
if keys["Size"] then
|
||||
if not keys["Type"] then keys["Type"] = "Threshold" end
|
||||
if not keys["MinSize"] then keys["MinSize"] = keys["Size"] end
|
||||
if not keys["MaxSize"] then keys["MaxSize"] = keys["Size"] end
|
||||
if not keys["Threshold"] then keys["Threshold"] = 2 end
|
||||
self.per_directory_keys[header] = keys
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
handler:close()
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
theme_index.get_subdirectories = function(self)
|
||||
return self["Directories"]
|
||||
end
|
||||
|
||||
theme_index.get_inherits = function(self)
|
||||
return self["Inherits"]
|
||||
end
|
||||
|
||||
theme_index.mt.__call = function(cls, theme, basedirs)
|
||||
return theme_index.new(cls, theme, basedirs)
|
||||
end
|
||||
|
||||
return setmetatable(theme_index, theme_index.mt)
|
||||
@@ -1,245 +0,0 @@
|
||||
-----------------------------------------------------
|
||||
-- Helper to get icons from a program/program name --
|
||||
-----------------------------------------------------
|
||||
|
||||
local gears = require("gears")
|
||||
local GLib = require("lgi").GLib
|
||||
|
||||
local theme_index = require("src.tools.theme_index")
|
||||
|
||||
local function get_basedir()
|
||||
local dirs = {}
|
||||
|
||||
local dir = GLib.build_filenamev({ GLib.get_home_dir(), ".icons" })
|
||||
if gears.filesystem.dir_readable(dir) then
|
||||
table.insert(dirs, dir)
|
||||
end
|
||||
|
||||
dir = GLib.build_filenamev({ GLib.get_user_data_dir(), "icons" })
|
||||
if gears.filesystem.dir_readable(dir) then table.insert(dirs, dir) end
|
||||
|
||||
for _, value in ipairs(GLib.get_system_data_dirs()) do
|
||||
dir = GLib.build_filenamev({ value, "icons" })
|
||||
if gears.filesystem.dir_readable(dir) then table.insert(dirs, dir) end
|
||||
end
|
||||
|
||||
local need_usr_share_pixmaps = true
|
||||
for _, value in ipairs(GLib.get_system_data_dirs()) do
|
||||
dir = GLib.build_filenamev({ value, "icons" })
|
||||
if gears.filesystem.dir_readable(dir) then table.insert(dirs, dir) end
|
||||
if dir == "/usr/share/pixmaps" then
|
||||
need_usr_share_pixmaps = false
|
||||
end
|
||||
end
|
||||
|
||||
dir = "/usr/share/pixmaps"
|
||||
if gears.filesystem.dir_readable(dir) then table.insert(dirs, dir) end
|
||||
if need_usr_share_pixmaps and gears.filesystem.dir_readable(dir) then
|
||||
table.insert(dirs, dir)
|
||||
end
|
||||
|
||||
return dirs
|
||||
end
|
||||
|
||||
local xdg_icon_lookup = { mt = {} }
|
||||
|
||||
local icon_cache = {}
|
||||
|
||||
xdg_icon_lookup.new = function(theme, base_dirs)
|
||||
local self = {}
|
||||
|
||||
self.icon_theme = theme or User_config.icon_theme
|
||||
self.base_directories = base_dirs or get_basedir()
|
||||
self.file_extension = { "svg", "png", "xpm" }
|
||||
|
||||
if not icon_cache[self.icon_theme] then
|
||||
icon_cache[self.icon_theme] = {}
|
||||
end
|
||||
|
||||
local cache_key = table.concat(self.base_directories, ":")
|
||||
if not icon_cache[self.icon_theme][cache_key] then
|
||||
icon_cache[self.icon_theme][cache_key] = theme_index(self.icon_theme, self.base_directories)
|
||||
end
|
||||
self.theme_index = icon_cache[self.icon_theme][cache_key]
|
||||
|
||||
return setmetatable(self, { __index = xdg_icon_lookup })
|
||||
end
|
||||
|
||||
---Look for an fallback icon
|
||||
---@param iconname any
|
||||
---@return string|nil nil
|
||||
local function lookup_fallback_icon(self, iconname)
|
||||
for _, dir in ipairs(self.base_directories) do
|
||||
for _, ext in ipairs(self.file_extension) do
|
||||
local filename = string.format("%s/%s.%s", dir, iconname, ext)
|
||||
if gears.filesystem.file_readable(filename) then
|
||||
return filename
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
---Checkes if the size equals the actual icon size
|
||||
---@param subdir any
|
||||
---@param iconsize any
|
||||
---@return boolean
|
||||
local function directory_matches_size(self, subdir, iconsize)
|
||||
local type, size, min_size, max_size, threshold = self.theme_index.per_directory_keys[subdir]["Type"],
|
||||
self.theme_index.per_directory_keys[subdir]["Size"], self.theme_index.per_directory_keys[subdir]["MinSize"],
|
||||
self.theme_index.per_directory_keys[subdir]["MaxSize"], self.theme_index.per_directory_keys[subdir]["Threshold"]
|
||||
|
||||
if type == "Fixed" then
|
||||
return iconsize == size
|
||||
elseif type == "Scalable" then
|
||||
return iconsize >= min_size and iconsize <= max_size
|
||||
elseif type == "Threshold" then
|
||||
return iconsize >= size - threshold and iconsize <= size + threshold
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
---Returns how far off the size is from the actual icon size
|
||||
---@param subdir table
|
||||
---@param iconsize number
|
||||
---@return number
|
||||
local function directory_size_distance(self, subdir, iconsize)
|
||||
local type, size, min_size, max_size, threshold = self.theme_index.per_directory_keys[subdir]["Type"],
|
||||
self.theme_index.per_directory_keys[subdir]["Size"], self.theme_index.per_directory_keys[subdir]["MinSize"],
|
||||
self.theme_index.per_directory_keys[subdir]["MaxSize"], self.theme_index.per_directory_keys[subdir]["Threshold"]
|
||||
|
||||
if type and min_size and max_size and threshold then
|
||||
if type == "Fixed" then
|
||||
return math.abs(size - iconsize)
|
||||
elseif type == "Scalable" then
|
||||
if iconsize < min_size then
|
||||
return min_size - iconsize
|
||||
elseif iconsize > max_size then
|
||||
return iconsize - max_size
|
||||
end
|
||||
return 0
|
||||
elseif type == "Threshold" then
|
||||
if iconsize < size - threshold then
|
||||
return min_size - iconsize
|
||||
elseif iconsize > size + threshold then
|
||||
return iconsize - max_size
|
||||
end
|
||||
return 0
|
||||
end
|
||||
end
|
||||
return 0xffffffff
|
||||
end
|
||||
|
||||
---Checks each and every sub directory for an icon
|
||||
---@param iconname any
|
||||
---@param size any
|
||||
---@return string|unknown|nil path_to_icon
|
||||
local function lookup_icon(self, iconname, size)
|
||||
local already_checked = {}
|
||||
for _, subdir in ipairs(self.theme_index:get_subdirectories()) do
|
||||
for _, dir in ipairs(self.base_directories) do
|
||||
for _, ext in ipairs(self.file_extension) do
|
||||
if directory_matches_size(self, subdir, size) then
|
||||
local filename = string.format("%s/%s/%s/%s.%s", dir, self.icon_theme, subdir, iconname, ext)
|
||||
if gears.filesystem.file_readable(filename) then
|
||||
return filename
|
||||
else
|
||||
already_checked[filename] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local min_size = 0xffffffff
|
||||
local closest_filename = nil
|
||||
for _, subdir in ipairs(self.theme_index:get_subdirectories()) do
|
||||
local dist = directory_size_distance(self, subdir, size)
|
||||
if dist < min_size then
|
||||
for _, dir in ipairs(self.base_directories) do
|
||||
for _, ext in ipairs(self.file_extension) do
|
||||
local filename = string.format("%s/%s/%s/%s.%s", dir, self.icon_theme, subdir, iconname, ext)
|
||||
if not already_checked[filename] then
|
||||
if gears.filesystem.file_readable(filename) then
|
||||
closest_filename = filename
|
||||
min_size = dist
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return closest_filename or nil
|
||||
end
|
||||
|
||||
---Check if the icon inherits from another icon theme and search that for an icon
|
||||
---@param icon any
|
||||
---@param size any
|
||||
---@param self any
|
||||
---@return string|unknown|nil path_to_icon
|
||||
local function find_icon_helper(self, icon, size)
|
||||
local filename = lookup_icon(self, icon, size)
|
||||
if filename then return filename end
|
||||
|
||||
-- Exists purely for clients in hope to find a matching icon.
|
||||
filename = lookup_icon(self, icon:lower(), size)
|
||||
if filename then return filename end
|
||||
|
||||
-- !Disabled for now until memory leak can be fixed.
|
||||
--[[ for _, parent in ipairs(self.theme_index:get_inherits()) do
|
||||
if parent == "hicolor" then
|
||||
return
|
||||
end
|
||||
filename = find_icon_helper(xdg_icon_lookup(parent, self.base_directories), icon, size)
|
||||
if filename then return filename end
|
||||
end ]]
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
local iconcache = {}
|
||||
---Takes an icon and its props and theme to search for it inside the theme
|
||||
---@param icon any
|
||||
---@param size any
|
||||
---@return string|nil path_to_icon
|
||||
function xdg_icon_lookup:find_icon(icon, size)
|
||||
size = size or 64
|
||||
|
||||
|
||||
if icon_cache[icon] == "" then return nil end
|
||||
if iconcache[icon] then return iconcache[icon] end
|
||||
|
||||
if not icon or icon == "" then return nil end
|
||||
|
||||
if gears.filesystem.file_readable(icon) then
|
||||
iconcache[icon] = icon
|
||||
return icon
|
||||
end
|
||||
|
||||
local filename = find_icon_helper(self, icon, size)
|
||||
if filename then
|
||||
iconcache[icon] = filename
|
||||
return filename
|
||||
end
|
||||
|
||||
filename = find_icon_helper(xdg_icon_lookup("hicolor", self.base_directories), icon, size)
|
||||
if filename then
|
||||
iconcache[icon] = filename
|
||||
return filename
|
||||
end
|
||||
|
||||
filename = lookup_fallback_icon(self, icon)
|
||||
if filename then
|
||||
iconcache[icon] = filename
|
||||
return filename
|
||||
end
|
||||
|
||||
iconcache[icon] = ""
|
||||
return nil
|
||||
end
|
||||
|
||||
xdg_icon_lookup.mt.__call = function(_, ...)
|
||||
return xdg_icon_lookup.new(...)
|
||||
end
|
||||
|
||||
return setmetatable(xdg_icon_lookup, xdg_icon_lookup.mt)
|
||||
@@ -2,7 +2,7 @@
|
||||
-- This is the audio widget --
|
||||
------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
@@ -61,9 +61,7 @@ return function(s)
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
capi.awesome.connect_signal(
|
||||
"audio::get",
|
||||
function(muted, volume)
|
||||
capi.awesome.connect_signal("audio::get", function(muted, volume)
|
||||
if muted then
|
||||
audio_widget.container.audio_layout.label.visible = false
|
||||
audio_widget.container.audio_layout.icon_margin.icon_layout.icon:set_image(
|
||||
@@ -92,19 +90,10 @@ return function(s)
|
||||
audio_widget.container.audio_layout.icon_margin.icon_layout.icon:set_image(
|
||||
gears.color.recolor_image(icon .. ".svg", Theme_config.audio.fg))
|
||||
end
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
-- Signals
|
||||
Hover_signal(audio_widget)
|
||||
|
||||
audio_widget:connect_signal(
|
||||
"button::press",
|
||||
function()
|
||||
capi.awesome.emit_signal("volume_controller::toggle", s)
|
||||
capi.awesome.emit_signal("volume_controller::toggle:keygrabber")
|
||||
end
|
||||
)
|
||||
|
||||
return audio_widget
|
||||
end
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
---------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
@@ -13,7 +12,7 @@ local rubato = require("src.lib.rubato")
|
||||
|
||||
require("src.tools.helpers.cpu_freq")
|
||||
require("src.tools.helpers.cpu_temp")
|
||||
--!Has to be disabled until rewritten to perform better require("src.tools.helpers.cpu_usage")
|
||||
require("src.tools.helpers.cpu_usage")
|
||||
|
||||
local capi = {
|
||||
awesome = awesome,
|
||||
@@ -22,7 +21,7 @@ local capi = {
|
||||
local icon_dir = gears.filesystem.get_configuration_dir() .. "src/assets/icons/cpu/"
|
||||
|
||||
--TODO: Add tooltip with more CPU and per core information
|
||||
return function(widget, _)
|
||||
return function(widget)
|
||||
|
||||
local cpu_usage_widget = wibox.widget {
|
||||
{
|
||||
@@ -153,12 +152,9 @@ return function(widget, _)
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
capi.awesome.connect_signal(
|
||||
"update::cpu_usage",
|
||||
function(usage)
|
||||
capi.awesome.connect_signal("update::cpu_usage", function(usage)
|
||||
cpu_usage_widget.container.cpu_layout.label.text = usage .. "%"
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
local r_timed_cpu_bg = rubato.timed { duration = 2.5 }
|
||||
local g_timed_cpu_bg = rubato.timed { duration = 2.5 }
|
||||
@@ -180,9 +176,7 @@ return function(widget, _)
|
||||
r_timed_cpu_bg.target, g_timed_cpu_bg.target, b_timed_cpu_bg.target = color.utils.hex_to_rgba(newbg)
|
||||
end
|
||||
|
||||
capi.awesome.connect_signal(
|
||||
"update::cpu_temp",
|
||||
function(temp)
|
||||
capi.awesome.connect_signal("update::cpu_temp", function(temp)
|
||||
local temp_icon
|
||||
local temp_color
|
||||
|
||||
@@ -200,22 +194,15 @@ return function(widget, _)
|
||||
set_bg(temp_color)
|
||||
cpu_temp.container.cpu_layout.label.text = math.floor(temp) .. "°C"
|
||||
capi.awesome.emit_signal("update::cpu_temp_widget", temp, temp_icon)
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
capi.awesome.connect_signal(
|
||||
"update::cpu_freq_average",
|
||||
function(average)
|
||||
capi.awesome.connect_signal("update::cpu_freq_average", function(average)
|
||||
cpu_clock.container.cpu_layout.label.text = average .. "Mhz"
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
capi.awesome.connect_signal(
|
||||
"update::cpu_freq_core",
|
||||
function(freq)
|
||||
capi.awesome.connect_signal("update::cpu_freq_core", function(freq)
|
||||
cpu_clock.container.cpu_layout.label.text = freq .. "Mhz"
|
||||
end
|
||||
)
|
||||
end)
|
||||
|
||||
Hover_signal(cpu_temp)
|
||||
Hover_signal(cpu_usage_widget)
|
||||
|
||||
@@ -3,25 +3,32 @@
|
||||
----------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local abutton = require("awful.button")
|
||||
local alayout = require("awful.layout")
|
||||
local awidget = require("awful.widget")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local gtable = require("gears.table")
|
||||
local wibox = require("wibox")
|
||||
|
||||
--#region Layout icons
|
||||
local layout_path = Theme_path .. "../assets/layout/"
|
||||
|
||||
Theme.layout_floating = layout_path .. "floating.svg"
|
||||
Theme.layout_tile = layout_path .. "tile.svg"
|
||||
Theme.layout_dwindle = layout_path .. "dwindle.svg"
|
||||
Theme.layout_fairh = layout_path .. "fairh.svg"
|
||||
Theme.layout_fairv = layout_path .. "fairv.svg"
|
||||
Theme.layout_fullscreen = layout_path .. "fullscreen.svg"
|
||||
Theme.layout_max = layout_path .. "max.svg"
|
||||
Theme.layout_cornerne = layout_path .. "cornerne.svg"
|
||||
Theme.layout_cornernw = layout_path .. "cornernw.svg"
|
||||
Theme.layout_cornerse = layout_path .. "cornerse.svg"
|
||||
Theme.layout_cornersw = layout_path .. "cornersw.svg"
|
||||
Theme.layout_cornerne = layout_path .. "cornerne.png"
|
||||
Theme.layout_cornernw = layout_path .. "cornernw.png"
|
||||
Theme.layout_cornerse = layout_path .. "cornerse.png"
|
||||
Theme.layout_cornersw = layout_path .. "cornersw.png"
|
||||
Theme.layout_dwindle = layout_path .. "dwindle.png"
|
||||
Theme.layout_fairh = layout_path .. "fairh.png"
|
||||
Theme.layout_fairv = layout_path .. "fairv.png"
|
||||
Theme.layout_floating = layout_path .. "floating.png"
|
||||
Theme.layout_fullscreen = layout_path .. "fullscreen.png"
|
||||
Theme.layout_magnifier = layout_path .. "magnifier.png"
|
||||
Theme.layout_max = layout_path .. "max.png"
|
||||
Theme.layout_spiral = layout_path .. "spiral.png"
|
||||
Theme.layout_tile = layout_path .. "tile.png"
|
||||
Theme.layout_tilebottom = layout_path .. "tilebottom.png"
|
||||
Theme.layout_tileleft = layout_path .. "tileleft.png"
|
||||
Theme.layout_tiletop = layout_path .. "tiletop.png"
|
||||
--#endregion
|
||||
|
||||
-- Returns the layoutbox widget
|
||||
@@ -29,32 +36,40 @@ return function()
|
||||
local layout = wibox.widget {
|
||||
{
|
||||
{
|
||||
awful.widget.layoutbox(),
|
||||
id = "icon_layout",
|
||||
widget = wibox.container.place
|
||||
{
|
||||
awidget.layoutbox(),
|
||||
widget = wibox.container.place,
|
||||
halign = "center",
|
||||
valign = "center"
|
||||
},
|
||||
id = "icon_margin",
|
||||
left = dpi(5),
|
||||
right = dpi(5),
|
||||
forced_width = dpi(40),
|
||||
widget = wibox.container.margin
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
widget = wibox.container.constraint,
|
||||
width = dpi(40)
|
||||
},
|
||||
bg = Theme_config.layout_list.bg,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(6))
|
||||
end,
|
||||
shape = Theme_config.layout_list.shape,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
-- Signals
|
||||
Hover_signal(layout)
|
||||
|
||||
layout:connect_signal(
|
||||
"button::press",
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end
|
||||
)
|
||||
layout:buttons(gtable.join(
|
||||
abutton({}, 1, function()
|
||||
alayout.inc(1)
|
||||
end),
|
||||
abutton({}, 3, function()
|
||||
alayout.inc(-1)
|
||||
end),
|
||||
abutton({}, 4, function()
|
||||
alayout.inc(1)
|
||||
end),
|
||||
abutton({}, 5, function()
|
||||
alayout.inc(-1)
|
||||
end)
|
||||
))
|
||||
|
||||
return layout
|
||||
end
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
- Algorithm to select the best search match
|
||||
- Keep track of most launched applications and serve them over others
|
||||
|
||||
### Audio [0% Done]
|
||||
|
||||
#### TODO
|
||||
|
||||
- Reliabely fetch audio devices
|
||||
- Switch inputs
|
||||
- Fetch programs that make audio
|
||||
- Mute toggle
|
||||
|
||||
### Backlight [100% Done]
|
||||
|
||||
#### Features
|
||||
@@ -42,6 +51,7 @@
|
||||
|
||||
#### TODO
|
||||
|
||||
- Don't try to create a bluetooth proxy if there is no bluetooth adapter
|
||||
- Getting and asking for a passcode
|
||||
- "Greying out" non avaiable options in the dropdown
|
||||
|
||||
@@ -65,16 +75,18 @@
|
||||
|
||||
### Desktop [40% Done]
|
||||
|
||||
#### Features
|
||||
|
||||
- Create desktop icons, folders or files
|
||||
- Drag and drop desktop icons
|
||||
- Context menu
|
||||
- Saves accross restart
|
||||
- Desktop context menu
|
||||
|
||||
TODO
|
||||
#### TODO
|
||||
|
||||
- Actions for the context menu
|
||||
- Open width in context menu
|
||||
- "Open with" in context menu
|
||||
- Drag across multiple screens
|
||||
- Proper size calculation for desktop icons and desktop
|
||||
- Multiscreen support in general
|
||||
@@ -83,4 +95,73 @@ TODO
|
||||
- Drag-select
|
||||
- Cross-DE support (e.g. use the same desktop icons as used in KDE or Mate ...)
|
||||
|
||||
### crylia_bar [100% Done]
|
||||
|
||||
#### Features
|
||||
|
||||
- Add widgets into three different bars (Left, Center, Right)
|
||||
- Hide when no widget is present
|
||||
- Auto resize based on widgets size
|
||||
- Automatically loads widgets from config
|
||||
|
||||
### crylia_wibox [? Done]
|
||||
|
||||
#### Features
|
||||
|
||||
- Single bar that can be placed at the bottom
|
||||
- Automatically loads widgets from config
|
||||
|
||||
#### TODO
|
||||
|
||||
### Network Controller [50% Done]
|
||||
|
||||
#### Features
|
||||
|
||||
- List and show all WiFi-AccessPoints
|
||||
- Connect to an AccessPoint
|
||||
- Enter a password for each AccessPoint
|
||||
|
||||
#### TODO
|
||||
|
||||
- Toggle WiFi On/Off
|
||||
- Mark the connected AccessPoint
|
||||
- Send signals for connected AccessPoints wifi strength
|
||||
- Send notifications for various events
|
||||
- Only show the Module when a WiFi Agent exists
|
||||
|
||||
### Notification Center [95% Done]
|
||||
|
||||
#### Features
|
||||
|
||||
- Multiple widgets (Weather, Profile, Status Bars, Music, Notification, Date Time)
|
||||
- Keeps track of notification time sent
|
||||
- Displays bars which visualize various system resources (CPU/GPU-Usage/Temp, Ram, Audio Volume,Mic Volume, Battery, Backlight)
|
||||
- Fetches the user Profile picture and different informations like name, OS etc
|
||||
- Shows the current weather with the openweather.com API
|
||||
- Music widget which can fetch an album cover, song metadata etc
|
||||
- Do not Disturb button to hide notifications
|
||||
|
||||
#### TODO
|
||||
|
||||
- Cleanup
|
||||
- _Maybe_ add more widgets
|
||||
|
||||
### Powermenu [100% Done]
|
||||
|
||||
#### Feature
|
||||
|
||||
- Logout, Reboot, Shutdown, Lock or **Sus**pend system
|
||||
- Display user profile picture and name or hostname
|
||||
|
||||
### Window Switcher[90% Done]
|
||||
|
||||
#### Features
|
||||
|
||||
- Alt-Tab to cycle trough windows and switch to the tag and focus them
|
||||
|
||||
#### TODO
|
||||
|
||||
- "Toggle" alt tab to switch between two windows (keep track which was the last one as put it as the first one)
|
||||
- Rewrite and try to make more performant
|
||||
|
||||
## Widgets
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
-- @supermodule wibox.widget.base
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
local unpack = unpack or table.unpack -- luacheck: globals unpack (compatibility with Lua 5.1)
|
||||
local base = require("wibox.widget.base")
|
||||
local table = table
|
||||
@@ -364,7 +363,7 @@ function fixed:fit(context, orig_width, orig_height)
|
||||
local is_enough
|
||||
|
||||
if is_y then
|
||||
is_enough = height_left >= h
|
||||
is_enough = h > 0 and height_left >= h
|
||||
|
||||
if is_enough then
|
||||
used_max = math.max(used_max, w)
|
||||
|
||||