Initial commit

This commit is contained in:
jorraan committed 2021-11-29 19:57:00 +11:00
1 parent ed88af090f
commit 05c9c7fc71
448 files changed
+46802

No files matched your search

+72
View File
@@ -0,0 +1,72 @@
local awful = require('awful')
local beautiful = require('beautiful')
local wibox = require('wibox')
local gears = require('gears')
local dpi = beautiful.xresources.apply_dpi
local icons = require('theme.icons')
local tag_list = require('widget.tag-list')
local clickable_container = require('widget.clickable-container')
return function(s, panel, action_bar_width)
local menu_icon = wibox.widget {
{
id = 'menu_btn',
image = icons.menu,
resize = true,
widget = wibox.widget.imagebox
},
margins = dpi(10),
widget = wibox.container.margin
}
local open_dashboard_button = wibox.widget {
{
menu_icon,
widget = clickable_container
},
bg = beautiful.background .. '66',
widget = wibox.container.background
}
open_dashboard_button:buttons(
gears.table.join(
awful.button(
{},
1,
nil,
function()
panel:toggle()
end
)
)
)
panel:connect_signal(
'opened',
function()
menu_icon.menu_btn:set_image(gears.surface(icons.close_small))
end
)
panel:connect_signal(
'closed',
function()
menu_icon.menu_btn:set_image(gears.surface(icons.menu))
end
)
return wibox.widget {
id = 'action_bar',
layout = wibox.layout.align.vertical,
forced_width = action_bar_width,
{
require('widget.search-apps')(),
tag_list(s),
require("widget.xdg-folders")(),
layout = wibox.layout.fixed.vertical,
},
nil,
open_dashboard_button
}
end
@@ -0,0 +1,47 @@
local wibox = require('wibox')
local gears = require('gears')
local beautiful = require('beautiful')
local dpi = beautiful.xresources.apply_dpi
local hardware_header = wibox.widget {
text = 'Hardware Monitor',
font = 'Inter Regular 12',
align = 'left',
valign = 'center',
widget = wibox.widget.textbox
}
return wibox.widget {
layout = wibox.layout.fixed.vertical,
{
{
hardware_header,
left = dpi(24),
right = dpi(24),
widget = wibox.container.margin
},
bg = beautiful.groups_title_bg,
shape = function(cr, width, height)
gears.shape.partially_rounded_rect(cr, width, height, true, true, false, false, beautiful.groups_radius)
end,
forced_height = dpi(35),
widget = wibox.container.background
},
{
{
layout = wibox.layout.fixed.vertical,
require('widget.cpu-meter'),
require('widget.ram-meter'),
require('widget.temperature-meter'),
require('widget.harddrive-meter')
},
bg = beautiful.groups_bg,
shape = function(cr, width, height)
gears.shape.partially_rounded_rect(cr, width, height, false, false, true, true, beautiful.groups_radius)
end,
widget = wibox.container.background
}
}
@@ -0,0 +1,80 @@
local awful = require('awful')
local wibox = require('wibox')
local gears = require('gears')
local beautiful = require('beautiful')
local dpi = beautiful.xresources.apply_dpi
local clickable_container = require('widget.clickable-container')
local icons = require('theme.icons')
return function(_, panel)
local search_widget = wibox.widget {
{
{
{
image = icons.search,
resize = true,
widget = wibox.widget.imagebox
},
top = dpi(12),
bottom = dpi(12),
widget = wibox.container.margin
},
{
text = 'Global Search',
font = 'Inter Regular 12',
align = 'left',
valign = 'center',
widget = wibox.widget.textbox
},
spacing = dpi(24),
layout = wibox.layout.fixed.horizontal
},
left = dpi(24),
right = dpi(24),
forced_height = dpi(48),
widget = wibox.container.margin
}
search_button = wibox.widget {
{
search_widget,
widget = clickable_container
},
bg = beautiful.groups_bg,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, beautiful.groups_radius)
end,
widget = wibox.container.background
}
search_button:buttons(
awful.util.table.join(
awful.button(
{},
1,
function()
panel:run_rofi()
end
)
)
)
return wibox.widget {
{
{
layout = wibox.layout.fixed.vertical,
spacing = dpi(7),
search_button,
require('layout.left-panel.dashboard.hardware-monitor'),
require('layout.left-panel.dashboard.quick-settings'),
},
nil,
require('widget.end-session')(),
layout = wibox.layout.align.vertical
},
margins = dpi(16),
widget = wibox.container.margin
}
end
@@ -0,0 +1,67 @@
local wibox = require('wibox')
local gears = require('gears')
local beautiful = require('beautiful')
local bar_color = beautiful.groups_bg
local dpi = beautiful.xresources.apply_dpi
local quick_header = wibox.widget {
text = 'Quick Settings',
font = 'Inter Regular 12',
align = 'left',
valign = 'center',
widget = wibox.widget.textbox
}
return wibox.widget {
layout = wibox.layout.fixed.vertical,
spacing = dpi(7),
{
layout = wibox.layout.fixed.vertical,
{
{
quick_header,
left = dpi(24),
right = dpi(24),
widget = wibox.container.margin
},
forced_height = dpi(35),
bg = beautiful.groups_title_bg,
shape = function(cr, width, height)
gears.shape.partially_rounded_rect(cr, width, height, true, true, false, false, beautiful.groups_radius)
end,
widget = wibox.container.background
},
{
layout = wibox.layout.fixed.vertical,
spacing = dpi(7),
{
{
layout = wibox.layout.fixed.vertical,
require('widget.brightness-slider'),
require('widget.volume-slider'),
require('widget.airplane-mode'),
require('widget.bluetooth-toggle'),
require('widget.blue-light')
},
bg = beautiful.groups_bg,
shape = function(cr, width, height)
gears.shape.partially_rounded_rect(cr, width, height, false, false, true, true, beautiful.groups_radius)
end,
widget = wibox.container.background
},
{
{
layout = wibox.layout.fixed.vertical,
require('widget.blur-slider'),
require('widget.blur-toggle')
},
bg = beautiful.groups_bg,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, beautiful.groups_radius)
end,
widget = wibox.container.background
}
}
}
}
+154
View File
@@ -0,0 +1,154 @@
local wibox = require('wibox')
local awful = require('awful')
local gears = require('gears')
local beautiful = require('beautiful')
local dpi = beautiful.xresources.apply_dpi
local apps = require('configuration.apps')
local left_panel = function(screen)
local action_bar_width = dpi(45)
local panel_content_width = dpi(350)
local panel = wibox {
screen = screen,
width = action_bar_width,
type = 'dock',
height = screen.geometry.height,
x = screen.geometry.x,
y = screen.geometry.y,
ontop = true,
shape = gears.shape.rectangle,
bg = beautiful.background,
fg = beautiful.fg_normal
}
panel.opened = false
panel:struts {
left = action_bar_width
}
local backdrop = wibox {
ontop = true,
screen = screen,
bg = beautiful.transparent,
type = 'utility',
x = screen.geometry.x,
y = screen.geometry.y,
width = screen.geometry.width,
height = screen.geometry.height
}
function panel:run_rofi()
awesome.spawn(
apps.default.rofi_global,
false,
false,
false,
false,
function()
panel:toggle()
end
)
-- Hide panel content if rofi global search is opened
panel:get_children_by_id('panel_content')[1].visible = false
end
-- "Punch a hole" on backdrop to show the left dashboard
local update_backdrop = function(wibox_backdrop, wibox_panel)
local cairo = require('lgi').cairo
local geo = wibox_panel.screen.geometry
wibox_backdrop.x = geo.x
wibox_backdrop.y = geo.y
wibox_backdrop.width = geo.width
wibox_backdrop.height = geo.height
-- Create an image surface that is as large as the wibox_panel screen
local shape = cairo.ImageSurface.create(cairo.Format.A1, geo.width, geo.height)
local cr = cairo.Context(shape)
-- Fill with "completely opaque"
cr.operator = 'SOURCE'
cr:set_source_rgba(1, 1, 1, 1)
cr:paint()
-- Remove the shape of the client
local c_geo = wibox_panel:geometry()
local c_shape = gears.surface(wibox_panel.shape_bounding)
cr:set_source_rgba(0, 0, 0, 0)
cr:mask_surface(c_shape, c_geo.x + wibox_panel.border_width - geo.x, c_geo.y + wibox_panel.border_width - geo.y)
c_shape:finish()
wibox_backdrop.shape_bounding = shape._native
shape:finish()
wibox_backdrop:draw()
end
local open_panel = function(should_run_rofi)
panel.width = action_bar_width + panel_content_width
backdrop.visible = true
update_backdrop(backdrop, panel)
panel:get_children_by_id('panel_content')[1].visible = true
if should_run_rofi then
panel:run_rofi()
end
panel:emit_signal('opened')
end
local close_panel = function()
panel.width = action_bar_width
panel:get_children_by_id('panel_content')[1].visible = false
backdrop.visible = false
update_backdrop(backdrop, panel)
panel:emit_signal('closed')
end
-- Hide this panel when app dashboard is called.
function panel:hide_dashboard()
close_panel()
end
function panel:toggle(should_run_rofi)
self.opened = not self.opened
if self.opened then
open_panel(should_run_rofi)
else
close_panel()
end
end
backdrop:buttons(
awful.util.table.join(
awful.button(
{},
1,
function()
panel:toggle()
end
)
)
)
panel:setup {
layout = wibox.layout.align.horizontal,
nil,
{
id = 'panel_content',
bg = beautiful.transparent,
widget = wibox.container.background,
visible = false,
forced_width = panel_content_width,
{
require('layout.left-panel.dashboard')(screen, panel),
layout = wibox.layout.stack
}
},
require('layout.left-panel.action-bar')(screen, panel, action_bar_width)
}
return panel
end
return left_panel