added more widgets, rewritten folder structure

This commit is contained in:
Crylia
2021-11-28 14:58:07 +01:00
parent 7f28224bf1
commit 32ba8ff3a8
65 changed files with 832 additions and 1873 deletions

View File

@@ -1 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z" /></svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
<path fill="#ffffffdd" d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z" />
</svg>

Before

Width:  |  Height:  |  Size: 510 B

After

Width:  |  Height:  |  Size: 535 B

View File

@@ -1 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M7,9V15H11L16,20V4L11,9H7Z" /></svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
<path fill="#ffffffdd" d="M7,9V15H11L16,20V4L11,9H7Z" />
</svg>

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 346 B

View File

@@ -1 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M5,9V15H9L14,20V4L9,9M18.5,12C18.5,10.23 17.5,8.71 16,7.97V16C17.5,15.29 18.5,13.76 18.5,12Z" /></svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
<path fill="#ffffffdd" d="M5,9V15H9L14,20V4L9,9M18.5,12C18.5,10.23 17.5,8.71 16,7.97V16C17.5,15.29 18.5,13.76 18.5,12Z" />
</svg>

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 412 B

View File

@@ -1 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M3,9H7L12,4V20L7,15H3V9M16.59,12L14,9.41L15.41,8L18,10.59L20.59,8L22,9.41L19.41,12L22,14.59L20.59,16L18,13.41L15.41,16L14,14.59L16.59,12Z" /></svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
<path fill="#ffffffdd" d="M3,9H7L12,4V20L7,15H3V9M16.59,12L14,9.41L15.41,8L18,10.59L20.59,8L22,9.41L19.41,12L22,14.59L20.59,16L18,13.41L15.41,16L14,14.59L16.59,12Z" />
</svg>

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 457 B

View File

@@ -1 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M12,4L9.91,6.09L12,8.18M4.27,3L3,4.27L7.73,9H3V15H7L12,20V13.27L16.25,17.53C15.58,18.04 14.83,18.46 14,18.7V20.77C15.38,20.45 16.63,19.82 17.68,18.96L19.73,21L21,19.73L12,10.73M19,12C19,12.94 18.8,13.82 18.46,14.64L19.97,16.15C20.62,14.91 21,13.5 21,12C21,7.72 18,4.14 14,3.23V5.29C16.89,6.15 19,8.83 19,12M16.5,12C16.5,10.23 15.5,8.71 14,7.97V10.18L16.45,12.63C16.5,12.43 16.5,12.21 16.5,12Z" /></svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
<path fill="#ffffffdd" d="M12,4L9.91,6.09L12,8.18M4.27,3L3,4.27L7.73,9H3V15H7L12,20V13.27L16.25,17.53C15.58,18.04 14.83,18.46 14,18.7V20.77C15.38,20.45 16.63,19.82 17.68,18.96L19.73,21L21,19.73L12,10.73M19,12C19,12.94 18.8,13.82 18.46,14.64L19.97,16.15C20.62,14.91 21,13.5 21,12C21,7.72 18,4.14 14,3.23V5.29C16.89,6.15 19,8.83 19,12M16.5,12C16.5,10.23 15.5,8.71 14,7.97V10.18L16.45,12.63C16.5,12.43 16.5,12.21 16.5,12Z" />
</svg>

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 712 B

View File

@@ -1 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31L23.31,12L20,8.69Z" /></svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
<path fill="#ffffffdd" d="M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31L23.31,12L20,8.69Z" />
</svg>

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 562 B

View File

@@ -1 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z" /></svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
<path fill="#ffffffdd" d="M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z" />
</svg>

Before

Width:  |  Height:  |  Size: 471 B

After

Width:  |  Height:  |  Size: 496 B

View File

@@ -1 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M12,18V6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z" /></svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
<path fill="#ffffffdd" d="M12,18V6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z" />
</svg>

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 KiB

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 KiB

View File

