awesome: 9x decorations now use shapes

This commit is contained in:
Cynthia Foxwell 2022-12-22 14:41:13 -07:00
parent 96161201ec
commit 35b6a53205
6 changed files with 426 additions and 666 deletions

View File

@ -8,10 +8,13 @@ local wibox = require("wibox")
local menu = require("modules/menu") local menu = require("modules/menu")
local utils = require("modules/utils") local utils = require("modules/utils")
local vars = require("modules/vars") local vars = require("modules/vars")
local win9x = require("modules/win9x")
local markup = lain.util.markup local markup = lain.util.markup
local modkey = vars.modkey local modkey = vars.modkey
beautiful.wibar_height = 28
-- Create a wibox for each screen and add it -- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join( local taglist_buttons = gears.table.join(
awful.button({}, 1, function(t) awful.button({}, 1, function(t)
@ -85,8 +88,20 @@ local function make_bar_icon(icon)
return img return img
end end
local function make_inset(child)
return {
{
child,
margins = 3,
layout = wibox.container.margin,
},
shape = win9x.inset,
layout = wibox.container.background,
}
end
-- Widgets -- 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 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) local clock = wibox.widget.textclock(markup(beautiful.widget_clock or beautiful.wibar_fg, "%H:%M:%S"), 1)
lain.widget.cal({ lain.widget.cal({
@ -185,18 +200,11 @@ awful.widget.watch(
local packages_icon = make_bar_icon("packages") local packages_icon = make_bar_icon("packages")
local packages = wibox.widget.textbox() local packages = wibox.widget.textbox()
local packages_wrapper = wibox.widget({ local packages_wrapper = wibox.widget(make_inset({
{ packages_icon,
packages_icon, packages,
packages, layout = wibox.layout.fixed.horizontal,
layout = wibox.layout.fixed.horizontal, }))
},
top = 2,
bottom = 2,
left = 4,
right = 4,
layout = wibox.container.margin,
})
awful.widget.watch( awful.widget.watch(
'bash -c "xbps-install -Mun | wc -l"', 'bash -c "xbps-install -Mun | wc -l"',
@ -205,11 +213,11 @@ awful.widget.watch(
local count = tonumber(stdout) local count = tonumber(stdout)
if count == 0 then if count == 0 then
packages_wrapper.visible = false packages_wrapper.visible = false
widget:set_markup("") widget:set_markup("")
else else
packages_wrapper.visible = true 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
end, end,
packages packages
@ -228,18 +236,11 @@ local net_up = lain.widget.net({
local music_icon = make_bar_icon("music") local music_icon = make_bar_icon("music")
local music = wibox.widget.textbox() local music = wibox.widget.textbox()
local music_wrapper = wibox.widget({ local music_wrapper = wibox.widget(make_inset({
{ music_icon,
music_icon, music,
music, layout = wibox.layout.fixed.horizontal,
layout = wibox.layout.fixed.horizontal, }))
},
top = 2,
bottom = 2,
left = 4,
right = 4,
layout = wibox.container.margin,
})
awful.widget.watch( awful.widget.watch(
'bash -c "~/.config/awesome/scripts/cmus-wrapper.sh"', '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 artist = stdout:match("tag artist (.-)\n"):gsub("^%s*(.-)%s*$", "%1")
local title = stdout:match("tag title (.-)\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 end
if status == "paused" then if status == "paused" then
@ -283,6 +285,31 @@ awful.widget.watch(
music 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) awful.screen.connect_for_each_screen(function(s)
-- Wallpaper -- Wallpaper
utils.set_wallpaper(s) utils.set_wallpaper(s)
@ -307,31 +334,41 @@ awful.screen.connect_for_each_screen(function(s)
-- Create a tasklist widget -- Create a tasklist widget
s.__tasklist = awful.widget.tasklist({ s.__tasklist = awful.widget.tasklist({
screen = s, screen = s,
filter = awful.widget.tasklist.filter.currenttags, filter = awful.widget.tasklist.filter.currenttags,
buttons = tasklist_buttons, buttons = tasklist_buttons,
layout = {
spacing = 3,
layout = wibox.layout.fixed.horizontal,
},
widget_template = { 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, margins = 2,
widget = wibox.container.margin, layout = wibox.container.margin,
}, },
{ id = "background_role",
{ widget = wibox.container.background,
id = "text_role",
widget = wibox.widget.textbox,
},
left = 2,
widget = wibox.container.margin,
},
layout = wibox.layout.fixed.horizontal
}, },
id = "background_role", width = 160,
widget = wibox.container.background, strategy = "max",
layout = wibox.container.constraint,
}, },
}) })
@ -343,143 +380,115 @@ awful.screen.connect_for_each_screen(function(s)
-- Add widgets to the wibox -- Add widgets to the wibox
s.__bar:setup({ s.__bar:setup({
layout = wibox.layout.align.horizontal,
-- Left widgets
{ {
layout = wibox.layout.fixed.horizontal,
menu.launcher,
s.__taglist,
{ {
s.__layoutbox, -- Left widgets
margins = 2, {
layout = wibox.container.margin, start,
}, make_inset(s.__taglist),
s.__promptbox, make_inset(s.__layoutbox),
}, --[[{
s.__layoutbox,
margins = 2,
layout = wibox.container.margin,
},--]]
s.__promptbox,
spacing = 4,
layout = wibox.layout.fixed.horizontal,
},
-- Middle widgets -- Middle widgets
s.__tasklist, s.__tasklist,
-- Right widgets -- Right widgets
{
music_wrapper,
{
{ {
cpu_icon, music_wrapper,
cpu.widget, 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, layout = wibox.layout.fixed.horizontal,
}, },
top = 2, layout = wibox.layout.align.horizontal,
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,
}, },
top = 2, top = 2,
bottom = 2, left = 2,
left = 4, right = 2,
right = 4, bottom = 4,
layout = wibox.container.margin, layout = wibox.container.margin,
}, },
{ shape = win9x.taskbar,
{ layout = wibox.container.background,
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,
},
})
end) end)

View File

@ -27,8 +27,6 @@ end
theme.menu_height = 16 theme.menu_height = 16
theme.menu_width = 128 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_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_titlebar(theme, theme.win9x_buttons or theme.fg_focus, "focus")
theme = beautiful.theme_assets.recolor_layout(theme, theme.layout_fg) theme = beautiful.theme_assets.recolor_layout(theme, theme.layout_fg)

View File

@ -4,487 +4,64 @@ local beautiful = require("beautiful")
local gears = require("gears") local gears = require("gears")
local wibox = require("wibox") local wibox = require("wibox")
local win9x_l = { local win9x = require("modules/win9x")
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 function make_win9x_button(child) local function make_win9x_button(child)
return { return {
win9x_btn, {
{
wibox.widget({}),
shape = win9x.button,
layout = wibox.container.background,
},
top = 1,
bottom = 1,
layout = wibox.container.margin,
},
child, child,
layout = wibox.layout.stack, layout = wibox.layout.stack,
} }
end 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. -- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c) client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar -- buttons for the titlebar
@ -504,13 +81,21 @@ client.connect_signal("request::titlebars", function(c)
size = 4, size = 4,
bg_normal = "#00000000", bg_normal = "#00000000",
bg_focus = "#00000000", bg_focus = "#00000000",
}):setup(win9x_l) }):setup({
wibox.widget({}),
shape = win9x.border.left,
layout = wibox.container.background,
})
awful.titlebar(c, { awful.titlebar(c, {
position = "right", position = "right",
size = 4, size = 4,
bg_normal = "#00000000", bg_normal = "#00000000",
bg_focus = "#00000000", bg_focus = "#00000000",
}):setup(win9x_r) }):setup({
wibox.widget({}),
shape = win9x.border.right,
layout = wibox.container.background,
})
awful.titlebar(c, { awful.titlebar(c, {
position = "bottom", position = "bottom",
@ -518,10 +103,9 @@ client.connect_signal("request::titlebars", function(c)
bg_normal = "#00000000", bg_normal = "#00000000",
bg_focus = "#00000000", bg_focus = "#00000000",
}):setup({ }):setup({
win9x_bl, wibox.widget({}),
win9x_b, shape = win9x.border.bottom,
win9x_br, layout = wibox.container.background,
layout = wibox.layout.align.horizontal,
}) })
local titlebar = awful.titlebar(c, { local titlebar = awful.titlebar(c, {
@ -534,14 +118,18 @@ client.connect_signal("request::titlebars", function(c)
titlebar:setup({ titlebar:setup({
{ {
win9x_tl, wibox.widget({}),
win9x_t,
win9x_tr,
forced_height = 4, 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 { -- Left
@ -562,6 +150,7 @@ client.connect_signal("request::titlebars", function(c)
layout = wibox.layout.fixed.horizontal layout = wibox.layout.fixed.horizontal
}, },
{ -- Middle { -- Middle
--serenity_lines,
buttons = buttons, buttons = buttons,
layout = wibox.layout.flex.horizontal layout = wibox.layout.flex.horizontal
}, },
@ -591,10 +180,26 @@ client.connect_signal("request::titlebars", function(c)
forced_height = 18, forced_height = 18,
layout = wibox.layout.align.horizontal, 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, 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.horizontal,
}, },
layout = wibox.layout.align.vertical, layout = wibox.layout.align.vertical,

View 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,
}

View File

@ -1,5 +1,6 @@
return function(colors) return function(colors)
local theme_assets = require("beautiful.theme_assets") local theme_assets = require("beautiful.theme_assets")
local win9x = require("modules/win9x")
local gfs = require("gears.filesystem") local gfs = require("gears.filesystem")
local themes_path = gfs.get_themes_dir() local themes_path = gfs.get_themes_dir()
@ -51,6 +52,9 @@ return function(colors)
theme.tasklist_fg_focus = colors.color5 theme.tasklist_fg_focus = colors.color5
theme.tasklist_fg_urgent = colors.color1 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_bg = colors.background
theme.wibar_fg = colors.foreground theme.wibar_fg = colors.foreground
@ -102,7 +106,7 @@ return function(colors)
-- Generate Awesome icon: -- Generate Awesome icon:
theme.awesome_icon = theme_assets.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 -- You can add as many variables as
@ -113,10 +117,9 @@ return function(colors)
theme.win9x_main = colors.background theme.win9x_main = colors.background
theme.win9x_bright = colors.color8 theme.win9x_bright = colors.color8
theme.win9x_dark = colors.secondary theme.win9x_dark = colors.secondary
theme.win9x_outer_bright = colors.background theme.win9x_outer = colors.tertiary
theme.win9x_outer_dark = colors.tertiary
theme.win9x_focus = colors.accent theme.win9x_focus = colors.accent
theme.win9x_unfocus = colors.color8 theme.win9x_unfocus = colors.color8
return theme return theme
end end

View File

@ -31,8 +31,7 @@ local theme = dofile(vars.env.THEME_DIR .. "/_base.lua")(colors)
theme.win9x_main = colors.background theme.win9x_main = colors.background
theme.win9x_bright = "#ffffff" theme.win9x_bright = "#ffffff"
theme.win9x_dark = colors.secondary theme.win9x_dark = colors.secondary
theme.win9x_outer_bright = colors.background theme.win9x_outer = colors.tertiary
theme.win9x_outer_dark = colors.tertiary
theme.win9x_focus = colors.accent theme.win9x_focus = colors.accent
theme.win9x_unfocus = colors.color8 theme.win9x_unfocus = colors.color8
theme.win9x_buttons = "#000000" theme.win9x_buttons = "#000000"