a lot of stuff

This commit is contained in:
2022-12-11 17:30:18 +01:00
parent 42a888c311
commit d45e2496b1
89 changed files with 1067 additions and 1424 deletions

6
.gitmodules vendored
View File

@@ -10,6 +10,6 @@
[submodule "awesome/src/lib/nice"] [submodule "awesome/src/lib/nice"]
path = awesome/src/lib/nice path = awesome/src/lib/nice
url = https://github.com/Crylia/awesome-wm-nice url = https://github.com/Crylia/awesome-wm-nice
[submodule "awesome/src/lib/lua-dbus_proxy"] [submodule "awesome/src/lib/dbus_proxy"]
path = awesome/src/lib/lua-dbus_proxy path = awesome/src/lib/dbus_proxy
url = https://github.com/Crylia/lua-dbus_proxy url = git@github.com:Crylia/lua-dbus_proxy.git

View File

@@ -432,6 +432,8 @@ function inputbox.new(args)
--gtable.crush(w, args) --gtable.crush(w, args)
gtable.crush(w, inputbox, true) gtable.crush(w, inputbox, true)
w.font = args.font or beautiful.font
w.keybindings = args.keybindings or {} w.keybindings = args.keybindings or {}
w.hint_text = args.hint_text w.hint_text = args.hint_text

View File

@@ -20,11 +20,11 @@ tag = tag
-- Do not touch as this is used to share some variable settings files -- Do not touch as this is used to share some variable settings files
Global_config = {} Global_config = {}
require("src.core.error_handling")
require("src.theme.user_config") require("src.theme.user_config")
require("src.theme.theme_config") require("src.theme.theme_config")
require("src.tools.gio_icon_lookup") require("src.tools.gio_icon_lookup")
require("src.theme.init") require("src.theme.init")
require("src.core.error_handling")
require("src.tools.hex_to_rgba") require("src.tools.hex_to_rgba")
require("src.core.signals") require("src.core.signals")
require("src.core.notifications") require("src.core.notifications")
@@ -32,4 +32,6 @@ require("src.core.rules")
require("src.bindings.global_buttons") require("src.bindings.global_buttons")
require("src.bindings.bind_to_tags") require("src.bindings.bind_to_tags")
require("src.modules.init") require("src.modules.init")
--require("src.tools.auto_starter")(User_config.autostart) require("src.tools.auto_starter")(User_config.autostart)
--require("src.config.setup")()

View 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.

View 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 arent 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.

View 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.

View 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 arent 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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View 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

View 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

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 KiB

After

Width:  |  Height:  |  Size: 305 KiB

View File

