This repository was archived by the owner on Oct 31, 2023. It is now read-only.
forked from material-shell/material-awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathtop-panel.lua
executable file
·103 lines (92 loc) · 2.13 KB
/
top-panel.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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 top_panel = 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(45),
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(45)
}
panel:connect_signal(
'mouse::enter',
function()
local w = mouse.current_wibox
if w then
w.cursor = 'left_ptr'
end
end
)
s.systray = wibox.widget {
visible = true,
base_size = dpi(20),
horizontal = true,
screen = 'primary',
widget = wibox.widget.systray
}
local clock = require('widget.clock')(s)
local layout_box = require('widget.layoutbox')(s)
local add_button = require('widget.open-default-app')(s)
s.tray_toggler = require('widget.tray-toggle')
s.updater = require('widget.package-updater')()
s.screen_rec = require('widget.screen-recorder')()
s.mpd = require('widget.mpd')()
s.bluetooth = require('widget.bluetooth')()
s.battery = require('widget.battery')()
s.network = require('widget.network')()
s.info_center_toggle = require('widget.info-center-toggle')()
panel : setup {
layout = wibox.layout.align.horizontal,
expand = 'none',
{
layout = wibox.layout.fixed.horizontal,
task_list(s),
add_button
},
nil,
{
layout = wibox.layout.fixed.horizontal,
spacing = dpi(5),
{
s.systray,
left = dpi(5),
right = dpi(5),
top = dpi(12),
bottom = dpi(12),
widget = wibox.container.margin
},
s.tray_toggler,
--s.updater,
--s.screen_rec,
--s.mpd,
--s.network,
--s.bluetooth,
s.battery,
clock,
layout_box,
s.info_center_toggle
}
}
return panel
end
return top_panel