[awful] Add a couple of trivial functions
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
2313429a76
commit
961244964c
39
awful.lua
39
awful.lua
|
@ -107,10 +107,18 @@ end
|
||||||
|
|
||||||
-- Return only the first element of all visible tags,
|
-- Return only the first element of all visible tags,
|
||||||
-- so that's the first visible tags.
|
-- so that's the first visible tags.
|
||||||
local function getselectedtag()
|
function getselectedtag()
|
||||||
return getselectedtags()[1]
|
return getselectedtags()[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Set master width factor
|
||||||
|
function tag_setmwfact(i)
|
||||||
|
local t = getselectedtag()
|
||||||
|
if t then
|
||||||
|
t:mwfact_set(i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Increase master width factor
|
-- Increase master width factor
|
||||||
function tag_incmwfact(i)
|
function tag_incmwfact(i)
|
||||||
local t = getselectedtag()
|
local t = getselectedtag()
|
||||||
|
@ -119,6 +127,14 @@ function tag_incmwfact(i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Set number of master windows
|
||||||
|
function tag_setnmaster(i)
|
||||||
|
local t = getselectedtag()
|
||||||
|
if t then
|
||||||
|
t:nmaster_set(i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Increase number of master windows
|
-- Increase number of master windows
|
||||||
function tag_incnmaster(i)
|
function tag_incnmaster(i)
|
||||||
local t = getselectedtag()
|
local t = getselectedtag()
|
||||||
|
@ -127,6 +143,14 @@ function tag_incnmaster(i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Set number of column windows
|
||||||
|
function tag_setncol(i)
|
||||||
|
local t = getselectedtag()
|
||||||
|
if t then
|
||||||
|
t:ncol_set(i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Increase number of column windows
|
-- Increase number of column windows
|
||||||
function tag_incncol(i)
|
function tag_incncol(i)
|
||||||
local t = getselectedtag()
|
local t = getselectedtag()
|
||||||
|
@ -169,6 +193,13 @@ function tag_viewonly(t)
|
||||||
t:view(true)
|
t:view(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function tag_viewmore(tags)
|
||||||
|
tag_viewnone()
|
||||||
|
for i, t in ipairs(tags) do
|
||||||
|
t:view(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function client_movetotag(target, c)
|
function client_movetotag(target, c)
|
||||||
local sel = c or client.focus_get();
|
local sel = c or client.focus_get();
|
||||||
local tags = tag.get(mouse.screen_get(), ".*")
|
local tags = tag.get(mouse.screen_get(), ".*")
|
||||||
|
@ -203,8 +234,12 @@ P.tag =
|
||||||
viewprev = tag_viewprev;
|
viewprev = tag_viewprev;
|
||||||
viewnext = tag_viewnext;
|
viewnext = tag_viewnext;
|
||||||
viewonly = tag_viewonly;
|
viewonly = tag_viewonly;
|
||||||
|
viewmore = tag_viewmore;
|
||||||
|
setmwfact = tag_setmwfact;
|
||||||
incmwfact = tag_incmwfact;
|
incmwfact = tag_incmwfact;
|
||||||
|
setncol = tag_setncol;
|
||||||
incncol = tag_incncol;
|
incncol = tag_incncol;
|
||||||
|
setnmaster = tag_setnmaster;
|
||||||
incnmaster = tag_incnmaster;
|
incnmaster = tag_incnmaster;
|
||||||
}
|
}
|
||||||
P.client =
|
P.client =
|
||||||
|
@ -221,5 +256,7 @@ P.screen =
|
||||||
focus = screen_focus;
|
focus = screen_focus;
|
||||||
}
|
}
|
||||||
P.spawn = spawn
|
P.spawn = spawn
|
||||||
|
P.getselectedtags = getselectedtags
|
||||||
|
P.getselectedtag = getselectedtag
|
||||||
|
|
||||||
return P
|
return P
|
||||||
|
|
Loading…
Reference in New Issue