@@ -7,9 +7,6 @@ local ruled = require("ruled")
-- Third party libs -- Third party libs
local json = require("src.lib.json-lua.json-lua") local json = require("src.lib.json-lua.json-lua")
-- Own libs
local backlight_helper = require("src.tools.helpers.backlight")
local capi = { local capi = {
awesome = awesome, awesome = awesome,
mousegrabber = mousegrabber, mousegrabber = mousegrabber,

View File

@@ -8,7 +8,6 @@ local gears = require("gears")
local menubar = require('menubar') local menubar = require('menubar')
local naughty = require("naughty") local naughty = require("naughty")
local wibox = require("wibox") local wibox = require("wibox")
local wtemplate = require("wibox.template")
local rubato = require("src.lib.rubato") local rubato = require("src.lib.rubato")
@@ -32,153 +31,149 @@ naughty.config.defaults.spacing = Theme_config.notification.spacing
Theme.notification_spacing = Theme_config.notification.corner_spacing Theme.notification_spacing = Theme_config.notification.corner_spacing
naughty.connect_signal( naughty.connect_signal('request::icon', function(n, context, hints)
'request::icon', if context ~= 'app_icon' then
function(n, context, hints) return
if context ~= 'app_icon' then
return
end
local path = menubar.utils.lookup_icon(hints.app_icon) or menubar.utils.lookup_icon(hints.app_icon:lower())
if path then
n.icon = path
end
end end
) local path = menubar.utils.lookup_icon(hints.app_icon) or menubar.utils.lookup_icon(hints.app_icon:lower())
if path then
n.icon = path
end
end)
naughty.connect_signal( naughty.connect_signal("request::display", function(n)
"request::display", if User_config.dnd then
function(n) n:destroy()
if User_config.dnd then else
n:destroy() if n.urgency == "critical" then
n.title = string.format("<span foreground='%s' font='JetBrainsMono Nerd Font, ExtraBold 16'>%s</span>",
Theme_config.notification.fg_urgent_title, n.title) or ""
n.message = string.format("<span foreground='%s'>%s</span>", Theme_config.notification.fg_urgent_message,
n.message) or ""
n.app_name = string.format("<span foreground='%s'>%s</span>", Theme_config.notification.fg_urgent_app_name,
n.app_name) or ""
n.bg = Theme_config.notification.bg_urgent
else else
if n.urgency == "critical" then n.title = string.format("<span foreground='%s' font='JetBrainsMono Nerd Font, ExtraBold 16'>%s</span>",
n.title = string.format("<span foreground='%s' font='JetBrainsMono Nerd Font, ExtraBold 16'>%s</span>", Theme_config.notification.fg_normal_title, n.title) or ""
Theme_config.notification.fg_urgent_title, n.title) or "" n.message = string.format("<span foreground='%s'>%s</span>", Theme_config.notification.fg_normal_message,
n.message = string.format("<span foreground='%s'>%s</span>", Theme_config.notification.fg_urgent_message, n.message) or ""
n.message) or "" n.bg = Theme_config.notification.bg_normal
n.app_name = string.format("<span foreground='%s'>%s</span>", Theme_config.notification.fg_urgent_app_name, n.timeout = n.timeout or Theme_config.notification.timeout or 3
n.app_name) or "" end
n.bg = Theme_config.notification.bg_urgent
else
n.title = string.format("<span foreground='%s' font='JetBrainsMono Nerd Font, ExtraBold 16'>%s</span>",
Theme_config.notification.fg_normal_title, n.title) or ""
n.message = string.format("<span foreground='%s'>%s</span>", Theme_config.notification.fg_normal_message,
n.message) or ""
n.bg = Theme_config.notification.bg_normal
n.timeout = n.timeout or Theme_config.notification.timeout or 3
end
local use_image = false local use_image = false
if n.app_name == "Spotify" then if n.app_name == "Spotify" then
n.actions = { n.actions = {
naughty.action { naughty.action {
program = "Spotify", program = "Spotify",
id = "skip-prev", id = "skip-prev",
icon = gears.color.recolor_image(icondir .. "skip-prev.svg", icon = gears.color.recolor_image(icondir .. "skip-prev.svg",
Theme_config.notification.spotify_button_icon_color) Theme_config.notification.spotify_button_icon_color)
}, naughty.action { }, naughty.action {
program = "Spotify", program = "Spotify",
id = "play-pause", id = "play-pause",
icon = gears.color.recolor_image(icondir .. "play-pause.svg", icon = gears.color.recolor_image(icondir .. "play-pause.svg",
Theme_config.notification.spotify_button_icon_color) Theme_config.notification.spotify_button_icon_color)
}, naughty.action { }, naughty.action {
program = "Spotify", program = "Spotify",
id = "skip-next", id = "skip-next",
icon = gears.color.recolor_image(icondir .. "skip-next.svg", icon = gears.color.recolor_image(icondir .. "skip-next.svg",
Theme_config.notification.spotify_button_icon_color) Theme_config.notification.spotify_button_icon_color)
}
} }
use_image = true }
end use_image = true
end
local action_template_widget local action_template_widget
if use_image then if use_image then
action_template_widget = wibox.template { action_template_widget = wibox.template {
{
{ {
{ {
{ {
{ id = "icon_role",
id = "icon_role",
valign = "center",
halign = "center",
widget = wibox.widget.imagebox
},
id = "centered",
valign = "center", valign = "center",
halign = "center", halign = "center",
widget = wibox.container.place widget = wibox.widget.imagebox
}, },
margins = dpi(5), id = "centered",
widget = wibox.container.margin valign = "center",
halign = "center",
widget = wibox.container.place
}, },
forced_height = dpi(35), margins = dpi(5),
forced_width = dpi(35), widget = wibox.container.margin
bg = Theme_config.notification.action_bg,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, dpi(6))
end,
widget = wibox.container.background,
id = "bgrnd"
}, },
id = "mrgn", forced_height = dpi(35),
top = dpi(10), forced_width = dpi(35),
bottom = dpi(10), bg = Theme_config.notification.action_bg,
widget = wibox.container.margin shape = function(cr, width, height)
} gears.shape.rounded_rect(cr, width, height, dpi(6))
else end,
action_template_widget = wibox.template { widget = wibox.container.background,
id = "bgrnd"
},
id = "mrgn",
top = dpi(10),
bottom = dpi(10),
widget = wibox.container.margin
}
else
action_template_widget = wibox.template {
{
{ {
{ {
{ {
{ id = "text_role",
id = "text_role", font = "JetBrainsMono Nerd Font, Regular 12",
font = "JetBrainsMono Nerd Font, Regular 12", widget = wibox.widget.textbox
widget = wibox.widget.textbox
},
id = "centered",
widget = wibox.container.place
}, },
margins = dpi(5), id = "centered",
widget = wibox.container.margin widget = wibox.container.place
}, },
fg = Theme_config.notification.action_fg, margins = dpi(5),
bg = Theme_config.notification.action_bg, widget = wibox.container.margin
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, dpi(6))
end,
widget = wibox.container.background,
id = "bgrnd"
}, },
id = "mrgn", fg = Theme_config.notification.action_fg,
top = dpi(10), bg = Theme_config.notification.action_bg,
bottom = dpi(10), shape = function(cr, width, height)
widget = wibox.container.margin gears.shape.rounded_rect(cr, width, height, dpi(6))
} end,
end widget = wibox.container.background,
id = "bgrnd"
local actions_template = wibox.widget {
notification = n,
base_layout = wibox.widget {
spacing = dpi(40),
layout = wibox.layout.fixed.horizontal
}, },
widget_template = action_template_widget, id = "mrgn",
style = { top = dpi(10),
underline_normal = false, bottom = dpi(10),
underline_selected = true widget = wibox.container.margin
},
widget = naughty.list.actions
} }
end
local arc_start = n.timeout local actions_template = wibox.widget {
if n.timeout == 0 then notification = n,
arc_start = 10 base_layout = wibox.widget {
end spacing = dpi(40),
layout = wibox.layout.fixed.horizontal
},
widget_template = action_template_widget,
style = {
underline_normal = false,
underline_selected = true
},
widget = naughty.list.actions
}
local w_template = wibox.template { local arc_start = n.timeout
widget = wibox.widget { if n.timeout == 0 then
arc_start = 10
end
local w_template = wibox.template {
widget = wibox.widget {
{
{ {
{ {
{ {
@@ -188,241 +183,239 @@ naughty.connect_signal(
{ {
{ {
{ {
{ image = gears.color.recolor_image(icondir .. "notification-outline.svg",
image = gears.color.recolor_image(icondir .. "notification-outline.svg", Theme_config.notification.icon_color),
Theme_config.notification.icon_color), resize = false,
resize = false,
valign = "center",
halign = "center",
widget = wibox.widget.imagebox
},
right = dpi(5),
widget = wibox.container.margin
},
{
markup = n.app_name or 'System Notification',
align = "center",
valign = "center", valign = "center",
widget = wibox.widget.textbox halign = "center",
widget = wibox.widget.imagebox
}, },
layout = wibox.layout.fixed.horizontal right = dpi(5),
widget = wibox.container.margin
}, },
fg = Theme_config.notification.fg_appname,
widget = wibox.container.background
},
margins = dpi(10),
widget = wibox.container.margin
},
nil,
{
{
{ {
text = os.date("%H:%M"), markup = n.app_name or 'System Notification',
align = "center",
valign = "center",
widget = wibox.widget.textbox widget = wibox.widget.textbox
}, },
id = "background", layout = wibox.layout.fixed.horizontal
fg = Theme_config.notification.fg_time,
widget = wibox.container.background
}, },
fg = Theme_config.notification.fg_appname,
widget = wibox.container.background
},
margins = dpi(10),
widget = wibox.container.margin
},
nil,
{
{
{
text = os.date("%H:%M"),
widget = wibox.widget.textbox
},
id = "background",
fg = Theme_config.notification.fg_time,
widget = wibox.container.background
},
{
{ {
{ {
{ {
{ {
{ font = User_config.font.specify .. ", 10",
font = User_config.font.specify .. ", 10", text = "",
text = "", align = "center",
align = "center", valign = "center",
valign = "center", widget = wibox.widget.textbox
widget = wibox.widget.textbox
},
start_angle = 4.71239,
thickness = dpi(2),
min_value = 0,
max_value = arc_start,
value = arc_start,
widget = wibox.container.arcchart,
id = "arc_chart"
}, },
id = "background1", start_angle = 4.71239,
fg = Theme_config.notification.fg_close, thickness = dpi(2),
bg = Theme_config.notification.bg_close, min_value = 0,
widget = wibox.container.background max_value = arc_start,
value = arc_start,
widget = wibox.container.arcchart,
id = "arc_chart"
}, },
strategy = "exact", id = "background1",
width = dpi(20), fg = Theme_config.notification.fg_close,
height = dpi(20), bg = Theme_config.notification.bg_close,
widget = wibox.container.constraint, widget = wibox.container.background
id = "const1"
}, },
margins = dpi(10), strategy = "exact",
widget = wibox.container.margin, width = dpi(20),
id = "arc_margin" height = dpi(20),
widget = wibox.container.constraint,
id = "const1"
}, },
layout = wibox.layout.fixed.horizontal, margins = dpi(10),
id = "arc_app_layout_2" widget = wibox.container.margin,
id = "arc_margin"
}, },
id = "arc_app_layout", layout = wibox.layout.fixed.horizontal,
layout = wibox.layout.align.horizontal id = "arc_app_layout_2"
}, },
id = "arc_app_bg", id = "arc_app_layout",
border_color = Theme_config.notification.title_border_color, layout = wibox.layout.align.horizontal
border_width = Theme_config.notification.title_border_width,
widget = wibox.container.background
}, },
id = "arc_app_bg",
border_color = Theme_config.notification.title_border_color,
border_width = Theme_config.notification.title_border_width,
widget = wibox.container.background
},
{
{ {
{ {
{ {
{ {
{ image = n.icon,
image = n.icon, resize = true,
resize = true, widget = wibox.widget.imagebox,
widget = wibox.widget.imagebox, valign = "center",
valign = "center", halign = "center",
halign = "center", clip_shape = function(cr, width, height)
clip_shape = function(cr, width, height) gears.shape.rounded_rect(cr, width, height, 10)
gears.shape.rounded_rect(cr, width, height, 10) end
end
},
width = naughty.config.defaults.icon_size,
height = naughty.config.defaults.icon_size,
strategy = "exact",
widget = wibox.container.constraint
}, },
halign = "center", width = naughty.config.defaults.icon_size,
valign = "top", height = naughty.config.defaults.icon_size,
widget = wibox.container.place strategy = "exact",
widget = wibox.container.constraint
}, },
left = dpi(20), halign = "center",
bottom = dpi(15), valign = "top",
top = dpi(15), widget = wibox.container.place
right = dpi(10),
widget = wibox.container.margin
}, },
left = dpi(20),
bottom = dpi(15),
top = dpi(15),
right = dpi(10),
widget = wibox.container.margin
},
{
{ {
{ {
{ widget = naughty.widget.title,
widget = naughty.widget.title, align = "left"
align = "left"
},
{
widget = naughty.widget.message,
align = "left"
},
{
actions_template,
widget = wibox.container.place
},
layout = wibox.layout.fixed.vertical
}, },
left = dpi(10), {
bottom = dpi(10), widget = naughty.widget.message,
top = dpi(10), align = "left"
right = dpi(20), },
widget = wibox.container.margin {
actions_template,
widget = wibox.container.place
},
layout = wibox.layout.fixed.vertical
}, },
layout = wibox.layout.fixed.horizontal left = dpi(10),
bottom = dpi(10),
top = dpi(10),
right = dpi(20),
widget = wibox.container.margin
}, },
id = "widget_layout", layout = wibox.layout.fixed.horizontal
layout = wibox.layout.fixed.vertical
}, },
id = "min_size", id = "widget_layout",
strategy = "min", layout = wibox.layout.fixed.vertical
width = dpi(100),
widget = wibox.container.constraint
}, },
id = "max_size", id = "min_size",
strategy = "max", strategy = "min",
width = Theme.notification_max_width or dpi(500), width = dpi(100),
widget = wibox.container.constraint widget = wibox.container.constraint
}, },
id = "background", id = "max_size",
bg = Theme_config.notification.bg, strategy = "max",
border_color = Theme_config.notification.border_color, width = Theme.notification_max_width or dpi(500),
border_width = Theme_config.notification.border_width, widget = wibox.container.constraint
shape = Theme_config.notification.shape_inside,
widget = wibox.container.background
}, },
update_callback = function() id = "background",
bg = Theme_config.notification.bg,
border_color = Theme_config.notification.border_color,
border_width = Theme_config.notification.border_width,
shape = Theme_config.notification.shape_inside,
widget = wibox.container.background
},
update_callback = function()
end
}
local close = w_template:get_widget().max_size.min_size.widget_layout.arc_app_bg.arc_app_layout.arc_app_layout_2.arc_margin
.const1.background1
local arc = close.arc_chart
local timeout = n.timeout
if timeout ~= 0 then
local rubato_timer = rubato.timed {
duration = n.timeout,
pos = n.timeout,
easing = rubato.linear,
subscribed = function(value)
arc.value = value
end
}
rubato_timer.target = 0
w_template:get_widget():connect_signal(
"mouse::enter",
function()
n.timeout = 99999
rubato_timer.pause = true
end
)
w_template:get_widget():connect_signal(
"mouse::leave",
function()
n.timeout = rubato_timer.pos
rubato_timer.pause = false
rubato_timer.target = 0
end
)
end end
}
local close = w_template:get_widget().max_size.min_size.widget_layout.arc_app_bg.arc_app_layout.arc_app_layout_2.arc_margin
.const1.background1
local arc = close.arc_chart
Hover_signal(close) local timeout = n.timeout
close:connect_signal("button::press", function() if timeout ~= 0 then
n:destroy()
end)
w_template:get_widget():connect_signal("button::press", function(_, _, _, key) local rubato_timer = rubato.timed {
if key == 3 then duration = n.timeout,
n:destroy() pos = n.timeout,
easing = rubato.linear,
subscribed = function(value)
arc.value = value
end end
-- Raise the client on click
if key == 1 then
for _, client in ipairs(capi.client.get()) do
if client.name:match(n.app_name) then
if not client:isvisible() and client.first_tag then
client.first_tag:view_only()
end
client:emit_signal('request::activate')
client:raise()
end
end
end
end)
local box = naughty.layout.box {
notification = n,
timeout = 5,
type = "notification",
screen = capi.screen.primary,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 10)
end,
widget_template = w_template
} }
box.buttons = {} rubato_timer.target = 0
n.buttons = {}
w_template:get_widget():connect_signal(
"mouse::enter",
function()
n.timeout = 99999
rubato_timer.pause = true
end
)
w_template:get_widget():connect_signal(
"mouse::leave",
function()
n.timeout = rubato_timer.pos
rubato_timer.pause = false
rubato_timer.target = 0
end
)
end end
Hover_signal(close)
close:connect_signal("button::press", function()
n:destroy()
end)
w_template:get_widget():connect_signal("button::press", function(_, _, _, key)
if key == 3 then
n:destroy()
end
-- Raise the client on click
if key == 1 then
for _, client in ipairs(capi.client.get()) do
if client.name:match(n.app_name) then
if not client:isvisible() and client.first_tag then
client.first_tag:view_only()
end
client:emit_signal('request::activate')
client:raise()
end
end
end
end)
local box = naughty.layout.box {
notification = n,
timeout = 5,
type = "notification",
screen = capi.screen.primary,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 10)
end,
widget_template = w_template
}
box.buttons = {}
n.buttons = {}
end end
) end)
naughty.connect_signal( naughty.connect_signal(
"destroyed", "destroyed",

View File

@@ -14,85 +14,61 @@ local capi = {
tag = tag tag = tag
} }
capi.screen.connect_signal( capi.screen.connect_signal("added", function()
"added", capi.awesome.restart()
function() end)
capi.awesome.restart()
end
)
capi.screen.connect_signal( capi.screen.connect_signal("removed", function()
"removed", capi.awesome.restart()
function() end)
capi.awesome.restart()
end
)
capi.client.connect_signal( capi.client.connect_signal("manage", function(c)
"manage", if capi.awesome.startup and not c.size_hints.user_porition and not c.size_hints.program_position then
function(c) awful.placement.no_offscreen(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
if c.class == "Brave-browser" then
c.floating = false
end
if c.transient_for then
c.floating = true
end
if c.fullscreen then
gears.timer.delayed_call(function()
if c.valid then
c:geometry(c.screen.geometry)
end
end)
end
end end
) if c.class == "Brave-browser" then
c.floating = false
end
if c.transient_for then
c.floating = true
end
if c.fullscreen then
gears.timer.delayed_call(function()
if c.valid then
c:geometry(c.screen.geometry)
end
end)
end
end)
capi.client.connect_signal( capi.client.connect_signal('unmanage', function(c)
'unmanage', if #awful.screen.focused().clients > 0 then
function(c) awful.screen.focused().clients[1]:emit_signal(
if #awful.screen.focused().clients > 0 then 'request::activate',
awful.screen.focused().clients[1]:emit_signal( 'mouse_enter', {
'request::activate', raise = true
'mouse_enter', })
{
raise = true
}
)
end
end end
) end)
capi.tag.connect_signal( capi.tag.connect_signal('property::selected', function(c)
'property::selected', if #awful.screen.focused().clients > 0 then
function(c) awful.screen.focused().clients[1]:emit_signal(
if #awful.screen.focused().clients > 0 then 'request::activate',
awful.screen.focused().clients[1]:emit_signal( 'mouse_enter', {
'request::activate', raise = true
'mouse_enter', })
{
raise = true
}
)
end
end end
) end)
-- Sloppy focus -- Sloppy focus
--[[ client.connect_signal( --[[ client.connect_signal("mouse::enter", function(c)
"mouse::enter", c:emit_signal(
function(c) "request::activate",
c:emit_signal( "mouse_enter",{
"request::activate", raise = true
"mouse_enter", })
{ end) ]]
raise = true
}
)
end
) ]]
--- Takes a wibox.container.background and connects four signals to it --- Takes a wibox.container.background and connects four signals to it
---@param widget wibox.container.background a background widget ---@param widget wibox.container.background a background widget

View File

@@ -18,8 +18,6 @@ local gshape = require('gears.shape')
local gobject = require('gears.object') local gobject = require('gears.object')
local mousegrabber = mousegrabber local mousegrabber = mousegrabber
local rubato = require("src.lib.rubato")
local overflow = { mt = {} } local overflow = { mt = {} }
-- Determine the required space to draw the layout's children and, if necessary, -- 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`. --- 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`. -- The amount of units scrolled is affected by `step`.
-- --
@@ -307,9 +305,6 @@ end
-- @tparam number scroll_factor The scroll factor. -- @tparam number scroll_factor The scroll factor.
-- @propemits true false -- @propemits true false
overflow.rubato_timed = rubato.timed { duration = 0.2 }
local first_call = true
function overflow:set_scroll_factor(factor) function overflow:set_scroll_factor(factor)
local current = self._private.scroll_factor local current = self._private.scroll_factor
local interval = self._private.used_in_dir - self._private.avail_in_dir local interval = self._private.used_in_dir - self._private.avail_in_dir
@@ -323,22 +318,10 @@ function overflow:set_scroll_factor(factor)
return return
end end
self._private.scroll_factor = math.min(1, math.max(factor, 0))
local function update_scroll() self:emit_signal("widget::layout_changed")
self._private.scroll_factor = self.rubato_timed.pos self:emit_signal("property::scroll_factor", factor)
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 end
function overflow:get_scroll_factor() function overflow:get_scroll_factor()
@@ -486,6 +469,19 @@ function overflow:get_scrollbar_widget()
return self._private.scrollbar_widget return self._private.scrollbar_widget
end 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 function new(dir, ...)
local ret = fixed[dir](...) local ret = fixed[dir](...)
@@ -538,7 +534,7 @@ end
-- widgets exceeds the height available whithin the layout's outer container -- widgets exceeds the height available whithin the layout's outer container
-- a scrollbar will be added and scrolling behavior enabled. -- a scrollbar will be added and scrolling behavior enabled.
-- @tparam widget ... Widgets that should be added to the layout. -- @tparam widget ... Widgets that should be added to the layout.
-- @constructorfct wibox.layout.overflow.horizontal -- @constructorfct wibox.layout.overflow.vertical
function overflow.vertical(...) function overflow.vertical(...)
return new("vertical", ...) return new("vertical", ...)
end end

View File

@@ -4,7 +4,6 @@
-- Awesome Libs -- Awesome Libs
local awful = require("awful") local awful = require("awful")
local dpi = require("beautiful").xresources.apply_dpi local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox") local wibox = require("wibox")
return function(s, w) return function(s, w)

View File

@@ -4,7 +4,6 @@
-- Awesome Libs -- Awesome Libs
local awful = require("awful") local awful = require("awful")
local dpi = require("beautiful").xresources.apply_dpi local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox") local wibox = require("wibox")
return function(s, w) return function(s, w)
@@ -56,6 +55,7 @@ return function(s, w)
bg = Theme_config.right_bar.bg, bg = Theme_config.right_bar.bg,
visible = true, visible = true,
screen = s, screen = s,
maximum_width = dpi(650),
placement = function(c) awful.placement.top_right(c, { margins = dpi(10) }) end placement = function(c) awful.placement.top_right(c, { margins = dpi(10) }) end
} }