@@ -20,48 +20,56 @@ return function (s)
{
{
{
id = "label",
text = "Brightness",
align = "left",
valign = "center",
widget = wibox.widget.textbox
nil,
{
nil,
{
id = "icon",
forced_height = dpi(220),
image = icondir .. "brightness-high.svg",
widget = wibox.widget.imagebox
},
nil,
expand = "none",
id = "icon_margin2",
layout = wibox.layout.align.vertical
},
nil,
id = "icon_margin1",
expand = "none",
layout = wibox.layout.align.horizontal
},
nil,
{
id = "value",
text = "0%",
align = "center",
valign = "center",
widget = wibox.widget.textbox
},
id = "label_value_layout",
forced_height = dpi(48),
layout = wibox.layout.align.horizontal,
},
{
{
{
id = "icon",
image = gears.color.recolor_image(icondir .. "brightness-high.svg", color.color["White"]),
widget = wibox.widget.imagebox
id = "label",
text = "Brightness",
align = "left",
valign = "center",
widget = wibox.widget.textbox
},
id = "icon_margin",
top = dpi(12),
bottom = dpi(12),
widget = wibox.container.margin
nil,
{
id = "value",
text = "0%",
align = "center",
valign = "center",
widget = wibox.widget.textbox
},
id = "label_value_layout",
forced_height = dpi(48),
layout = wibox.layout.align.horizontal,
},
{
{
id = "brightness_slider",
bar_shape = gears.shape.rounded_rect,
bar_height = dpi(2),
bar_color = color.color["White"],
bar_active_color = color.color["White"],
handle_color = color.color["White"],
bar_height = dpi(10),
bar_color = color.color["Grey800"] .. "88",
bar_active_color = "#ffffff",
handle_color = "#ffffff",
handle_shape = gears.shape.circle,
handle_width = dpi(15),
handle_width = dpi(10),
handle_border_color = color.color["White"],
handle_border_width = dpi(1),
maximum = 100,
widget = wibox.widget.slider
},
@@ -70,23 +78,23 @@ return function (s)
widget = wibox.container.place
},
id = "icon_slider_layout",
spacing = dpi(24),
layout = wibox.layout.fixed.horizontal
spacing = dpi(0),
layout = wibox.layout.align.vertical
},
id = "osd_layout",
layout = wibox.layout.fixed.vertical
layout = wibox.layout.align.vertical
},
id = "container",
left = dpi(24),
right = dpi(24),
widget = wibox.container.margin
},
bg = color.color["Grey900"],
bg = color.color["Grey900"] .. "88",
widget = wibox.container.background,
ontop = true,
visible = true,
type = "notification",
forced_height = dpi(100),
forced_height = dpi(300),
forced_width = dpi(300),
offset = dpi(5),
}
@@ -97,7 +105,7 @@ return function (s)
local brightness_value = brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:get_value()
-- Performance is horrible, or it overrides and executes at the same time as the keybindings
--awful.spawn("xbacklight -set " .. brightness_value, false)
brightness_osd_widget.container.osd_layout.label_value_layout.value:set_text(brightness_value .. "%")
brightness_osd_widget.container.osd_layout.icon_slider_layout.label_value_layout.value:set_text(brightness_value .. "%")
awesome.emit_signal(
"widget::brightness:update",
@@ -119,13 +127,13 @@ return function (s)
elseif brightness_value >= 67 then
icon = icon .. "-high"
end
brightness_osd_widget.container.osd_layout.icon_slider_layout.icon_margin.icon:set_image(gears.color.recolor_image(icon .. ".svg", color.color["White"]))
brightness_osd_widget.container.osd_layout.icon_slider_layout.icon_margin1.icon_margin2.icon:set_image(icon .. ".svg")
end
)
local update_slider = function ()
awful.spawn.easy_async_with_shell(
[[ xbacklight -get ]],
[[ sleep 0.1 && xbacklight -get ]],
function (stdout)
stdout = stdout:sub(1,-9)
brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:set_value(tonumber(stdout))
@@ -152,17 +160,17 @@ return function (s)
local brightness_container = awful.popup{
widget = wibox.container.background,
ontop = true,
bg = color.color["Grey900"],
bg = color.color["Grey900"] .. "00",
stretch = false,
visible = false,
placement = function (c) awful.placement.bottom_right(c, {margins = dpi(10)}) end,
placement = function (c) awful.placement.centered(c, {margins = {top = dpi(200)}}) end,
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
gears.shape.rounded_rect(cr, width, height, 15)
end
}
local hide_brightness_osd = gears.timer{
timeout = 1,
timeout = 2,
autostart = true,
callback = function ()
brightness_container.visible = false

View File

@@ -8,7 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/powermenu/"
@@ -77,7 +77,7 @@ return function (s)
update_profile_picture()
-- Will determin the display style
local namestyle = RC.vars.namestyle
local namestyle = user_vars.vars.namestyle
-- Get the full username(if set) and the username + hostname
local update_user_name = function()
awful.spawn.easy_async_with_shell(

View File

@@ -8,7 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/titlebar/"
@@ -138,16 +138,23 @@ local create_titlebar = function (c, bg, size)
end
local create_titlebar_dialog = function(c, bg, size)
awful.titlebar(c, {position = "left", bg = bg, size = size}) : setup {
{
{
{
local titlebar = awful.titlebar(c, {
position = "left",
bg = bg,
size = size
})
titlebar : setup {
{
{
{
awful.titlebar.widget.closebutton(c),
widget = wibox.container.background,
bg = color.color["Red200"],
shape = function (cr, height, width)
gears.shape.rounded_rect(cr, width, height, 4)
end
end,
id = "closebutton"
},
{
awful.titlebar.widget.minimizebutton(c),
@@ -155,21 +162,33 @@ local create_titlebar_dialog = function(c, bg, size)
bg = color.color["Green200"],
shape = function (cr, height, width)
gears.shape.rounded_rect(cr, width, height, 4)
end
end,
id = "minimizebutton"
},
spacing = dpi(7),
layout = wibox.layout.fixed.vertical
},
margins = dpi(8),
widget = wibox.container.margin
},
{
spacing = dpi(10),
layout = wibox.layout.fixed.vertical,
id = "spacing"
},
margins = dpi(8),
widget = wibox.container.margin,
id = "margin"
},
{
buttons = create_click_events(c),
layout = wibox.layout.flex.vertical
},
nil,
layout = wibox.layout.align.vertical
}
},
{
{
widget = awful.widget.clienticon(c)
},
margins = dpi(5),
widget = wibox.container.margin
},
layout = wibox.layout.align.vertical,
id = "main"
}
hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
end
local create_titlebar_borderhack = function (c, bg, position)
@@ -234,6 +253,9 @@ local draw_titlebar = function (c)
end
elseif c.type == 'dialog' then
create_titlebar_dialog(c, '#121212AA', 35)
create_titlebar_borderhack(c, "#121212AA", "right")
create_titlebar_borderhack(c, "#121212AA", "top")
create_titlebar_borderhack(c, "#121212AA", "bottom")
elseif c.type == 'modal' then
else
create_titlebar_borderhack(c, "#121212AA", "right")

View File

@@ -20,48 +20,56 @@ return function (s)
{
{
{
id = "label",
text = "Volume",
align = "left",
valign = "center",
widget = wibox.widget.textbox
nil,
{
nil,
{
id = "icon",
forced_height = dpi(220),
image = icondir .. "volume-high.svg",
widget = wibox.widget.imagebox
},
nil,
expand = "none",
id = "icon_margin2",
layout = wibox.layout.align.vertical
},
nil,
id = "icon_margin1",
expand = "none",
layout = wibox.layout.align.horizontal
},
nil,
{
id = "value",
text = "0%",
align = "center",
valign = "center",
widget = wibox.widget.textbox
},
id = "label_value_layout",
forced_height = dpi(48),
layout = wibox.layout.align.horizontal,
},
{
{
{
id = "icon",
image = gears.color.recolor_image(icondir .. "volume-high.svg", color.color["White"]),
widget = wibox.widget.imagebox
id = "label",
text = "Volume",
align = "left",
valign = "center",
widget = wibox.widget.textbox
},
id = "icon_margin",
top = dpi(12),
bottom = dpi(12),
widget = wibox.container.margin
nil,
{
id = "value",
text = "0%",
align = "center",
valign = "center",
widget = wibox.widget.textbox
},
id = "label_value_layout",
forced_height = dpi(48),
layout = wibox.layout.align.horizontal,
},
{
{
id = "volume_slider",
bar_shape = gears.shape.rounded_rect,
bar_height = dpi(2),
bar_color = color.color["White"],
bar_active_color = color.color["White"],
handle_color = color.color["White"],
bar_height = dpi(10),
bar_color = color.color["Grey800"] .. "88",
bar_active_color = "#ffffff",
handle_color = "#ffffff",
handle_shape = gears.shape.circle,
handle_width = dpi(15),
handle_width = dpi(10),
handle_border_color = color.color["White"],
handle_border_width = dpi(1),
maximum = 100,
widget = wibox.widget.slider
},
@@ -70,76 +78,80 @@ return function (s)
widget = wibox.container.place
},
id = "icon_slider_layout",
spacing = dpi(24),
layout = wibox.layout.fixed.horizontal
spacing = dpi(0),
layout = wibox.layout.align.vertical
},
id = "osd_layout",
layout = wibox.layout.fixed.vertical
layout = wibox.layout.align.vertical
},
id = "container",
left = dpi(24),
right = dpi(24),
widget = wibox.container.margin
},
bg = color.color["Grey900"],
bg = color.color["Grey900"] .. '88',
widget = wibox.container.background,
ontop = true,
visible = true,
type = "notification",
forced_height = dpi(100),
forced_height = dpi(300),
forced_width = dpi(300),
offset = dpi(5),
}
local function update_osd()
local volume_level = volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:get_value()
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ ".. volume_level .. "%", false)
awesome.emit_signal("widget::volume")
volume_osd_widget.container.osd_layout.icon_slider_layout.label_value_layout.value:set_text(volume_level .. "%")
awesome.emit_signal(
"widget::volume:update",
volume_level
)
if awful.screen.focused().show_volume_osd then
awesome.emit_signal(
"module::volume_osd:show",
true
)
end
local icon = icondir .. "volume"
if volume_level < 1 then
icon = icon .. "-mute"
elseif volume_level >= 1 and volume_level < 34 then
icon = icon .. "-low"
elseif volume_level >= 34 and volume_level < 67 then
icon = icon .. "-medium"
elseif volume_level >= 67 then
icon = icon .. "-high"
end
volume_osd_widget.container.osd_layout.icon_slider_layout.icon_margin1.icon_margin2.icon:set_image(icon .. ".svg")
end
volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:connect_signal(
"property::value",
function ()
local volume_level = volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:get_value()
awful.spawn("amixer sset Master ".. volume_level .. "%", false)
awesome.emit_signal("widget::volume")
volume_osd_widget.container.osd_layout.label_value_layout.value:set_text(volume_level .. "%")
awesome.emit_signal(
"widget::volume:update",
volume_level
)
if awful.screen.focused().show_volume_osd then
awesome.emit_signal(
"module::volume_osd:show",
true
)
end
local icon = icondir .. "volume"
if volume_level < 1 then
icon = icon .. "-mute"
elseif volume_level >= 1 and volume_level < 34 then
icon = icon .. "-low"
elseif volume_level >= 34 and volume_level < 67 then
icon = icon .. "-medium"
elseif volume_level >= 67 then
icon = icon .. "-high"
end
volume_osd_widget.container.osd_layout.icon_slider_layout.icon_margin.icon:set_image(gears.color.recolor_image(icon .. ".svg", color.color["White"]))
update_osd()
end
)
local update_slider = function ()
awful.spawn.easy_async_with_shell(
[[ awk -F"[][]" '/dB/ { print $6 }' <(amixer sget Master) ]],
[[ pacmd list-sinks | grep "muted" ]],
function (stdout)
if stdout:match("off") then
volume_osd_widget.container.osd_layout.label_value_layout.value:set_text("0%")
--volume_osd_slider.volume_slider:set_value(0)
volume_osd_widget.container.osd_layout.icon_slider_layout.icon_margin.icon:set_image(gears.color.recolor_image(icondir .. "volume-mute" .. ".svg", color.color["White"]))
if stdout:match("yes") then
volume_osd_widget.container.osd_layout.icon_slider_layout.label_value_layout.value:set_text("0%")
volume_osd_widget.container.osd_layout.icon_slider_layout.icon_margin1.icon_margin2.icon:set_image(icondir .. "volume-mute" .. ".svg")
else
awful.spawn.easy_async_with_shell(
[[ awk -F"[][]" '/dB/ { print $2 }' <(amixer sget Master) ]],
function (stdout)
stdout = stdout:sub(1, -3)
volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:set_value(tonumber(stdout))
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
function (stdout2)
stdout2 = stdout2:sub(1, -3)
volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:set_value(tonumber(stdout2))
update_osd()
end
)
end
@@ -167,12 +179,12 @@ return function (s)
local volume_container = awful.popup{
widget = wibox.container.background,
ontop = true,
bg = color.color["Grey900"],
bg = color.color["Grey900"] .. "00",
stretch = false,
visible = false,
placement = function (c) awful.placement.bottom_right(c, {margins = dpi(10)}) end,
placement = function (c) awful.placement.centered(c, {margins = {top = dpi(200)}}) end,
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
gears.shape.rounded_rect(cr, width, height, 15)
end
}
@@ -190,36 +202,36 @@ return function (s)
}
awesome.connect_signal(
"module::volume_osd:show",
function ()
volume_container.visible = true
end
)
"module::volume_osd:show",
function ()
volume_container.visible = true
end
)
volume_container:connect_signal(
"mouse::enter",
function ()
volume_container.visible = true
hide_volume_osd:stop()
end
)
volume_container:connect_signal(
"mouse::enter",
function ()
volume_container.visible = true
hide_volume_osd:stop()
end
)
volume_container:connect_signal(
"mouse::leave",
function ()
volume_container.visible = true
volume_container:connect_signal(
"mouse::leave",
function ()
volume_container.visible = true
hide_volume_osd:again()
end
)
awesome.connect_signal(
"widget::volume_osd:rerun",
function ()
if hide_volume_osd.started then
hide_volume_osd:again()
else
hide_volume_osd:start()
end
)
awesome.connect_signal(
"widget::volume_osd:rerun",
function ()
if hide_volume_osd.started then
hide_volume_osd:again()
else
hide_volume_osd:start()
end
end
)
end
)
end

View File

@@ -67,4 +67,7 @@ Theme.titlebar_close_button_normal = icondir .. "close.svg"
Theme.titlebar_maximized_button_normal = icondir .. "maximize.svg"
Theme.titlebar_minimize_button_normal = icondir .. "minimize.svg"
Theme.titlebar_maximized_button_active = icondir .. "maximize.svg"
Theme.titlebar_maximized_button_inactive = icondir .. "maximize.svg"
Theme.titlebar_maximized_button_inactive = icondir .. "maximize.svg"
Theme.bg_systray = colors.color["BlueGrey800"]
Theme.systray_icon_spacing = dpi(10)

View File

@@ -1,21 +1,21 @@
------------------------------
-- This is the audio widget --
------------------------------
function GetIcon(theme, c)
local naughty = require("naughty")
function Get_icon(theme, c)
if theme and c then
local clientName = string.lower(c.class) .. ".svg"
local resolutions = {"128x128", "96x96", "64x64", "48x48", "42x42", "32x32", "24x24", "16x16"}
local home = os.getenv("HOME")
for i, res in ipairs(resolutions) do
local iconDir = home .. "/.icons/" .. theme .. "/" .. res .."/apps/"
local iconDir = "/usr/share/icons/" .. theme .. "/" .. res .."/apps/"
local ioStream = io.open(iconDir .. clientName, "r")
if ioStream ~= nil then
return iconDir .. clientName
else
return c:get_icon(1)
return c.icon
end
end
end
return nil
return c:Get_icon(1)
end

View File

@@ -8,7 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/audio/"
@@ -58,7 +58,7 @@ return function ()
local get_volume = function ()
awful.spawn.easy_async_with_shell(
[[ awk -F"[][]" '/dB/ { print $2 }' <(amixer sget Master) ]],
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
function (stdout)
local icon = icondir .. "volume"
stdout = stdout:gsub("%%", "")
@@ -84,9 +84,9 @@ return function ()
local check_muted = function ()
awful.spawn.easy_async_with_shell(
[[ awk -F"[][]" '/dB/ { print $6 }' <(amixer sget Master) ]],
[[ pacmd list-sinks | grep "muted" ]],
function (stdout)
if stdout:match("off") then
if stdout:match("yes") then
audio_widget.container.audio_layout.label.visible = false
audio_widget.container:set_right(0)
audio_widget.container.audio_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. "volume-mute" .. ".svg", color.color["Grey900"]))

View File

@@ -10,7 +10,7 @@ local gears = require("gears")
local naughty = require("naughty")
local watch = awful.widget.watch
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/battery/"

View File

@@ -8,7 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/bluetooth/"
@@ -86,7 +86,14 @@ return function ()
autostart = true,
call_now = true,
callback = function ()
get_bluetooth_information()
awful.spawn.easy_async_with_shell(
"bluetoothctl list",
function (stdout)
if stdout ~= nil or stdout:gsub("\n", ""):match("") then
get_bluetooth_information()
end
end
)
end
}

