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

View File

@@ -12,203 +12,203 @@ return function()
{ modkey },
"s",
hotkeys_popup.show_help,
{description="Cheat sheet", group="Awesome"}
{ description = "Cheat sheet", group = "Awesome" }
),
-- Tag browsing
awful.key(
{ modkey },
"Left",
awful.tag.viewprev,
{description = "View previous tag", group = "Tag"}
{ description = "View previous tag", group = "Tag" }
),
awful.key(
{ modkey },
"Right",
awful.tag.viewnext,
{description = "View next tag", group = "Tag"}
{ description = "View next tag", group = "Tag" }
),
awful.key(
{ modkey },
"Escape",
awful.tag.history.restore,
{description = "Go back to last tag", group = "Tag"}
{ description = "Go back to last tag", group = "Tag" }
),
awful.key(
{ modkey },
"j",
function ()
function()
awful.client.focus.byidx(1)
end,
{description = "Focus next client by index", group = "Client"}
{ description = "Focus next client by index", group = "Client" }
),
awful.key(
{ modkey },
"k",
function ()
function()
awful.client.focus.byidx(-1)
end,
{description = "Focus previous client by index", group = "Client"}
{ description = "Focus previous client by index", group = "Client" }
),
awful.key(
{ modkey },
"w",
function ()
function()
user_vars.main_menu:show()
end,
{description = "Show context menu", group = "Awesome"}
{ description = "Show context menu", group = "Awesome" }
),
awful.key(
{ modkey, "Shift" },
"j",
function ()
function()
awful.client.swap.byidx(1)
end,
{description = "Swap with next client by index", group = "Client"}
{ description = "Swap with next client by index", group = "Client" }
),
awful.key(
{ modkey, "Shift" },
"k",
function ()
function()
awful.client.swap.byidx(-1)
end,
{description = "Swap with previous client by index", group = "Client"}
{ description = "Swap with previous client by index", group = "Client" }
),
awful.key(
{ modkey, "Control" },
"j",
function ()
function()
awful.screen.focus_relative(1)
end,
{description = "Focus the next screen", group = "Screen"}
{ description = "Focus the next screen", group = "Screen" }
),
awful.key(
{ modkey, "Control" },
"k",
function ()
function()
awful.screen.focus_relative(-1)
end,
{description = "Focus the previous screen", group = "Screen"}
{ description = "Focus the previous screen", group = "Screen" }
),
awful.key(
{ modkey },
"u",
awful.client.urgent.jumpto,
{description = "Jump to urgent client", group = "Client"}
{ description = "Jump to urgent client", group = "Client" }
),
awful.key(
{ modkey },
"Return",
function ()
function()
awful.spawn(user_vars.vars.terminal)
end,
{description = "Open terminal", group = "Applications"}
{ description = "Open terminal", group = "Applications" }
),
awful.key(
{ modkey, "Control" },
"r",
awesome.restart,
{description = "Reload awesome", group = "Awesome"}
{ description = "Reload awesome", group = "Awesome" }
),
awful.key(
{ modkey },
"l",
function ()
awful.tag.incmwfact( 0.05)
function()
awful.tag.incmwfact(0.05)
end,
{description = "Increase client width", group = "Layout"}
{ description = "Increase client width", group = "Layout" }
),
awful.key(
{ modkey },
"h",
function ()
function()
awful.tag.incmwfact(-0.05)
end,
{description = "Decrease client width", group = "Layout"}
{ description = "Decrease client width", group = "Layout" }
),
awful.key(
{ modkey, "Control" },
"h",
function ()
function()
awful.tag.incncol(1, nil, true)
end,
{description = "Increase the number of columns", group = "Layout"}
{ description = "Increase the number of columns", group = "Layout" }
),
awful.key(
{ modkey, "Control" },
"l",
function ()
function()
awful.tag.incncol(-1, nil, true)
end,
{description = "Decrease the number of columns", group = "Layout"}
{ description = "Decrease the number of columns", group = "Layout" }
),
awful.key(
{ modkey, "Shift" },
"space",
function ()
function()
awful.layout.inc(-1)
end,
{description = "Select previous layout", group = "Layout"}
{ description = "Select previous layout", group = "Layout" }
),
awful.key(
{ modkey, "Shift" },
"Return",
function ()
function()
awful.layout.inc(1)
end,
{description = "Select next layout", group = "Layout"}
{ description = "Select next layout", group = "Layout" }
),
awful.key(
{ modkey },
"d",
function ()
awful.spawn("/home/crylia/.local/bin/rofi -show drun -theme ~/.config/rofi/rofi.rasi")
end,
{ descripton = "Application launcher", group = "Application" }
),
{ modkey },
"d",
function()
awful.spawn("rofi -show drun -theme ~/.config/rofi/rofi.rasi")
end,
{ descripton = "Application launcher", group = "Application" }
),
awful.key(
{ modkey },
"Tab",
function ()
awful.spawn("/home/crylia/.local/bin/rofi -show window -theme ~/.config/rofi/window.rasi")
end,
{ descripton = "Client switcher (alt+tab)", group = "Application" }
),
{ modkey },
"Tab",
function()
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
end,
{ descripton = "Client switcher (alt+tab)", group = "Application" }
),
awful.key(
{ "Mod1" },
"Tab",
function ()
awful.spawn("/home/crylia/.local/bin/rofi -show window -theme ~/.config/rofi/window.rasi")
end,
{ descripton = "Client switcher (alt+tab)", group = "Application" }
),
{ "Mod1" },
"Tab",
function()
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
end,
{ descripton = "Client switcher (alt+tab)", group = "Application" }
),
awful.key(
{ modkey },
"e",
function ()
awful.spawn(user_vars.vars.file_manager)
function()
awful.spawn(user_vars.vars.file_manager)
end,
{ descripton = "Open file manager", group = "System" }
),
awful.key(
{ modkey, "Shift" },
"e",
function ()
function()
awesome.emit_signal("module::powermenu:show")
end,
{ descripton = "Session options", group = "System" }
),
awful.key(
{ },
{},
"Print",
function ()
function()
awful.spawn(user_vars.vars.screenshot_program)
end,
{ description = "Screenshot", group = "Applications" }
),
awful.key(
{ },
{},
"XF86AudioLowerVolume",
function (c)
function(c)
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ -2%")
awesome.emit_signal("widget::volume")
awesome.emit_signal("module::volume_osd:show", true)
@@ -218,18 +218,18 @@ return function()
{ description = "Lower volume", group = "System" }
),
awful.key(
{ },
{},
"XF86AudioRaiseVolume",
function (c)
function(c)
awful.spawn.easy_async_with_shell(
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
function (stdout)
stdout = stdout:gsub("%%", "")
local volume = tonumber(stdout) or 0
if volume <= 98 then
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ +2%")
end
end)
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
function(stdout)
stdout = stdout:gsub("%%", "")
local volume = tonumber(stdout) or 0
if volume <= 98 then
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ +2%")
end
end)
awesome.emit_signal("widget::volume")
awesome.emit_signal("module::volume_osd:show", true)
awesome.emit_signal("module::slider:update")
@@ -238,9 +238,9 @@ return function()
{ description = "Increase volume", group = "System" }
),
awful.key(
{ },
{},
"XF86AudioMute",
function (c)
function(c)
awful.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")
awesome.emit_signal("widget::volume")
awesome.emit_signal("module::volume_osd:show", true)
@@ -250,9 +250,9 @@ return function()
{ description = "Mute volume", group = "System" }
),
awful.key(
{ },
{},
"XF86MonBrightnessUp",
function (c)
function(c)
awful.spawn("xbacklight -time 100 -inc 10%+")
awesome.emit_signal("module::brightness_osd:show", true)
awesome.emit_signal("module::brightness_slider:update")
@@ -261,9 +261,9 @@ return function()
{ description = "Raise backlight brightness", group = "System" }
),
awful.key(
{ },
{},
"XF86MonBrightnessDown",
function (c)
function(c)
awful.spawn("xbacklight -time 100 -dec 10%-")
awesome.emit_signal("widget::brightness_osd:rerun")
awesome.emit_signal("module::brightness_osd:show", true)
@@ -272,14 +272,38 @@ return function()
{ description = "Lower backlight brightness", group = "System" }
),
awful.key(
{modkey},
{},
"XF86AudioPlay",
function(c)
awful.spawn("playerctl play-pause")
end,
{ description = "Play / Pause audio", group = "System" }
),
awful.key(
{},
"XF86AudioNext",
function(c)
awful.spawn("playerctl next")
end,
{ description = "Play / Pause audio", group = "System" }
),
awful.key(
{},
"XF86AudioPrev",
function(c)
awful.spawn("playerctl previous")
end,
{ description = "Play / Pause audio", group = "System" }
),
awful.key(
{ modkey },
"space",
function ()
function()
awesome.emit_signal("kblayout::toggle")
end,
{ description = "Toggle keyboard layout", group = "System" }
)
)
return globalkeys
return globalkeys
end

