Merge pull request #88 from cherti/no_focus_only
Implement no_focus_only-property for tags
This commit is contained in:
commit
bafe3b6bf1
|
@ -126,6 +126,10 @@ Similar to `no_focus_stealing_in`. If a tag enable this, then the tag will stay
|
||||||
selected no matter what event happen. This is useful for video games and video
|
selected no matter what event happen. This is useful for video games and video
|
||||||
players.
|
players.
|
||||||
|
|
||||||
|
**no_tag_deselect:**
|
||||||
|
When a new client is added somewhere, that tag gets selected in addition to the
|
||||||
|
current selection of tags instead of being selected solely.
|
||||||
|
|
||||||
**no_autofocus:**
|
**no_autofocus:**
|
||||||
When a class has this flag, then new clients wont be focused when they are
|
When a class has this flag, then new clients wont be focused when they are
|
||||||
launched. This is useful for download managers or background terminals tasks.
|
launched. This is useful for download managers or background terminals tasks.
|
||||||
|
@ -277,6 +281,7 @@ Then edit this section to fit your needs.
|
||||||
| **master_count** | Number of master clients | number |
|
| **master_count** | Number of master clients | number |
|
||||||
| **no_focus_stealing_in** | Do not select this tag when a new client is added | boolean |
|
| **no_focus_stealing_in** | Do not select this tag when a new client is added | boolean |
|
||||||
| **no_focus_stealing_out** | Do not unselect when a new client is added elsewhere | boolean |
|
| **no_focus_stealing_out** | Do not unselect when a new client is added elsewhere | boolean |
|
||||||
|
| **no_tag_deselect** | Do not unselect other tags spawning/selecting this | boolean |
|
||||||
| **screen** | Tag screen(s) | number or array |
|
| **screen** | Tag screen(s) | number or array |
|
||||||
| **selected** | Select when created | boolean |
|
| **selected** | Select when created | boolean |
|
||||||
| **volatile** | Destroy when the last client is closed | boolean |
|
| **volatile** | Destroy when the last client is closed | boolean |
|
||||||
|
|
7
init.lua
7
init.lua
|
@ -114,7 +114,12 @@ function module.focus_client(c,properties)
|
||||||
local tags = c:tags()
|
local tags = c:tags()
|
||||||
|
|
||||||
if #tags > 0 and not has_selected(tags, c.screen) and not tags[1].no_focus_stealing_in then
|
if #tags > 0 and not has_selected(tags, c.screen) and not tags[1].no_focus_stealing_in then
|
||||||
c:tags()[1]:view_only()
|
local t = c:tags()[1]
|
||||||
|
if t.no_tag_deselect then
|
||||||
|
t.selected = true
|
||||||
|
else
|
||||||
|
t:view_only()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
capi.client.focus = c
|
capi.client.focus = c
|
||||||
|
|
Loading…
Reference in New Issue