chore: build awesome-slot from source

I'm working on some new updates on awesome-slot that I want to test here
on my config before pushing the commits.
This commit is contained in:
Aire-One 2024-11-27 01:35:36 +01:00
parent 77ce301c22
commit 820a48dea0
4 changed files with 87 additions and 52 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/lua_modules

View File

@ -1,3 +1,24 @@
# Install the dependencies in the local tree (aka project directory). This is
# useful for development, since we may require a different version of a
# dependency than the one installed in the system.
# awesome-slot is on heavy development, so we need to install the dependencies
# from the local source code.
install:
cd /home/aireone/documents/prog/awesome-slot \
&& luarocks \
--lua-version 5.4 \
make \
--tree /home/aireone/documents/prog/awesomerc/lua_modules
luarocks \
--lua-version 5.4 \
install \
--tree lua_modules \
--only-deps \
awesomerc-dev-1.rockspec
clean:
rm -rf lua_modules
dev:
scripts/run.sh start

View File

@ -17,7 +17,8 @@ startXephyr() {
runAwesome() {
DISPLAY=$display $awesome \
--config $rcfile \
--search $confdir
--search $confdir \
--search ./lua_modules/share/lua/5.4
}
case $1 in

View File

@ -16,71 +16,83 @@ local cairo = lgi.cairo
local slots = {}
function slots.wallpaper(screen)
local screen_geo = screen.geometry
local source = cairo.ImageSurface(cairo.Format.RGB32, screen_geo.width, screen_geo.height)
local cr = cairo.Context(source)
function slots.wallpaper()
return function(screen)
local screen_geo = screen.geometry
local source = cairo.ImageSurface(cairo.Format.RGB32, screen_geo.width, screen_geo.height)
local cr = cairo.Context(source)
-- Load base image
local image_surface = gsurface.load_uncached(beautiful.wallpaper)
local w, h = gsurface.get_size(image_surface)
cr:scale(screen_geo.width / w, screen_geo.height / h)
cr:set_source_surface(image_surface, 0, 0)
cr:paint()
-- Load base image
local image_surface = gsurface.load_uncached(beautiful.wallpaper)
local w, h = gsurface.get_size(image_surface)
cr:scale(screen_geo.width / w, screen_geo.height / h)
cr:set_source_surface(image_surface, 0, 0)
cr:paint()
-- Add color layer
local color_pattern = gcolor.create_linear_pattern {
from = { 0, 0 },
to = { screen.width, screen.height },
stops = {
{ 0, "#26323840" },
},
}
cr:set_source(color_pattern)
cr:paint()
-- Add color layer
local color_pattern = gcolor.create_linear_pattern {
from = { 0, 0 },
to = { screen.width, screen.height },
stops = {
{ 0, "#26323840" },
},
}
cr:set_source(color_pattern)
cr:paint()
awallpaper {
screen = screen,
widget = {
image = source,
widget = imagebox,
},
}
awallpaper {
screen = screen,
widget = {
image = source,
widget = imagebox,
},
}
end
end
function slots.create_tags(screen)
local first_tag = atag.add("home", {
screen = screen,
layout = alayout.suit.tile,
icon = beautiful.icon_hometag,
gap = beautiful.gaps_hometag,
})
function slots.create_tags()
return function(screen)
local first_tag = atag.add("home", {
screen = screen,
layout = alayout.suit.tile,
icon = beautiful.icon_hometag,
gap = beautiful.gaps_hometag,
})
gtimer.delayed_call(function()
first_tag:view_only()
-- spawn(apps.open_terminal(), { screen = screen, tag = first_tag })
end)
gtimer.delayed_call(function()
first_tag:view_only()
-- spawn(apps.open_terminal(), { screen = screen, tag = first_tag })
end)
end
end
function slots.build_desktop_decoration(screen)
desktop_bar(screen)
function slots.build_desktop_decoration()
return function(screen)
desktop_bar(screen)
end
end
function slots.build_titlebars(client)
titlebar(client)
function slots.build_titlebars()
return function(client)
titlebar(client)
end
end
function slots.client_shape(client)
client.shape = nice_shapes.rounded_rect {
tl = beautiful.client_corner_radius_top,
tr = beautiful.client_corner_radius_top,
bl = beautiful.client_corner_radius_bottom,
br = beautiful.client_corner_radius_bottom,
}
function slots.client_shape()
return function(client)
client.shape = nice_shapes.rounded_rect {
tl = beautiful.client_corner_radius_top,
tr = beautiful.client_corner_radius_top,
bl = beautiful.client_corner_radius_bottom,
br = beautiful.client_corner_radius_bottom,
}
end
end
function slots.naughty_display(notification)
naughty.layout.box { notification = notification }
function slots.naughty_display()
return function(notification)
naughty.layout.box { notification = notification }
end
end
return slots