a lot of stuff

This commit is contained in:
Kievits Rene
2022-04-16 05:08:33 +02:00
parent dae28d55eb
commit 1ceec3a7d9
74 changed files with 4743 additions and 716 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1008 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 KiB

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1008 KiB

View File

@@ -10,28 +10,28 @@ local gears = require("gears")
local dpi = require("beautiful").xresources.apply_dpi
local color = require("theme.crylia.colors")
return function (s)
return function(s)
local styles = {}
styles.month = {
styles.month = {
padding = 15,
bg_color = color.color["Grey900"],
border_width = 1,
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
styles.normal = {
fg_color = color.color["Grey900"],
font = "JetBrainsMonoExtraBold NF",
shape = function (cr, width, height)
font = user_vars.vars.font.extrabold,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
styles.focus = {
styles.focus = {
fg_color = color.color["Grey900"],
bg_color = color.color["Purple200"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
@@ -39,7 +39,7 @@ return function (s)
fg_color = color.color["Grey900"],
bg_color = color.color["Teal200"],
markup = function(t) return '<b>' .. t .. '</b>' end,
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
@@ -48,12 +48,12 @@ return function (s)
fg_color = color.color["Grey900"],
bg_color = color.color["Teal200"],
markup = function(t) return '<b>' .. t .. '</b>' end,
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
local function decorate_cell(widget, flag, date)
if flag=='monthheader' and not styles.monthheader then
if flag == 'monthheader' and not styles.monthheader then
flag = 'header'
end
local props = styles[flag] or {}
@@ -61,19 +61,19 @@ return function (s)
widget:set_markup(props.markup(widget:get_text()))
end
-- Change bg color for weekends
local d = {year=date.year, month=(date.month or 1), day=(date.day or 1)}
local d = { year = date.year, month = (date.month or 1), day = (date.day or 1) }
local weekday = tonumber(os.date('%w', os.time(d)))
local default_bg = (weekday == 0 or weekday == 6) and color.color["Red200"] or color.color["White"]
local ret = wibox.widget {
{
widget,
left = dpi(8),
right = dpi(8),
top = dpi(4),
left = dpi(8),
right = dpi(8),
top = dpi(4),
bottom = dpi(4),
widget = wibox.container.margin
widget = wibox.container.margin
},
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
fg = props.fg_color or '#999999',
@@ -82,15 +82,16 @@ return function (s)
}
return ret
end
local calendar = wibox.widget {
date = os.date('*t'),
fn_embed = decorate_cell,
widget = wibox.widget.calendar.month,
font = "JetBrainsMonoExtraBold NF",
font = user_vars.vars.font.extrabold,
spacing = dpi(10)
}
local calendar_osd_widget = wibox.widget{
local calendar_osd_widget = wibox.widget {
{
widget = wibox.widget.textbox,
fg = "#ffffff",
@@ -106,7 +107,7 @@ return function (s)
layout = wibox.layout.fixed.vertical
}
local set_clock = function ()
local set_clock = function()
calendar_osd_widget.digital_clock:set_text(os.date("%H:%M"))
end
@@ -114,40 +115,40 @@ return function (s)
timeout = 5,
autostart = true,
call_now = true,
callback = function ()
callback = function()
set_clock()
end
}
local calendar_osd_container = awful.popup{
local calendar_osd_container = awful.popup {
screen = s,
widget = wibox.container.background,
ontop = true,
bg = color.color["Grey900"],
stretch = false,
visible = false,
placement = function (c)awful.placement.top_right(c, {margins = {right = dpi(100),top = dpi(60)}})end,
shape = function (cr, width, height)
placement = function(c) awful.placement.top_right(c, { margins = { right = dpi(100), top = dpi(60) } }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
local hide_osd = gears.timer{
local hide_osd = gears.timer {
timeout = 0.25,
autostart = true,
callback = function ()
callback = function()
calendar_osd_container.visible = false
end
}
calendar_osd_container:setup{
calendar_osd_container:setup {
calendar_osd_widget,
layout = wibox.layout.align.horizontal
}
calendar_osd_container:connect_signal(
"mouse::enter",
function ()
function()
calendar_osd_container.visible = true
hide_osd:stop()
end
@@ -155,7 +156,7 @@ return function (s)
calendar_osd_container:connect_signal(
"mouse::leave",
function ()
function()
calendar_osd_container.visible = false
hide_osd:stop()
end
@@ -163,7 +164,7 @@ return function (s)
awesome.connect_signal(
"widget::calendar_osd:stop",
function ()
function()
calendar_osd_container.visible = true
hide_osd:stop()
end
@@ -171,7 +172,7 @@ return function (s)
awesome.connect_signal(
"widget::calendar_osd:rerun",
function ()
function()
if hide_osd.started then
hide_osd:again()
else

View File

@@ -13,15 +13,15 @@ require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/powermenu/"
return function (s)
return function(s)
-- Profile picture imagebox
local profile_picture = wibox.widget {
image = icondir .. "defaultpfp.svg",
resize = true,
forced_height = dpi(200),
clip_shape = function (cr, width, height)
gears.shape.rounded_rect(cr, dpi(width), dpi(height), 30)
clip_shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 30)
end,
widget = wibox.widget.imagebox
}
@@ -38,7 +38,7 @@ return function (s)
-- Get the profile script from /var/lib/AccountsService/icons/${USER}
-- and copy it to the assets folder
-- TODO: If the user doesnt have AccountsService look into $HOME/.faces
local update_profile_picture = function ()
local update_profile_picture = function()
awful.spawn.easy_async_with_shell(
[=[
iconPath="/var/lib/AccountsService/icons/${USER}"
@@ -65,7 +65,7 @@ return function (s)
fi
fi
]=],
function (stdout)
function(stdout)
if stdout then
profile_picture:set_image(stdout:gsub("\n", ""))
else
@@ -107,7 +107,7 @@ return function (s)
-- Universal Button widget
local button = function(name, icon, bg_color, callback)
local item = wibox.widget{
local item = wibox.widget {
{
{
{
@@ -141,7 +141,7 @@ return function (s)
},
fg = color.color["Grey900"],
bg = bg_color,
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 10)
end,
widget = wibox.container.background,
@@ -194,11 +194,11 @@ return function (s)
local lock_button = button("Lock", icondir .. "lock.svg", color.color["Orange200"], lock_command)
-- Signals to change color on hover
hover_signal(shutdown_button.background, color.color["Blue200"])
hover_signal(reboot_button.background, color.color["Red200"])
hover_signal(suspend_button.background, color.color["Yellow200"])
hover_signal(logout_button.background, color.color["Green200"])
hover_signal(lock_button.background, color.color["Orange200"])
Hover_signal(shutdown_button.background, color.color["Blue200"])
Hover_signal(reboot_button.background, color.color["Red200"])
Hover_signal(suspend_button.background, color.color["Yellow200"])
Hover_signal(logout_button.background, color.color["Green200"])
Hover_signal(lock_button.background, color.color["Orange200"])
-- The powermenu widget
local powermenu = wibox.widget {
@@ -263,7 +263,7 @@ return function (s)
}
-- Container for the widget, covers the entire screen
local powermenu_container = wibox{
local powermenu_container = wibox {
widget = powermenu,
screen = s,
type = "splash",
@@ -282,7 +282,7 @@ return function (s)
awful.button(
{},
3,
function ()
function()
awesome.emit_signal("module::powermenu:hide")
end
)
@@ -290,10 +290,10 @@ return function (s)
)
-- Close on Escape
local powermenu_keygrabber = awful.keygrabber{
local powermenu_keygrabber = awful.keygrabber {
autostart = false,
stop_event = 'release',
keypressed_callback = function (self, mod, key, command)
keypressed_callback = function(self, mod, key, command)
if key == 'Escape' then
awesome.emit_signal("module::powermenu:hide")
end
@@ -317,4 +317,4 @@ return function (s)
powermenu_container.visible = false
end
)
end
end

View File

@@ -17,28 +17,28 @@ awful.titlebar.enable_tooltip = true
awful.titlebar.fallback_name = 'Client'
local double_click_event_handler = function(double_click_event)
if double_click_timer then
double_click_timer:stop()
double_click_timer = nil
double_click_event()
return
end
double_click_timer = gears.timer.start_new(
0.20,
function()
double_click_timer = nil
return false
end
)
if double_click_timer then
double_click_timer:stop()
double_click_timer = nil
double_click_event()
return
end
double_click_timer = gears.timer.start_new(
0.20,
function()
double_click_timer = nil
return false
end
)
end
local create_click_events = function (c)
local create_click_events = function(c)
local buttons = gears.table.join(
awful.button(
{},
1,
function ()
double_click_event_handler(function ()
function()
double_click_event_handler(function()
if c.floating then
c.float = false
return
@@ -52,7 +52,7 @@ local create_click_events = function (c)
awful.button(
{},
3,
function ()
function()
c:activate { context = 'titlebar', action = 'mouse_resize' }
end
)
@@ -60,12 +60,12 @@ local create_click_events = function (c)
return buttons
end
local createresize_click_events = function (c)
local createresize_click_events = function(c)
local buttons = gears.table.join(
awful.button(
{},
1,
function ()
function()
c:activate { context = 'titlebar', action = 'mouse_resize' }
end
)
@@ -73,21 +73,21 @@ local createresize_click_events = function (c)
return buttons
end
local create_titlebar = function (c, bg, size)
local create_titlebar = function(c, bg, size)
local titlebar = awful.titlebar(c, {
position = "left",
bg = bg,
size = size
})
titlebar : setup {
titlebar:setup {
{
{
{
awful.titlebar.widget.closebutton(c),
widget = wibox.container.background,
bg = color.color["Red200"],
shape = function (cr, height, width)
shape = function(cr, height, width)
gears.shape.rounded_rect(cr, width, height, 4)
end,
id = "closebutton"
@@ -96,7 +96,7 @@ local create_titlebar = function (c, bg, size)
awful.titlebar.widget.maximizedbutton(c),
widget = wibox.container.background,
bg = color.color["Yellow200"],
shape = function (cr, height, width)
shape = function(cr, height, width)
gears.shape.rounded_rect(cr, width, height, 4)
end,
id = "maximizebutton"
@@ -105,22 +105,22 @@ local create_titlebar = function (c, bg, size)
awful.titlebar.widget.minimizebutton(c),
widget = wibox.container.background,
bg = color.color["Green200"],
shape = function (cr, height, width)
shape = function(cr, height, width)
gears.shape.rounded_rect(cr, width, height, 4)
end,
id = "minimizebutton"
},
spacing = dpi(10),
layout = wibox.layout.fixed.vertical,
id = "spacing"
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
buttons = create_click_events(c),
layout = wibox.layout.flex.vertical
},
{
{
@@ -132,26 +132,26 @@ local create_titlebar = function (c, bg, size)
layout = wibox.layout.align.vertical,
id = "main"
}
hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
hover_signal(titlebar.main.margin.spacing.maximizebutton, color.color["Yellow200"])
hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
Hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
Hover_signal(titlebar.main.margin.spacing.maximizebutton, color.color["Yellow200"])
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
end
local create_titlebar_dialog = function(c, bg, size)
local titlebar = awful.titlebar(c, {
local titlebar = awful.titlebar(c, {
position = "left",
bg = bg,
size = size
})
titlebar : setup {
titlebar:setup {
{
{
{
awful.titlebar.widget.closebutton(c),
widget = wibox.container.background,
bg = color.color["Red200"],
shape = function (cr, height, width)
shape = function(cr, height, width)
gears.shape.rounded_rect(cr, width, height, 4)
end,
id = "closebutton"
@@ -160,22 +160,22 @@ local create_titlebar_dialog = function(c, bg, size)
awful.titlebar.widget.minimizebutton(c),
widget = wibox.container.background,
bg = color.color["Green200"],
shape = function (cr, height, width)
shape = function(cr, height, width)
gears.shape.rounded_rect(cr, width, height, 4)
end,
id = "minimizebutton"
},
spacing = dpi(10),
layout = wibox.layout.fixed.vertical,
id = "spacing"
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
buttons = create_click_events(c),
layout = wibox.layout.flex.vertical
},
{
{
@@ -187,33 +187,33 @@ local create_titlebar_dialog = function(c, bg, size)
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"])
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)
local create_titlebar_borderhack = function(c, bg, position)
local borderhack = awful.titlebar(c, {
position = position,
bg = bg,
size = "2"
})
borderhack : setup {
borderhack:setup {
{
bg = bg,
widget = wibox.container.background
},
{
buttons = createresize_click_events(c),
layout = wibox.layout.flex.vertical
},
nil,
layout = wibox.layout.align.vertical
}
{
buttons = createresize_click_events(c),
layout = wibox.layout.flex.vertical
},
nil,
layout = wibox.layout.align.vertical
}
local old_wibox, old_cursor
borderhack:connect_signal(
"mouse::enter",
function ()
function()
local w = mouse.current_client
if w then
old_cursor, old_wibox = w.cursor, w
@@ -224,7 +224,7 @@ local create_titlebar_borderhack = function (c, bg, position)
borderhack:connect_signal(
"mouse::leave",
function ()
function()
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
@@ -234,8 +234,8 @@ local create_titlebar_borderhack = function (c, bg, position)
end
local draw_titlebar = function (c)
if c.type == 'normal' and not c.requests_no_titlebar then
local draw_titlebar = function(c)
if c.type == 'normal' and not c.requests_no_titlebar then
create_titlebar_borderhack(c, "#121212AA", "right")
create_titlebar_borderhack(c, "#121212AA", "top")
create_titlebar_borderhack(c, "#121212AA", "bottom")
@@ -267,7 +267,7 @@ end
client.connect_signal(
"property::maximized",
function (c)
function(c)
if c.maximized then
Theme.titlebar_maximized_button_normal = icondir .. "unmaximize.svg"
Theme.titlebar_maximized_button_active = icondir .. "unmaximize.svg"
@@ -282,7 +282,7 @@ client.connect_signal(
client.connect_signal(
"request::titlebars",
function (c)
function(c)
if c.maximized then
Theme.titlebar_maximized_button_normal = icondir .. "unmaximize.svg"
Theme.titlebar_maximized_button_active = icondir .. "unmaximize.svg"
@@ -304,7 +304,7 @@ client.connect_signal(
client.connect_signal(
'property::floating',
function (c)
function(c)
if c.floating and not c.maximized then
if c.class == "Steam" then
awful.titlebar.hide(c, 'left')

View File

@@ -13,9 +13,9 @@ local wibox = require("wibox")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/audio/"
-- Returns the volume_osd
return function (s)
return function(s)
local volume_osd_widget = wibox.widget{
local volume_osd_widget = wibox.widget {
{
{
{
@@ -101,8 +101,6 @@ return function (s)
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 .. "%")
@@ -133,22 +131,26 @@ return function (s)
volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:connect_signal(
"property::value",
function ()
function()
update_osd()
end
)
local update_slider = function ()
local update_slider = function()
awful.spawn.easy_async_with_shell(
[[ pacmd list-sinks | grep "muted" ]],
function (stdout)
function(stdout)
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(
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
function (stdout2)
[[
SINK="$(pacmd stat | awk -F": " '/^Default sink name: /{print $2}')"
echo $(pacmd list-sinks | awk '/^\s+name: /{indefault = $2 == "<'$SINK'>"} /^\s+volume: / && indefault {print $5; exit}')
]],
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()
@@ -162,55 +164,55 @@ return function (s)
-- Signals
awesome.connect_signal(
"module::slider:update",
function ()
function()
update_slider()
end
)
awesome.connect_signal(
"widget::volume:update",
function (value)
function(value)
volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:set_value(tonumber(value))
end
)
update_slider()
local volume_container = awful.popup{
local volume_container = awful.popup {
widget = wibox.container.background,
ontop = true,
bg = color.color["Grey900"] .. "00",
stretch = false,
visible = false,
placement = function (c) awful.placement.centered(c, {margins = {top = dpi(200)}}) end,
shape = function (cr, width, height)
placement = function(c) awful.placement.centered(c, { margins = { top = dpi(200) } }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 15)
end
}
local hide_volume_osd = gears.timer{
local hide_volume_osd = gears.timer {
timeout = 2,
autostart = true,
callback = function ()
callback = function()
volume_container.visible = false
end
}
volume_container:setup{
volume_container:setup {
volume_osd_widget,
layout = wibox.layout.fixed.horizontal
}
awesome.connect_signal(
"module::volume_osd:show",
function ()
function()
volume_container.visible = true
end
)
volume_container:connect_signal(
"mouse::enter",
function ()
function()
volume_container.visible = true
hide_volume_osd:stop()
end
@@ -218,7 +220,7 @@ return function (s)
volume_container:connect_signal(
"mouse::leave",
function ()
function()
volume_container.visible = true
hide_volume_osd:again()
end
@@ -226,7 +228,7 @@ return function (s)
awesome.connect_signal(
"widget::volume_osd:rerun",
function ()
function()
if hide_volume_osd.started then
hide_volume_osd:again()
else
@@ -234,4 +236,4 @@ return function (s)
end
end
)
end
end

View File

@@ -9,13 +9,12 @@
local awful = require("awful")
Theme_path = awful.util.getdir("config") .. "/theme/crylia/"
Theme = { }
Theme = {}
dofile(Theme_path .. "theme_variables.lua")
dofile(Theme_path .. "layouts.lua")
--Theme.wallpaper = Theme_path .. "assets/space.jpg"
Theme.awesome_icon = Theme_path .. "assets/icons/icon.png"
Theme.awesome_subicon = Theme_path .. "assets/icons/icon.png"
Theme.awesome_icon = Theme_path .. "assets/icons/ArchLogo.png"
Theme.awesome_subicon = Theme_path .. "assets/icons/ArchLogo.png"
return Theme

View File

@@ -12,7 +12,7 @@ local awful = require("awful")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/titlebar/"
Theme.font = "JetBrains Mono, Bold"
Theme.font = user_vars.vars.font.bold
Theme.bg_normal = colors.color["Grey900"]
Theme.bg_focus = colors.color["Grey900"]
@@ -31,7 +31,7 @@ Theme.border_normal = colors.color["Grey800"]
--Theme.border_focus = colors.color["Red"] -- Doesnt work, no idea why; workaround is in signals.lua
Theme.border_marked = colors.color["Red400"]
Theme.menu_submenu_icon = Theme_path .. "assets.ArchLogo.png"
--Theme.menu_submenu_icon = Theme_path .. "assets.ArchLogo.png"
Theme.menu_height = dpi(30)
Theme.menu_width = dpi(200)
Theme.menu_bg_normal = colors.color["Grey900"]
@@ -47,7 +47,7 @@ Theme.tooltip_border_color = colors.color["Grey700"]
Theme.tooltip_bg = colors.color["Grey800"]
Theme.tooltip_fg = colors.color["White"]
Theme.tooltip_border_width = dpi(0)
Theme.tooltip_shape = function (cr, width, heigth)
Theme.tooltip_shape = function(cr, width, heigth)
gears.shape.rounded_rect(cr, width, heigth, 10)
end
@@ -55,7 +55,7 @@ Theme.notification_bg = colors.color["Grey900"]
Theme.notification_fg = colors.color["White"]
Theme.notification_border_width = dpi(0)
Theme.notification_border_color = colors.color["Grey900"]
Theme.notification_shape = function (cr, width, heigth)
Theme.notification_shape = function(cr, width, heigth)
gears.shape.rounded_rect(cr, width, heigth, 10)
end
Theme.notification_margin = dpi(10)
@@ -75,8 +75,7 @@ Theme.systray_icon_spacing = dpi(10)
Theme.hotkeys_bg = colors.color["Grey900"]
Theme.hotkeys_fg = colors.color["White"]
Theme.hotkeys_border_width = 0
Theme.hotkeys_shape = function (cr, width, height)
Theme.hotkeys_shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 10)
end
Theme.hotkeys_description_font = "JetBrains Mono, Bold 14"
Theme.hotkeys_description_font = user_vars.vars.font.bold

View File

@@ -0,0 +1,7 @@
local awful = require("awful")
-- Autostart programs
--awful.spawn.with_shell("~/.screenlayout/single_screen.sh")
awful.spawn.with_shell("picom --experimental-backends")
awful.spawn.with_shell("xfce4-power-manager")
awful.spawn.with_shell("light-locker --lock-on-suspend --lock-on-lid &")

View File

@@ -2,6 +2,8 @@
-- This is a button widget to add a new tag to the taglist --
-------------------------------------------------------------
-- !!! THIS WIDGET IS OBSCOLETE !!!
-- Awesome Libs
local awful = require("awful")
local dpi = require("beautiful").xresources.apply_dpi
@@ -15,10 +17,10 @@ local color = require("theme.crylia.colors")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/addtag/"
-- Returns the add tag button widget
return function ()
return function()
-- This is the widget that gets dispayed
local add_tag_button = wibox.widget{
local add_tag_button = wibox.widget {
{
{
image = gears.color.recolor_image(icondir .. "plus.svg", color.color["White"]),
@@ -29,7 +31,7 @@ return function ()
widget = wibox.container.margin
},
bg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
@@ -38,12 +40,12 @@ return function ()
-- Keybindings and Mouse click bindings
add_tag_button:buttons(
gears.table.join(
-- Add a new tag
-- Add a new tag
awful.button(
{ },
{},
1,
nil,
function ()
function()
awful.tag.add()
end
)
@@ -54,7 +56,7 @@ return function ()
local old_wibox, old_cursor, old_bg
add_tag_button:connect_signal(
"mouse::enter",
function ()
function()
old_bg = add_tag_button.bg
add_tag_button.bg = "#ffffff" .. "12"
local w = mouse.current_wibox
@@ -66,19 +68,19 @@ return function ()
)
add_tag_button:connect_signal(
"button::press",
function ()
function()
add_tag_button.bg = "#ffffff" .. "24"
end
)
add_tag_button:connect_signal(
"button::release",
function ()
function()
add_tag_button.bg = "#ffffff" .. "12"
end
)
add_tag_button:connect_signal(
"mouse::leave",
function ()
function()
add_tag_button.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
@@ -88,4 +90,4 @@ return function ()
)
return add_tag_button
end
end

View File

@@ -14,9 +14,9 @@ require("main.signals")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/audio/"
-- Returns the audio widget
return function ()
return function()
local audio_widget = wibox.widget{
local audio_widget = wibox.widget {
{
{
{
@@ -33,7 +33,7 @@ return function ()
widget = wibox.container.margin,
id = "icon_margin"
},
spacing = dpi(6),
spacing = dpi(10),
{
id = "label",
align = "center",
@@ -44,22 +44,26 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(5),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Yellow200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local get_volume = function ()
local get_volume = function()
awful.spawn.easy_async_with_shell(
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
function (stdout)
[[
SINK="$(pacmd stat | awk -F": " '/^Default sink name: /{print $2}')"
echo $(pacmd list-sinks | awk '/^\s+name: /{indefault = $2 == "<'$SINK'>"} /^\s+volume: / && indefault {print $5; exit}')
]],
function(stdout)
local icon = icondir .. "volume"
stdout = stdout:gsub("%%", "")
local volume = tonumber(stdout) or 0
@@ -82,10 +86,10 @@ return function ()
)
end
local check_muted = function ()
local check_muted = function()
awful.spawn.easy_async_with_shell(
[[ pacmd list-sinks | grep "muted" ]],
function (stdout)
function(stdout)
if stdout:match("yes") then
audio_widget.container.audio_layout.label.visible = false
audio_widget.container:set_right(0)
@@ -99,11 +103,11 @@ return function ()
end
-- Signals
hover_signal(audio_widget, color.color["Yellow200"])
Hover_signal(audio_widget, color.color["Yellow200"])
audio_widget:connect_signal(
"button::press",
function ()
function()
awesome.emit_signal("widget::volume")
awesome.emit_signal("module::volume_osd:show", true)
awesome.emit_signal("module::slider:update")
@@ -113,7 +117,7 @@ return function ()
awesome.connect_signal(
"widget::volume",
function (c)
function(c)
check_muted()
end
)

View File

@@ -16,8 +16,8 @@ require("main.signals")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/battery/"
-- Returns the battery widget
return function ()
local battery_widget = wibox.widget{
return function()
local battery_widget = wibox.widget {
{
{
{
@@ -35,7 +35,7 @@ return function ()
top = dpi(2),
widget = wibox.container.margin
},
spacing = dpi(8),
spacing = dpi(10),
{
visible = false,
align = 'center',
@@ -47,30 +47,30 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(5),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Purple200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local battery_tooltip = awful.tooltip{
objects = {battery_widget},
local battery_tooltip = awful.tooltip {
objects = { battery_widget },
text = "",
mode = "outside",
mode = "inside",
preferred_alignments = "middle",
margins = dpi(10)
}
local get_battery_info = function ()
local get_battery_info = function()
awful.spawn.easy_async_with_shell(
[[ upower -i $(upower -e | grep BAT) | grep "time to " ]],
function (stdout)
function(stdout)
if stdout == nil or stdout == '' then
battery_tooltip:set_text('No Battery Found')
return
@@ -95,7 +95,7 @@ return function ()
local last_battery_check = os.time()
local notify_critical_battery = true
local battery_warning = function ()
local battery_warning = function()
naughty.notify({
icon = gears.color.recolor_image(icondir .. "battery-alert.svg", color.color["White"]),
app_name = "System notification",
@@ -105,10 +105,10 @@ return function ()
})
end
local update_battery = function (status)
local update_battery = function(status)
awful.spawn.easy_async_with_shell(
[[sh -c "upower -i $(upower -e | grep BAT) | grep percentage | awk '{print \$2}' |tr -d '\n%'"]],
function (stdout)
function(stdout)
local battery_percentage = tonumber(stdout)
if not battery_percentage then
@@ -129,7 +129,7 @@ return function ()
if battery_percentage > 0 and battery_percentage < 10 and status == 'discharging' then
icon = icon .. '-' .. 'alert'
if(os.difftime(os.time(), last_battery_check) > 300 or notify_critical_battery) then
if (os.difftime(os.time(), last_battery_check) > 300 or notify_critical_battery) then
last_battery_check = os.time()
notify_critical_battery = false
battery_warning()
@@ -156,7 +156,7 @@ return function ()
icon = icon .. '-' .. status .. '-' .. '70'
elseif battery_percentage >= 80 and battery_percentage < 90 then
icon = icon .. '-' .. status .. '-' .. '80'
elseif battery_percentage >=90 and battery_percentage < 100 then
elseif battery_percentage >= 90 and battery_percentage < 100 then
icon = icon .. '-' .. status .. '-' .. '90'
end
@@ -166,18 +166,18 @@ return function ()
)
end
hover_signal(battery_widget, color.color["Purple200"])
Hover_signal(battery_widget, color.color["Purple200"])
battery_widget:connect_signal(
'button::press',
function ()
function()
awful.spawn("xfce4-power-manager-settings")
end
)
battery_widget:connect_signal(
"mouse::enter",
function ()
function()
get_battery_info()
end
)
@@ -185,7 +185,7 @@ return function ()
watch(
[[sh -c "upower -i $(upower -e | grep BAT) | grep state | awk '{print \$2}' | tr -d '\n'"]],
5,
function (widget, stdout)
function(widget, stdout)
local status = stdout:gsub('%\n', '')
if status == nil or status == '' then
battery_widget.container.battery_layout.spacing = dpi(0)

View File

@@ -14,8 +14,8 @@ require("main.signals")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/bluetooth/"
-- Returns the bluetooth widget
return function ()
local bluetooth_widget = wibox.widget{
return function()
local bluetooth_widget = wibox.widget {
{
{
{
@@ -28,22 +28,22 @@ return function ()
widget = wibox.container.place
},
id = "icon_margin",
left = dpi(5),
right = dpi(5),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Blue200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local bluetooth_tooltip = awful.tooltip{
objects = {bluetooth_widget},
local bluetooth_tooltip = awful.tooltip {
objects = { bluetooth_widget },
text = "",
mode = "outside",
mode = "inside",
preferred_alignments = "middle",
margins = dpi(10)
}
@@ -51,69 +51,72 @@ return function ()
local bluetooth_state = "off"
local connected_device = "nothing"
local get_bluetooth_information = function ()
awful.spawn.easy_async_with_shell(
[[ bluetoothctl show | grep Powered | awk '{print $2}' ]],
function (stdout)
local icon = icondir .. "bluetooth"
stdout = stdout:gsub("\n", "")
if stdout == "yes" then
icon = icon .. "-on"
bluetooth_state = "on"
awful.spawn.easy_async_with_shell(
[[ bluetoothctl info | grep Name: | awk '{ first = $1; $1 = ""; print $0 }' ]],
function (stdout2)
if stdout2 == nil or stdout2:gsub("\n", "") == "" then
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently not connected")
else
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently connected to:" .. connected_device)
connected_device = stdout2
end
end
)
else
icon = icon .. "-off"
bluetooth_state = "off"
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n")
end
bluetooth_widget.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color.color["Grey900"]))
end
)
-- ! if you don't have a bluetooth device then this function will
-- ! spawn hundereds of processes of bluetoothctl, this will be bad
-- TODO: Check for a bluetooth controller first, maybe use a different program
local get_bluetooth_information = function()
-- awful.spawn.easy_async_with_shell(
-- [[ bluetoothctl show | grep Powered | awk '{print $2}' ]],
-- function(stdout)
-- local icon = icondir .. "bluetooth"
-- stdout = stdout:gsub("\n", "")
-- if stdout == "yes" then
-- icon = icon .. "-on"
-- bluetooth_state = "on"
-- awful.spawn.easy_async_with_shell(
-- [[ bluetoothctl info | grep Name: | awk '{ first = $1; $1 = ""; print $0 }' ]],
-- function(stdout2)
-- if stdout2 == nil or stdout2:gsub("\n", "") == "" then
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently not connected")
-- else
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently connected to:" .. connected_device)
-- connected_device = stdout2
-- end
-- end
-- )
-- else
-- icon = icon .. "-off"
-- bluetooth_state = "off"
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n")
-- end
-- bluetooth_widget.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color.color["Grey900"]))
-- end
-- )
end
local bluetooth_update = gears.timer{
local bluetooth_update = gears.timer {
timeout = 5,
autostart = true,
call_now = true,
callback = function ()
awful.spawn.easy_async_with_shell(
callback = function()
--[[ awful.spawn.easy_async_with_shell(
"bluetoothctl list",
function (stdout)
function(stdout)
if stdout ~= nil or stdout:gsub("\n", ""):match("") then
get_bluetooth_information()
end
end
)
) ]]
end
}
-- Signals
hover_signal(bluetooth_widget, color.color["Blue200"])
Hover_signal(bluetooth_widget, color.color["Blue200"])
bluetooth_widget:connect_signal(
"button::press",
function ()
function()
if bluetooth_state == "on" then
awful.spawn.easy_async_with_shell(
"bluetoothctl power off",
function (stdout)
function(stdout)
get_bluetooth_information()
end
)
else
awful.spawn.easy_async_with_shell(
"bluetoothctl power on",
function (stdout)
function(stdout)
get_bluetooth_information()
end
)

View File

@@ -14,9 +14,9 @@ require("main.signals")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/clock/"
-- Returns the clock widget
return function ()
return function()
local clock_widget = wibox.widget{
local clock_widget = wibox.widget {
{
{
{
@@ -45,19 +45,19 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(10),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Orange200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local set_clock = function ()
local set_clock = function()
clock_widget.container.clock_layout.label:set_text(os.date("%H:%M"))
end
@@ -67,12 +67,12 @@ return function ()
timeout = 5,
autostart = true,
call_now = true,
callback = function ()
callback = function()
set_clock()
end
}
hover_signal(clock_widget, color.color["Orange200"])
Hover_signal(clock_widget, color.color["Orange200"])
return clock_widget
end

View File

@@ -14,9 +14,9 @@ require("main.signals")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/date/"
-- Returns the date widget
return function ()
return function()
local date_widget = wibox.widget{
local date_widget = wibox.widget {
{
{
{
@@ -45,19 +45,19 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(10),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Teal200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local set_date = function ()
local set_date = function()
date_widget.container.date_layout.label:set_text(os.date("%a, %b %d"))
end
@@ -66,24 +66,24 @@ return function ()
timeout = 60,
autostart = true,
call_now = true,
callback = function ()
callback = function()
set_date()
end
}
-- Signals
hover_signal(date_widget, color.color["Teal200"])
Hover_signal(date_widget, color.color["Teal200"])
date_widget:connect_signal(
"mouse::enter",
function ()
function()
awesome.emit_signal("widget::calendar_osd:stop", true)
end
)
date_widget:connect_signal(
"mouse::leave",
function ()
function()
awesome.emit_signal("widget::calendar_osd:rerun", true)
end
)

View File

@@ -13,8 +13,8 @@ require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/kblayout/"
return function (s)
local kblayout_widget = wibox.widget{
return function(s)
local kblayout_widget = wibox.widget {
{
{
{
@@ -32,7 +32,7 @@ return function (s)
widget = wibox.container.margin,
id = "icon_margin"
},
spacing = dpi(6),
spacing = dpi(10),
{
id = "label",
align = "center",
@@ -43,129 +43,129 @@ return function (s)
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(5),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Green200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local layout = "";
local get_kblayout = function ()
local get_kblayout = function()
awful.spawn.easy_async_with_shell(
[[ setxkbmap -query | grep layout | awk '{print $2}' ]],
function (stdout)
layout = stdout
kblayout_widget.container.kblayout_layout.label.text = stdout
return stdout
function(stdout)
layout = stdout:gsub("\n", "")
kblayout_widget.container.kblayout_layout.label.text = layout
return layout
end
)
return layout
end
local function create_kb_layout_item (keymap)
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"}, -- Afghanistan
{"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
{ "ad", "", "AND" }, -- Andorra
{ "af", "", "AFG" }, -- Afghanistan
{ "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
@@ -175,7 +175,7 @@ return function (s)
end
end
local kb_layout_item = wibox.widget{
local kb_layout_item = wibox.widget {
{
{
{
@@ -184,7 +184,7 @@ return function (s)
{
text = shortname,
widget = wibox.widget.textbox,
font = "JetBrains Mono ExtraBold, 12",
font = user_vars.vars.font.extrabold,
id = "kbmapname"
},
widget = wibox.container.margin,
@@ -195,7 +195,7 @@ return function (s)
{
text = longname,
widget = wibox.widget.textbox,
font = "JetBrains Mono Bold, 12",
font = user_vars.vars.font.bold,
},
widget = wibox.container.margin
@@ -208,7 +208,7 @@ return function (s)
widget = wibox.container.margin,
id = "margin"
},
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 10)
end,
bg = color.color["Grey800"],
@@ -219,13 +219,13 @@ return function (s)
margins = dpi(5),
widget = wibox.container.margin
}
hover_signal(kb_layout_item.background, color.color["White"], color.color["Grey900"])
Hover_signal(kb_layout_item.background, color.color["White"], color.color["Grey900"])
kb_layout_item:connect_signal(
"button::press",
function ()
function()
awful.spawn.easy_async_with_shell(
"setxkbmap " .. keymap,
function (stdout)
function(stdout)
awesome.emit_signal("kblayout::hide:kbmenu")
get_kblayout()
end
@@ -245,9 +245,9 @@ return function (s)
return kb_layout_items
end
local kb_menu_widget = awful.popup{
local kb_menu_widget = awful.popup {
screen = s,
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background,
@@ -257,7 +257,7 @@ return function (s)
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
placement = function(c) awful.placement.align(c, { position = "top_right", margins = { right = dpi(255), top = dpi(60) } }) end
}
kb_menu_widget:setup(
@@ -267,20 +267,20 @@ return function (s)
local function toggle_kb_layout()
awful.spawn.easy_async_with_shell(
"setxkbmap -query | grep layout: | awk '{print $2}'",
function (stdout)
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 ()
function()
get_kblayout()
end
)
else
awful.spawn.easy_async_with_shell(
"setxkbmap " .. user_vars.vars.kblayout[j + 1],
function ()
function()
get_kblayout()
end
)
@@ -293,19 +293,19 @@ return function (s)
awesome.connect_signal(
"kblayout::toggle",
function ()
function()
toggle_kb_layout()
end
)
--kb_menu_widget:move_next_to(mouse.current_widget_geometry)
-- Signals
hover_signal(kblayout_widget, color.color["Green200"])
Hover_signal(kblayout_widget, color.color["Green200"])
local kblayout_keygrabber = awful.keygrabber{
local kblayout_keygrabber = awful.keygrabber {
autostart = false,
stop_event = 'release',
keypressed_callback = function (self, mod, key, command)
keypressed_callback = function(self, mod, key, command)
if key == 'Escape' then
awesome.emit_signal("kblayout::hide:kbmenu")
end
@@ -314,7 +314,7 @@ return function (s)
kblayout_widget:connect_signal(
"button::press",
function ()
function()
if kb_menu_widget.visible then
kb_menu_widget.visible = false
kblayout_keygrabber:stop()
@@ -327,7 +327,7 @@ return function (s)
awesome.connect_signal(
"kblayout::hide:kbmenu",
function ()
function()
kb_menu_widget.visible = false
kblayout_keygrabber:stop()
end

View File

@@ -11,30 +11,36 @@ local wibox = require("wibox")
require("main.signals")
-- Returns the layoutbox widget
return function ()
local layout = wibox.widget{
return function()
local layout = wibox.widget {
{
awful.widget.layoutbox(),
margins = dpi(3),
forced_width = dpi(33),
{
awful.widget.layoutbox(),
id = "icon_layout",
widget = wibox.container.place
},
id = "icon_margin",
left = dpi(5),
right = dpi(5),
forced_width = dpi(40),
widget = wibox.container.margin
},
bg = color.color["LightBlue200"],
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
-- Signals
hover_signal(layout, color.color["LightBlue200"])
Hover_signal(layout, color.color["LightBlue200"])
layout:connect_signal(
"button::press",
function ()
function()
awful.layout.inc(-1)
end
)
return layout
end
end

View File

@@ -16,18 +16,18 @@ local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/networ
-- Insert your interfaces here, get the from ip a
local interfaces = {
wlan_interface = "wlo1",
lan_interface = "enx00e04c89ce6f"
wlan_interface = user_vars.vars.network.wlan,
lan_interface = user_vars.vars.network.ethernet
}
local network_mode = nil
-- Returns the network widget
return function ()
return function()
local startup = true
local reconnect_startup = true
local network_widget = wibox.widget{
local wifi_strength
local network_widget = wibox.widget {
{
{
{
@@ -45,7 +45,7 @@ return function ()
top = dpi(2),
widget = wibox.container.margin
},
spacing = dpi(8),
spacing = dpi(10),
{
id = "label",
visible = false,
@@ -57,22 +57,22 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(10),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Red200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local network_tooltip = awful.tooltip{
local network_tooltip = awful.tooltip {
text = "Loading",
objects = {network_widget},
mode = "outside",
objects = { network_widget },
mode = "inside",
preferred_alignments = "middle",
margins = dpi(10)
}
@@ -92,21 +92,21 @@ return function ()
fi
]=]
local update_startup = function ()
local update_startup = function()
if startup then
startup = false
end
end
local update_reconnect_startup = function (status)
local update_reconnect_startup = function(status)
reconnect_startup = status
end
local update_tooltip = function (message)
local update_tooltip = function(message)
network_tooltip:set_markup(message)
end
local network_notify = function (message, title, app_name, icon)
local network_notify = function(message, title, app_name, icon)
naughty.notify({
text = message,
title = title,
@@ -116,21 +116,21 @@ return function ()
})
end
local update_wireless = function ()
local update_wireless = function()
network_mode = "wireless"
local notify_connected = function (essid)
local message = "You are now connected to ".. essid
local notify_connected = function(essid)
local message = "You are now connected to " .. essid
local title = "Connection successfull"
local app_name = "System Notification"
local icon = icondir .. "wifi-strength-4.svg"
network_notify(message, title, app_name, icon)
end
local update_wireless_data = function (healthy)
local update_wireless_data = function(healthy)
awful.spawn.easy_async_with_shell(
[[ iw dev ]] .. interfaces.wlan_interface .. [[ link ]],
function (stdout)
function(stdout)
local essid = stdout:match("SSID: (.-)\n") or "N/A"
local bitrate = stdout:match("tx bitrate: (.+/s)") or "N/A"
local message = "Connected to <b>" .. essid .. "</b>\nSignal strength <b>" .. tostring(wifi_strength) .. "%</b>\n" .. "Bit rate <b>" .. tostring(bitrate) .. "</b>"
@@ -149,10 +149,10 @@ return function ()
)
end
local update_wireless_icon = function (strength)
local update_wireless_icon = function(strength)
awful.spawn.easy_async_with_shell(
check_for_internet,
function (stdout)
function(stdout)
local icon = "wifi-strength"
if not stdout:match("Connected but no internet") then
if startup or reconnect_startup then
@@ -170,10 +170,10 @@ return function ()
)
end
local update_wireless_strength = function ()
local update_wireless_strength = function()
awful.spawn.easy_async_with_shell(
[[ awk 'NR==3 {printf "%3.0f", ($3/70)*100}' /proc/net/wireless ]],
function (stdout)
function(stdout)
if not tonumber(stdout) then
return
end
@@ -191,11 +191,11 @@ return function ()
update_startup()
end
local update_wired = function ()
local update_wired = function()
network_mode = "wired"
local notify_connected = function ()
local message = "You are now connected to ".. interfaces.lan_interface
local notify_connected = function()
local message = "You are now connected to " .. interfaces.lan_interface
local title = "Connection successfull"
local app_name = "System Notification"
local icon = icondir .. "ethernet.svg"
@@ -204,7 +204,7 @@ return function ()
awful.spawn.easy_async_with_shell(
check_for_internet,
function (stdout)
function(stdout)
local icon = "ethernet"
if stdout:match("Connected but no internet") then
@@ -229,15 +229,15 @@ return function ()
end
local update_disconnected = function ()
local notify_wireless_disconnected = function (essid)
local update_disconnected = function()
local notify_wireless_disconnected = function(essid)
local message = "WiFi has been disconnected"
local title = "Connection lost"
local app_name = "System Notification"
local icon = icondir .. "wifi-strength-off-outline.svg"
network_notify(message, title, app_name, icon)
end
local notify_wired_disconnected = function (essid)
local notify_wired_disconnected = function(essid)
local message = "Ethernet has been unplugged"
local title = "Connection lost"
local app_name = "System Notification"
@@ -264,7 +264,7 @@ return function ()
network_widget.container.network_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. icon .. ".svg", color.color["Grey900"]))
end
local check_network_mode = function ()
local check_network_mode = function()
awful.spawn.easy_async_with_shell(
[=[
wireless="]=] .. tostring(interfaces.wlan_interface) .. [=["
@@ -301,7 +301,7 @@ return function ()
}
print_network_mode
]=],
function (stdout)
function(stdout)
local mode = stdout:gsub("%\n", "")
if stdout:match("No internet connected") then
update_disconnected()
@@ -314,21 +314,21 @@ return function ()
)
end
local network_updater = gears.timer{
local network_updater = gears.timer {
timeout = 5,
autostart = true,
call_now = true,
callback = function ()
callback = function()
check_network_mode()
end
}
-- Signals
hover_signal(network_widget, color.color["Red200"])
Hover_signal(network_widget, color.color["Red200"])
network_widget:connect_signal(
"button::press",
function ()
function()
awful.spawn("gnome-control-center wlan")
end
)

View File

@@ -14,9 +14,9 @@ require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/power/"
return function ()
return function()
local power_widget = wibox.widget{
local power_widget = wibox.widget {
{
{
{
@@ -38,24 +38,24 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(5),
right = dpi(5),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Red200"],
fg = color.color["Grey800"],
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, height, width, 5)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
-- Signals
hover_signal(power_widget, color.color["Red200"])
Hover_signal(power_widget, color.color["Red200"])
power_widget:connect_signal(
"button::release",
function ()
function()
awesome.emit_signal("module::powermenu:show")
end
)

View File

@@ -11,16 +11,13 @@ local wibox = require("wibox")
require("main.signals")
return function (s)
return function(s)
local systray = wibox.widget{
local systray = wibox.widget {
{
{
wibox.widget.systray(),
top = dpi(6),
bottom = dpi(6),
left = dpi(6),
right = dpi(6),
margins = dpi(6),
widget = wibox.container.margin,
id = 'st'
},
@@ -29,13 +26,15 @@ return function (s)
id = "container"
},
widget = wibox.container.background,
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
bg = color.color["BlueGrey800"]
}
-- Signals
hover_signal(systray.container, color.color["Red200"])
Hover_signal(systray.container, color.color["Red200"])
systray.container.st.widget:set_base_size(dpi(20))
return systray
end

View File

@@ -5,87 +5,81 @@ local dpi = require("beautiful").xresources.apply_dpi
local color = require("theme.crylia.colors")
require("theme.crylia.tools.icon_handler")
local list_update = function (widget, buttons, label, data, objects)
local list_update = function(widget, buttons, label, data, objects)
widget:reset()
for i, object in ipairs(objects) do
local tag_icon = wibox.widget{
nil,
{
id = "icon",
resize = true,
widget = wibox.widget.imagebox
},
nil,
layout = wibox.layout.align.horizontal
}
local tag_icon = wibox.widget {
nil,
{
id = "icon",
resize = true,
widget = wibox.widget.imagebox
},
nil,
layout = wibox.layout.align.horizontal
}
local tag_icon_margin = wibox.widget{
tag_icon,
forced_width = dpi(33),
margins = dpi(3),
widget = wibox.container.margin
}
local tag_icon_margin = wibox.widget {
tag_icon,
forced_width = dpi(33),
margins = dpi(3),
widget = wibox.container.margin
}
local tag_label = wibox.widget{
text = "",
align = "center",
valign = "center",
visible = true,
font = "JetBrains Mono ExtraBold, 14",
local tag_label = wibox.widget {
text = "",
align = "center",
valign = "center",
visible = true,
font = user_vars.vars.font.extrabold,
forced_width = dpi(25),
widget = wibox.widget.textbox
}
widget = wibox.widget.textbox
}
local tag_label_margin = wibox.widget{
tag_label,
left = dpi(5),
local tag_label_margin = wibox.widget {
tag_label,
left = dpi(5),
right = dpi(5),
widget = wibox.container.margin
}
widget = wibox.container.margin
}
local tag_widget = wibox.widget {
id = "widget_margin",
{
id = "widget_margin",
{
id = "container",
tag_label_margin,
layout = wibox.layout.fixed.horizontal
},
margins = dpi(0),
widget = wibox.container.margin
},
id = "container",
tag_label_margin,
layout = wibox.layout.fixed.horizontal
},
fg = color.color["White"],
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local function create_buttons(buttons, object)
if buttons then
local btns = {}
for _, b in ipairs(buttons) do
-- Create a proxy button object: it will receive the real
-- press and release events, and will propagate them to the
-- button object the user provided, but with the object as
-- argument.
local btn = awful.button {
modifiers = b.modifiers,
button = b.button,
on_press = function()
b:emit_signal('press', object)
end,
on_release = function()
b:emit_signal('release', object)
end
}
btns[#btns + 1] = btn
end
return btns
end
end
if buttons then
local btns = {}
for _, b in ipairs(buttons) do
local btn = awful.button {
modifiers = b.modifiers,
button = b.button,
on_press = function()
b:emit_signal('press', object)
end,
on_release = function()
b:emit_signal('release', object)
end
}
btns[#btns + 1] = btn
end
return btns
end
end
tag_widget:buttons(create_buttons(buttons, object))
@@ -102,9 +96,10 @@ local list_update = function (widget, buttons, label, data, objects)
tag_widget:set_bg("#3A475C")
end
-- Set the icon for each client
for _, client in ipairs(object:clients()) do
tag_label_margin:set_right(0)
local icon = wibox.widget{
local icon = wibox.widget {
{
id = "icon_container",
{
@@ -115,21 +110,22 @@ local list_update = function (widget, buttons, label, data, objects)
widget = wibox.container.place
},
tag_icon_margin,
forced_width = dpi(33),
margins = dpi(6),
widget = wibox.container.margin
forced_width = dpi(33),
margins = dpi(6),
widget = wibox.container.margin
}
icon.icon_container.icon:set_image(Get_icon("Papirus-Dark", client))
tag_widget.widget_margin.container:setup({
tag_widget.container:setup({
icon,
layout = wibox.layout.align.horizontal
strategy = "exact",
layout = wibox.container.constraint,
})
end
local old_wibox, old_cursor, old_bg
tag_widget:connect_signal(
"mouse::enter",
function ()
function()
old_bg = tag_widget.bg
if object == awful.screen.focused().selected_tag then
tag_widget.bg = '#dddddd' .. 'dd'
@@ -146,7 +142,7 @@ local list_update = function (widget, buttons, label, data, objects)
tag_widget:connect_signal(
"button::press",
function ()
function()
if object == awful.screen.focused().selected_tag then
tag_widget.bg = '#bbbbbb' .. 'dd'
else
@@ -157,7 +153,7 @@ local list_update = function (widget, buttons, label, data, objects)
tag_widget:connect_signal(
"button::release",
function ()
function()
if object == awful.screen.focused().selected_tag then
tag_widget.bg = '#dddddd' .. 'dd'
else
@@ -168,7 +164,7 @@ local list_update = function (widget, buttons, label, data, objects)
tag_widget:connect_signal(
"mouse::leave",
function ()
function()
tag_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
@@ -182,31 +178,31 @@ local list_update = function (widget, buttons, label, data, objects)
end
end
local tag_list = function (s)
local tag_list = function(s)
return awful.widget.taglist(
s,
awful.widget.taglist.filter.noempty,
gears.table.join(
awful.button(
{ },
{},
1,
function (t)
function(t)
t:view_only()
end
),
awful.button(
{ modkey },
1,
function (t)
function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end
),
awful.button(
{ },
{},
3,
function (t)
function(t)
if client.focus then
client.focus:toggle_tag(t)
end
@@ -215,23 +211,23 @@ local tag_list = function (s)
awful.button(
{ modkey },
3,
function (t)
function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end
),
awful.button(
{ },
{},
4,
function (t)
function(t)
awful.tag.viewnext(t.screen)
end
),
awful.button(
{ },
{},
5,
function (t)
function(t)
awful.tag.viewprev(t.screen)
end
)

View File

@@ -4,12 +4,12 @@ local dpi = require('beautiful').xresources.apply_dpi
local gears = require('gears')
local color = require('theme.crylia.colors')
local list_update = function (widget, buttons, label, data, objects)
local list_update = function(widget, buttons, label, data, objects)
widget:reset()
local count
for i, object in ipairs(objects) do
count = i
local task_widget = wibox.widget{
local task_widget = wibox.widget {
{
{
{
@@ -47,14 +47,14 @@ local list_update = function (widget, buttons, label, data, objects)
},
bg = color.color["White"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local task_tool_tip = awful.tooltip{
objects = {task_widget},
local task_tool_tip = awful.tooltip {
objects = { task_widget },
mode = "inside",
align = "right",
delay_show = 1
@@ -83,6 +83,7 @@ local list_update = function (widget, buttons, label, data, objects)
return btns
end
end
task_widget:buttons(create_buttons(buttons, object))
local text, bg, bg_image, icon, args = label(object, task_widget.container.layout_it.title)
@@ -92,7 +93,7 @@ local list_update = function (widget, buttons, label, data, objects)
else
local text_full = text:match('>(.-)<')
if text_full then
text = object.class:sub(1,20)
text = object.class:sub(1, 20)
task_tool_tip:set_text(text_full)
task_tool_tip:add_to_object(task_widget)
else
@@ -110,55 +111,55 @@ local list_update = function (widget, buttons, label, data, objects)
widget:add(task_widget)
widget:set_spacing(dpi(6))
local old_wibox, old_cursor, old_bg
task_widget:connect_signal(
"mouse::enter",
function ()
old_bg = task_widget.bg
task_widget:connect_signal(
"mouse::enter",
function()
old_bg = task_widget.bg
if object == client.focus then
task_widget.bg = '#dddddddd'
task_widget.bg = '#dddddddd'
else
task_widget.bg = '#3A475Cdd'
end
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
task_widget:connect_signal(
"button::press",
function ()
if object == client.focus then
task_widget:connect_signal(
"button::press",
function()
if object == client.focus then
task_widget.bg = "#ffffffaa"
else
task_widget.bg = '#3A475Caa'
end
end
)
end
)
task_widget:connect_signal(
"button::release",
function ()
if object == client.focus then
task_widget:connect_signal(
"button::release",
function()
if object == client.focus then
task_widget.bg = "#ffffffdd"
else
task_widget.bg = '#3A475Cdd'
end
end
)
end
)
task_widget:connect_signal(
"mouse::leave",
function ()
task_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)
task_widget:connect_signal(
"mouse::leave",
function()
task_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)
end
return widget
end