-
Notifications
You must be signed in to change notification settings - Fork 242
/
init.lua
57 lines (52 loc) · 1.22 KB
/
init.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
local awful = require('awful')
local left_panel = require('layout.left-panel')
local top_panel = require('layout.top-panel')
-- Create a wibox for each screen and add it
awful.screen.connect_for_each_screen(
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
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
-- Order matter here for shadow
s.top_panel.visible = not fullscreen
if s.left_panel then
s.left_panel.visible = not fullscreen
end
end
end
end
_G.tag.connect_signal(
'property::selected',
function(t)
updateBarsVisibility()
end
)
_G.client.connect_signal(
'property::fullscreen',
function(c)
c.first_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
)