Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

client helpers use client properties #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions helpers/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,16 @@ local _client = {}
-- Remove current tag from window's tags
--
-- @param c A client
function _client.turn_off(c, current_tag)
if current_tag == nil then
current_tag = c.screen.selected_tag
end
local ctags = {}
for k, tag in pairs(c:tags()) do
if tag ~= current_tag then
table.insert(ctags, tag)
end
end
c:tags(ctags)
function _client.turn_off(c)
c.hidden = true
c.sticky = false
end

--- Turn on passed client (add current tag to window's tags)
--
-- @param c A client
function _client.turn_on(c)
local current_tag = c.screen.selected_tag
ctags = { current_tag }
for k, tag in pairs(c:tags()) do
if tag ~= current_tag then
table.insert(ctags, tag)
end
end
c:tags(ctags)
c.hidden = false
c:raise()
client.focus = c
end
Expand Down