-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclients.lua
More file actions
93 lines (77 loc) · 1.9 KB
/
clients.lua
File metadata and controls
93 lines (77 loc) · 1.9 KB
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
-- Functions to manipulate clients
-- Copyright 2013 Brandon Thomas
-- Hide a client
function hide_client(c)
c.minimized = true
end
-- Kill a client
function kill_client(c)
c:kill()
end
-- Kill all clients on tag
function kill_clients_on_tag(t)
for ck, cv in ipairs(t.clients(t)) do
cv:kill()
end
end
-- Minimize all clients on tag
function minimize_clients_on_tag(t)
for ck, cv in ipairs(t.clients(t)) do
cv.minimized = true
end
end
function unminimize_clients_on_tag(t)
for ck, cv in ipairs(t.clients(t)) do
if cv.minimized then
cv:raise()
end
cv.minimized = false
end
end
-- Kill all clients on the current tag
function kill_clients_on_cur_tag()
kill_clients_on_tag(awful.tag.selected(mouse.screen))
end
function minimize_clients_on_cur_tag()
minimize_clients_on_tag(awful.tag.selected(mouse.screen))
end
function unminimize_clients_on_cur_tag()
unminimize_clients_on_tag(awful.tag.selected(mouse.screen))
end
-- Switch to the next client
function switch_client_next()
awful.client.focus.byidx( 1)
if client.focus then client.focus:raise() end
end
-- Switch to the previous client
function switch_client_prev()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end
-- Move client around current tag
function swap_client_next()
awful.client.swap.byidx(1)
end
function swap_client_prev()
awful.client.swap.byidx(-1)
end
-- Move client to left tag
function move_client_prev_tag(c)
local curidx = awful.tag.getidx(c:tags()[1])
if curidx == 1 then
c:tags({screen[mouse.screen]:tags()[AWESOME_NUM_TAGS]})
else
c:tags({screen[mouse.screen]:tags()[curidx - 1]})
end
awful.tag.viewprev()
end
-- Move client to right tag
function move_client_next_tag(c)
local curidx = awful.tag.getidx(c:tags()[1])
if curidx == AWESOME_NUM_TAGS then
c:tags({screen[mouse.screen]:tags()[1]})
else
c:tags({screen[mouse.screen]:tags()[curidx + 1]})
end
awful.tag.viewnext()
end