Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide A Way to Exclude Certain Apps #7

Open
akefirad opened this issue Sep 6, 2023 · 3 comments
Open

Provide A Way to Exclude Certain Apps #7

akefirad opened this issue Sep 6, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@akefirad
Copy link

akefirad commented Sep 6, 2023

If doesn't exist yet, is it possible to add a way to exclude/ignore certain applications. For example Scoot has two hidden windows that show up in the list.

@oniatsu oniatsu added the enhancement New feature or request label Sep 7, 2023
@oniatsu
Copy link
Owner

oniatsu commented Sep 7, 2023

Currently not supported.
I record this as a feature suggestion.

@akefirad
Copy link
Author

akefirad commented Sep 7, 2023

LMK if you need a hand. (Disclaimer; I'm new to Lua, so not sure how much I can do 🙂)

@oniatsu
Copy link
Owner

oniatsu commented Sep 7, 2023

If we want to remove some windows, we will have to change it here.

obj.removeInvalidWindows = function(orderedWindows)
local cleanedOrderedWindows = {}
for i = 1, #orderedWindows do
local window = orderedWindows[i]
-- local role = window:role()
local subrole = window:subrole()
-- local id = window:id()
-- local isVisible = window:isVisible()
-- local isStandard = window:isStandard()
-- Debugger.log(window:application():name() .. " | " .. role ..
-- " : " ..
-- subrole ..
-- " | " .. id .. " | " .. tostring(isVisible) .. " | " .. tostring(isStandard) .. " | " .. tabCount)
if subrole ~= "AXUnknown" and subrole ~= "AXSystemDialog" and subrole ~= "" then
table.insert(cleanedOrderedWindows, window)
-- not work
-- local applicationName = window:application():name()
-- if applicationName == "Finder" then
-- local tabCount = window:tabCount()
-- Debugger.log(applicationName .. " | " .. tabCount)
-- table.insert(cleanedOrderedWindows, window)
-- if tabCount > 0 then
-- table.insert(cleanedOrderedWindows, window)
-- end
-- else
-- table.insert(cleanedOrderedWindows, window)
-- end
end
end
return cleanedOrderedWindows
end

It may be possible to exclude it generically by checking subrole, etc.
If possible, I believe generic exclusion is a better approach.

c.f. Hammerspoon docs: hs.window

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants