Skip to content

Commit

Permalink
feat: ✨ added option to configure autohide
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 19, 2020
1 parent fdbf124 commit 31104c9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ click=toggle-cycle
menu-click=show
#Exclude windows whose class or instance contains one of these values
exclude=scratchpad;
#Automatically hides Polydock if another window overlaps
autoHide=true

[commands]
hide=bspc node {window} -g hidden=on -f
Expand Down
2 changes: 2 additions & 0 deletions config/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ groupBy=instance;visibility;
activeWorkspaceOnly=false
showHidden=true
showVisible=true
#Automatically hides Polydock if another window overlaps
autoHide=true
#Action on click. One of: show, hide, toggle, cycle, toggle-cycle
click=toggle-cycle
menu-click=show
Expand Down
3 changes: 2 additions & 1 deletion src/app-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ export class AppWindow {
}

autoHide() {
const overlaps = this.overlapsWithActiveWindow()
const overlaps =
config.settings.behavior.autoHide && this.overlapsWithActiveWindow()
const show = this.dock.show && !overlaps

if (show) {
Expand Down
6 changes: 6 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const defaults = {
activeWorkspaceOnly: false,
showHidden: true,
showVisible: true,
autoHide: true,
click: "toggle-cycle" as DockAction,
"menu-click": "show" as DockAction,
exclude: ["scratchpad"],
Expand Down Expand Up @@ -141,6 +142,11 @@ class Config {
"iconTheme",
`An gtk icon theme name, or 'default'`
)
ini.set_comment(
"behavior",
"autoHide",
"Automatically hides Polydock if another window overlaps"
)
ini.set_comment(
"behavior",
"click",
Expand Down

0 comments on commit 31104c9

Please sign in to comment.