View File

@@ -8,7 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/clock/"

View File

@@ -8,7 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/date/"

View File

@@ -8,7 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/kblayout/"
@@ -54,6 +54,7 @@ return function ()
end,
widget = wibox.widget.background
}
local layout = "";
local get_kblayout = function ()
awful.spawn.easy_async_with_shell(
@@ -67,25 +68,271 @@ return function ()
return layout
end
local set_kblayout = function (kblayout)
kblayout = "de"
if get_kblayout():gsub("\n", "") == "de" then
kblayout = "ru"
local function create_kb_layout_item (keymap)
-- TODO: Add more, too lazy rn
local longname, shortname
local xkeyboard_country_code = {
{"ad", "", "AND"}, -- Andorra
{"af", "", "AFG"}, -- Afganistan
{"al", "", "ALB"}, -- Albania
{"am", "", "ARM"}, -- Armenia
{"ara", "", "ARB"}, -- Arabic
{"at", "", "AUT"}, -- Austria
{"az", "", "AZE"}, -- Azerbaijan
{"ba", "", "BIH"}, -- Bosnia and Herzegovina
{"bd", "", "BGD"}, -- Bangladesh
{"be", "", "BEL"}, -- Belgium
{"bg", "", "BGR"}, -- Bulgaria
{"br", "", "BRA"}, -- Brazil
{"bt", "", "BTN"}, -- Bhutan
{"bw", "", "BWA"}, -- Botswana
{"by", "", "BLR"}, -- Belarus
{"ca", "", "CAN"}, -- Canada
{"cd", "", "COD"}, -- Congo
{"ch", "", "CHE"}, -- Switzerland
{"cm", "", "CMR"}, -- Cameroon
{"cn", "", "CHN"}, -- China
{"cz", "", "CZE"}, -- Czechia
{"de", "Deutsch (Germany)", "GER"}, -- Germany
{"dk", "", "DNK"}, -- Denmark
{"ee", "", "EST"}, -- Estonia
{"es", "", "ESP"}, -- Spain
{"et", "", "ETH"}, -- Ethiopia
{"eu", "?", "?"}, -- EurKey
{"fi", "", "FIN"}, -- Finland
{"fo", "", "FRO"}, -- Faroe Islands
{"fr", "", "FRA"}, -- France
{"gb", "English (Bri'ish)", "ENG"}, -- United Kingdom
{"ge", "", "GEO"}, -- Georgia
{"gh", "", "GHA"}, -- Ghana
{"gn", "", "GIN"}, -- Guinea
{"gr", "", "GRC"}, -- Greece
{"hr", "", "HRV"}, -- Croatia
{"hu", "", "HUN"}, -- Hungary
{"ie", "", "IRL"}, -- Ireland
{"il", "", "ISR"}, -- Israel
{"in", "", "IND"}, -- India
{"iq", "", "IRQ"}, -- Iraq
{"ir", "", "IRN"}, -- Iran
{"is", "", "ISL"}, -- Iceland
{"it", "", "ITA"}, -- Italy
{"jp", "", "JPN"}, -- Japan
{"ke", "", "KEN"}, -- Kenya
{"kg", "", "KGZ"}, -- Kyrgyzstan
{"kh", "", "KHM"}, -- Cambodia
{"kr", "", "KOR"}, -- Korea
{"kz", "", "KAZ"}, -- Kazakhstan
{"la", "", "LAO"}, -- Laos
{"latam", "?", "?"}, -- Latin America
{"latin", "?", "?"}, -- Latin
{"lk", "", "LKA"}, -- Sri Lanka
{"lt", "", "LTU"}, -- Lithuania
{"lv", "", "LVA"}, -- Latvia
{"ma", "", "MAR"}, -- Morocco
{"mao", "?", "?"}, -- Maori
{"me", "", "MNE"}, -- Montenegro
{"mk", "", "MKD"}, -- Macedonia
{"ml", "", "MLI"}, -- Mali
{"mm", "", "MMR"}, -- Myanmar
{"mn", "", "MNG"}, -- Mongolia
{"mt", "", "MLT"}, -- Malta
{"mv", "", "MDV"}, -- Maldives
{"ng", "", "NGA"}, -- Nigeria
{"nl", "", "NLD"}, -- Netherlands
{"no", "", "NOR"}, -- Norway
{"np", "", "NRL"}, -- Nepal
{"ph", "", "PHL"}, -- Philippines
{"pk", "", "PAK"}, -- Pakistan
{"pl", "", "POL"}, -- Poland
{"pt", "", "PRT"}, -- Portugal
{"ro", "", "ROU"}, -- Romania
{"rs", "", "SRB"}, -- Serbia
{"ru", "Русски (Russia)", "RUS"}, -- Russia
{"se", "", "SWE"}, -- Sweden
{"si", "", "SVN"}, -- Slovenia
{"sk", "", "SVK"}, -- Slovakia
{"sn", "", "SEN"}, -- Senegal
{"sy", "", "SYR"}, -- Syria
{"th", "", "THA"}, -- Thailand
{"tj", "", "TJK"}, -- Tajikistan
{"tm", "", "TKM"}, -- Turkmenistan
{"tr", "", "TUR"}, -- Turkey
{"tw", "", "TWN"}, -- Taiwan
{"tz", "", "TZA"}, -- Tanzania
{"ua", "", "UKR"}, -- Ukraine
{"us", "English (United States)", "USA"}, -- USA
{"uz", "", "UZB"}, -- Uzbekistan
{"vn", "", "VNM"}, -- Vietnam
{"za", "", "ZAF"} -- South Africa
}
for i, c in ipairs(xkeyboard_country_code) do
if c[1] == keymap then
longname = c[2]
shortname = c[3]
end
end
awful.spawn.easy_async_with_shell("setxkbmap -layout " .. kblayout)
get_kblayout()
local kb_layout_item = wibox.widget{
{
{
{
-- Short name e.g. GER, ENG, RUS
{
{
text = shortname,
widget = wibox.widget.textbox,
font = "JetBrains Mono ExtraBold, 12",
id = "kbmapname"
},
widget = wibox.container.margin,
id = "margin2"
},
nil,
{
{
text = longname,
widget = wibox.widget.textbox,
font = "JetBrains Mono Bold, 12",
},
widget = wibox.container.margin
},
spacing = dpi(15),
layout = wibox.layout.fixed.horizontal,
id = "container"
},
margins = dpi(10),
widget = wibox.container.margin,
id = "margin"
},
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 10)
end,
bg = color.color["Grey800"],
fg = color.color["White"],
widget = wibox.container.background,
id = "background"
},
margins = dpi(5),
widget = wibox.container.margin
}
hover_signal(kb_layout_item.background, color.color["White"], color.color["Grey900"])
kb_layout_item:connect_signal(
"button::press",
function ()
awful.spawn.easy_async_with_shell(
"setxkbmap " .. keymap,
function (stdout)
awesome.emit_signal("kblayout::hide:kbmenu")
get_kblayout()
end
)
end
)
return kb_layout_item
end
local function get_kblist()
local kb_layout_items = {
layout = wibox.layout.fixed.vertical
}
for i, keymap in pairs(user_vars.vars.kblayout) do
kb_layout_items[i] = create_kb_layout_item(keymap)
end
return kb_layout_items
end
local kb_menu_widget = awful.popup{
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background,
bg = color.color["Grey900"],
fg = color.color["White"],
width = dpi(100),
max_height = dpi(600),
visible = false,
ontop = true,
placement = function (c) awful.placement.align(c, {position = "top_right", margins = {right = dpi(255), top = dpi(60)}}) end
}
kb_menu_widget:setup(
get_kblist()
)
local function toggle_kb_layout()
awful.spawn.easy_async_with_shell(
"setxkbmap -query | grep layout: | awk '{print $2}'",
function (stdout)
for j, n in ipairs(user_vars.vars.kblayout) do
if stdout:match(n) then
if j == #user_vars.vars.kblayout then
awful.spawn.easy_async_with_shell(
"setxkbmap " .. user_vars.vars.kblayout[1],
function ()
get_kblayout()
end
)
else
awful.spawn.easy_async_with_shell(
"setxkbmap " .. user_vars.vars.kblayout[j + 1],
function ()
get_kblayout()
end
)
end
end
end
end
)
end
awesome.connect_signal(
"kblayout::toggle",
function ()
toggle_kb_layout()
end
)
--kb_menu_widget:move_next_to(mouse.current_widget_geometry)
-- Signals
hover_signal(kblayout_widget, color.color["Green200"])
local kblayout_keygrabber = awful.keygrabber{
autostart = false,
stop_event = 'release',
keypressed_callback = function (self, mod, key, command)
if key == 'Escape' then
awesome.emit_signal("kblayout::hide:kbmenu")
end
end
}
kblayout_widget:connect_signal(
"button::press",
function ()
set_kblayout()
if kb_menu_widget.visible then
kb_menu_widget.visible = false
kblayout_keygrabber:stop()
else
kb_menu_widget.visible = true
kblayout_keygrabber:start()
end
end
)
awesome.connect_signal(
"kblayout::hide:kbmenu",
function ()
kb_menu_widget.visible = false
kblayout_keygrabber:stop()
end
)
get_kblayout()
kb_menu_widget.visible = false
return kblayout_widget
end

