restore all, select client by idx
This commit is contained in:
parent
334d71f5fd
commit
06fbcaee7c
52
rc.lua
52
rc.lua
@ -306,32 +306,58 @@ local function getAllClient()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- make all client minimized=false,maximized=false,fullscreen=false
|
local function restoreClient(currentClient)
|
||||||
local function restoreAll()
|
|
||||||
local clientsOnTag = getAllClient()
|
|
||||||
for k, currentClient in pairs(clientsOnTag) do
|
|
||||||
currentClient.minimized = false
|
currentClient.minimized = false
|
||||||
currentClient.maximized = false
|
currentClient.maximized = false
|
||||||
currentClient.fullscreen = false
|
currentClient.fullscreen = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- make all client minimized=false,maximized=false,fullscreen=false
|
||||||
|
local function restoreAll()
|
||||||
|
local clientsOnTag = getAllClient()
|
||||||
|
for k, currentClient in pairs(clientsOnTag) do
|
||||||
|
restoreClient(currentClient)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function minimizeClient(currentClient)
|
||||||
|
currentClient.minimized = true
|
||||||
|
currentClient.maximized = false
|
||||||
|
currentClient.fullscreen = false
|
||||||
|
end
|
||||||
|
|
||||||
|
local function minimizeAll()
|
||||||
|
local clientsOnTag = getAllClient()
|
||||||
|
for k, currentClient in pairs(clientsOnTag) do
|
||||||
|
minimizeClient(currentClient)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- make all client minimized=false,maximized=false,fullscreen=false
|
||||||
|
local function selectClientIdx(idx)
|
||||||
|
local clientsOnTag = getAllClient()
|
||||||
|
local clientCount = tablelength(clientsOnTag)
|
||||||
|
minimizeAll()
|
||||||
|
if ( clientCount >= idx ) then
|
||||||
|
local clientToFocus = clientsOnTag[idx];
|
||||||
|
client.focus = clientToFocus
|
||||||
|
clientToFocus:raise()
|
||||||
|
restoreClient(clientToFocus)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- only the focused client will be opened, all other client minimized
|
-- only the focused client will be opened, all other client minimized
|
||||||
local function normalizeClients(idx)
|
local function normalizeClients()
|
||||||
local focusedScreen = awful.screen.focused ()
|
local focusedScreen = awful.screen.focused ()
|
||||||
local focusedClient = client.focus
|
local focusedClient = client.focus
|
||||||
local t = focusedScreen.selected_tag
|
local t = focusedScreen.selected_tag
|
||||||
print ( 'tag' .. tostring(t))
|
|
||||||
local clientsOnTag = t:clients()
|
local clientsOnTag = t:clients()
|
||||||
print('focused is'..tostring(focusedClient))
|
|
||||||
|
|
||||||
for k, currentClient in pairs(clientsOnTag) do
|
for k, currentClient in pairs(clientsOnTag) do
|
||||||
currentClient.maximized = false
|
currentClient.maximized = false
|
||||||
if currentClient == focusedClient then
|
if currentClient == focusedClient then
|
||||||
print('focused found'..tostring(k))
|
|
||||||
currentClient.minimized = false
|
currentClient.minimized = false
|
||||||
else
|
else
|
||||||
print('minimize client'..tostring(currentClient))
|
|
||||||
currentClient.minimized = true;
|
currentClient.minimized = true;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -448,6 +474,12 @@ globalkeys = gears.table.join(
|
|||||||
awful.client.focus.byidx(-1)
|
awful.client.focus.byidx(-1)
|
||||||
end,
|
end,
|
||||||
{description = "focus previous by index", group = "client"}
|
{description = "focus previous by index", group = "client"}
|
||||||
|
),
|
||||||
|
awful.key({ modkey, }, "o",
|
||||||
|
function ()
|
||||||
|
restoreAll()
|
||||||
|
end,
|
||||||
|
{description = "restore all", group = "client"}
|
||||||
),
|
),
|
||||||
awful.key({ modkey, }, "u",
|
awful.key({ modkey, }, "u",
|
||||||
function ()
|
function ()
|
||||||
@ -653,7 +685,7 @@ for i = 1, 9 do
|
|||||||
|
|
||||||
awful.key({ modkey, KEY_ALT }, "#" .. i + 9,
|
awful.key({ modkey, KEY_ALT }, "#" .. i + 9,
|
||||||
function ()
|
function ()
|
||||||
move_tag_to_focused_screen(tags[i])
|
selectClientIdx(i)
|
||||||
end,
|
end,
|
||||||
{description = "view tag #"..i, group = "tag"}),
|
{description = "view tag #"..i, group = "tag"}),
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user