Initial Commit
This commit is contained in:
37
layout/bottom-bar.lua
Normal file
37
layout/bottom-bar.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
local beautiful = require('beautiful')
|
||||
local wibox = require('wibox')
|
||||
local TaskList = require('widget.task-list')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
local BottomBar = function(s, offset)
|
||||
|
||||
-- BOTTOM BAR
|
||||
-- =======
|
||||
local panel_height = dpi(16)
|
||||
local panel = wibox({
|
||||
ontop = false,
|
||||
screen = s,
|
||||
height = panel_height,
|
||||
width = s.geometry.width,
|
||||
x = s.geometry.x,
|
||||
y = s.geometry.height - panel_height,
|
||||
stretch = false,
|
||||
bg = beautiful.primary.hue_100,
|
||||
fg = beautiful.fg_normal,
|
||||
})
|
||||
|
||||
panel:struts({
|
||||
bottom = panel.height
|
||||
})
|
||||
|
||||
panel:setup{
|
||||
layout = wibox.layout.align.horizontal,
|
||||
nil,
|
||||
TaskList(s),
|
||||
nil,
|
||||
}
|
||||
|
||||
return panel
|
||||
end
|
||||
|
||||
return BottomBar
|
44
layout/init.lua
Normal file
44
layout/init.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
local awful = require('awful')
|
||||
local top_bar = require('layout.top-bar')
|
||||
local bottom_bar = require('layout.bottom-bar')
|
||||
local left_panel = require('layout.left-panel')
|
||||
|
||||
local key_grabber
|
||||
|
||||
-- Create a wibox for each screen and add it
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
if s.index == 1 then
|
||||
s.top_bar = top_bar(s, true)
|
||||
s.bottom_bar = bottom_bar(s, true)
|
||||
else
|
||||
s.top_bar = top_bar(s, false)
|
||||
s.bottom_bar = bottom_bar(s, false)
|
||||
end
|
||||
end)
|
||||
|
||||
-- Hide bars when app go fullscreen
|
||||
function updateBarsVisibility()
|
||||
for s in screen do
|
||||
if s.selected_tag then
|
||||
local fullscreen = s.selected_tag.fullscreenMode
|
||||
s.top_bar.visible = not fullscreen
|
||||
s.bottom_bar.visible = not fullscreen
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
_G.tag.connect_signal('property::selected', function(t)
|
||||
updateBarsVisibility()
|
||||
end)
|
||||
|
||||
_G.client.connect_signal('property::fullscreen', function(c)
|
||||
c.screen.selected_tag.fullscreenMode = c.fullscreen
|
||||
updateBarsVisibility()
|
||||
end)
|
||||
|
||||
_G.client.connect_signal('unmanage', function(c)
|
||||
if c.fullscreen then
|
||||
c.screen.selected_tag.fullscreenMode = false
|
||||
updateBarsVisibility()
|
||||
end
|
||||
end)
|
34
layout/left-panel/action-bar.lua
Normal file
34
layout/left-panel/action-bar.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
local awful = require('awful')
|
||||
local beautiful = require('beautiful')
|
||||
local wibox = require('wibox')
|
||||
local gears = require('gears')
|
||||
local mat_icon = require('widget.material.icon')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
local icons = require('theme.icons')
|
||||
local clickable_container = require('widget.material.clickable-container')
|
||||
|
||||
return function(screen, panel, action_bar_width)
|
||||
local menu_icon = wibox.widget {
|
||||
icon = icons.menu,
|
||||
size = dpi(16),
|
||||
widget = mat_icon
|
||||
}
|
||||
|
||||
local home_button = wibox.widget {
|
||||
wibox.widget {menu_icon, widget = clickable_container},
|
||||
visible = true,
|
||||
bg = beautiful.primary.hue_700,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
home_button:buttons(gears.table.join(
|
||||
awful.button({}, 1, nil,
|
||||
function() _G.dashboard_show() end)))
|
||||
|
||||
return wibox.widget {
|
||||
id = 'action_bar',
|
||||
layout = wibox.layout.align.horizontal,
|
||||
forced_width = action_bar_width,
|
||||
{layout = wibox.layout.fixed.horizontal, home_button}
|
||||
}
|
||||
end
|
18
layout/left-panel/dashboard/hardware-monitor.lua
Normal file
18
layout/left-panel/dashboard/hardware-monitor.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
local wibox = require('wibox')
|
||||
local mat_list_item = require('widget.material.list-item')
|
||||
|
||||
return wibox.widget {
|
||||
-- wibox.widget {
|
||||
-- wibox.widget {
|
||||
-- text = 'Hardware monitor',
|
||||
-- font = 'Roboto medium 12',
|
||||
-- widget = wibox.widget.textbox
|
||||
-- },
|
||||
-- widget = mat_list_item
|
||||
-- },
|
||||
require('widget.cpu.cpu-meter'),
|
||||
require('widget.ram.ram-meter'),
|
||||
require('widget.temperature.temperature-meter'),
|
||||
require('widget.harddrive.harddrive-meter'),
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
71
layout/left-panel/dashboard/init.lua
Normal file
71
layout/left-panel/dashboard/init.lua
Normal file
@@ -0,0 +1,71 @@
|
||||
local awful = require('awful')
|
||||
local beautiful = require('beautiful')
|
||||
local wibox = require('wibox')
|
||||
local mat_list_item = require('widget.material.list-item')
|
||||
local mat_icon = require('widget.material.icon')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
local icons = require('theme.icons')
|
||||
|
||||
return function(_, panel)
|
||||
local search_button = wibox.widget {
|
||||
wibox.widget {icon = icons.search, size = dpi(24), widget = mat_icon},
|
||||
wibox.widget {
|
||||
text = 'Search Applications',
|
||||
font = 'Roboto medium 13',
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
clickable = true,
|
||||
widget = mat_list_item
|
||||
}
|
||||
|
||||
search_button:buttons(awful.util.table.join(
|
||||
awful.button({}, 1,
|
||||
function() panel:run_rofi() end)))
|
||||
|
||||
local exit_button = wibox.widget {
|
||||
wibox.widget {icon = icons.logout, size = dpi(24), widget = mat_icon},
|
||||
wibox.widget {
|
||||
text = 'End work session',
|
||||
font = 'Roboto medium 13',
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
clickable = true,
|
||||
divider = true,
|
||||
widget = mat_list_item
|
||||
}
|
||||
|
||||
exit_button:buttons(awful.util.table.join(
|
||||
awful.button({}, 1, function()
|
||||
panel:toggle()
|
||||
_G.exit_screen_show()
|
||||
end)))
|
||||
|
||||
return wibox.widget {
|
||||
layout = wibox.layout.align.vertical,
|
||||
{
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
{
|
||||
search_button,
|
||||
bg = beautiful.primary.hue_800,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
wibox.widget {
|
||||
orientation = 'horizontal',
|
||||
forced_height = 0.8,
|
||||
opacity = 0.3,
|
||||
widget = wibox.widget.separator
|
||||
},
|
||||
require('layout.left-panel.dashboard.quick-settings'),
|
||||
require('layout.left-panel.dashboard.hardware-monitor')
|
||||
},
|
||||
nil,
|
||||
{
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
{
|
||||
exit_button,
|
||||
bg = beautiful.primary.hue_800,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
16
layout/left-panel/dashboard/quick-settings.lua
Normal file
16
layout/left-panel/dashboard/quick-settings.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
local wibox = require('wibox')
|
||||
local mat_list_item = require('widget.material.list-item')
|
||||
|
||||
return wibox.widget {
|
||||
-- wibox.widget {
|
||||
-- wibox.widget {
|
||||
-- text = 'Quick settings',
|
||||
-- font = 'Roboto medium 12',
|
||||
-- widget = wibox.widget.textbox
|
||||
-- },
|
||||
-- widget = mat_list_item
|
||||
-- },
|
||||
require('widget.volume.volume-slider'),
|
||||
require('widget.brightness.brightness-slider'),
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
98
layout/left-panel/init.lua
Normal file
98
layout/left-panel/init.lua
Normal file
@@ -0,0 +1,98 @@
|
||||
local awful = require('awful')
|
||||
local beautiful = require('beautiful')
|
||||
local wibox = require('wibox')
|
||||
local apps = require('configuration.apps')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
local left_panel = function(screen)
|
||||
local action_bar_width = dpi(32)
|
||||
local panel_content_width = dpi(400)
|
||||
local offsety = dpi(12)
|
||||
|
||||
local panel = wibox {
|
||||
screen = screen,
|
||||
width = dpi(32),
|
||||
height = dpi(32),
|
||||
x = screen.geometry.x + 12,
|
||||
y = screen.geometry.y + offsety,
|
||||
ontop = false,
|
||||
bg = beautiful.primary.hue_900,
|
||||
fg = beautiful.fg_normal
|
||||
}
|
||||
|
||||
panel.opened = false
|
||||
|
||||
panel:struts({left = dpi(0), top = dpi(48)})
|
||||
|
||||
local backdrop = wibox {
|
||||
ontop = true,
|
||||
screen = screen,
|
||||
bg = '#00000000',
|
||||
type = 'dock',
|
||||
x = screen.geometry.x,
|
||||
y = screen.geometry.y + offsety,
|
||||
width = screen.geometry.width,
|
||||
height = screen.geometry.height
|
||||
}
|
||||
|
||||
function panel:run_rofi()
|
||||
_G.awesome.spawn(apps.default.rofi, false, false, false, false,
|
||||
function() panel:toggle() end)
|
||||
end
|
||||
|
||||
local openPanel = function(should_run_rofi)
|
||||
panel.width = panel_content_width
|
||||
panel.height = screen.geometry.height
|
||||
backdrop.visible = true
|
||||
panel.visible = false
|
||||
panel.visible = true
|
||||
panel.x = screen.geometry.x
|
||||
panel.y = screen.geometry.y
|
||||
panel.ontop = true
|
||||
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 closePanel = function()
|
||||
panel.width = action_bar_width
|
||||
panel.height = dpi(32)
|
||||
panel:get_children_by_id('panel_content')[1].visible = false
|
||||
backdrop.visible = false
|
||||
panel.ontop = false
|
||||
panel.x = screen.geometry.x + 12
|
||||
panel.y = screen.geometry.y + offsety
|
||||
panel:emit_signal('closed')
|
||||
end
|
||||
|
||||
function panel:toggle(should_run_rofi)
|
||||
self.opened = not self.opened
|
||||
if self.opened then
|
||||
openPanel(should_run_rofi)
|
||||
else
|
||||
closePanel()
|
||||
end
|
||||
end
|
||||
|
||||
backdrop:buttons(awful.util.table.join(
|
||||
awful.button({}, 1, function() panel:toggle() end)))
|
||||
|
||||
panel:setup{
|
||||
require('layout.left-panel.action-bar')(screen, panel, action_bar_width),
|
||||
layout = wibox.layout.align.vertical,
|
||||
{
|
||||
id = 'panel_content',
|
||||
bg = beautiful.primary.hue_900,
|
||||
widget = wibox.container.background,
|
||||
visible = false,
|
||||
forced_width = panel_content_width,
|
||||
{
|
||||
require('layout.left-panel.dashboard')(screen, panel),
|
||||
layout = wibox.layout.stack
|
||||
}
|
||||
}
|
||||
}
|
||||
return panel
|
||||
end
|
||||
|
||||
return left_panel
|
165
layout/top-bar.lua
Normal file
165
layout/top-bar.lua
Normal file
@@ -0,0 +1,165 @@
|
||||
local awful = require('awful')
|
||||
local beautiful = require('beautiful')
|
||||
local clickable_container = require('widget.material.clickable-container')
|
||||
local mat_icon_button = require('widget.material.icon-button')
|
||||
local wibox = require('wibox')
|
||||
local TagList = require('widget.tag-list')
|
||||
local gears = require('gears')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
local theme = require "theme"
|
||||
local table = awful.util.table or gears.table
|
||||
|
||||
local separator = wibox.container.margin(wibox.widget {
|
||||
orientation = 'vertical',
|
||||
forced_width = dpi(1),
|
||||
opacity = 0.3,
|
||||
widget = wibox.widget.separator
|
||||
}, dpi(0), dpi(0), dpi(4), dpi(4))
|
||||
|
||||
local TopBar = function(s, offset)
|
||||
|
||||
-- LAYOUT BOX
|
||||
-- ==========
|
||||
local function update_txt_layoutbox(s)
|
||||
-- Writes a string representation of the current layout in a textbox widget
|
||||
local txt_l = theme["layout_txt_" .. awful.layout.getname(awful.layout.get(s))] or ""
|
||||
s.layoutbox:set_text(txt_l)
|
||||
end
|
||||
|
||||
s.layoutbox = wibox.widget.textbox(theme["layout_txt_" .. awful.layout.getname(awful.layout.get(s))])
|
||||
s.layoutbox.font = beautiful.icon_font
|
||||
awful.tag.attached_connect_signal(s, "property::selected", function () update_txt_layoutbox(s) end)
|
||||
awful.tag.attached_connect_signal(s, "property::layout", function () update_txt_layoutbox(s) end)
|
||||
s.layoutbox:buttons(table.join(
|
||||
awful.button({}, 1, function() awful.layout.inc(1) end),
|
||||
awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
|
||||
awful.button({}, 3, function() awful.layout.inc(-1) end),
|
||||
awful.button({}, 4, function() awful.layout.inc(1) end),
|
||||
awful.button({}, 5, function() awful.layout.inc(-1) end)))
|
||||
|
||||
-- SYSTEM TRAY
|
||||
-- ===========
|
||||
local systray = wibox.widget.systray()
|
||||
systray:set_horizontal(true)
|
||||
|
||||
-- SYSTEM DETAILS
|
||||
-- ==============
|
||||
local volume_widget = require('widget.volume')
|
||||
local battery_widget = require('widget.battery')
|
||||
local clock_widget = require('widget.clock')
|
||||
local mem_widget = require('widget.memory')
|
||||
local cpu_widget = require('widget.cpu')
|
||||
local temprature_widget = require('widget.temprature')
|
||||
local storage_widget = require('widget.storage')
|
||||
local system_details = wibox.widget {
|
||||
systray,
|
||||
separator,
|
||||
battery,
|
||||
--separator,
|
||||
wibox.widget{
|
||||
wibox.widget{
|
||||
text = 'mem',
|
||||
font = beautiful.icon_font,
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
fg = beautiful.accent.hue_600,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
mem_widget,
|
||||
separator,
|
||||
wibox.widget{
|
||||
wibox.widget{
|
||||
text = 'cpu',
|
||||
font = beautiful.icon_font,
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
fg = beautiful.accent.hue_500,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
cpu_widget,
|
||||
separator,
|
||||
wibox.widget{
|
||||
wibox.widget{
|
||||
text = 'temp',
|
||||
font = beautiful.icon_font,
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
fg = beautiful.accent.hue_400,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
temprature_widget,
|
||||
separator,
|
||||
wibox.widget{
|
||||
wibox.widget{
|
||||
text = 'disk',
|
||||
font = beautiful.icon_font,
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
fg = beautiful.accent.hue_200,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
storage_widget,
|
||||
separator,
|
||||
wibox.widget{
|
||||
wibox.widget{
|
||||
text = 'vol',
|
||||
font = beautiful.icon_font,
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
fg = beautiful.accent.hue_500,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
volume_widget,
|
||||
separator,
|
||||
wibox.widget{
|
||||
wibox.widget{
|
||||
text = 'date',
|
||||
font = beautiful.icon_font,
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
fg = beautiful.accent.hue_400,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
clock_widget,
|
||||
wibox.widget{
|
||||
s.layoutbox,
|
||||
fg = beautiful.primary.hue_100,
|
||||
bg = beautiful.accent.hue_200,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
spacing = dpi(4),
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
|
||||
local calendar = require('widget.calendar')
|
||||
calendar:attach(clock_widget)
|
||||
|
||||
-- TOP BAR
|
||||
-- =======
|
||||
local panel = wibox({
|
||||
ontop = false,
|
||||
screen = s,
|
||||
height = dpi(20),
|
||||
width = s.geometry.width,
|
||||
x = s.geometry.x,
|
||||
y = s.geometry.y,
|
||||
stretch = false,
|
||||
bg = beautiful.primary.hue_100,
|
||||
fg = beautiful.fg_normal,
|
||||
})
|
||||
|
||||
panel:struts({
|
||||
top = panel.height - panel.y
|
||||
})
|
||||
|
||||
panel:setup{
|
||||
layout = wibox.layout.align.horizontal,
|
||||
TagList(s),
|
||||
nil,
|
||||
system_details,
|
||||
}
|
||||
|
||||
return panel
|
||||
end
|
||||
|
||||
return TopBar
|
Reference in New Issue
Block a user