View File

@@ -8,7 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Returns the layoutbox widget
return function ()

View File

@@ -9,7 +9,7 @@ local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local naughty = require("naughty")
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/network/"
@@ -180,7 +180,7 @@ return function ()
wifi_strength = tonumber(stdout)
network_widget.container.network_layout.spacing = dpi(8)
network_widget.container.network_layout.label.visible = true
network_widget.container.network_layout.label:set_text(tostring(wifi_strength))
network_widget.container.network_layout.label:set_text(tostring(wifi_strength .. "%"))
local wifi_strength_rounded = math.floor(wifi_strength / 25 + 0.5)
update_wireless_icon(wifi_strength_rounded)
end

View File

@@ -9,7 +9,7 @@ local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local naughty = require("naughty")
local wibox = require("wibox")
require("Main.Signals")
require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/power/"

View File

@@ -0,0 +1,40 @@
--------------------------------
-- This is the power widget --
--------------------------------
-- Awesome Libs
local awful = require("awful")
local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("main.signals")
return function (s)
local systray = wibox.widget{
{
{
wibox.widget.systray,
top = dpi(6),
bottom = dpi(6),
left = dpi(6),
right = dpi(6),
widget = wibox.container.margin
},
width = dpi(100),
strategy = "exact",
layout = wibox.container.constraint,
},
widget = wibox.container.background,
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
bg = color.color["BlueGrey800"]
}
-- Signals
--hover_signal(systray, color.color["Red200"])
return systray
end

