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