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 pathinit.lua
70 lines (64 loc) · 1.54 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
58
59
60
61
62
63
64
65
66
67
68
69
70
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
s.left_panel = left_panel(s)
s.top_panel = top_panel(s, true)
else
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 update_bars_visibility()
for s in screen do
if s.selected_tag then
local fullscreen = s.selected_tag.fullscreen_mode
-- 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 s.right_panel.visible then
s.right_panel:toggle()
s.right_panel_show_again = true
elseif not fullscreen and not s.right_panel.visible and s.right_panel_show_again then
s.right_panel:toggle()
s.right_panel_show_again = false
end
end
end
end
end
tag.connect_signal(
'property::selected',
function(t)
update_bars_visibility()
end
)
client.connect_signal(
'property::fullscreen',
function(c)
if c.first_tag then
c.first_tag.fullscreen_mode = c.fullscreen
end
update_bars_visibility()
end
)
client.connect_signal(
'unmanage',
function(c)
if c.fullscreen then
c.screen.selected_tag.fullscreen_mode = false
update_bars_visibility()
end
end
)