View File

@@ -3,8 +3,7 @@ local awful = require("awful")
local gears = require("gears")
local dpi = require("beautiful").xresources.apply_dpi
local color = require("theme.crylia.colors")
local naughty =require("naughty")
require("theme.crylia.Tools.IconHandler")
require("theme.crylia.tools.icon_handler")
local list_update = function (widget, buttons, label, data, objects)
widget:reset()
@@ -52,7 +51,6 @@ local list_update = function (widget, buttons, label, data, objects)
{
id = "container",
tag_label_margin,
--tag_icon_margin,
layout = wibox.layout.fixed.horizontal
},
margins = dpi(0),
@@ -114,12 +112,12 @@ local list_update = function (widget, buttons, label, data, objects)
},
widget = wibox.container.place
},
tag_icon,
tag_icon_margin,
forced_width = dpi(33),
margins = dpi(6),
widget = wibox.container.margin
}
icon.icon_container.icon:set_image(GetIcon("Papirus", client))
icon.icon_container.icon:set_image(Get_icon("Papirus-Dark", client))
tag_widget.widget_margin.container:setup({
icon,
layout = wibox.layout.align.horizontal

View File

@@ -109,9 +109,7 @@ local list_update = function (widget, buttons, label, data, objects)
task_widget:set_bg("#3A475C")
task_title:set_text('')
end
task_icon.icon:set_image(GetIcon("Papirus", object))
task_icon.icon:set_image(Get_icon("Papirus-Dark", object))
widget:add(task_widget)
widget:set_spacing(dpi(6))