-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59de315
commit cbd5be5
Showing
4 changed files
with
69 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,77 @@ | ||
-- Awesome Libs | ||
local awful = require("awful") | ||
local color = require("src.theme.colors") | ||
local dpi = require("beautiful").xresources.apply_dpi | ||
local gears = require("gears") | ||
local wibox = require("wibox") | ||
|
||
return function(s, widgets) | ||
|
||
local top_right = awful.popup { | ||
widget = wibox.container.background, | ||
ontop = false, | ||
bg = color["BlueA400"], | ||
visible = true, | ||
screen = s, | ||
placement = function(c) awful.placement.top_right(c, { margins = dpi(10) }) end, | ||
shape = function(cr, width, height) | ||
gears.shape.rounded_rect(cr, width, height, 10) | ||
end | ||
} | ||
|
||
top_right:struts { | ||
top = 55 | ||
} | ||
-- Custom local libraries | ||
local color = require("src.theme.colors") | ||
|
||
local function prepare_widgets(widgets) | ||
local layout = { | ||
forced_height = 40, | ||
layout = wibox.layout.fixed.horizontal | ||
-- This freturns a widget function for the right bar | ||
return function(s, widgets) | ||
-- create right wibar as a floating popup widget | ||
local top_right = awful.popup { | ||
widget = wibox.container.background, | ||
ontop = false, | ||
bg = color["BlueA400"], | ||
visible = true, | ||
screen = s, | ||
placement = function(c) awful.placement.top_right(c, { margins = dpi(10) }) end, | ||
-- rounded edges | ||
shape = function(cr, width, height) | ||
gears.shape.rounded_rect(cr, width, height, 10) | ||
end | ||
} | ||
-- this sets the distance between the top of the screen and the clients | ||
top_right:struts { | ||
top = 55 | ||
} | ||
for i, widget in pairs(widgets) do | ||
if i == 1 then | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(6), | ||
right = dpi(3), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
elseif i == #widgets then | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(3), | ||
right = dpi(6), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
else | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(3), | ||
right = dpi(3), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
end | ||
|
||
local function prepare_widgets(widgets) | ||
local layout = { | ||
forced_height = 40, | ||
layout = wibox.layout.fixed.horizontal | ||
} | ||
for i, widget in pairs(widgets) do | ||
if i == 1 then | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(6), | ||
right = dpi(3), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
elseif i == #widgets then | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(3), | ||
right = dpi(6), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
else | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(3), | ||
right = dpi(3), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
end | ||
end | ||
return layout | ||
return layout | ||
end | ||
|
||
top_right:setup { | ||
nil, | ||
nil, | ||
prepare_widgets(widgets), | ||
layout = wibox.layout.align.horizontal | ||
} | ||
top_right:setup { | ||
nil, | ||
nil, | ||
prepare_widgets(widgets), | ||
layout = wibox.layout.align.horizontal | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
-- Awesome libs | ||
local wibox = require("wibox") | ||
local gears = require("gears") | ||
|
||
|