Merge pull request #11 from spiderforrest/v4.0

add a jumpto function to move focus to monitor containing a tag
This commit is contained in:
Albert Diserholt 2023-01-14 08:22:11 +01:00 committed by GitHub
commit 47fbce1433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -140,6 +140,7 @@ Notes
2. Because of constraints in the X server, *awesome* does not allow
toggling clients on tags allocated to other screens. Having a client on
multiple tags and moving one of the tags will cause the client to move as well.
3. When selecting a tag on a different screen with `sharedtags.viewonly`, the tag is pulled to the current screen. To instead move focus to the other screen and view the tag there, use `sharedtags.jumpto(tag)`. This can be used with a seperate bind that calls `sharedtags.movetag(tag, screen)` to directly move a tag to another screen.
API
---

View File

@ -170,6 +170,13 @@ function sharedtags.viewonly(tag, screen)
tag:view_only()
end
--- Move focus to screen containing tag and view the tag on that screen
-- @param tag The tag to jump to.
function sharedtags.jumpto(tag)
awful.screen.focus(tag.screen)
tag:view_only()
end
--- Toggle the specified tag on the specified screen.
-- The tag will be selected if the screen changes, and toggled if it does not
-- change the screen.