awesome: 9x decorations now use shapes
This commit is contained in:
parent
96161201ec
commit
35b6a53205
6 changed files with 426 additions and 666 deletions
|
@ -8,10 +8,13 @@ local wibox = require("wibox")
|
|||
local menu = require("modules/menu")
|
||||
local utils = require("modules/utils")
|
||||
local vars = require("modules/vars")
|
||||
local win9x = require("modules/win9x")
|
||||
|
||||
local markup = lain.util.markup
|
||||
local modkey = vars.modkey
|
||||
|
||||
beautiful.wibar_height = 28
|
||||
|
||||
-- Create a wibox for each screen and add it
|
||||
local taglist_buttons = gears.table.join(
|
||||
awful.button({}, 1, function(t)
|
||||
|
@ -85,8 +88,20 @@ local function make_bar_icon(icon)
|
|||
return img
|
||||
end
|
||||
|
||||
local function make_inset(child)
|
||||
return {
|
||||
{
|
||||
child,
|
||||
margins = 3,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
shape = win9x.inset,
|
||||
layout = wibox.container.background,
|
||||
}
|
||||
end
|
||||
|
||||
-- Widgets
|
||||
local clock_icon = make_bar_icon("clock")
|
||||
--local clock_icon = make_bar_icon("clock")
|
||||
local uclock = wibox.widget.textclock(markup(beautiful.widget_clock or beautiful.wibar_fg, "(UTC: %H) "), 1, "UTC")
|
||||
local clock = wibox.widget.textclock(markup(beautiful.widget_clock or beautiful.wibar_fg, "%H:%M:%S"), 1)
|
||||
lain.widget.cal({
|
||||
|
@ -185,18 +200,11 @@ awful.widget.watch(
|
|||
|
||||
local packages_icon = make_bar_icon("packages")
|
||||
local packages = wibox.widget.textbox()
|
||||
local packages_wrapper = wibox.widget({
|
||||
{
|
||||
packages_icon,
|
||||
packages,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
})
|
||||
local packages_wrapper = wibox.widget(make_inset({
|
||||
packages_icon,
|
||||
packages,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}))
|
||||
|
||||
awful.widget.watch(
|
||||
'bash -c "xbps-install -Mun | wc -l"',
|
||||
|
@ -205,11 +213,11 @@ awful.widget.watch(
|
|||
local count = tonumber(stdout)
|
||||
if count == 0 then
|
||||
packages_wrapper.visible = false
|
||||
|
||||
widget:set_markup("")
|
||||
else
|
||||
packages_wrapper.visible = true
|
||||
widget:set_markup(markup(beautiful.widget_packages or beautiful.wibar_fg, count .. " pkg" .. (count > 1 and "s" or "")))
|
||||
local str = count .. " pkg" .. (count > 1 and "s" or "")
|
||||
widget:set_markup(markup(beautiful.widget_packages or beautiful.wibar_fg, str))
|
||||
end
|
||||
end,
|
||||
packages
|
||||
|
@ -228,18 +236,11 @@ local net_up = lain.widget.net({
|
|||
|
||||
local music_icon = make_bar_icon("music")
|
||||
local music = wibox.widget.textbox()
|
||||
local music_wrapper = wibox.widget({
|
||||
{
|
||||
music_icon,
|
||||
music,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
})
|
||||
local music_wrapper = wibox.widget(make_inset({
|
||||
music_icon,
|
||||
music,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}))
|
||||
|
||||
awful.widget.watch(
|
||||
'bash -c "~/.config/awesome/scripts/cmus-wrapper.sh"',
|
||||
|
@ -269,7 +270,8 @@ awful.widget.watch(
|
|||
local artist = stdout:match("tag artist (.-)\n"):gsub("^%s*(.-)%s*$", "%1")
|
||||
local title = stdout:match("tag title (.-)\n"):gsub("^%s*(.-)%s*$", "%1")
|
||||
|
||||
nowplaying = artist .. " - " .. title .. " [" .. utils.format_time(position) .. "/" .. utils.format_time(duration) .. "]"
|
||||
nowplaying = artist .. " - " .. title
|
||||
nowplaying = nowplaying .. " [" .. utils.format_time(position) .. "/" .. utils.format_time(duration) .. "]"
|
||||
end
|
||||
|
||||
if status == "paused" then
|
||||
|
@ -283,6 +285,31 @@ awful.widget.watch(
|
|||
music
|
||||
)
|
||||
|
||||
local start = wibox.widget({
|
||||
{
|
||||
{
|
||||
wibox.widget.imagebox(beautiful.awesome_icon),
|
||||
--wibox.widget.textbox("Start"),
|
||||
spacing = 2,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
margins = 2,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
shape = win9x.button,
|
||||
layout = wibox.container.background,
|
||||
})
|
||||
start:buttons(gears.table.join(
|
||||
awful.button({}, 1, function()
|
||||
menu.mainmenu:toggle()
|
||||
--[[if menu.mainmenu.wibox.visible then
|
||||
start.shape = win9x.inset_button
|
||||
else
|
||||
start.shape = win9x.button
|
||||
end--]]
|
||||
end)
|
||||
))
|
||||
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
-- Wallpaper
|
||||
utils.set_wallpaper(s)
|
||||
|
@ -307,31 +334,41 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
|
||||
-- Create a tasklist widget
|
||||
s.__tasklist = awful.widget.tasklist({
|
||||
screen = s,
|
||||
filter = awful.widget.tasklist.filter.currenttags,
|
||||
screen = s,
|
||||
filter = awful.widget.tasklist.filter.currenttags,
|
||||
buttons = tasklist_buttons,
|
||||
layout = {
|
||||
spacing = 3,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
widget_template = {
|
||||
{
|
||||
{
|
||||
{
|
||||
id = "icon_role",
|
||||
widget = wibox.widget.imagebox,
|
||||
{
|
||||
{
|
||||
id = "icon_role",
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
margins = 1,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
id = "text_role",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
spacing = 4,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
margins = 2,
|
||||
widget = wibox.container.margin,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
id = "text_role",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
left = 2,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
id = "background_role",
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
id = "background_role",
|
||||
widget = wibox.container.background,
|
||||
width = 160,
|
||||
strategy = "max",
|
||||
layout = wibox.container.constraint,
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -343,143 +380,115 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
|
||||
-- Add widgets to the wibox
|
||||
s.__bar:setup({
|
||||
layout = wibox.layout.align.horizontal,
|
||||
|
||||
-- Left widgets
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
menu.launcher,
|
||||
s.__taglist,
|
||||
{
|
||||
s.__layoutbox,
|
||||
margins = 2,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
s.__promptbox,
|
||||
},
|
||||
-- Left widgets
|
||||
{
|
||||
start,
|
||||
make_inset(s.__taglist),
|
||||
make_inset(s.__layoutbox),
|
||||
--[[{
|
||||
s.__layoutbox,
|
||||
margins = 2,
|
||||
layout = wibox.container.margin,
|
||||
},--]]
|
||||
s.__promptbox,
|
||||
spacing = 4,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
|
||||
-- Middle widgets
|
||||
s.__tasklist,
|
||||
-- Middle widgets
|
||||
s.__tasklist,
|
||||
|
||||
-- Right widgets
|
||||
{
|
||||
music_wrapper,
|
||||
{
|
||||
-- Right widgets
|
||||
{
|
||||
cpu_icon,
|
||||
cpu.widget,
|
||||
music_wrapper,
|
||||
make_inset({
|
||||
{
|
||||
cpu_icon,
|
||||
cpu.widget,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
{
|
||||
cpu_temp_icon,
|
||||
cpu_temp,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
spacing = 2,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}),
|
||||
make_inset({
|
||||
{
|
||||
gpu_icon,
|
||||
gpu,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
{
|
||||
gpu_temp_icon,
|
||||
gpu_temp,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
spacing = 2,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}),
|
||||
make_inset({
|
||||
memory_icon,
|
||||
memory.widget,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}),
|
||||
--[[
|
||||
{
|
||||
{
|
||||
net_down_icon,
|
||||
net_down,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
net_up_icon,
|
||||
net_up.widget,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},--]]
|
||||
packages_wrapper,
|
||||
make_inset({
|
||||
wibox.widget.systray(true),
|
||||
{
|
||||
{
|
||||
uclock,
|
||||
clock,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
left = 3,
|
||||
right = 3,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
spacing = 2,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}),
|
||||
spacing = 4,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
cpu_temp_icon,
|
||||
cpu_temp,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
gpu_icon,
|
||||
gpu,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
gpu_temp_icon,
|
||||
gpu_temp,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
memory_icon,
|
||||
memory.widget,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
--[[{
|
||||
{
|
||||
net_down_icon,
|
||||
net_down,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
left = 2,
|
||||
right = 2,
|
||||
bottom = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
net_up_icon,
|
||||
net_up.widget,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},--]]
|
||||
packages_wrapper,
|
||||
--[[{
|
||||
{
|
||||
volume_icon,
|
||||
volume.widget,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},--]]
|
||||
{
|
||||
{
|
||||
clock_icon,
|
||||
uclock,
|
||||
clock,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 4,
|
||||
right = 4,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
wibox.widget.systray(),
|
||||
margins = 2,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
})
|
||||
shape = win9x.taskbar,
|
||||
layout = wibox.container.background,
|
||||
})
|
||||
end)
|
||||
|
|
|
@ -27,8 +27,6 @@ end
|
|||
theme.menu_height = 16
|
||||
theme.menu_width = 128
|
||||
|
||||
theme.wibar_height = 20
|
||||
|
||||
theme = beautiful.theme_assets.recolor_titlebar(theme, theme.win9x_buttons_unfocus or theme.win9x_unfocus, "normal")
|
||||
theme = beautiful.theme_assets.recolor_titlebar(theme, theme.win9x_buttons or theme.fg_focus, "focus")
|
||||
theme = beautiful.theme_assets.recolor_layout(theme, theme.layout_fg)
|
||||
|
|
|
@ -4,487 +4,64 @@ local beautiful = require("beautiful")
|
|||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
local win9x_l = {
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_bright,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_bright,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "vertical",
|
||||
thickness = 2,
|
||||
forced_width = 2,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_width = 4,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
local win9x_r = {
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "vertical",
|
||||
thickness = 2,
|
||||
forced_width = 2,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_dark,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_dark,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_width = 4,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
local win9x_bl = {
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_bright,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
{
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_bright,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "vertical",
|
||||
thickness = 2,
|
||||
forced_width = 2,
|
||||
forced_height = 2,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 2,
|
||||
forced_width = 3,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_dark,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 3,
|
||||
forced_width = 3,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
forced_height = 3,
|
||||
forced_width = 4,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_dark,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 4,
|
||||
forced_width = 4,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
local win9x_b = {
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "horizontal",
|
||||
thickness = 2,
|
||||
forced_height = 2,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_dark,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_dark,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 4,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
local win9x_br = {
|
||||
{
|
||||
{
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "vertical",
|
||||
thickness = 2,
|
||||
forced_width = 2,
|
||||
forced_height = 2,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_dark,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 2,
|
||||
forced_width = 3,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_dark,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 3,
|
||||
forced_width = 3,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_dark,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 3,
|
||||
forced_width = 4,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_dark,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 4,
|
||||
forced_width = 4,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
local win9x_tl = {
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_bright,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_bright,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_bright,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_bright,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "vertical",
|
||||
thickness = 2,
|
||||
forced_width = 2,
|
||||
forced_height = 2,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 2,
|
||||
forced_width = 3,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
forced_height = 3,
|
||||
forced_width = 3,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
forced_height = 3,
|
||||
forced_width = 4,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
forced_height = 4,
|
||||
forced_width = 4,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
local win9x_t = {
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_bright,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_bright,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "horizontal",
|
||||
thickness = 2,
|
||||
forced_height = 2,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 4,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
local win9x_tr = {
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_bright,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
{
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_bright,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "vertical",
|
||||
thickness = 2,
|
||||
forced_width = 2,
|
||||
forced_height = 2,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 3,
|
||||
forced_width = 2,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_dark,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 3,
|
||||
forced_width = 3,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
forced_height = 4,
|
||||
forced_width = 3,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_dark,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 4,
|
||||
forced_width = 4,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
local win9x_div = {
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "horizontal",
|
||||
thickness = 2,
|
||||
forced_height = 2,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 2,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
local win9x_btn = {
|
||||
{
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_bright,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_bright,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_bright,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_bright,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "horizontal",
|
||||
thickness = 10,
|
||||
forced_height = 10,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 11,
|
||||
forced_width = 12,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_dark,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 11,
|
||||
forced_width = 14,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_dark,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 13,
|
||||
forced_width = 14,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_dark,
|
||||
orientation = "vertical",
|
||||
thickness = 1,
|
||||
forced_width = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 13,
|
||||
forced_width = 16,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_outer_dark,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 14,
|
||||
forced_width = 16,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
forced_height = 16,
|
||||
forced_width = 16,
|
||||
top = 1,
|
||||
bottom = 1,
|
||||
layout = wibox.container.margin,
|
||||
}
|
||||
local win9x = require("modules/win9x")
|
||||
|
||||
local function make_win9x_button(child)
|
||||
return {
|
||||
win9x_btn,
|
||||
{
|
||||
{
|
||||
wibox.widget({}),
|
||||
shape = win9x.button,
|
||||
layout = wibox.container.background,
|
||||
},
|
||||
top = 1,
|
||||
bottom = 1,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
child,
|
||||
layout = wibox.layout.stack,
|
||||
}
|
||||
end
|
||||
|
||||
-- serentiy uses 19px tall titlebars :(
|
||||
--[[local _lines = {}
|
||||
for i = 1, 8 do
|
||||
_lines[#_lines + 1] = wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_dark,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
})
|
||||
_lines[#_lines + 1] = wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = "#00000000",
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
})
|
||||
end
|
||||
_lines[#_lines + 1] = wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_dark,
|
||||
orientation = "horizontal",
|
||||
thickness = 1,
|
||||
forced_height = 1,
|
||||
border_width = 0,
|
||||
})
|
||||
_lines.layout = wibox.layout.fixed.vertical
|
||||
|
||||
local serenity_lines = {
|
||||
_lines,
|
||||
top = 2,
|
||||
left = 2,
|
||||
bottom = 2,
|
||||
right = 0,
|
||||
layout = wibox.container.margin,
|
||||
}--]]
|
||||
|
||||
-- Add a titlebar if titlebars_enabled is set to true in the rules.
|
||||
client.connect_signal("request::titlebars", function(c)
|
||||
-- buttons for the titlebar
|
||||
|
@ -504,13 +81,21 @@ client.connect_signal("request::titlebars", function(c)
|
|||
size = 4,
|
||||
bg_normal = "#00000000",
|
||||
bg_focus = "#00000000",
|
||||
}):setup(win9x_l)
|
||||
}):setup({
|
||||
wibox.widget({}),
|
||||
shape = win9x.border.left,
|
||||
layout = wibox.container.background,
|
||||
})
|
||||
awful.titlebar(c, {
|
||||
position = "right",
|
||||
size = 4,
|
||||
bg_normal = "#00000000",
|
||||
bg_focus = "#00000000",
|
||||
}):setup(win9x_r)
|
||||
}):setup({
|
||||
wibox.widget({}),
|
||||
shape = win9x.border.right,
|
||||
layout = wibox.container.background,
|
||||
})
|
||||
|
||||
awful.titlebar(c, {
|
||||
position = "bottom",
|
||||
|
@ -518,10 +103,9 @@ client.connect_signal("request::titlebars", function(c)
|
|||
bg_normal = "#00000000",
|
||||
bg_focus = "#00000000",
|
||||
}):setup({
|
||||
win9x_bl,
|
||||
win9x_b,
|
||||
win9x_br,
|
||||
layout = wibox.layout.align.horizontal,
|
||||
wibox.widget({}),
|
||||
shape = win9x.border.bottom,
|
||||
layout = wibox.container.background,
|
||||
})
|
||||
|
||||
local titlebar = awful.titlebar(c, {
|
||||
|
@ -534,14 +118,18 @@ client.connect_signal("request::titlebars", function(c)
|
|||
|
||||
titlebar:setup({
|
||||
{
|
||||
win9x_tl,
|
||||
win9x_t,
|
||||
win9x_tr,
|
||||
wibox.widget({}),
|
||||
forced_height = 4,
|
||||
layout = wibox.layout.align.horizontal,
|
||||
shape = win9x.border.top,
|
||||
layout = wibox.container.background,
|
||||
},
|
||||
{
|
||||
win9x_l,
|
||||
{
|
||||
wibox.widget({}),
|
||||
forced_width = 4,
|
||||
shape = win9x.border.left,
|
||||
layout = wibox.container.background,
|
||||
},
|
||||
{
|
||||
{
|
||||
{ -- Left
|
||||
|
@ -562,6 +150,7 @@ client.connect_signal("request::titlebars", function(c)
|
|||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
{ -- Middle
|
||||
--serenity_lines,
|
||||
buttons = buttons,
|
||||
layout = wibox.layout.flex.horizontal
|
||||
},
|
||||
|
@ -591,10 +180,26 @@ client.connect_signal("request::titlebars", function(c)
|
|||
forced_height = 18,
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
win9x_div,
|
||||
{
|
||||
wibox.widget({
|
||||
widget = wibox.widget.separator,
|
||||
color = beautiful.win9x_main,
|
||||
orientation = "horizontal",
|
||||
thickness = 2,
|
||||
forced_height = 2,
|
||||
border_width = 0,
|
||||
}),
|
||||
forced_height = 2,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
layout = wibox.layout.align.vertical,
|
||||
},
|
||||
win9x_r,
|
||||
{
|
||||
wibox.widget({}),
|
||||
forced_width = 4,
|
||||
shape = win9x.border.right,
|
||||
layout = wibox.container.background,
|
||||
},
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
layout = wibox.layout.align.vertical,
|
||||
|
|
146
linux/.config/awesome/modules/win9x.lua
Normal file
146
linux/.config/awesome/modules/win9x.lua
Normal file
|
@ -0,0 +1,146 @@
|
|||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
|
||||
local function button(cr, width, height)
|
||||
cr:set_source(gears.color(beautiful.win9x_main))
|
||||
cr:rectangle(0, 0, width, height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_bright))
|
||||
cr:rectangle(0, 0, width - 1, 1)
|
||||
cr:rectangle(0, 1, 1, height - 1)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_outer))
|
||||
cr:rectangle(0, height - 1, width, 1)
|
||||
cr:rectangle(width - 1, 0, 1, height - 1)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_dark))
|
||||
cr:rectangle(1, height - 2, width - 2, 1)
|
||||
cr:rectangle(width - 2, 1, 1, height - 2)
|
||||
cr:fill()
|
||||
end
|
||||
local function inset(cr, width, height)
|
||||
cr:set_source(gears.color(beautiful.win9x_main))
|
||||
cr:rectangle(0, 0, width, height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_outer))
|
||||
cr:rectangle(0, 0, width - 1, 1)
|
||||
cr:rectangle(0, 1, 1, height - 1)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_bright))
|
||||
cr:rectangle(0, height - 1, width, 1)
|
||||
cr:rectangle(width - 1, 0, 1, height - 1)
|
||||
cr:fill()
|
||||
end
|
||||
local function inset_button(cr, width, height)
|
||||
cr:set_source(gears.color(beautiful.win9x_bright))
|
||||
cr:rectangle(0, 0, width, height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_outer))
|
||||
cr:rectangle(0, 0, width - 1, 1)
|
||||
cr:rectangle(0, 1, 1, height - 1)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_bright))
|
||||
cr:rectangle(0, height - 1, width, 1)
|
||||
cr:rectangle(width - 1, 0, 1, height - 1)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_main))
|
||||
cr:rectangle(1, height - 2, width - 2, 1)
|
||||
cr:rectangle(width - 2, 1, 1, height - 2)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_dark))
|
||||
cr:rectangle(1, 1, width - 2, 1)
|
||||
cr:rectangle(1, 2, 1, height - 4)
|
||||
cr:fill()
|
||||
end
|
||||
|
||||
local function border_left(cr, width, height)
|
||||
cr:set_source(gears.color(beautiful.win9x_main))
|
||||
cr:rectangle(0, 0, width, height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_bright))
|
||||
cr:rectangle(1, 0, 1, height)
|
||||
cr:fill()
|
||||
end
|
||||
local function border_right(cr, width, height)
|
||||
cr:set_source(gears.color(beautiful.win9x_main))
|
||||
cr:rectangle(0, 0, width, height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_dark))
|
||||
cr:rectangle(width - 2, 0, 1, height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_outer))
|
||||
cr:rectangle(width - 1, 0, 1, height)
|
||||
cr:fill()
|
||||
end
|
||||
local function border_bottom(cr, width, height)
|
||||
cr:set_source(gears.color(beautiful.win9x_main))
|
||||
cr:rectangle(0, 0, width, height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_bright))
|
||||
cr:rectangle(1, 0, 1, height - 1)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_dark))
|
||||
cr:rectangle(width - 2, 0, 1, height - 2)
|
||||
cr:rectangle(1, height - 2, width - 2, 1)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_outer))
|
||||
cr:rectangle(0, height - 1, width, 1)
|
||||
cr:rectangle(width - 1, 0, 1, height - 1)
|
||||
cr:fill()
|
||||
end
|
||||
local function border_top(cr, width, height)
|
||||
cr:set_source(gears.color(beautiful.win9x_main))
|
||||
cr:rectangle(0, 0, width, height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_bright))
|
||||
cr:rectangle(1, 1, width - 2, 1)
|
||||
cr:rectangle(1, 2, 1, height - 2)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_dark))
|
||||
cr:rectangle(width - 2, 2, 1, height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_outer))
|
||||
cr:rectangle(width - 1, 0, 1, height)
|
||||
cr:fill()
|
||||
end
|
||||
|
||||
local function taskbar(cr, width, height)
|
||||
cr:set_source(gears.color(beautiful.win9x_main))
|
||||
cr:rectangle(0, 0, width, height)
|
||||
cr:fill()
|
||||
|
||||
cr:set_source(gears.color(beautiful.win9x_bright))
|
||||
cr:rectangle(0, height - 2, width, 1)
|
||||
cr:fill()
|
||||
end
|
||||
|
||||
return {
|
||||
button = button,
|
||||
inset = inset,
|
||||
inset_button = inset_button,
|
||||
border = {
|
||||
left = border_left,
|
||||
right = border_right,
|
||||
bottom = border_bottom,
|
||||
top = border_top,
|
||||
},
|
||||
taskbar = taskbar,
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
return function(colors)
|
||||
local theme_assets = require("beautiful.theme_assets")
|
||||
local win9x = require("modules/win9x")
|
||||
|
||||
local gfs = require("gears.filesystem")
|
||||
local themes_path = gfs.get_themes_dir()
|
||||
|
@ -51,6 +52,9 @@ return function(colors)
|
|||
theme.tasklist_fg_focus = colors.color5
|
||||
theme.tasklist_fg_urgent = colors.color1
|
||||
|
||||
theme.tasklist_shape = win9x.button
|
||||
theme.tasklist_shape_focus = win9x.inset_button
|
||||
|
||||
theme.wibar_bg = colors.background
|
||||
theme.wibar_fg = colors.foreground
|
||||
|
||||
|
@ -102,7 +106,7 @@ return function(colors)
|
|||
|
||||
-- Generate Awesome icon:
|
||||
theme.awesome_icon = theme_assets.awesome_icon(
|
||||
16, colors.background, colors.accent
|
||||
16, colors.background, colors.accent
|
||||
)
|
||||
|
||||
-- You can add as many variables as
|
||||
|
@ -113,10 +117,9 @@ return function(colors)
|
|||
theme.win9x_main = colors.background
|
||||
theme.win9x_bright = colors.color8
|
||||
theme.win9x_dark = colors.secondary
|
||||
theme.win9x_outer_bright = colors.background
|
||||
theme.win9x_outer_dark = colors.tertiary
|
||||
theme.win9x_outer = colors.tertiary
|
||||
theme.win9x_focus = colors.accent
|
||||
theme.win9x_unfocus = colors.color8
|
||||
|
||||
return theme
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,8 +31,7 @@ local theme = dofile(vars.env.THEME_DIR .. "/_base.lua")(colors)
|
|||
theme.win9x_main = colors.background
|
||||
theme.win9x_bright = "#ffffff"
|
||||
theme.win9x_dark = colors.secondary
|
||||
theme.win9x_outer_bright = colors.background
|
||||
theme.win9x_outer_dark = colors.tertiary
|
||||
theme.win9x_outer = colors.tertiary
|
||||
theme.win9x_focus = colors.accent
|
||||
theme.win9x_unfocus = colors.color8
|
||||
theme.win9x_buttons = "#000000"
|
||||
|
|
Loading…
Reference in a new issue