moved to personal fennel config for awesome and added qutebrowser
This commit is contained in:
parent
403cb92b7d
commit
688748f8a6
502 changed files with 8576 additions and 9597 deletions
72
awes2/layout/init.lua
Normal file
72
awes2/layout/init.lua
Normal file
|
@ -0,0 +1,72 @@
|
|||
local awful = require('awful')
|
||||
local left_panel = require('layout.left-panel')
|
||||
local top_panel = require('layout.top-panel')
|
||||
local right_panel = require('layout.right-panel')
|
||||
|
||||
-- Create a wibox panel for each screen and add it
|
||||
screen.connect_signal("request::desktop_decoration", function(s)
|
||||
|
||||
if s.index == 1 then
|
||||
-- Create the left_panel
|
||||
s.left_panel = left_panel(s)
|
||||
-- Create the Top bar
|
||||
s.top_panel = top_panel(s, true)
|
||||
else
|
||||
-- Create the Top bar
|
||||
s.top_panel = top_panel(s, false)
|
||||
end
|
||||
s.right_panel = right_panel(s)
|
||||
s.right_panel_show_again = false
|
||||
end)
|
||||
|
||||
|
||||
-- Hide bars when app go fullscreen
|
||||
function updateBarsVisibility()
|
||||
for s in screen do
|
||||
focused = awful.screen.focused()
|
||||
if s.selected_tag then
|
||||
local fullscreen = s.selected_tag.fullscreenMode
|
||||
-- Order matter here for shadow
|
||||
s.top_panel.visible = not fullscreen
|
||||
if s.left_panel then
|
||||
s.left_panel.visible = not fullscreen
|
||||
end
|
||||
if s.right_panel then
|
||||
if fullscreen and focused.right_panel.visible then
|
||||
focused.right_panel:toggle()
|
||||
focused.right_panel_show_again = true
|
||||
elseif not fullscreen and not focused.right_panel.visible and focused.right_panel_show_again then
|
||||
focused.right_panel:toggle()
|
||||
focused.right_panel_show_again = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
tag.connect_signal(
|
||||
'property::selected',
|
||||
function(t)
|
||||
updateBarsVisibility()
|
||||
end
|
||||
)
|
||||
|
||||
client.connect_signal(
|
||||
'property::fullscreen',
|
||||
function(c)
|
||||
if c.first_tag then
|
||||
c.first_tag.fullscreenMode = c.fullscreen
|
||||
end
|
||||
updateBarsVisibility()
|
||||
end
|
||||
)
|
||||
|
||||
client.connect_signal(
|
||||
'unmanage',
|
||||
function(c)
|
||||
if c.fullscreen then
|
||||
c.screen.selected_tag.fullscreenMode = false
|
||||
updateBarsVisibility()
|
||||
end
|
||||
end
|
||||
)
|
74
awes2/layout/left-panel/action-bar.lua
Executable file
74
awes2/layout/left-panel/action-bar.lua
Executable file
|
@ -0,0 +1,74 @@
|
|||
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 home_button = wibox.widget {
|
||||
{
|
||||
menu_icon,
|
||||
widget = clickable_container
|
||||
},
|
||||
bg = beautiful.background .. '66',
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
home_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,
|
||||
home_button
|
||||
}
|
||||
end
|
72
awes2/layout/left-panel/dashboard/hardware-monitor.lua
Normal file
72
awes2/layout/left-panel/dashboard/hardware-monitor.lua
Normal file
|
@ -0,0 +1,72 @@
|
|||
local wibox = require('wibox')
|
||||
local gears = require('gears')
|
||||
local beautiful = require('beautiful')
|
||||
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
local hardware_header = wibox.widget
|
||||
{
|
||||
|
||||
text = 'Hardware Monitor',
|
||||
font = 'SF Pro Text 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
|
||||
|
||||
},
|
||||
{
|
||||
require('widget.cpu.cpu-meter'),
|
||||
bg = beautiful.groups_bg,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(cr, width, height, false, false, false, false, beautiful.groups_radius)
|
||||
end,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
},
|
||||
{
|
||||
require('widget.ram.ram-meter'),
|
||||
bg = beautiful.groups_bg,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(cr, width, height, false, false, false, false, beautiful.groups_radius)
|
||||
end,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
},
|
||||
{
|
||||
require('widget.temperature.temperature-meter'),
|
||||
bg = beautiful.groups_bg,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(cr, width, height, false, false, false, false, beautiful.groups_radius)
|
||||
end,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
|
||||
},
|
||||
{
|
||||
require('widget.harddrive.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,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
},
|
||||
}
|
137
awes2/layout/left-panel/dashboard/init.lua
Normal file
137
awes2/layout/left-panel/dashboard/init.lua
Normal file
|
@ -0,0 +1,137 @@
|
|||
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 = 'SF Pro Text 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
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
local exit_widget = {
|
||||
{
|
||||
{
|
||||
{
|
||||
image = icons.logout,
|
||||
resize = true,
|
||||
widget = wibox.widget.imagebox
|
||||
},
|
||||
top = dpi(12),
|
||||
bottom = dpi(12),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
{
|
||||
text = 'End work session',
|
||||
font = 'SF Pro Text 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
|
||||
}
|
||||
|
||||
exit_button = wibox.widget {
|
||||
{
|
||||
exit_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
|
||||
}
|
||||
|
||||
|
||||
exit_button:buttons(
|
||||
awful.util.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
function()
|
||||
panel:toggle()
|
||||
awesome.emit_signal("module::exit_screen_show")
|
||||
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,
|
||||
exit_button,
|
||||
layout = wibox.layout.align.vertical
|
||||
},
|
||||
margins = dpi(16),
|
||||
widget = wibox.container.margin
|
||||
|
||||
}
|
||||
end
|
105
awes2/layout/left-panel/dashboard/quick-settings.lua
Normal file
105
awes2/layout/left-panel/dashboard/quick-settings.lua
Normal file
|
@ -0,0 +1,105 @@
|
|||
local wibox = require('wibox')
|
||||
local gears = require('gears')
|
||||
local beautiful = require('beautiful')
|
||||
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
local bar_color = beautiful.groups_bg
|
||||
|
||||
local quick_header = wibox.widget
|
||||
{
|
||||
|
||||
text = 'Quick Settings',
|
||||
font = 'SF Pro Text 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
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
require('widget.brightness.brightness-slider'),
|
||||
bg = bar_color,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(cr, width, height, false, false, false, false, beautiful.groups_radius) end,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
|
||||
},
|
||||
{
|
||||
require('widget.volume.volume-slider'),
|
||||
bg = bar_color,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(cr, width, height, false, false, false, false, beautiful.groups_radius) end,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
require('widget.network.network-toggle'),
|
||||
bg = bar_color,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(cr, width, height, false, false, false, false, beautiful.groups_radius) end,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
},
|
||||
|
||||
{
|
||||
require('widget.bluetooth.bluetooth-toggle'),
|
||||
bg = bar_color,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(cr, width, height, false, false, false, false, beautiful.groups_radius) end,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
},
|
||||
{
|
||||
require('widget.blue-light'),
|
||||
bg = bar_color,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(cr, width, height, false, false, true, true, beautiful.groups_radius) end,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
}
|
||||
},
|
||||
{
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
{
|
||||
require('widget.window-effects.blur-toggle'),
|
||||
bg = bar_color,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(cr, width, height, true, true, false, false, beautiful.groups_radius) end,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
},
|
||||
{
|
||||
require('widget.window-effects.blur-strength-slider'),
|
||||
bg = bar_color,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(cr, width, height, false, false, true, true, beautiful.groups_radius) end,
|
||||
forced_height = dpi(48),
|
||||
widget = wibox.container.background
|
||||
}
|
||||
}
|
||||
}
|
124
awes2/layout/left-panel/init.lua
Normal file
124
awes2/layout/left-panel/init.lua
Normal file
|
@ -0,0 +1,124 @@
|
|||
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(45)
|
||||
local panel_content_width = dpi(350)
|
||||
|
||||
local panel =
|
||||
wibox {
|
||||
screen = screen,
|
||||
width = action_bar_width,
|
||||
type = 'dock',
|
||||
height = screen.geometry.height - 500,
|
||||
x = screen.geometry.x,
|
||||
y = screen.geometry.y + 250,
|
||||
ontop = false,
|
||||
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()
|
||||
_G.awesome.spawn(
|
||||
apps.default.rofiglobal,
|
||||
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
|
||||
|
||||
local openPanel = function(should_run_rofi)
|
||||
panel.width = action_bar_width + panel_content_width
|
||||
backdrop.visible = true
|
||||
panel.visible = false
|
||||
panel.visible = 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:get_children_by_id('panel_content')[1].visible = false
|
||||
backdrop.visible = false
|
||||
panel:emit_signal('closed')
|
||||
end
|
||||
|
||||
-- Hide this panel when app dashboard is called.
|
||||
function panel:HideDashboard()
|
||||
closePanel()
|
||||
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 {
|
||||
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
|
111
awes2/layout/right-panel/icons/notification.svg
Normal file
111
awes2/layout/right-panel/icons/notification.svg
Normal file
|
@ -0,0 +1,111 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
id="Capa_1"
|
||||
enable-background="new 0 0 374.706 374.706"
|
||||
height="240"
|
||||
viewBox="0 0 175.64344 175.64344"
|
||||
width="240"
|
||||
class=""
|
||||
version="1.1"
|
||||
sodipodi:docname="notification.svg"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
||||
<metadata
|
||||
id="metadata16">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs14" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1321"
|
||||
inkscape:window-height="740"
|
||||
id="namedview12"
|
||||
showgrid="false"
|
||||
inkscape:pagecheckerboard="true"
|
||||
inkscape:zoom="0.4609375"
|
||||
inkscape:cx="256"
|
||||
inkscape:cy="256"
|
||||
inkscape:window-x="45"
|
||||
inkscape:window-y="28"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="Capa_1" />
|
||||
<g
|
||||
id="g9"
|
||||
transform="matrix(0.38752239,0,0,0.38752239,14.249432,12.505775)">
|
||||
<path
|
||||
id="path-1_59_"
|
||||
d="m 80.294,53.529 h 294.412 v 53.529 H 80.294 Z"
|
||||
transform="translate(4,3)"
|
||||
data-original="#000000"
|
||||
class="active-path"
|
||||
data-old_color="#000000"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<path
|
||||
d="m 80.294,160.588 h 267.647 v 53.529 H 80.294 Z"
|
||||
data-original="#000000"
|
||||
class="active-path"
|
||||
data-old_color="#000000"
|
||||
id="path3"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<path
|
||||
id="path-1_58_"
|
||||
d="m 80.294,267.647 h 294.412 v 53.529 H 80.294 Z"
|
||||
transform="translate(4,11)"
|
||||
data-original="#000000"
|
||||
class="active-path"
|
||||
data-old_color="#000000"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<path
|
||||
id="path-2_11_"
|
||||
d="m 0,53.529 h 53.529 v 53.529 H 0 Z"
|
||||
transform="translate(1,3)"
|
||||
data-original="#000000"
|
||||
class="active-path"
|
||||
data-old_color="#000000"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<path
|
||||
id="path-2_10_"
|
||||
d="m 0,160.588 h 53.529 v 53.529 H 0 Z"
|
||||
transform="translate(1,7)"
|
||||
data-original="#000000"
|
||||
class="active-path"
|
||||
data-old_color="#000000"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<path
|
||||
id="path-2_9_"
|
||||
d="m 0,267.647 h 53.529 v 53.529 H 0 Z"
|
||||
transform="translate(1,11)"
|
||||
data-original="#000000"
|
||||
class="active-path"
|
||||
data-old_color="#000000"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.3 KiB |
175
awes2/layout/right-panel/init.lua
Normal file
175
awes2/layout/right-panel/init.lua
Normal file
|
@ -0,0 +1,175 @@
|
|||
local awful = require('awful')
|
||||
local wibox = require('wibox')
|
||||
local beautiful = require('beautiful')
|
||||
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
panel_visible = false
|
||||
|
||||
local right_panel = function(s)
|
||||
|
||||
-- Set right panel geometry
|
||||
local panel_width = dpi(350)
|
||||
local panel_x = s.geometry.x + s.geometry.width - panel_width
|
||||
|
||||
local panel = wibox {
|
||||
ontop = true,
|
||||
screen = s,
|
||||
type = 'dock',
|
||||
width = panel_width,
|
||||
height = s.geometry.height,
|
||||
x = panel_x,
|
||||
y = s.geometry.y,
|
||||
bg = beautiful.background,
|
||||
fg = beautiful.fg_normal
|
||||
}
|
||||
|
||||
panel.opened = false
|
||||
|
||||
s.backdrop_rdb = wibox
|
||||
{
|
||||
ontop = true,
|
||||
screen = s,
|
||||
bg = beautiful.transparent,
|
||||
type = 'utility',
|
||||
x = s.geometry.x,
|
||||
y = s.geometry.y,
|
||||
width = s.geometry.width,
|
||||
height = s.geometry.height
|
||||
}
|
||||
|
||||
panel:struts
|
||||
{
|
||||
right = 0
|
||||
}
|
||||
|
||||
open_panel = function()
|
||||
local focused = awful.screen.focused()
|
||||
panel_visible = true
|
||||
|
||||
focused.backdrop_rdb.visible = true
|
||||
focused.right_panel.visible = true
|
||||
|
||||
panel:emit_signal('opened')
|
||||
end
|
||||
|
||||
close_panel = function()
|
||||
local focused = awful.screen.focused()
|
||||
panel_visible = false
|
||||
|
||||
focused.right_panel.visible = false
|
||||
focused.backdrop_rdb.visible = false
|
||||
|
||||
panel:emit_signal('closed')
|
||||
end
|
||||
|
||||
-- Hide this panel when app dashboard is called.
|
||||
function panel:HideDashboard()
|
||||
close_panel()
|
||||
end
|
||||
|
||||
function panel:toggle()
|
||||
self.opened = not self.opened
|
||||
if self.opened then
|
||||
open_panel()
|
||||
else
|
||||
close_panel()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function panel:switch_pane(mode)
|
||||
if mode == 'notif_mode' then
|
||||
-- Update Content
|
||||
panel:get_children_by_id('notif_id')[1].visible = true
|
||||
panel:get_children_by_id('pane_id')[1].visible = false
|
||||
elseif mode == 'today_mode' then
|
||||
-- Update Content
|
||||
panel:get_children_by_id('notif_id')[1].visible = false
|
||||
panel:get_children_by_id('pane_id')[1].visible = true
|
||||
end
|
||||
end
|
||||
|
||||
s.backdrop_rdb:buttons(
|
||||
awful.util.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
function()
|
||||
panel:toggle()
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
local separator = wibox.widget {
|
||||
orientation = 'horizontal',
|
||||
opacity = 0.0,
|
||||
forced_height = 15,
|
||||
widget = wibox.widget.separator,
|
||||
}
|
||||
|
||||
local line_separator = wibox.widget {
|
||||
orientation = 'horizontal',
|
||||
forced_height = dpi(1),
|
||||
span_ratio = 1.0,
|
||||
color = beautiful.groups_title_bg,
|
||||
widget = wibox.widget.separator
|
||||
}
|
||||
|
||||
panel : setup {
|
||||
{
|
||||
expand = 'none',
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
{
|
||||
layout = wibox.layout.align.horizontal,
|
||||
expand = 'none',
|
||||
nil,
|
||||
require('layout.right-panel.panel-mode-switcher'),
|
||||
nil
|
||||
},
|
||||
separator,
|
||||
line_separator,
|
||||
separator,
|
||||
{
|
||||
layout = wibox.layout.stack,
|
||||
-- Today Pane
|
||||
{
|
||||
id = 'pane_id',
|
||||
visible = true,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
{
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
spacing = dpi(7),
|
||||
require('widget.user-profile'),
|
||||
require('widget.weather'),
|
||||
require('widget.email'),
|
||||
require('widget.social-media'),
|
||||
require('widget.calculator')
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
-- Notification Center
|
||||
{
|
||||
id = 'notif_id',
|
||||
visible = false,
|
||||
require('widget.notif-center')(s),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
margins = dpi(16),
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
|
||||
|
||||
return panel
|
||||
end
|
||||
|
||||
|
||||
return right_panel
|
||||
|
||||
|
135
awes2/layout/right-panel/panel-mode-switcher.lua
Normal file
135
awes2/layout/right-panel/panel-mode-switcher.lua
Normal file
|
@ -0,0 +1,135 @@
|
|||
local awful = require('awful')
|
||||
local wibox = require('wibox')
|
||||
local gears = require('gears')
|
||||
local beautiful = require('beautiful')
|
||||
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
local clickable_container = require('widget.clickable-container')
|
||||
|
||||
-- Variable used for switching panel modes
|
||||
right_panel_mode = 'today_mode'
|
||||
|
||||
local active_button = beautiful.groups_title_bg
|
||||
local inactive_button = beautiful.transparent
|
||||
|
||||
local notif_text = wibox.widget
|
||||
{
|
||||
text = 'Notifications',
|
||||
font = 'SF Pro Text Bold 11',
|
||||
align = 'center',
|
||||
valign = 'center',
|
||||
widget = wibox.widget.textbox
|
||||
}
|
||||
|
||||
local notif_button = clickable_container(
|
||||
wibox.container.margin(
|
||||
notif_text, dpi(0), dpi(0), dpi(7), dpi(7)
|
||||
)
|
||||
)
|
||||
|
||||
local wrap_notif = wibox.widget {
|
||||
notif_button,
|
||||
forced_width = dpi(140),
|
||||
bg = inactive_button,
|
||||
border_width = dpi(1),
|
||||
border_color = beautiful.groups_title_bg,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(
|
||||
cr, width, height, false, true, true, false, beautiful.groups_radius
|
||||
)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
|
||||
local today_text = wibox.widget
|
||||
{
|
||||
text = 'Today',
|
||||
font = 'SF Pro Text Bold 11',
|
||||
align = 'center',
|
||||
valign = 'center',
|
||||
widget = wibox.widget.textbox
|
||||
}
|
||||
|
||||
local today_button = clickable_container(
|
||||
wibox.container.margin(
|
||||
today_text, dpi(0), dpi(0), dpi(7), dpi(7)
|
||||
)
|
||||
)
|
||||
|
||||
local wrap_today = wibox.widget {
|
||||
today_button,
|
||||
forced_width = dpi(140),
|
||||
bg = active_button,
|
||||
border_width = dpi(1),
|
||||
border_color = beautiful.groups_title_bg,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(
|
||||
cr, width, height, true, false, false, true, beautiful.groups_radius
|
||||
)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local switcher = wibox.widget {
|
||||
expand = 'none',
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
wrap_today,
|
||||
wrap_notif
|
||||
}
|
||||
|
||||
|
||||
function switch_rdb_pane(right_panel_mode)
|
||||
|
||||
local focused = awful.screen.focused()
|
||||
|
||||
if right_panel_mode == 'notif_mode' then
|
||||
|
||||
-- Update button color
|
||||
wrap_notif.bg = active_button
|
||||
wrap_today.bg = inactive_button
|
||||
|
||||
-- Change panel content of right-panel.lua
|
||||
focused.right_panel:switch_pane(right_panel_mode)
|
||||
|
||||
elseif right_panel_mode == 'today_mode' then
|
||||
|
||||
-- Update button color
|
||||
wrap_notif.bg = inactive_button
|
||||
wrap_today.bg = active_button
|
||||
|
||||
-- Change panel content of right-panel.lua
|
||||
focused.right_panel:switch_pane(right_panel_mode)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
notif_button:buttons(
|
||||
gears.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
nil,
|
||||
function()
|
||||
switch_rdb_pane('notif_mode')
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
today_button:buttons(
|
||||
gears.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
nil,
|
||||
function()
|
||||
switch_rdb_pane('today_mode')
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
return switcher
|
62
awes2/layout/right-panel/right-panel-opener.lua
Normal file
62
awes2/layout/right-panel/right-panel-opener.lua
Normal file
|
@ -0,0 +1,62 @@
|
|||
local awful = require('awful')
|
||||
local wibox = require('wibox')
|
||||
local gears = require('gears')
|
||||
local beautiful = require('beautiful')
|
||||
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
local clickable_container = require('widget.clickable-container')
|
||||
|
||||
local config_dir = gears.filesystem.get_configuration_dir()
|
||||
local widget_icon_dir = config_dir .. 'layout/right-panel/icons/'
|
||||
|
||||
|
||||
-- ▄▄▄▄▄ ▄ ▄
|
||||
-- █ █ ▄ ▄ ▄▄█▄▄ ▄▄█▄▄ ▄▄▄ ▄ ▄▄
|
||||
-- █▄▄▄▄▀ █ █ █ █ █▀ ▀█ █▀ █
|
||||
-- █ █ █ █ █ █ █ █ █ █
|
||||
-- █▄▄▄▄▀ ▀▄▄▀█ ▀▄▄ ▀▄▄ ▀█▄█▀ █ █
|
||||
|
||||
|
||||
-- The button in top panel
|
||||
|
||||
local return_button = function()
|
||||
|
||||
local widget =
|
||||
wibox.widget {
|
||||
{
|
||||
id = 'icon',
|
||||
image = widget_icon_dir .. 'notification' .. '.svg',
|
||||
widget = wibox.widget.imagebox,
|
||||
resize = true
|
||||
},
|
||||
layout = wibox.layout.align.horizontal
|
||||
}
|
||||
|
||||
local widget_button = wibox.widget {
|
||||
{
|
||||
widget,
|
||||
margins = dpi(7),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
widget = clickable_container
|
||||
}
|
||||
|
||||
widget_button:buttons(
|
||||
gears.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
nil,
|
||||
function()
|
||||
awful.screen.focused().right_panel:toggle()
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
return widget_button
|
||||
|
||||
end
|
||||
|
||||
|
||||
return return_button
|
336
awes2/layout/top-panel.lua
Executable file
336
awes2/layout/top-panel.lua
Executable file
|
@ -0,0 +1,336 @@
|
|||
local awful = require('awful')
|
||||
local beautiful = require('beautiful')
|
||||
local wibox = require('wibox')
|
||||
local gears = require('gears')
|
||||
|
||||
local icons = require('theme.icons')
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
local clickable_container = require('widget.clickable-container')
|
||||
local task_list = require('widget.task-list')
|
||||
|
||||
|
||||
|
||||
local TopPanel = function(s, offset)
|
||||
|
||||
local offsetx = 0
|
||||
if offset == true then
|
||||
offsetx = dpi(45)
|
||||
end
|
||||
|
||||
local panel = wibox
|
||||
{
|
||||
ontop = true,
|
||||
screen = s,
|
||||
type = 'dock',
|
||||
height = dpi(28),
|
||||
width = s.geometry.width - offsetx,
|
||||
x = s.geometry.x + offsetx,
|
||||
y = s.geometry.y,
|
||||
stretch = false,
|
||||
bg = beautiful.background,
|
||||
fg = beautiful.fg_normal
|
||||
}
|
||||
|
||||
|
||||
panel:struts
|
||||
{
|
||||
top = dpi(28)
|
||||
}
|
||||
|
||||
|
||||
panel:connect_signal(
|
||||
'mouse::enter',
|
||||
function()
|
||||
local w = mouse.current_wibox
|
||||
if w then
|
||||
w.cursor = 'left_ptr'
|
||||
end
|
||||
end
|
||||
|
||||
)
|
||||
|
||||
|
||||
s.add_button = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
{
|
||||
image = icons.plus,
|
||||
resize = true,
|
||||
widget = wibox.widget.imagebox
|
||||
},
|
||||
margins = dpi(4),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
widget = clickable_container
|
||||
},
|
||||
bg = beautiful.transparent,
|
||||
shape = gears.shape.circle,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
margins = dpi(4),
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
|
||||
s.add_button:buttons(
|
||||
gears.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
nil,
|
||||
function()
|
||||
awful.spawn(
|
||||
awful.screen.focused().selected_tag.default_app,
|
||||
{
|
||||
tag = mouse.screen.selected_tag,
|
||||
placement = awful.placement.bottom_right
|
||||
}
|
||||
)
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
local layout_box = function(s)
|
||||
local layoutbox = wibox.widget {
|
||||
{
|
||||
awful.widget.layoutbox(s),
|
||||
margins = dpi(7),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
widget = clickable_container
|
||||
}
|
||||
layoutbox:buttons(
|
||||
awful.util.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
function()
|
||||
awful.layout.inc(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
|
||||
)
|
||||
)
|
||||
)
|
||||
return layoutbox
|
||||
end
|
||||
|
||||
|
||||
s.clock_widget = wibox.widget.textclock(
|
||||
'<span font="SF Pro Text Bold 11">%l:%M %p</span>',
|
||||
1
|
||||
)
|
||||
|
||||
s.clock_widget = wibox.widget {
|
||||
{
|
||||
s.clock_widget,
|
||||
margins = dpi(7),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
widget = clickable_container
|
||||
}
|
||||
|
||||
|
||||
s.clock_widget:connect_signal(
|
||||
'mouse::enter',
|
||||
function()
|
||||
local w = mouse.current_wibox
|
||||
if w then
|
||||
old_cursor, old_wibox = w.cursor, w
|
||||
w.cursor = 'hand1'
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
s.clock_widget:connect_signal(
|
||||
'mouse::leave',
|
||||
function()
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
s.clock_tooltip = awful.tooltip
|
||||
{
|
||||
objects = {s.clock_widget},
|
||||
mode = 'outside',
|
||||
delay_show = 1,
|
||||
preferred_positions = {'right', 'left', 'top', 'bottom'},
|
||||
preferred_alignments = {'middle'},
|
||||
margin_leftright = dpi(8),
|
||||
margin_topbottom = dpi(8),
|
||||
timer_function = function()
|
||||
local ordinal = nil
|
||||
|
||||
local day = os.date('%d')
|
||||
local month = os.date('%B')
|
||||
|
||||
local first_digit = string.sub(day, 0, 1)
|
||||
local last_digit = string.sub(day, -1)
|
||||
|
||||
if first_digit == '0' then
|
||||
day = last_digit
|
||||
end
|
||||
|
||||
|
||||
if last_digit == '1' and day ~= '11' then
|
||||
ordinal = 'st'
|
||||
elseif last_digit == '2' and day ~= '12' then
|
||||
ordinal = 'nd'
|
||||
elseif last_digit == '3' and day ~= '13' then
|
||||
ordinal = 'rd'
|
||||
else
|
||||
ordinal = 'th'
|
||||
end
|
||||
|
||||
local date_str = 'Today is the ' ..
|
||||
'<b>' .. day .. ordinal ..
|
||||
' of ' .. month .. '</b>.\n' ..
|
||||
'And it\'s ' .. os.date('%A') .. ' ya idiot!'
|
||||
|
||||
return date_str
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
s.clock_widget:connect_signal(
|
||||
'button::press',
|
||||
function(self, lx, ly, button)
|
||||
-- Hide the tooltip when you press the clock widget
|
||||
if s.clock_tooltip.visible and button == 1 then
|
||||
s.clock_tooltip.visible = false
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
s.month_calendar = awful.widget.calendar_popup.month({
|
||||
start_sunday = true,
|
||||
spacing = dpi(5),
|
||||
font = 'SF Pro Text Regular 10',
|
||||
long_weekdays = true,
|
||||
margin = dpi(5),
|
||||
screen = s,
|
||||
style_month = {
|
||||
border_width = dpi(0),
|
||||
padding = dpi(20),
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(
|
||||
cr, width, height, true, true, true, true, beautiful.groups_radius
|
||||
)
|
||||
end
|
||||
},
|
||||
style_header = {
|
||||
border_width = 0,
|
||||
bg_color = beautiful.transparent
|
||||
},
|
||||
style_weekday = {
|
||||
border_width = 0,
|
||||
bg_color = beautiful.transparent
|
||||
},
|
||||
|
||||
style_normal = {
|
||||
border_width = 0,
|
||||
bg_color = beautiful.transparent
|
||||
},
|
||||
style_focus = {
|
||||
border_width = dpi(0),
|
||||
border_color = beautiful.fg_normal,
|
||||
bg_color = beautiful.accent,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.partially_rounded_rect(
|
||||
cr, width, height, true, true, true, true, dpi(4))
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
s.month_calendar:attach(
|
||||
s.clock_widget,
|
||||
'tc',
|
||||
{
|
||||
on_pressed = true,
|
||||
on_hover = false
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
s.systray = wibox.widget {
|
||||
visible = false,
|
||||
base_size = dpi(20),
|
||||
horizontal = true,
|
||||
screen = 'primary',
|
||||
widget = wibox.widget.systray
|
||||
}
|
||||
|
||||
|
||||
s.tray_toggler = require('widget.tray-toggler')
|
||||
s.updater = require('widget.package-updater')()
|
||||
s.screen_rec = require('widget.screen-recorder')()
|
||||
s.music = require('widget.music')()
|
||||
s.bluetooth = require('widget.bluetooth')()
|
||||
s.network = require('widget.network')()
|
||||
s.battery = require('widget.battery')()
|
||||
s.r_dashboard = require('layout.right-panel.right-panel-opener')()
|
||||
|
||||
|
||||
panel : setup {
|
||||
layout = wibox.layout.align.horizontal,
|
||||
expand = "none",
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
task_list(s),
|
||||
s.add_button
|
||||
},
|
||||
s.clock_widget,
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
spacing = dpi(5),
|
||||
{
|
||||
s.systray,
|
||||
margins = dpi(5),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
s.tray_toggler,
|
||||
s.updater,
|
||||
s.screen_rec,
|
||||
s.music,
|
||||
s.bluetooth,
|
||||
s.network,
|
||||
s.battery,
|
||||
layout_box(s),
|
||||
s.r_dashboard
|
||||
}
|
||||
}
|
||||
|
||||
return panel
|
||||
end
|
||||
|
||||
|
||||
return TopPanel
|
Loading…
Add table
Add a link
Reference in a new issue