View File

@@ -3,17 +3,17 @@
--------------------------------------------------------------------------------------------------------------
-- Awesome Libs
local awful = require("awful")
local colors = require ("theme.crylia.colors")
local colors = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
return function(s, programs)
return function(screen, programs)
local function create_dock_element (program, name, is_steam, size)
local function create_dock_element(program, name, is_steam, size)
is_steam = is_steam or false
local dock_element = wibox.widget{
local dock_element = wibox.widget {
{
{
{
@@ -21,7 +21,7 @@ return function(s, programs)
resize = true,
forced_width = size,
forced_height = size,
image = Get_icon("Papirus-Dark",program, is_steam),
image = Get_icon("Papirus-Dark", program, is_steam),
widget = wibox.widget.imagebox
},
{
@@ -36,7 +36,7 @@ return function(s, programs)
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 = colors.color["Grey900"],
@@ -47,11 +47,11 @@ return function(s, programs)
widget = wibox.container.margin
}
hover_signal(dock_element.background, colors.color["Grey800"], colors.color["White"])
Hover_signal(dock_element.background, colors.color["Grey800"], colors.color["White"])
dock_element:connect_signal(
"button::press",
function ()
function()
if is_steam then
awful.spawn("steam steam://rungameid/" .. program)
else
@@ -61,7 +61,7 @@ return function(s, programs)
)
awful.tooltip {
objects = {dock_element},
objects = { dock_element },
text = name,
mode = "outside",
preferred_alignments = "middle",
@@ -72,8 +72,8 @@ return function(s, programs)
local color = ""
local indicators
local t = 1
for indicator_screen in screen do
for j,indicator_client in ipairs(indicator_screen.get_clients()) do
--[[ for indicator_screen in screen do
for j, indicator_client in ipairs(indicator_screen.get_clients()) do
if indicator_client.class == program then
if indicator_client.maximized then
color = colors.color["Green200"]
@@ -87,7 +87,7 @@ return function(s, programs)
color = colors.color["White"]
end
local indicator = wibox.widget{
local indicator = wibox.widget {
widget = wibox.container.background,
shape = gears.shape.circle,
forced_height = dpi(50),
@@ -97,7 +97,7 @@ return function(s, programs)
t = t + 1
end
end
end
end ]]
return indicators
end
@@ -106,22 +106,34 @@ return function(s, programs)
return dock_element
end
local dock = awful.popup{
local dock = awful.popup {
widget = wibox.container.background,
ontop = true,
bg = colors.color["Grey900"],
visible = true,
screen = s,
screen = screen,
type = "dock",
height = user_vars.vars.dock_icon_size + 10,
placement = function(c) awful.placement.bottom(c, {margins = dpi(10)}) end,
placement = function(c) awful.placement.bottom(c, { margins = dpi(10) }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 15)
end
}
local fakedock = awful.popup {
widget = wibox.container.background,
ontop = true,
bg = '#00000000',
visible = true,
screen = screen,
type = "dock",
id = "fakedock",
height = dpi(10),
placement = function(c) awful.placement.bottom(c, { margins = dpi(0) }) end,
}
local function get_dock_elements(pr)
local dock_elements = {layout = wibox.layout.fixed.horizontal}
local dock_elements = { layout = wibox.layout.fixed.horizontal }
for i, p in ipairs(pr) do
dock_elements[i] = create_dock_element(p[1], p[2], p[3], user_vars.vars.dock_icon_size)
@@ -130,60 +142,83 @@ return function(s, programs)
return dock_elements
end
local function get_fake_elements(amount)
local fake_elements = { layout = wibox.layout.fixed.horizontal }
for i = 0, amount, 1 do
fake_elements[i] = wibox.widget {
bg = '00000000',
forced_width = user_vars.vars.dock_icon_size + dpi(20),
forced_height = dpi(10),
widget = wibox.container.background
}
end
return fake_elements
end
dock:setup {
get_dock_elements(programs),
layout = wibox.layout.fixed.vertical
}
--TODO: Replace with fake elements
fakedock:setup {
get_fake_elements(#programs),
layout = wibox.layout.fixed.vertical
}
local naughty = require("naughty")
--[[ TODO: This function runs every 0.1 second, it can be optimized by
calling it every time the mouse is over the dock, a client changes it states ...
but im too lazy rn ]]
local function check_for_dock_hide()
for s in screen do
local mx, my = mouse.coords().x * 100 / s.geometry.width, mouse.coords().y * 100 / s.geometry.height
if ((mx > 30) and (mx < 70)) and (my > 99) then
-- TODO: draw a invisible non clickable fake dock and check of mouse if over that
local function check_for_dock_hide(s)
if s == mouse.screen then
--local mx, my = mouse.coords().x * 100 / screen.geometry.width, mouse.coords().y * 100 / screen.geometry.height
if mouse.current_widget then
dock.visible = true
break;
return
end
for j,c in ipairs(s.get_clients()) do
for j, c in ipairs(screen.get_clients()) do
local y = c:geometry().y
local h = c.height
if (y + h) >= s.geometry.height - user_vars.vars.dock_icon_size - 35 then
if (y + h) >= screen.geometry.height - user_vars.vars.dock_icon_size - 35 then
dock.visible = false
break;
else
dock.visible = true
end
end
else
dock.visible = false
end
end
client.connect_signal(
"manage",
function ()
check_for_dock_hide()
function()
check_for_dock_hide(screen)
end
)
local dock_intelligent_hide = gears.timer{
local dock_intelligent_hide = gears.timer {
timeout = 1,
autostart = true,
call_now = true,
callback = function ()
check_for_dock_hide()
callback = function()
check_for_dock_hide(screen)
end
}
dock:connect_signal(
"mouse::enter",
function ()
function()
dock_intelligent_hide:stop()
end
)
dock:connect_signal(
"mouse::leave",
function ()
function()
dock_intelligent_hide:again()
end
)

View File

@@ -3,27 +3,27 @@
--------------------------------------------------------------------------------------------------------------
-- Awesome Libs
local awful = require("awful")
local colors = require ("theme.crylia.colors")
local colors = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
return function (s, widgets)
return function(s, widgets)
local top_left = awful.popup{
local top_left = awful.popup {
screen = s,
widget = wibox.container.background,
ontop = false,
bg = colors.color["Grey900"],
visible = true,
maximum_width = dpi(650),
placement = function(c) awful.placement.top_left(c, {margins = dpi(10)}) end,
shape = function (cr, width, height)
maximum_width = dpi(650),
placement = function(c) awful.placement.top_left(c, { margins = dpi(10) }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
top_left:struts{
top_left:struts {
top = 55
}

View File

@@ -4,21 +4,21 @@ local beautiful = require("beautiful")
screen.connect_signal(
"added",
function ()
function()
awesome.restart()
end
)
screen.connect_signal(
"removed",
function ()
function()
awesome.restart()
end
)
client.connect_signal(
"manage",
function (c)
function(c)
if awesome.startup and not c.size_hints.user_porition and not c.size_hints.program_position then
awful.placement.no_offscreen(c)
end
@@ -58,24 +58,24 @@ client.connect_signal(
-- Sloppy focus
client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::activate", "mouse_enter", {raise = false})
c:emit_signal("request::activate", "mouse_enter", { raise = false })
end)
-- Workaround for focused border color, why in the love of god doesnt it work with
-- beautiful.border_focus
client.connect_signal("focus", function (c)
client.connect_signal("focus", function(c)
c.border_color = "#616161"
end)
client.connect_signal("unfocus", function (c)
client.connect_signal("unfocus", function(c)
c.border_color = beautiful.border_normal
end)
function hover_signal (widget, bg, fg)
function Hover_signal(widget, bg, fg)
local old_wibox, old_cursor, old_bg, old_fg
widget:connect_signal(
"mouse::enter",
function ()
function()
if bg then
old_bg = widget.bg
if string.len(bg) == 7 then
@@ -98,7 +98,7 @@ function hover_signal (widget, bg, fg)
widget:connect_signal(
"button::press",
function ()
function()
if bg then
if bg then
if string.len(bg) == 7 then
@@ -116,7 +116,7 @@ function hover_signal (widget, bg, fg)
widget:connect_signal(
"button::release",
function ()
function()
if bg then
if bg then
if string.len(bg) == 7 then
@@ -134,7 +134,7 @@ function hover_signal (widget, bg, fg)
widget:connect_signal(
"mouse::leave",
function ()
function()
if bg then
widget.bg = old_bg
end

View File

@@ -8,7 +8,7 @@ local awful = require("awful")
return function()
local tags = {}
awful.screen.connect_for_each_screen(
function (s)
function(s)
tags[s] = awful.tag(
{
"1", "2", "3", "4", "5", "6", "7", "8", "9"
@@ -20,4 +20,4 @@ return function()
)
return tags
end
end

View File

@@ -7,7 +7,7 @@ local home = os.getenv("HOME")
local function get_screen()
local screen = {}
for i, s in ipairs(screen) do
screen[i] = {screen.x, screen.y}
screen[i] = { screen.x, screen.y }
end
return screen
end
@@ -15,20 +15,32 @@ end
-- If you want different default programs, wallpaper path or modkey; edit this file.
local _M = {
network = {
wlan = "",
ethernet = "eno1"
},
-- Set your font with this format:
font = {
regular = "JetBrainsMono Nerd Font, 14",
bold = "JetBrainsMono Nerd Font, bold 14",
extrabold = "JetBrainsMono Nerd Font, ExtraBold 14"
},
-- This is your default Terminal
terminal = "alacritty -o font.size=8",
terminal = "alacritty -o font.size=14",
-- This is the modkey 'mod4' = Super/Mod/WindowsKey, 'mod3' = alt...
modkey = "Mod4",
-- place your wallpaper at this path with this name, you could also try to change the path
wallpaper = home .. "/.config/awesome/theme/crylia/assets/space.jpg",
wallpaper = home .. "/.config/awesome/theme/crylia/assets/fuji.jpg",
-- Naming scheme for the powermenu, userhost = "user@hostname", fullname = "Firstname Surname", something else ...
namestyle = "userhost",
-- List every Keyboard layout you use here comma seperated. (run localectl list-keymaps to list all averiable keymaps)
kblayout = {"de", "ru"},
kblayout = { "de", "ru" },
-- Set to false if you dont have a controller
bluetooth = true,
@@ -47,15 +59,15 @@ local _M = {
-- Second can be what ever the fuck you want it to be (will be the displayed name if you hover over it)
-- For steam games please use this format {"394360", "Name", true} true will tell the func that it's a steam game
dock_programs = {
{"firefox", "Firefox"},
{"discord", "Discord"},
{"spotify", "Spotify"},
{"code", "Visual Studio Code"},
{"arduino", "Arduino IDE"},
{"zoom", "Zoom"},
{"thunderbird", "Thunderbird"},
{"mattermost-desktop", "Mattermost"},
{"blender", "Blender"}
{ "firefox", "Firefox" },
{ "discord", "Discord" },
{ "spotify", "Spotify" },
{ "code", "Visual Studio Code" },
{ "arduino", "Arduino IDE" },
{ "zoom", "Zoom" },
{ "thunderbird", "Thunderbird" },
{ "mattermost-desktop", "Mattermost" },
{ "blender", "Blender" }
},
screens_size = get_screen()

View File

@@ -57,11 +57,11 @@ user_vars.main_menu = awful.menu({
items = main.menu()
})
-- A Variable needed in Statusbar (helper)
--[[ -- A Variable needed in Statusbar (helper)
user_vars.launcher = awful.widget.launcher({
image = beautiful.awesome_icon,
menu = user_vars.main_menu
})
}) ]]
-- Menubar configuration
menubar.utils.terminal = user_vars.vars.terminal
@@ -70,7 +70,7 @@ menubar.utils.terminal = user_vars.vars.terminal
root.buttons(bindings.global_buttons())
root.keys(bindings.bind_to_tags(bindings.global_keys()))
-- Default statusbar, comment if you want use a third party tool like polybar
-- Default statusbar
require("crylia_bar.init")
-- Rules to apply to new clients
@@ -81,9 +81,4 @@ awful.rules.rules = main.rules(
-- Signals
require("main.signals")
-- 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 &")
require("theme.crylia.tools.auto_starter")

View File

@@ -1,2 +0,0 @@
#!/bin/bash
awmtt -c rc.lua -S 1800x900

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