Huge refractor and many fixes for dock, icons(again) etc
6
.vscode/settings.json
vendored
@@ -2,6 +2,10 @@
|
||||
"Lua.diagnostics.globals": [
|
||||
"user_vars",
|
||||
"modkey",
|
||||
"root"
|
||||
"root",
|
||||
"awesome",
|
||||
"client",
|
||||
"screen",
|
||||
"mouse"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
|
||||
local modkey = user_vars.vars.modkey
|
||||
|
||||
return function ()
|
||||
local clientbuttons = gears.table.join(
|
||||
awful.button({ }, 1, function (c)
|
||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||
end),
|
||||
awful.button({ modkey }, 1, function (c)
|
||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||
awful.mouse.client.move(c)
|
||||
end),
|
||||
awful.button({ modkey }, 3, function (c)
|
||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||
awful.mouse.client.resize(c)
|
||||
end)
|
||||
)
|
||||
return clientbuttons
|
||||
end
|
||||
@@ -1,43 +0,0 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
|
||||
local modkey = user_vars.vars.modkey
|
||||
|
||||
return function ()
|
||||
local clientkeys = gears.table.join(
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"f",
|
||||
function(c)
|
||||
c.fullscreen = not c.fullscreen
|
||||
c:raise()
|
||||
end,
|
||||
{ description = "Toggle fullscreen", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"q",
|
||||
function(c)
|
||||
c:kill()
|
||||
end,
|
||||
{ description = "Close focused client", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"g",
|
||||
awful.client.floating.toggle,
|
||||
{ description = "Toggle floating window", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey},
|
||||
"m",
|
||||
function (c)
|
||||
c.maximized = not c.maximized
|
||||
c:raise()
|
||||
end ,
|
||||
{description = "(un)maximize", group = "Client"}
|
||||
)
|
||||
)
|
||||
return clientkeys
|
||||
end
|
||||
@@ -1,14 +0,0 @@
|
||||
-- Awesome Libs
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
|
||||
return function ()
|
||||
local globalbuttons = gears.table.join(
|
||||
awful.button({ }, 3, function()
|
||||
user_vars.main_menu:toggle()
|
||||
end),
|
||||
awful.button({ }, 4, awful.tag.viewnext),
|
||||
awful.button({ }, 5, awful.tag.viewprev)
|
||||
)
|
||||
return globalbuttons
|
||||
end
|
||||
@@ -1,309 +0,0 @@
|
||||
-- Awesome Libs
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
|
||||
-- Resource Configuration
|
||||
local modkey = user_vars.vars.modkey
|
||||
|
||||
return function()
|
||||
local globalkeys = gears.table.join(
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#39",
|
||||
hotkeys_popup.show_help,
|
||||
{ description = "Cheat sheet", group = "Awesome" }
|
||||
),
|
||||
-- Tag browsing
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#113",
|
||||
awful.tag.viewprev,
|
||||
{ description = "View previous tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#114",
|
||||
awful.tag.viewnext,
|
||||
{ description = "View next tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#66",
|
||||
awful.tag.history.restore,
|
||||
{ description = "Go back to last tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#44",
|
||||
function()
|
||||
awful.client.focus.byidx(1)
|
||||
end,
|
||||
{ description = "Focus next client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#45",
|
||||
function()
|
||||
awful.client.focus.byidx(-1)
|
||||
end,
|
||||
{ description = "Focus previous client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#25",
|
||||
function()
|
||||
user_vars.main_menu:show()
|
||||
end,
|
||||
{ description = "Show context menu", group = "Awesome" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"#44",
|
||||
function()
|
||||
awful.client.swap.byidx(1)
|
||||
end,
|
||||
{ description = "Swap with next client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"#45",
|
||||
function()
|
||||
awful.client.swap.byidx(-1)
|
||||
end,
|
||||
{ description = "Swap with previous client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"#44",
|
||||
function()
|
||||
awful.screen.focus_relative(1)
|
||||
end,
|
||||
{ description = "Focus the next screen", group = "Screen" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"#45",
|
||||
function()
|
||||
awful.screen.focus_relative(-1)
|
||||
end,
|
||||
{ description = "Focus the previous screen", group = "Screen" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#30",
|
||||
awful.client.urgent.jumpto,
|
||||
{ description = "Jump to urgent client", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#36",
|
||||
function()
|
||||
awful.spawn(user_vars.vars.terminal)
|
||||
end,
|
||||
{ description = "Open terminal", group = "Applications" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"#27",
|
||||
awesome.restart,
|
||||
{ description = "Reload awesome", group = "Awesome" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#46",
|
||||
function()
|
||||
awful.tag.incmwfact(0.05)
|
||||
end,
|
||||
{ description = "Increase client width", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#43",
|
||||
function()
|
||||
awful.tag.incmwfact(-0.05)
|
||||
end,
|
||||
{ description = "Decrease client width", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"#43",
|
||||
function()
|
||||
awful.tag.incncol(1, nil, true)
|
||||
end,
|
||||
{ description = "Increase the number of columns", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"#46",
|
||||
function()
|
||||
awful.tag.incncol(-1, nil, true)
|
||||
end,
|
||||
{ description = "Decrease the number of columns", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"#65",
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end,
|
||||
{ description = "Select previous layout", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"#36",
|
||||
function()
|
||||
awful.layout.inc(1)
|
||||
end,
|
||||
{ description = "Select next layout", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#40",
|
||||
function()
|
||||
awful.spawn("rofi -show drun -theme ~/.config/rofi/rofi.rasi")
|
||||
end,
|
||||
{ descripton = "Application launcher", group = "Application" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#23",
|
||||
function()
|
||||
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||
end,
|
||||
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
||||
),
|
||||
awful.key(
|
||||
{ "Mod1" },
|
||||
"#23",
|
||||
function()
|
||||
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||
end,
|
||||
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#26",
|
||||
function()
|
||||
awful.spawn(user_vars.vars.file_manager)
|
||||
end,
|
||||
{ descripton = "Open file manager", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"#26",
|
||||
function()
|
||||
awesome.emit_signal("module::powermenu:show")
|
||||
end,
|
||||
{ descripton = "Session options", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"#107",
|
||||
function()
|
||||
awful.spawn(user_vars.vars.screenshot_program)
|
||||
end,
|
||||
{ description = "Screenshot", group = "Applications" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86AudioLowerVolume",
|
||||
function(c)
|
||||
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ -2%")
|
||||
awesome.emit_signal("widget::volume")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
awesome.emit_signal("module::slider:update")
|
||||
awesome.emit_signal("widget::volume_osd:rerun")
|
||||
end,
|
||||
{ description = "Lower volume", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86AudioRaiseVolume",
|
||||
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)
|
||||
awesome.emit_signal("widget::volume")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
awesome.emit_signal("module::slider:update")
|
||||
awesome.emit_signal("widget::volume_osd:rerun")
|
||||
end,
|
||||
{ description = "Increase volume", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86AudioMute",
|
||||
function(c)
|
||||
awful.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")
|
||||
awesome.emit_signal("widget::volume")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
awesome.emit_signal("module::slider:update")
|
||||
awesome.emit_signal("widget::volume_osd:rerun")
|
||||
end,
|
||||
{ description = "Mute volume", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86MonBrightnessUp",
|
||||
function(c)
|
||||
awful.spawn("xbacklight -time 100 -inc 10%+")
|
||||
awesome.emit_signal("module::brightness_osd:show", true)
|
||||
awesome.emit_signal("module::brightness_slider:update")
|
||||
awesome.emit_signal("widget::brightness_osd:rerun")
|
||||
end,
|
||||
{ description = "Raise backlight brightness", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86MonBrightnessDown",
|
||||
function(c)
|
||||
awful.spawn("xbacklight -time 100 -dec 10%-")
|
||||
awesome.emit_signal("widget::brightness_osd:rerun")
|
||||
awesome.emit_signal("module::brightness_osd:show", true)
|
||||
awesome.emit_signal("module::brightness_slider:update")
|
||||
end,
|
||||
{ description = "Lower backlight brightness", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"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 },
|
||||
"#65",
|
||||
function()
|
||||
awesome.emit_signal("kblayout::toggle")
|
||||
end,
|
||||
{ description = "Toggle keyboard layout", group = "System" }
|
||||
)
|
||||
)
|
||||
|
||||
return globalkeys
|
||||
end
|
||||
@@ -3,27 +3,27 @@
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local colors = require ("theme.crylia.colors")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
return function (s, widget)
|
||||
return function(s, widget)
|
||||
|
||||
local top_center = awful.popup{
|
||||
local top_center = awful.popup {
|
||||
screen = s,
|
||||
widget = wibox.container.background,
|
||||
ontop = false,
|
||||
bg = colors.color["Grey900"],
|
||||
bg = color["Grey900"],
|
||||
visible = true,
|
||||
maximum_width = dpi(500),
|
||||
placement = function (c) awful.placement.top(c, {margins = dpi(10)}) end,
|
||||
shape = function (cr, width, height)
|
||||
placement = function(c) awful.placement.top(c, { margins = dpi(10) }) end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 10)
|
||||
end
|
||||
}
|
||||
local naught = require("naughty")
|
||||
top_center:setup{
|
||||
|
||||
top_center:setup {
|
||||
nil,
|
||||
{
|
||||
widget,
|
||||
@@ -37,8 +37,8 @@ return function (s, widget)
|
||||
|
||||
client.connect_signal(
|
||||
"manage",
|
||||
function (c)
|
||||
if #s:get_clients() < 1 then
|
||||
function(c)
|
||||
if #s.selected_tag:clients() < 1 then
|
||||
top_center.visible = false
|
||||
else
|
||||
top_center.visible = true
|
||||
@@ -48,8 +48,8 @@ return function (s, widget)
|
||||
|
||||
client.connect_signal(
|
||||
"unmanage",
|
||||
function (c)
|
||||
if #s:get_clients() < 1 then
|
||||
function(c)
|
||||
if #s.selected_tag:clients() < 1 then
|
||||
top_center.visible = false
|
||||
else
|
||||
top_center.visible = true
|
||||
@@ -59,8 +59,8 @@ return function (s, widget)
|
||||
|
||||
client.connect_signal(
|
||||
"tag::switched",
|
||||
function (c)
|
||||
if #s:get_clients() < 1 then
|
||||
function(c)
|
||||
if #s.selected_tag:clients() < 1 then
|
||||
top_center.visible = false
|
||||
else
|
||||
top_center.visible = true
|
||||
@@ -70,8 +70,8 @@ return function (s, widget)
|
||||
|
||||
awesome.connect_signal(
|
||||
"refresh",
|
||||
function (c)
|
||||
if #s:get_clients() < 1 then
|
||||
function(c)
|
||||
if #s.selected_tag:clients() < 1 then
|
||||
top_center.visible = false
|
||||
else
|
||||
top_center.visible = true
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local colors = require("theme.crylia.colors")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
@@ -13,6 +13,42 @@ return function(screen, programs)
|
||||
local function create_dock_element(program, name, is_steam, size)
|
||||
is_steam = is_steam or false
|
||||
|
||||
if program:match("com.*%a.Client") ~= nil then
|
||||
program = program:gsub("com.", ""):gsub(".Client", ""):gsub("flatpak", ""):gsub("run", ""):gsub(" ", "")
|
||||
end
|
||||
|
||||
local function create_indicator()
|
||||
local col = "#fff"
|
||||
local indicators = { layout = wibox.layout.flex.horizontal, spacing = dpi(5) }
|
||||
for i, c in ipairs(client.get()) do
|
||||
if string.lower(c.class):match(program or name) then
|
||||
if c == client.focus then
|
||||
col = color["YellowA200"]
|
||||
elseif c.urgent then
|
||||
col = color["RedA200"]
|
||||
elseif c.maximized then
|
||||
col = color["GreenA200"]
|
||||
elseif c.minimized then
|
||||
col = color["BlueA200"]
|
||||
elseif c.fullscreen then
|
||||
col = color["PinkA200"]
|
||||
else
|
||||
col = color["Grey600"]
|
||||
end
|
||||
local indicator = wibox.widget {
|
||||
widget = wibox.container.background,
|
||||
shape = gears.shape.rounded_rect,
|
||||
forced_height = dpi(3),
|
||||
spacing_widget = dpi(5),
|
||||
spacing = dpi(5),
|
||||
bg = col
|
||||
}
|
||||
indicators[i] = indicator
|
||||
end
|
||||
end
|
||||
return indicators
|
||||
end
|
||||
|
||||
local dock_element = wibox.widget {
|
||||
{
|
||||
{
|
||||
@@ -21,14 +57,11 @@ return function(screen, programs)
|
||||
resize = true,
|
||||
forced_width = size,
|
||||
forced_height = size,
|
||||
image = Get_icon("Papirus-Dark", program, is_steam),
|
||||
widget = wibox.widget.imagebox
|
||||
},
|
||||
{
|
||||
widget = nil,
|
||||
layout = wibox.layout.align.horizontal,
|
||||
id = "indicator"
|
||||
image = Get_icon(user_vars.icon_theme, program, is_steam),
|
||||
widget = wibox.widget.imagebox,
|
||||
id = "icon"
|
||||
},
|
||||
create_indicator(),
|
||||
layout = wibox.layout.align.vertical,
|
||||
id = "dock_layout"
|
||||
},
|
||||
@@ -39,7 +72,7 @@ return function(screen, programs)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 10)
|
||||
end,
|
||||
bg = colors.color["Grey900"],
|
||||
bg = color["Grey900"],
|
||||
widget = wibox.container.background,
|
||||
id = "background"
|
||||
},
|
||||
@@ -47,7 +80,13 @@ return function(screen, programs)
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
|
||||
Hover_signal(dock_element.background, colors.color["Grey800"], colors.color["White"])
|
||||
for k, c in ipairs(client.get()) do
|
||||
if string.lower(c.class):match(program) and c == client.focus then
|
||||
dock_element.background.bg = color["Grey800"]
|
||||
end
|
||||
end
|
||||
|
||||
Hover_signal(dock_element.background, color["Grey800"], color["White"])
|
||||
|
||||
dock_element:connect_signal(
|
||||
"button::press",
|
||||
@@ -68,52 +107,17 @@ return function(screen, programs)
|
||||
margins = dpi(10)
|
||||
}
|
||||
|
||||
local function create_indicator()
|
||||
local color = ""
|
||||
local indicators
|
||||
local t = 1
|
||||
--[[ 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"]
|
||||
elseif indicator_client.fullscreen then
|
||||
color = colors.color["Red200"]
|
||||
elseif indicator_client.focus then
|
||||
color = colors.color["Blue200"]
|
||||
elseif indicator_client.minimised then
|
||||
color = colors.color["Pink200"]
|
||||
else
|
||||
color = colors.color["White"]
|
||||
end
|
||||
|
||||
local indicator = wibox.widget {
|
||||
widget = wibox.container.background,
|
||||
shape = gears.shape.circle,
|
||||
forced_height = dpi(50),
|
||||
bg = color
|
||||
}
|
||||
indicators.add(indicator)
|
||||
t = t + 1
|
||||
end
|
||||
end
|
||||
end ]]
|
||||
return indicators
|
||||
end
|
||||
|
||||
dock_element.background.margin.dock_layout.indicator = create_indicator()
|
||||
|
||||
return dock_element
|
||||
end
|
||||
|
||||
local dock = awful.popup {
|
||||
widget = wibox.container.background,
|
||||
ontop = true,
|
||||
bg = colors.color["Grey900"],
|
||||
bg = color["Grey900"],
|
||||
visible = true,
|
||||
screen = screen,
|
||||
type = "dock",
|
||||
height = user_vars.vars.dock_icon_size + 10,
|
||||
height = user_vars.dock_icon_size + 10,
|
||||
placement = function(c) awful.placement.bottom(c, { margins = dpi(10) }) end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 15)
|
||||
@@ -136,7 +140,7 @@ return function(screen, programs)
|
||||
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)
|
||||
dock_elements[i] = create_dock_element(p[1], p[2], p[3], user_vars.dock_icon_size)
|
||||
end
|
||||
|
||||
return dock_elements
|
||||
@@ -148,7 +152,7 @@ return function(screen, programs)
|
||||
for i = 0, amount, 1 do
|
||||
fake_elements[i] = wibox.widget {
|
||||
bg = '00000000',
|
||||
forced_width = user_vars.vars.dock_icon_size + dpi(20),
|
||||
forced_width = user_vars.dock_icon_size + dpi(20),
|
||||
forced_height = dpi(10),
|
||||
widget = wibox.container.background
|
||||
}
|
||||
@@ -161,28 +165,26 @@ return function(screen, programs)
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
|
||||
--TODO: Replace with fake elements
|
||||
fakedock:setup {
|
||||
get_fake_elements(#programs),
|
||||
type = 'dock',
|
||||
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 ]]
|
||||
-- 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
|
||||
|
||||
local function check_for_dock_hide(s)
|
||||
if #s:get_clients() < 1 then
|
||||
dock.visible = true
|
||||
return
|
||||
end
|
||||
if s == mouse.screen then
|
||||
if mouse.current_widget then
|
||||
dock.visible = true
|
||||
return
|
||||
end
|
||||
for j, c in ipairs(screen.get_clients()) do
|
||||
for j, c in ipairs(screen.selected_tag:clients()) do
|
||||
local y = c:geometry().y
|
||||
local h = c.height
|
||||
if (y + h) >= screen.geometry.height - user_vars.vars.dock_icon_size - 35 then
|
||||
if (y + h) >= screen.geometry.height - user_vars.dock_icon_size - 35 then
|
||||
dock.visible = false
|
||||
else
|
||||
dock.visible = true
|
||||
@@ -197,6 +199,32 @@ return function(screen, programs)
|
||||
"manage",
|
||||
function()
|
||||
check_for_dock_hide(screen)
|
||||
dock:setup {
|
||||
get_dock_elements(programs),
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
end
|
||||
)
|
||||
|
||||
client.connect_signal(
|
||||
"unmanage",
|
||||
function()
|
||||
check_for_dock_hide(screen)
|
||||
dock:setup {
|
||||
get_dock_elements(programs),
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
end
|
||||
)
|
||||
|
||||
client.connect_signal(
|
||||
"focus",
|
||||
function()
|
||||
check_for_dock_hide(screen)
|
||||
dock:setup {
|
||||
get_dock_elements(programs),
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
@@ -5,31 +5,38 @@
|
||||
local awful = require("awful")
|
||||
|
||||
awful.screen.connect_for_each_screen(
|
||||
-- For each screen this function is called once
|
||||
-- If you want to change the modules per screen use the indices
|
||||
-- e.g. 1 would be the primary screen and 2 the secondary screen.
|
||||
function (s)
|
||||
-- For each screen this function is called once
|
||||
-- If you want to change the modules per screen use the indices
|
||||
-- e.g. 1 would be the primary screen and 2 the secondary screen.
|
||||
function(s)
|
||||
-- Create 9 tags
|
||||
awful.layout.layouts = user_vars.layouts
|
||||
awful.tag(
|
||||
{ "1", "2", "3", "4", "5", "6", "7", "8", "9" },
|
||||
s,
|
||||
user_vars.layouts[1]
|
||||
)
|
||||
|
||||
require("theme.crylia.modules.powermenu")(s)
|
||||
require("src.modules.powermenu")(s)
|
||||
-- TODO: rewrite calendar osd, maybe write an own inplementation
|
||||
-- require("theme.crylia.modules.calendar_osd")(s)
|
||||
require("theme.crylia.modules.volume_osd")(s)
|
||||
require("theme.crylia.modules.brightness_osd")(s)
|
||||
require("theme.crylia.modules.titlebar")
|
||||
-- require("src.modules.calendar_osd")(s)
|
||||
require("src.modules.volume_osd")(s)
|
||||
require("src.modules.brightness_osd")(s)
|
||||
require("src.modules.titlebar")
|
||||
|
||||
-- Widgets
|
||||
s.battery = require("theme.crylia.widgets.battery")()
|
||||
s.network = require("theme.crylia.widgets.network")()
|
||||
s.audio = require("theme.crylia.widgets.audio")()
|
||||
s.date = require("theme.crylia.widgets.date")()
|
||||
s.clock = require("theme.crylia.widgets.clock")()
|
||||
s.bluetooth = require("theme.crylia.widgets.bluetooth")()
|
||||
s.layoutlist = require("theme.crylia.widgets.layout_list")()
|
||||
s.powerbutton = require("theme.crylia.widgets.power")()
|
||||
s.kblayout = require("theme.crylia.widgets.kblayout")(s)
|
||||
s.taglist = require("theme.crylia.widgets.taglist")(s)
|
||||
s.tasklist = require("theme.crylia.widgets.tasklist")(s)
|
||||
s.systray = require("theme.crylia.widgets.systray")(s)
|
||||
s.battery = require("src.widgets.battery")()
|
||||
s.network = require("src.widgets.network")()
|
||||
s.audio = require("src.widgets.audio")()
|
||||
s.date = require("src.widgets.date")()
|
||||
s.clock = require("src.widgets.clock")()
|
||||
s.bluetooth = require("src.widgets.bluetooth")()
|
||||
s.layoutlist = require("src.widgets.layout_list")()
|
||||
s.powerbutton = require("src.widgets.power")()
|
||||
s.kblayout = require("src.widgets.kblayout")(s)
|
||||
s.taglist = require("src.widgets.taglist")(s)
|
||||
s.tasklist = require("src.widgets.tasklist")(s)
|
||||
s.systray = require("src.widgets.systray")(s)
|
||||
|
||||
-- Add more of these if statements if you want to change
|
||||
-- the modules/widgets per screen.
|
||||
@@ -38,7 +45,7 @@ awful.screen.connect_for_each_screen(
|
||||
require("crylia_bar.left_bar")(s, {s.layoutlist, s.systray, s.taglist})
|
||||
require("crylia_bar.center_bar")(s, s.tasklist)
|
||||
require("crylia_bar.right_bar")(s, {s.date, s.clock,s.powerbutton})
|
||||
require("crylia_bar.dock")(s, user_vars.vars.dock_programs)
|
||||
require("crylia_bar.dock")(s, user_vars.dock_programs)
|
||||
end ]]
|
||||
|
||||
--[[ if s.index == 2 then
|
||||
@@ -47,10 +54,10 @@ awful.screen.connect_for_each_screen(
|
||||
require("crylia_bar.right_bar")(s, {s.battery, s.network, s.bluetooth, s.audio, s.kblayout, s.date, s.clock,s.powerbutton})
|
||||
end ]]
|
||||
-- Bars
|
||||
require("crylia_bar.left_bar")(s, {s.layoutlist, s.systray, s.taglist})
|
||||
require("crylia_bar.left_bar")(s, { s.layoutlist, s.systray, s.taglist })
|
||||
require("crylia_bar.center_bar")(s, s.tasklist)
|
||||
require("crylia_bar.right_bar")(s, {s.battery, s.network, s.bluetooth, s.audio, s.kblayout, s.date, s.clock,s.powerbutton})
|
||||
require("crylia_bar.dock")(s, user_vars.vars.dock_programs)
|
||||
require("crylia_bar.right_bar")(s, { s.battery, s.network, s.bluetooth, s.audio, s.kblayout, s.date, s.clock, s.powerbutton })
|
||||
require("crylia_bar.dock")(s, user_vars.dock_programs)
|
||||
|
||||
end
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local colors = require("theme.crylia.colors")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
@@ -14,7 +14,7 @@ return function(s, widgets)
|
||||
screen = s,
|
||||
widget = wibox.container.background,
|
||||
ontop = false,
|
||||
bg = colors.color["Grey900"],
|
||||
bg = color["Grey900"],
|
||||
visible = true,
|
||||
maximum_width = dpi(650),
|
||||
placement = function(c) awful.placement.top_left(c, { margins = dpi(10) }) end,
|
||||
|
||||
@@ -3,21 +3,21 @@
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local colors = require ("theme.crylia.colors")
|
||||
local color = require("src.theme.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_right = awful.popup{
|
||||
local top_right = awful.popup {
|
||||
widget = wibox.container.background,
|
||||
ontop = false,
|
||||
bg = colors.color["Grey900"],
|
||||
bg = color["Grey900"],
|
||||
visible = true,
|
||||
screen = s,
|
||||
placement = function (c) awful.placement.top_right(c, {margins = dpi(10)}) end,
|
||||
shape = function (cr, width, height)
|
||||
placement = function(c) awful.placement.top_right(c, { margins = dpi(10) }) end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
@@ -95,4 +95,4 @@ return function (s, widgets)
|
||||
},
|
||||
layout = wibox.layout.align.horizontal
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
------------------------------------------------------------------------------------------
|
||||
-- Layout class, if you want to add or remove layouts from the list do it in this table --
|
||||
------------------------------------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
|
||||
return function()
|
||||
local layouts = {
|
||||
awful.layout.suit.tile,
|
||||
awful.layout.suit.floating,
|
||||
awful.layout.suit.fair,
|
||||
}
|
||||
|
||||
return layouts
|
||||
end
|
||||
@@ -1,38 +0,0 @@
|
||||
--------------------------------------------------------------
|
||||
-- Menu class, this is where you change the rightclick menu --
|
||||
--------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
|
||||
-- Module Namespace
|
||||
local _M = { }
|
||||
|
||||
local session = {
|
||||
{ "Logout", function () awesome.quit() end },
|
||||
{ "Shutdown", function () awful.spawn.with_shell('shutdown now') end },
|
||||
{ "Reboot", function () awful.spawn.with_shell('reboot') end },
|
||||
}
|
||||
|
||||
local applications = {
|
||||
{ "Firefox", "firefox" },
|
||||
{ "VS Code", "code" },
|
||||
{ "Blender", "blender" },
|
||||
{ "Steam", "steam" },
|
||||
{ "Lutris", "lutris" },
|
||||
}
|
||||
|
||||
local settings = {
|
||||
{ "General Settings", "gnome-control-center" },
|
||||
{ "Power Settings", "xfce4-power-manager-settings" },
|
||||
{ "Display Settings", "arandr" }
|
||||
}
|
||||
|
||||
return function()
|
||||
local menu_items = {
|
||||
{ "Power Menu", session },
|
||||
{ "Applications", applications },
|
||||
{ "Open Terminal", user_vars.vars.terminal },
|
||||
{ "Settings", settings },
|
||||
}
|
||||
return menu_items
|
||||
end
|
||||
@@ -1,53 +0,0 @@
|
||||
-------------------------------------------------------------------------------------------------
|
||||
-- This class contains rules for float exceptions or special themeing for certain applications --
|
||||
-------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
return function (clientkeys, clientbuttons)
|
||||
local rules = {
|
||||
{
|
||||
rule = { },
|
||||
properties = {
|
||||
border_width = beautiful.border_width,
|
||||
border_color = beautiful.border_normal,
|
||||
focus = awful.client.focus.filter,
|
||||
raise = true,
|
||||
keys = clientkeys,
|
||||
buttons = clientbuttons,
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap+awful.placement.no_offscreen
|
||||
}
|
||||
},
|
||||
{
|
||||
rule_any = {
|
||||
instance = { },
|
||||
class = {
|
||||
"Arandr",
|
||||
"Lxappearance",
|
||||
"kdeconnect.app",
|
||||
"zoom",
|
||||
"file-roller",
|
||||
"File-roller"
|
||||
},
|
||||
name = { },
|
||||
role = {
|
||||
"AlarmWindow",
|
||||
"ConfigManager",
|
||||
"pop-up"
|
||||
}
|
||||
},
|
||||
properties = { floating = true, titlebars_enabled = true }
|
||||
},
|
||||
{
|
||||
id = "titlebar",
|
||||
rule_any = {
|
||||
type = { "normal", "dialog", "modal", "utility" }
|
||||
},
|
||||
properties = { titlebars_enabled = true }
|
||||
}
|
||||
}
|
||||
return rules
|
||||
end
|
||||
@@ -1,23 +0,0 @@
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
-- Here are the ammount of tags generated, edit the awful.tag args if you want a different ammount --
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
|
||||
return function()
|
||||
local tags = {}
|
||||
awful.screen.connect_for_each_screen(
|
||||
function(s)
|
||||
tags[s] = awful.tag(
|
||||
{
|
||||
"1", "2", "3", "4", "5", "6", "7", "8", "9"
|
||||
},
|
||||
s,
|
||||
user_vars.Layouts[1]
|
||||
)
|
||||
end
|
||||
)
|
||||
|
||||
return tags
|
||||
end
|
||||
@@ -1,19 +0,0 @@
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
local home = os.getenv("HOME")
|
||||
|
||||
beautiful.init(home .. "/.config/awesome/theme/crylia/theme.lua")
|
||||
|
||||
if(user_vars.vars.wallpaper) then
|
||||
local wallpaper = user_vars.vars.wallpaper
|
||||
if awful.util.file_readable(wallpaper) then
|
||||
Theme.wallpaper = wallpaper
|
||||
end
|
||||
end
|
||||
|
||||
if beautiful.wallpaper then
|
||||
for s = 1, screen.count() do
|
||||
gears.wallpaper.maximized(beautiful.wallpaper, s, true)
|
||||
end
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
---------------------------------------
|
||||
-- This function sets your wallpaper --
|
||||
---------------------------------------
|
||||
-- Awesome Libs
|
||||
local gears = require("gears")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
function Set_wallpaper(s)
|
||||
if beautiful.wallpaper then
|
||||
local wallpaper = beautiful.wallpaper
|
||||
if type(wallpaper) == "function" then
|
||||
wallpaper = wallpaper(s)
|
||||
end
|
||||
gears.wallpaper.maximized(wallpaper, s, true)
|
||||
end
|
||||
end
|
||||
|
||||
screen.connect_signal("property::geometry", Set_wallpaper)
|
||||
@@ -1,16 +1,15 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local globalkeys = require("../mappings/global_keys")
|
||||
local modkey = user_vars.modkey
|
||||
|
||||
local modkey = user_vars.vars.modkey
|
||||
|
||||
return function (globalkeys)
|
||||
for i = 1, 9 do
|
||||
globalkeys = gears.table.join(globalkeys,
|
||||
for i = 1, 9 do
|
||||
globalkeys = gears.table.join(globalkeys,
|
||||
|
||||
-- View tag only
|
||||
awful.key(
|
||||
{modkey},
|
||||
{ modkey },
|
||||
"#" .. i + 9,
|
||||
function()
|
||||
local screen = awful.screen.focused()
|
||||
@@ -20,11 +19,11 @@ return function (globalkeys)
|
||||
end
|
||||
client.emit_signal("tag::switched")
|
||||
end,
|
||||
{description = "View Tag " .. i, group = "Tag"}
|
||||
{ description = "View Tag " .. i, group = "Tag" }
|
||||
),
|
||||
-- Brings the window over without chaning the tag, reverts automatically on tag change
|
||||
awful.key(
|
||||
{modkey, "Control"},
|
||||
{ modkey, "Control" },
|
||||
"#" .. i + 9,
|
||||
function()
|
||||
local screen = awful.screen.focused()
|
||||
@@ -33,11 +32,11 @@ return function (globalkeys)
|
||||
awful.tag.viewtoggle(tag)
|
||||
end
|
||||
end,
|
||||
{description = "Toggle Tag " .. i, group = "Tag"}
|
||||
{ description = "Toggle Tag " .. i, group = "Tag" }
|
||||
),
|
||||
-- Brings the window over without chaning the tag, reverts automatically on tag change
|
||||
awful.key(
|
||||
{modkey, "Shift"},
|
||||
{ modkey, "Shift" },
|
||||
"#" .. i + 9,
|
||||
function()
|
||||
local screen = awful.screen.focused()
|
||||
@@ -48,11 +47,11 @@ return function (globalkeys)
|
||||
end
|
||||
end
|
||||
end,
|
||||
{description = "Move focused client on tag " .. i, group = "Tag"}
|
||||
{ description = "Move focused client on tag " .. i, group = "Tag" }
|
||||
),
|
||||
-- Brings the window over without chaning the tag, reverts automatically on tag change
|
||||
awful.key(
|
||||
{modkey, "Control", "Shift"},
|
||||
{ modkey, "Control", "Shift" },
|
||||
"#" .. i + 9,
|
||||
function()
|
||||
local screen = awful.screen.focused()
|
||||
@@ -61,9 +60,8 @@ return function (globalkeys)
|
||||
awful.tag.viewtoggle(tag)
|
||||
end
|
||||
end,
|
||||
{description = "Move focused client on tag " .. i, group = "Tag"}
|
||||
{ description = "Move focused client on tag " .. i, group = "Tag" }
|
||||
)
|
||||
)
|
||||
end
|
||||
return globalkeys
|
||||
end
|
||||
end
|
||||
root.keys(globalkeys)
|
||||
19
awesome/mappings/client_buttons.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
|
||||
local modkey = user_vars.modkey
|
||||
|
||||
return gears.table.join(
|
||||
awful.button({}, 1, function(c)
|
||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||
end),
|
||||
awful.button({ modkey }, 1, function(c)
|
||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||
awful.mouse.client.move(c)
|
||||
end),
|
||||
awful.button({ modkey }, 3, function(c)
|
||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||
awful.mouse.client.resize(c)
|
||||
end)
|
||||
)
|
||||
57
awesome/mappings/client_keys.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
|
||||
local modkey = user_vars.modkey
|
||||
|
||||
return gears.table.join(
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#41",
|
||||
function(c)
|
||||
c.fullscreen = not c.fullscreen
|
||||
c:raise()
|
||||
end,
|
||||
{ description = "Toggle fullscreen", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#24",
|
||||
function(c)
|
||||
c:kill()
|
||||
end,
|
||||
{ description = "Close focused client", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#42",
|
||||
awful.client.floating.toggle,
|
||||
{ description = "Toggle floating window", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#58",
|
||||
function(c)
|
||||
c.maximized = not c.maximized
|
||||
c:raise()
|
||||
end,
|
||||
{ description = "(un)maximize", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#57",
|
||||
function(c)
|
||||
if c == client.focus then
|
||||
c.minimized = true
|
||||
else
|
||||
c.minimized = false
|
||||
if not c:isvisible() and c.first_tag then
|
||||
c.first_tag:view_only()
|
||||
end
|
||||
c:emit_signal('request::activate')
|
||||
c:raise()
|
||||
end
|
||||
end,
|
||||
{ description = "(un)hide", group = "Client" }
|
||||
)
|
||||
)
|
||||
8
awesome/mappings/global_buttons.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
-- Awesome Libs
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
|
||||
root.buttons = gears.table.join(
|
||||
awful.button({}, 4, awful.tag.viewnext),
|
||||
awful.button({}, 5, awful.tag.viewprev)
|
||||
)
|
||||
304
awesome/mappings/global_keys.lua
Normal file
@@ -0,0 +1,304 @@
|
||||
-- Awesome Libs
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
|
||||
local modkey = user_vars.modkey
|
||||
|
||||
return gears.table.join(
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#39",
|
||||
hotkeys_popup.show_help,
|
||||
{ description = "Cheat sheet", group = "Awesome" }
|
||||
),
|
||||
-- Tag browsing
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#113",
|
||||
awful.tag.viewprev,
|
||||
{ description = "View previous tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#114",
|
||||
awful.tag.viewnext,
|
||||
{ description = "View next tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#66",
|
||||
awful.tag.history.restore,
|
||||
{ description = "Go back to last tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#44",
|
||||
function()
|
||||
awful.client.focus.byidx(1)
|
||||
end,
|
||||
{ description = "Focus next client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#45",
|
||||
function()
|
||||
awful.client.focus.byidx(-1)
|
||||
end,
|
||||
{ description = "Focus previous client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#25",
|
||||
function()
|
||||
user_vars.main_menu:show()
|
||||
end,
|
||||
{ description = "Show context menu", group = "Awesome" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"#44",
|
||||
function()
|
||||
awful.client.swap.byidx(1)
|
||||
end,
|
||||
{ description = "Swap with next client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"#45",
|
||||
function()
|
||||
awful.client.swap.byidx(-1)
|
||||
end,
|
||||
{ description = "Swap with previous client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"#44",
|
||||
function()
|
||||
awful.screen.focus_relative(1)
|
||||
end,
|
||||
{ description = "Focus the next screen", group = "Screen" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"#45",
|
||||
function()
|
||||
awful.screen.focus_relative(-1)
|
||||
end,
|
||||
{ description = "Focus the previous screen", group = "Screen" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#30",
|
||||
awful.client.urgent.jumpto,
|
||||
{ description = "Jump to urgent client", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#36",
|
||||
function()
|
||||
awful.spawn(user_vars.terminal)
|
||||
end,
|
||||
{ description = "Open terminal", group = "Applications" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"#27",
|
||||
awesome.restart,
|
||||
{ description = "Reload awesome", group = "Awesome" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#46",
|
||||
function()
|
||||
awful.tag.incmwfact(0.05)
|
||||
end,
|
||||
{ description = "Increase client width", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#43",
|
||||
function()
|
||||
awful.tag.incmwfact(-0.05)
|
||||
end,
|
||||
{ description = "Decrease client width", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"#43",
|
||||
function()
|
||||
awful.tag.incncol(1, nil, true)
|
||||
end,
|
||||
{ description = "Increase the number of columns", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"#46",
|
||||
function()
|
||||
awful.tag.incncol(-1, nil, true)
|
||||
end,
|
||||
{ description = "Decrease the number of columns", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"#65",
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end,
|
||||
{ description = "Select previous layout", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"#36",
|
||||
function()
|
||||
awful.layout.inc(1)
|
||||
end,
|
||||
{ description = "Select next layout", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#40",
|
||||
function()
|
||||
awful.spawn("rofi -show drun -theme ~/.config/rofi/rofi.rasi")
|
||||
end,
|
||||
{ descripton = "Application launcher", group = "Application" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#23",
|
||||
function()
|
||||
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||
end,
|
||||
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
||||
),
|
||||
awful.key(
|
||||
{ "Mod1" },
|
||||
"#23",
|
||||
function()
|
||||
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||
end,
|
||||
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"#26",
|
||||
function()
|
||||
awful.spawn(user_vars.file_manager)
|
||||
end,
|
||||
{ descripton = "Open file manager", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"#26",
|
||||
function()
|
||||
awesome.emit_signal("module::powermenu:show")
|
||||
end,
|
||||
{ descripton = "Session options", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"#107",
|
||||
function()
|
||||
awful.spawn(user_vars.screenshot_program)
|
||||
end,
|
||||
{ description = "Screenshot", group = "Applications" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86AudioLowerVolume",
|
||||
function(c)
|
||||
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ -2%")
|
||||
awesome.emit_signal("widget::volume")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
awesome.emit_signal("module::slider:update")
|
||||
awesome.emit_signal("widget::volume_osd:rerun")
|
||||
end,
|
||||
{ description = "Lower volume", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86AudioRaiseVolume",
|
||||
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)
|
||||
awesome.emit_signal("widget::volume")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
awesome.emit_signal("module::slider:update")
|
||||
awesome.emit_signal("widget::volume_osd:rerun")
|
||||
end,
|
||||
{ description = "Increase volume", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86AudioMute",
|
||||
function(c)
|
||||
awful.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")
|
||||
awesome.emit_signal("widget::volume")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
awesome.emit_signal("module::slider:update")
|
||||
awesome.emit_signal("widget::volume_osd:rerun")
|
||||
end,
|
||||
{ description = "Mute volume", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86MonBrightnessUp",
|
||||
function(c)
|
||||
awful.spawn("xbacklight -time 100 -inc 10%+")
|
||||
awesome.emit_signal("module::brightness_osd:show", true)
|
||||
awesome.emit_signal("module::brightness_slider:update")
|
||||
awesome.emit_signal("widget::brightness_osd:rerun")
|
||||
end,
|
||||
{ description = "Raise backlight brightness", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86MonBrightnessDown",
|
||||
function(c)
|
||||
awful.spawn("xbacklight -time 100 -dec 10%-")
|
||||
awesome.emit_signal("widget::brightness_osd:rerun")
|
||||
awesome.emit_signal("module::brightness_osd:show", true)
|
||||
awesome.emit_signal("module::brightness_slider:update")
|
||||
end,
|
||||
{ description = "Lower backlight brightness", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"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 },
|
||||
"#65",
|
||||
function()
|
||||
awesome.emit_signal("kblayout::toggle")
|
||||
end,
|
||||
{ description = "Toggle keyboard layout", group = "System" }
|
||||
)
|
||||
)
|
||||
@@ -7,51 +7,13 @@
|
||||
-- ╚═╝ ╚═╝ ╚══╝╚══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═╝ ╚═╝ --
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
|
||||
user_vars = {}
|
||||
user_vars.vars = require("main.user_variables")
|
||||
|
||||
require("main.error_handling")
|
||||
|
||||
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
|
||||
require("main.theme")
|
||||
|
||||
local main = {
|
||||
layouts = require("main.layouts"),
|
||||
tags = require("main.tags"),
|
||||
menu = require("main.menu"),
|
||||
rules = require("main.rules")
|
||||
}
|
||||
|
||||
local bindings = {
|
||||
global_buttons = require("bindings.global_buttons"),
|
||||
client_buttons = require("bindings.client_buttons"),
|
||||
global_keys = require("bindings.global_keys"),
|
||||
bind_to_tags = require("bindings.bind_to_tags"),
|
||||
client_keys = require("bindings.client_keys")
|
||||
}
|
||||
|
||||
user_vars.Layouts = main.layouts()
|
||||
awful.layout.layouts = main.layouts()
|
||||
user_vars.tags = main.tags()
|
||||
user_vars.main_menu = awful.menu({
|
||||
items = main.menu()
|
||||
})
|
||||
|
||||
root.buttons(bindings.global_buttons())
|
||||
root.keys(bindings.bind_to_tags(bindings.global_keys()))
|
||||
|
||||
-- Initialising, order is important!
|
||||
require("src.theme.user_variables")
|
||||
require("src.theme.init")
|
||||
require("src.core.error_handling")
|
||||
require("src.core.rules")
|
||||
require("src.core.signals")
|
||||
require("mappings.global_buttons")
|
||||
require("mappings.bind_to_tags")
|
||||
require("crylia_bar.init")
|
||||
|
||||
awful.rules.rules = main.rules(
|
||||
bindings.client_keys(),
|
||||
bindings.client_buttons()
|
||||
)
|
||||
|
||||
require("main.signals")
|
||||
|
||||
require("theme.crylia.tools.auto_starter")
|
||||
--Autostarter(user_vars.vars.autostart)
|
||||
require("src.tools.auto_starter")(user_vars.autostart)
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 535 B After Width: | Height: | Size: 535 B |
|
Before Width: | Height: | Size: 346 B After Width: | Height: | Size: 346 B |
|
Before Width: | Height: | Size: 412 B After Width: | Height: | Size: 412 B |
|
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 457 B |
|
Before Width: | Height: | Size: 712 B After Width: | Height: | Size: 712 B |
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
|
Before Width: | Height: | Size: 505 B After Width: | Height: | Size: 505 B |
|
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 506 B |
|
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 438 B |
|
Before Width: | Height: | Size: 465 B After Width: | Height: | Size: 465 B |
|
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 464 B After Width: | Height: | Size: 464 B |
|
Before Width: | Height: | Size: 464 B After Width: | Height: | Size: 464 B |
|
Before Width: | Height: | Size: 505 B After Width: | Height: | Size: 505 B |
|
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 439 B |
|
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 439 B |
|
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 682 B After Width: | Height: | Size: 682 B |
|
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
|
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 460 B |
|
Before Width: | Height: | Size: 562 B After Width: | Height: | Size: 562 B |
|
Before Width: | Height: | Size: 496 B After Width: | Height: | Size: 496 B |
|
Before Width: | Height: | Size: 468 B After Width: | Height: | Size: 468 B |
|
Before Width: | Height: | Size: 481 B After Width: | Height: | Size: 481 B |
|
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 400 B |
|
Before Width: | Height: | Size: 477 B After Width: | Height: | Size: 477 B |
|
Before Width: | Height: | Size: 525 B After Width: | Height: | Size: 525 B |
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
|
Before Width: | Height: | Size: 530 B After Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
|
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 674 B |
|
Before Width: | Height: | Size: 495 B After Width: | Height: | Size: 495 B |
|
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 508 B |
|
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
|
Before Width: | Height: | Size: 553 B After Width: | Height: | Size: 553 B |
|
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 446 B |
|
Before Width: | Height: | Size: 528 B After Width: | Height: | Size: 528 B |
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 491 B |
|
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
|
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 409 B |
|
Before Width: | Height: | Size: 172 B After Width: | Height: | Size: 172 B |
|
Before Width: | Height: | Size: 392 B After Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 405 B |
|
Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 398 B |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 930 KiB After Width: | Height: | Size: 930 KiB |
|
Before Width: | Height: | Size: 292 KiB After Width: | Height: | Size: 292 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 1008 KiB After Width: | Height: | Size: 1008 KiB |
50
awesome/src/core/rules.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
-------------------------------------------------------------------------------------------------
|
||||
-- This class contains rules for float exceptions or special themeing for certain applications --
|
||||
-------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
awful.rules.rules = {
|
||||
{
|
||||
rule = {},
|
||||
properties = {
|
||||
border_width = beautiful.border_width,
|
||||
border_color = beautiful.border_normal,
|
||||
focus = awful.client.focus.filter,
|
||||
raise = true,
|
||||
keys = require("../../mappings/client_keys"),
|
||||
buttons = require("../../mappings/client_buttons"),
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen
|
||||
}
|
||||
},
|
||||
{
|
||||
rule_any = {
|
||||
instance = {},
|
||||
class = {
|
||||
"Arandr",
|
||||
"Lxappearance",
|
||||
"kdeconnect.app",
|
||||
"zoom",
|
||||
"file-roller",
|
||||
"File-roller"
|
||||
},
|
||||
name = {},
|
||||
role = {
|
||||
"AlarmWindow",
|
||||
"ConfigManager",
|
||||
"pop-up"
|
||||
}
|
||||
},
|
||||
properties = { floating = true, titlebars_enabled = true }
|
||||
},
|
||||
{
|
||||
id = "titlebar",
|
||||
rule_any = {
|
||||
type = { "normal", "dialog", "modal", "utility" }
|
||||
},
|
||||
properties = { titlebars_enabled = true }
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local color = require("theme.crylia.colors")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
-- Icon directory path
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/brightness/"
|
||||
local icondir = awful.util.getdir("config") .. "src/assets/icons/brightness/"
|
||||
|
||||
-- TODO: fix backlight keys and osd not working correctly
|
||||
return function(s)
|
||||
@@ -64,12 +64,12 @@ return function(s)
|
||||
id = "brightness_slider",
|
||||
bar_shape = gears.shape.rounded_rect,
|
||||
bar_height = dpi(10),
|
||||
bar_color = color.color["Grey800"] .. "88",
|
||||
bar_color = color["Grey800"] .. "88",
|
||||
bar_active_color = "#ffffff",
|
||||
handle_color = "#ffffff",
|
||||
handle_shape = gears.shape.circle,
|
||||
handle_width = dpi(10),
|
||||
handle_border_color = color.color["White"],
|
||||
handle_border_color = color["White"],
|
||||
maximum = 100,
|
||||
widget = wibox.widget.slider
|
||||
},
|
||||
@@ -89,7 +89,7 @@ return function(s)
|
||||
right = dpi(24),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Grey900"] .. "88",
|
||||
bg = color["Grey900"] .. "88",
|
||||
widget = wibox.container.background,
|
||||
ontop = true,
|
||||
visible = true,
|
||||
@@ -103,7 +103,7 @@ return function(s)
|
||||
"property::value",
|
||||
function()
|
||||
local brightness_value = brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:get_value()
|
||||
-- Performance is horrible, or it overrides and executes at the same time as the keybindings
|
||||
-- Performance is horrible, or it overrides and executes at the same time as the keymappings
|
||||
--awful.spawn("xbacklight -set " .. brightness_value, false)
|
||||
brightness_osd_widget.container.osd_layout.icon_slider_layout.label_value_layout.value:set_text(brightness_value .. "%")
|
||||
|
||||
@@ -160,7 +160,7 @@ return function(s)
|
||||
local brightness_container = awful.popup {
|
||||
widget = wibox.container.background,
|
||||
ontop = true,
|
||||
bg = color.color["Grey900"] .. "00",
|
||||
bg = color["Grey900"] .. "00",
|
||||
stretch = false,
|
||||
visible = false,
|
||||
screen = s,
|
||||
@@ -8,36 +8,36 @@ local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local gears = require("gears")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local color = require("theme.crylia.colors")
|
||||
local color = require("src.theme.colors")
|
||||
|
||||
return function(s)
|
||||
local styles = {}
|
||||
|
||||
styles.month = {
|
||||
padding = 15,
|
||||
bg_color = color.color["Grey900"],
|
||||
bg_color = color["Grey900"],
|
||||
border_width = 1,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
styles.normal = {
|
||||
fg_color = color.color["Grey900"],
|
||||
font = user_vars.vars.font.extrabold,
|
||||
fg_color = color["Grey900"],
|
||||
font = user_vars.font.extrabold,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
styles.focus = {
|
||||
fg_color = color.color["Grey900"],
|
||||
bg_color = color.color["Purple200"],
|
||||
fg_color = color["Grey900"],
|
||||
bg_color = color["Purple200"],
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
styles.header = {
|
||||
fg_color = color.color["Grey900"],
|
||||
bg_color = color.color["Teal200"],
|
||||
fg_color = color["Grey900"],
|
||||
bg_color = color["Teal200"],
|
||||
markup = function(t) return '<b>' .. t .. '</b>' end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
@@ -45,8 +45,8 @@ return function(s)
|
||||
}
|
||||
styles.weekday = {
|
||||
padding = 8,
|
||||
fg_color = color.color["Grey900"],
|
||||
bg_color = color.color["Teal200"],
|
||||
fg_color = color["Grey900"],
|
||||
bg_color = color["Teal200"],
|
||||
markup = function(t) return '<b>' .. t .. '</b>' end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
@@ -63,7 +63,7 @@ return function(s)
|
||||
-- Change bg color for weekends
|
||||
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 default_bg = (weekday == 0 or weekday == 6) and color["Red200"] or color["White"]
|
||||
local ret = wibox.widget {
|
||||
{
|
||||
widget,
|
||||
@@ -87,7 +87,7 @@ return function(s)
|
||||
date = os.date('*t'),
|
||||
fn_embed = decorate_cell,
|
||||
widget = wibox.widget.calendar.month,
|
||||
font = user_vars.vars.font.extrabold,
|
||||
font = user_vars.font.extrabold,
|
||||
spacing = dpi(10)
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ return function(s)
|
||||
screen = s,
|
||||
widget = wibox.container.background,
|
||||
ontop = true,
|
||||
bg = color.color["Grey900"],
|
||||
bg = color["Grey900"],
|
||||
stretch = false,
|
||||
visible = false,
|
||||
placement = function(c) awful.placement.top_right(c, { margins = { right = dpi(100), top = dpi(60) } }) end,
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local color = require("theme.crylia.colors")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
require("main.signals")
|
||||
require("src.core.signals")
|
||||
|
||||
-- Icon directory path
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/powermenu/"
|
||||
local icondir = awful.util.getdir("config") .. "src/assets/icons/powermenu/"
|
||||
|
||||
return function(s)
|
||||
|
||||
@@ -42,7 +42,7 @@ return function(s)
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[=[
|
||||
iconPath="/var/lib/AccountsService/icons/${USER}"
|
||||
userIconPath="${HOME}/.config/awesome/theme/crylia/assets/userpfp/"
|
||||
userIconPath="${HOME}/.config/awesome/src/assets/userpfp/"
|
||||
if [[ -f "${userIconPath}" ]];
|
||||
then
|
||||
if [[ -f "${iconPath}" ]];
|
||||
@@ -77,7 +77,7 @@ return function(s)
|
||||
update_profile_picture()
|
||||
|
||||
-- Will determin the display style
|
||||
local namestyle = user_vars.vars.namestyle
|
||||
local namestyle = user_vars.namestyle
|
||||
-- Get the full username(if set) and the username + hostname
|
||||
local update_user_name = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
@@ -97,7 +97,7 @@ return function(s)
|
||||
]=],
|
||||
function(stdout)
|
||||
if stdout:gsub("\n", "") == "Rick Astley" then
|
||||
profile_picture:set_image(awful.util.getdir("config") .. "theme/crylia/assets/userpfp/" .. "rickastley.jpg")
|
||||
profile_picture:set_image(awful.util.getdir("config") .. "src/assets/userpfp/" .. "rickastley.jpg")
|
||||
end
|
||||
profile_name:set_text(stdout)
|
||||
end
|
||||
@@ -116,7 +116,7 @@ return function(s)
|
||||
-- TODO: using gears.color to recolor a SVG will make it look super low res
|
||||
-- currently I recolor it in the .svg file directly, but later implement
|
||||
-- a better way to recolor a SVG
|
||||
-- image = gears.color.recolor_image(icon, color.color["Grey900"]),
|
||||
-- image = gears.color.recolor_image(icon, color["Grey900"]),
|
||||
image = icon,
|
||||
resize = true,
|
||||
forced_height = dpi(30),
|
||||
@@ -139,7 +139,7 @@ return function(s)
|
||||
margins = dpi(10),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
fg = color.color["Grey900"],
|
||||
fg = color["Grey900"],
|
||||
bg = bg_color,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 10)
|
||||
@@ -163,7 +163,7 @@ return function(s)
|
||||
|
||||
-- Create the power menu actions
|
||||
local suspend_command = function()
|
||||
awful.spawn.easy_async_with_shell("dm-tool lock & systemctl suspend")
|
||||
awful.spawn("dm-tool lock & systemctl suspend")
|
||||
awesome.emit_signal("module::powermenu:hide")
|
||||
end
|
||||
|
||||
@@ -172,33 +172,33 @@ return function(s)
|
||||
end
|
||||
|
||||
local lock_command = function()
|
||||
awful.spawn.easy_async_with_shell("dm-tool lock")
|
||||
awful.spawn("dm-tool lock")
|
||||
awesome.emit_signal("module::powermenu:hide")
|
||||
end
|
||||
|
||||
local shutdown_command = function()
|
||||
awful.spawn.easy_async_with_shell("shutdown now")
|
||||
awful.spawn("shutdown now")
|
||||
awesome.emit_signal("module::powermenu:hide")
|
||||
end
|
||||
|
||||
local reboot_command = function()
|
||||
awful.spawn.easy_async_with_shell("reboot")
|
||||
awful.spawn("reboot")
|
||||
awesome.emit_signal("module::powermenu:hide")
|
||||
end
|
||||
|
||||
-- Create the buttons with their command and name etc
|
||||
local shutdown_button = button("Shutdown", icondir .. "shutdown.svg", color.color["Blue200"], shutdown_command)
|
||||
local reboot_button = button("Reboot", icondir .. "reboot.svg", color.color["Red200"], reboot_command)
|
||||
local suspend_button = button("Suspend", icondir .. "suspend.svg", color.color["Yellow200"], suspend_command)
|
||||
local logout_button = button("Logout", icondir .. "logout.svg", color.color["Green200"], logout_command)
|
||||
local lock_button = button("Lock", icondir .. "lock.svg", color.color["Orange200"], lock_command)
|
||||
local shutdown_button = button("Shutdown", icondir .. "shutdown.svg", color["Blue200"], shutdown_command)
|
||||
local reboot_button = button("Reboot", icondir .. "reboot.svg", color["Red200"], reboot_command)
|
||||
local suspend_button = button("Suspend", icondir .. "suspend.svg", color["Yellow200"], suspend_command)
|
||||
local logout_button = button("Logout", icondir .. "logout.svg", color["Green200"], logout_command)
|
||||
local lock_button = button("Lock", icondir .. "lock.svg", 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["Blue200"])
|
||||
Hover_signal(reboot_button.background, color["Red200"])
|
||||
Hover_signal(suspend_button.background, color["Yellow200"])
|
||||
Hover_signal(logout_button.background, color["Green200"])
|
||||
Hover_signal(lock_button.background, color["Orange200"])
|
||||
|
||||
-- The powermenu widget
|
||||
local powermenu = wibox.widget {
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local color = require("theme.crylia.colors")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
require("main.signals")
|
||||
require("src.core.signals")
|
||||
|
||||
-- Icon directory path
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/titlebar/"
|
||||
local icondir = awful.util.getdir("config") .. "src/assets/icons/titlebar/"
|
||||
|
||||
awful.titlebar.enable_tooltip = true
|
||||
awful.titlebar.fallback_name = 'Client'
|
||||
@@ -86,7 +86,7 @@ local create_titlebar = function(c, bg, size)
|
||||
{
|
||||
awful.titlebar.widget.closebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Red200"],
|
||||
bg = color["Red200"],
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
@@ -95,7 +95,7 @@ local create_titlebar = function(c, bg, size)
|
||||
{
|
||||
awful.titlebar.widget.maximizedbutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Yellow200"],
|
||||
bg = color["Yellow200"],
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
@@ -104,7 +104,7 @@ local create_titlebar = function(c, bg, size)
|
||||
{
|
||||
awful.titlebar.widget.minimizebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Green200"],
|
||||
bg = color["Green200"],
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
@@ -132,9 +132,9 @@ 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["Red200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.maximizebutton, color["Yellow200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color["Green200"])
|
||||
end
|
||||
|
||||
local create_titlebar_dialog = function(c, bg, size)
|
||||
@@ -150,7 +150,7 @@ local create_titlebar_dialog = function(c, bg, size)
|
||||
{
|
||||
awful.titlebar.widget.closebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Red200"],
|
||||
bg = color["Red200"],
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
@@ -159,7 +159,7 @@ local create_titlebar_dialog = function(c, bg, size)
|
||||
{
|
||||
awful.titlebar.widget.minimizebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Green200"],
|
||||
bg = color["Green200"],
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
@@ -187,8 +187,8 @@ 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["Red200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color["Green200"])
|
||||
end
|
||||
|
||||
local create_titlebar_borderhack = function(c, bg, position)
|
||||