View File

@@ -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_osd") { screen = s }
--require("src.modules.audio.volume_controller") { screen = s } --require("src.modules.audio.volume_controller") { screen = s }
require("src.modules.brightness.brightness_osd") { 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_bar.init")(s)
--require("src.modules.crylia_wibox.init")(s) --require("src.modules.crylia_wibox.init")(s)
require("src.modules.notification-center.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.application_launcher.init") { screen = s }
require("src.modules.network_controller.init") { screen = s } require("src.modules.network_controller.init") { screen = s }
end) end)
do
require("src.lib.nice") { titlebar_font = User_config.font.bold,
titlebar_items = { left = { "icon" }, right = { "minimize", "maximize", "close" } } }
end

View File

@@ -59,6 +59,7 @@ network.DeviceState = {
function network:get_wifi_proxy() function network:get_wifi_proxy()
local devices = self._private.NetworkManager:GetDevices() local devices = self._private.NetworkManager:GetDevices()
if (not devices) or (#devices == 0) then return end
for _, path in ipairs(devices) do for _, path in ipairs(devices) do
local NetworkManagerDevice = dbus_proxy.Proxy:new { local NetworkManagerDevice = dbus_proxy.Proxy:new {
bus = dbus_proxy.Bus.SYSTEM, bus = dbus_proxy.Bus.SYSTEM,
@@ -117,6 +118,7 @@ end
---Scan for access points and create a widget for each one. ---Scan for access points and create a widget for each one.
function network:scan_access_points() 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] local ap_list = self:get_children_by_id("wifi_ap_list")[1]
ap_list:reset() ap_list:reset()
self._private.NetworkManagerDeviceWireless:RequestScanAsync(function(proxy, context, success, failure) self._private.NetworkManagerDeviceWireless:RequestScanAsync(function(proxy, context, success, failure)
@@ -358,7 +360,7 @@ function network.new(args)
ret:scan_access_points() ret:scan_access_points()
gtimer.delayed_call(function() --[[ gtimer.delayed_call(function()
local active_access_point = ret._private.NetworkManagerDeviceWireless.ActiveAccessPoint local active_access_point = ret._private.NetworkManagerDeviceWireless.ActiveAccessPoint
if ret._private.NetworkManager.State == network.DeviceState.ACTIVATED and active_access_point ~= "/" then if ret._private.NetworkManager.State == network.DeviceState.ACTIVATED and active_access_point ~= "/" then
local active_access_point_proxy = dbus_proxy.Proxy:new { local active_access_point_proxy = dbus_proxy.Proxy:new {
@@ -368,7 +370,7 @@ function network.new(args)
path = active_access_point, path = active_access_point,
} }
end end
end) end) ]]
--#endregion --#endregion

View File

@@ -497,7 +497,6 @@ return function()
local rubato_timer = rubato.timed { local rubato_timer = rubato.timed {
duration = 1, duration = 1,
pos = bar.value, pos = bar.value,
easing = rubato.linear,
subscribed = function(v) subscribed = function(v)
bar.value = v bar.value = v
end end
@@ -594,7 +593,6 @@ return function()
local rubato_timer = rubato.timed { local rubato_timer = rubato.timed {
duration = 1, duration = 1,
pos = bar.value, pos = bar.value,
easing = rubato.linear,
subscribed = function(v) subscribed = function(v)
bar.value = v bar.value = v
end end

View File

@@ -6,7 +6,6 @@
-- ╚██████╗██║ ██║ ██║ ███████╗██║██║ ██║ -- -- ╚██████╗██║ ██║ ██║ ███████╗██║██║ ██║ --
-- ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝╚═╝ ╚═╝ -- -- ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝╚═╝ ╚═╝ --
-------------------------------------------------- --------------------------------------------------
local awful = require("awful")
local beautiful = require("beautiful") local beautiful = require("beautiful")
local gears = require("gears") local gears = require("gears")
@@ -14,9 +13,6 @@ local capi = {
screen = screen, screen = screen,
} }
require("src.theme.user_config")
require("src.theme.theme_config")
Theme_path = gears.filesystem.get_configuration_dir() .. "/src/theme/" Theme_path = gears.filesystem.get_configuration_dir() .. "/src/theme/"
Theme = {} Theme = {}
@@ -53,9 +49,6 @@ Theme.hotkeys_label_bg = Theme_config.hotkeys.label_bg
Theme.hotkeys_label_fg = Theme_config.hotkeys.label_fg Theme.hotkeys_label_fg = Theme_config.hotkeys.label_fg
--#endregion --#endregion
Theme.awesome_icon = Theme_path .. "../assets/icons/ArchLogo.png"
Theme.awesome_subicon = Theme_path .. "../assets/icons/ArchLogo.png"
-- Wallpaper -- Wallpaper
beautiful.wallpaper = User_config.wallpaper beautiful.wallpaper = User_config.wallpaper
capi.screen.connect_signal( capi.screen.connect_signal(

View File

@@ -93,7 +93,10 @@ Theme_config.kblayout = {
Theme_config.layout_list = { Theme_config.layout_list = {
bg = color["LightBlue200"], 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 = { Theme_config.network = {
@@ -672,6 +675,73 @@ Theme_config.context_menu = {
icon_color_hover = color["Teal200"] 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 -- #endregion
--[[ --[[

View File

@@ -18,11 +18,9 @@ User_config = {
]] -- ]] --
autostart = { autostart = {
"picom", "picom",
"xfce4-power-manager",
"light-locker --lock-on-suspend --lock-on-lid &",
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1", "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1",
"setxkbmap -option caps:swapescape", "setxkbmap -option caps:swapescape",
"/home/crylia/.screenlayout/single.sh" "/home/crylia/.screenlayout/double.sh"
}, },
--[[ --[[
@@ -45,7 +43,7 @@ User_config = {
"MEDIA_PLAYER" "MEDIA_PLAYER"
More information at: https://lazka.github.io/pgi-docs/UPowerGlib-1.0/enums.html#UPowerGlib.DeviceKind.KEYBOARD 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. If your battery is not found you can specify its path here.
@@ -208,8 +206,6 @@ User_config = {
"volume", "volume",
"gpu_temp", "gpu_temp",
"gpu_usage", "gpu_usage",
"battery",
"backlight"
}, },
--[[ --[[
@@ -267,7 +263,7 @@ User_config = {
unit = "metric" 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. 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" "Tasklist"
}, },
right_bar = { right_bar = {
"Battery", "Cpu Frequency",
"Network", "Cpu Temperature",
"Bluetooth", "Cpu Usage",
"Audio", "Audio",
"Keyboard Layout", "Keyboard Layout",
"Date", "Date",
"Clock", "Clock",
"Power Button" "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 = { crylia_wibox = {

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -1,116 +1,59 @@
local awful = require("awful") local aspawn = require("awful.spawn")
local capi = { local capi = {
awesome = awesome, awesome = awesome,
} }
local lgi = require("lgi") 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
--[[ ctx:connect(nil, function(state) capi.awesome.emit_signal("audio::volume_changed")
if state == 4 then capi.awesome.emit_signal("microphone::volume_changed")
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"]],
{
stdout = function(line)
-- Volume changed
if line:match("on sink") or line:match("on source") then
capi.awesome.emit_signal("audio::volume_changed")
capi.awesome.emit_signal("microphone::volume_changed")
end
-- Device added/removed
if line:match("on server") then
capi.awesome.emit_signal("audio::device_changed")
capi.awesome.emit_signal("microphone::device_changed")
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")
end end
} -- Device added/removed
) if line:match("on server") then
capi.awesome.emit_signal("audio::device_changed")
capi.awesome.connect_signal( capi.awesome.emit_signal("microphone::device_changed")
"exit", end
function() end,
awful.spawn.with_shell("pkill pactl && pkill grep") output_done = function()
aspawn.with_shell("pkill pactl && pkill grep")
end end
) })
capi.awesome.connect_signal( capi.awesome.connect_signal("audio::volume_changed", function()
"audio::volume_changed", aspawn.easy_async_with_shell("./.config/awesome/src/scripts/vol.sh mute", function(stdout)
function() if stdout == "" or stdout == nil then
awful.spawn.easy_async_with_shell( return
"./.config/awesome/src/scripts/vol.sh mute", end
function(stdout) local muted = false
if stdout == "" or stdout == nil then if stdout:match("yes") then
return muted = true
end end
local muted = false aspawn.easy_async_with_shell("./.config/awesome/src/scripts/vol.sh volume", function(stdout2)
if stdout:match("yes") then if stdout == "" or stdout == nil then
muted = true return
end
awful.spawn.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
) capi.awesome.emit_signal("audio::get", muted, stdout2:gsub("%%", ""):gsub("\n", "") or 0)
end end)
) end)
end)
capi.awesome.connect_signal( capi.awesome.connect_signal("microphone::volume_changed", function()
"microphone::volume_changed", aspawn.easy_async_with_shell("./.config/awesome/src/scripts/mic.sh mute", function(stdout)
function() local muted = false
awful.spawn.easy_async_with_shell( if stdout:match("yes") then
"./.config/awesome/src/scripts/mic.sh mute", muted = true
function(stdout) end
local muted = false aspawn.easy_async_with_shell("./.config/awesome/src/scripts/mic.sh volume", function(stdout2)
if stdout:match("yes") then if stdout2 == nil or stdout2 == "awful" then
muted = true return
end
awful.spawn.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
) capi.awesome.emit_signal("microphone::get", muted, stdout2:gsub("%%", ""):gsub("\n", "") or 0)
end end)
) end)
end)
capi.awesome.emit_signal("audio::volume_changed") capi.awesome.emit_signal("audio::volume_changed")
capi.awesome.emit_signal("microphone::volume_changed") capi.awesome.emit_signal("microphone::volume_changed")

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -2,7 +2,7 @@
-- This is the audio widget -- -- This is the audio widget --
------------------------------ ------------------------------
-- Awesome Libs -- Awesome Libs
local awful = require("awful")
local dpi = require("beautiful").xresources.apply_dpi local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears") local gears = require("gears")
local wibox = require("wibox") local wibox = require("wibox")
@@ -61,50 +61,39 @@ return function(s)
widget = wibox.container.background widget = wibox.container.background
} }
capi.awesome.connect_signal( capi.awesome.connect_signal("audio::get", function(muted, volume)
"audio::get", if muted then
function(muted, volume) audio_widget.container.audio_layout.label.visible = false
if muted then audio_widget.container.audio_layout.icon_margin.icon_layout.icon:set_image(
audio_widget.container.audio_layout.label.visible = false gears.color.recolor_image(icondir .. "volume-mute" .. ".svg", Theme_config.audio.fg))
audio_widget.container.audio_layout.icon_margin.icon_layout.icon:set_image( else
gears.color.recolor_image(icondir .. "volume-mute" .. ".svg", Theme_config.audio.fg)) audio_widget.container:set_right(10)
else local icon = icondir .. "volume"
audio_widget.container:set_right(10) audio_widget.container.audio_layout.spacing = dpi(5)
local icon = icondir .. "volume" audio_widget.container.audio_layout.label.visible = true
audio_widget.container.audio_layout.spacing = dpi(5) volume = tonumber(volume)
audio_widget.container.audio_layout.label.visible = true if not volume then
volume = tonumber(volume) return
if not volume then
return
end
if volume < 1 then
icon = icon .. "-mute"
audio_widget.container.audio_layout.spacing = dpi(0)
audio_widget.container.audio_layout.label.visible = false
elseif volume >= 1 and volume < 34 then
icon = icon .. "-low"
elseif volume >= 34 and volume < 67 then
icon = icon .. "-medium"
elseif volume >= 67 then
icon = icon .. "-high"
end
audio_widget.container.audio_layout.label:set_text(volume .. "%")
audio_widget.container.audio_layout.icon_margin.icon_layout.icon:set_image(
gears.color.recolor_image(icon .. ".svg", Theme_config.audio.fg))
end end
if volume < 1 then
icon = icon .. "-mute"
audio_widget.container.audio_layout.spacing = dpi(0)
audio_widget.container.audio_layout.label.visible = false
elseif volume >= 1 and volume < 34 then
icon = icon .. "-low"
elseif volume >= 34 and volume < 67 then
icon = icon .. "-medium"
elseif volume >= 67 then
icon = icon .. "-high"
end
audio_widget.container.audio_layout.label:set_text(volume .. "%")
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 -- Signals
Hover_signal(audio_widget) 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 return audio_widget
end end

View File

@@ -3,7 +3,6 @@
--------------------------------- ---------------------------------
-- Awesome Libs -- Awesome Libs
local awful = require("awful")
local dpi = require("beautiful").xresources.apply_dpi local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears") local gears = require("gears")
local wibox = require("wibox") 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_freq")
require("src.tools.helpers.cpu_temp") 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 = { local capi = {
awesome = awesome, awesome = awesome,
@@ -22,7 +21,7 @@ local capi = {
local icon_dir = gears.filesystem.get_configuration_dir() .. "src/assets/icons/cpu/" local icon_dir = gears.filesystem.get_configuration_dir() .. "src/assets/icons/cpu/"
--TODO: Add tooltip with more CPU and per core information --TODO: Add tooltip with more CPU and per core information
return function(widget, _) return function(widget)
local cpu_usage_widget = wibox.widget { local cpu_usage_widget = wibox.widget {
{ {
@@ -153,12 +152,9 @@ return function(widget, _)
widget = wibox.container.background widget = wibox.container.background
} }
capi.awesome.connect_signal( capi.awesome.connect_signal("update::cpu_usage", function(usage)
"update::cpu_usage", cpu_usage_widget.container.cpu_layout.label.text = usage .. "%"
function(usage) end)
cpu_usage_widget.container.cpu_layout.label.text = usage .. "%"
end
)
local r_timed_cpu_bg = rubato.timed { duration = 2.5 } local r_timed_cpu_bg = rubato.timed { duration = 2.5 }
local g_timed_cpu_bg = rubato.timed { duration = 2.5 } local g_timed_cpu_bg = rubato.timed { duration = 2.5 }
@@ -180,42 +176,33 @@ return function(widget, _)
r_timed_cpu_bg.target, g_timed_cpu_bg.target, b_timed_cpu_bg.target = color.utils.hex_to_rgba(newbg) r_timed_cpu_bg.target, g_timed_cpu_bg.target, b_timed_cpu_bg.target = color.utils.hex_to_rgba(newbg)
end end
capi.awesome.connect_signal( capi.awesome.connect_signal("update::cpu_temp", function(temp)
"update::cpu_temp", local temp_icon
function(temp) local temp_color
local temp_icon
local temp_color
if temp < 50 then if temp < 50 then
temp_color = Theme_config.cpu_temp.bg_low temp_color = Theme_config.cpu_temp.bg_low
temp_icon = icon_dir .. "thermometer-low.svg" temp_icon = icon_dir .. "thermometer-low.svg"
elseif temp >= 50 and temp < 80 then elseif temp >= 50 and temp < 80 then
temp_color = Theme_config.cpu_temp.bg_mid temp_color = Theme_config.cpu_temp.bg_mid
temp_icon = icon_dir .. "thermometer.svg" temp_icon = icon_dir .. "thermometer.svg"
elseif temp >= 80 then elseif temp >= 80 then
temp_color = Theme_config.cpu_temp.bg_high temp_color = Theme_config.cpu_temp.bg_high
temp_icon = icon_dir .. "thermometer-high.svg" temp_icon = icon_dir .. "thermometer-high.svg"
end
cpu_temp.container.cpu_layout.icon_margin.icon_layout.icon:set_image(temp_icon)
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
) cpu_temp.container.cpu_layout.icon_margin.icon_layout.icon:set_image(temp_icon)
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)
capi.awesome.connect_signal( capi.awesome.connect_signal("update::cpu_freq_average", function(average)
"update::cpu_freq_average", cpu_clock.container.cpu_layout.label.text = average .. "Mhz"
function(average) end)
cpu_clock.container.cpu_layout.label.text = average .. "Mhz"
end
)
capi.awesome.connect_signal( capi.awesome.connect_signal("update::cpu_freq_core", function(freq)
"update::cpu_freq_core", cpu_clock.container.cpu_layout.label.text = freq .. "Mhz"
function(freq) end)
cpu_clock.container.cpu_layout.label.text = freq .. "Mhz"
end
)
Hover_signal(cpu_temp) Hover_signal(cpu_temp)
Hover_signal(cpu_usage_widget) Hover_signal(cpu_usage_widget)

View File

@@ -3,25 +3,32 @@
---------------------------------- ----------------------------------
-- Awesome Libs -- 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 dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears") local gtable = require("gears.table")
local wibox = require("wibox") local wibox = require("wibox")
--#region Layout icons --#region Layout icons
local layout_path = Theme_path .. "../assets/layout/" local layout_path = Theme_path .. "../assets/layout/"
Theme.layout_floating = layout_path .. "floating.svg" Theme.layout_cornerne = layout_path .. "cornerne.png"
Theme.layout_tile = layout_path .. "tile.svg" Theme.layout_cornernw = layout_path .. "cornernw.png"
Theme.layout_dwindle = layout_path .. "dwindle.svg" Theme.layout_cornerse = layout_path .. "cornerse.png"
Theme.layout_fairh = layout_path .. "fairh.svg" Theme.layout_cornersw = layout_path .. "cornersw.png"
Theme.layout_fairv = layout_path .. "fairv.svg" Theme.layout_dwindle = layout_path .. "dwindle.png"
Theme.layout_fullscreen = layout_path .. "fullscreen.svg" Theme.layout_fairh = layout_path .. "fairh.png"
Theme.layout_max = layout_path .. "max.svg" Theme.layout_fairv = layout_path .. "fairv.png"
Theme.layout_cornerne = layout_path .. "cornerne.svg" Theme.layout_floating = layout_path .. "floating.png"
Theme.layout_cornernw = layout_path .. "cornernw.svg" Theme.layout_fullscreen = layout_path .. "fullscreen.png"
Theme.layout_cornerse = layout_path .. "cornerse.svg" Theme.layout_magnifier = layout_path .. "magnifier.png"
Theme.layout_cornersw = layout_path .. "cornersw.svg" 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 --#endregion
-- Returns the layoutbox widget -- Returns the layoutbox widget
@@ -29,32 +36,40 @@ return function()
local layout = wibox.widget { local layout = wibox.widget {
{ {
{ {
awful.widget.layoutbox(), {
id = "icon_layout", awidget.layoutbox(),
widget = wibox.container.place widget = wibox.container.place,
halign = "center",
valign = "center"
},
left = dpi(5),
right = dpi(5),
widget = wibox.container.margin,
}, },
id = "icon_margin", widget = wibox.container.constraint,
left = dpi(5), width = dpi(40)
right = dpi(5),
forced_width = dpi(40),
widget = wibox.container.margin
}, },
bg = Theme_config.layout_list.bg, bg = Theme_config.layout_list.bg,
shape = function(cr, width, height) shape = Theme_config.layout_list.shape,
gears.shape.rounded_rect(cr, width, height, dpi(6))
end,
widget = wibox.container.background widget = wibox.container.background
} }
-- Signals
Hover_signal(layout) Hover_signal(layout)
layout:connect_signal( layout:buttons(gtable.join(
"button::press", abutton({}, 1, function()
function() alayout.inc(1)
awful.layout.inc(-1) end),
end abutton({}, 3, function()
) alayout.inc(-1)
end),
abutton({}, 4, function()
alayout.inc(1)
end),
abutton({}, 5, function()
alayout.inc(-1)
end)
))
return layout return layout
end end

View File

@@ -16,6 +16,15 @@
- Algorithm to select the best search match - Algorithm to select the best search match
- Keep track of most launched applications and serve them over others - 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] ### Backlight [100% Done]
#### Features #### Features
@@ -42,6 +51,7 @@
#### TODO #### TODO
- Don't try to create a bluetooth proxy if there is no bluetooth adapter
- Getting and asking for a passcode - Getting and asking for a passcode
- "Greying out" non avaiable options in the dropdown - "Greying out" non avaiable options in the dropdown
@@ -65,16 +75,18 @@
### Desktop [40% Done] ### Desktop [40% Done]
#### Features
- Create desktop icons, folders or files - Create desktop icons, folders or files
- Drag and drop desktop icons - Drag and drop desktop icons
- Context menu - Context menu
- Saves accross restart - Saves accross restart
- Desktop context menu - Desktop context menu
TODO #### TODO
- Actions for the context menu - Actions for the context menu
- Open width in context menu - "Open with" in context menu
- Drag across multiple screens - Drag across multiple screens
- Proper size calculation for desktop icons and desktop - Proper size calculation for desktop icons and desktop
- Multiscreen support in general - Multiscreen support in general
@@ -83,4 +95,73 @@ TODO
- Drag-select - Drag-select
- Cross-DE support (e.g. use the same desktop icons as used in KDE or Mate ...) - 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 ## Widgets

View File

@@ -23,7 +23,6 @@
-- @supermodule wibox.widget.base -- @supermodule wibox.widget.base
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
---@diagnostic disable-next-line: deprecated
local unpack = unpack or table.unpack -- luacheck: globals unpack (compatibility with Lua 5.1) local unpack = unpack or table.unpack -- luacheck: globals unpack (compatibility with Lua 5.1)
local base = require("wibox.widget.base") local base = require("wibox.widget.base")
local table = table local table = table
@@ -364,7 +363,7 @@ function fixed:fit(context, orig_width, orig_height)
local is_enough local is_enough
if is_y then if is_y then
is_enough = height_left >= h is_enough = h > 0 and height_left >= h
if is_enough then if is_enough then
used_max = math.max(used_max, w) used_max = math.max(used_max, w)