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

Tile workspaces at startup #47

Merged
merged 2 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ type cfg struct {
WindowsToIgnore []string `toml:"ignore"`
Gap int
Proportion float64
HideDecor bool `toml:"remove_decorations"`
HideDecor bool `toml:"remove_decorations"`
TileStartup []int `toml:"tile_workspaces"`
}

func init() {
Expand Down Expand Up @@ -70,6 +71,10 @@ gap = 5
# How much to increment the master area size.
proportion = 0.1

# tile on startup (optional)
# list of workspace numbers to activate tiling for at startup
# tile_workspaces = [0, 1, 3]

[keybindings]
# key sequences can have zero or more modifiers and exactly one key.
# example: Control-Shift-t has two modifiers and one key.
Expand Down
13 changes: 13 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ func main() {
t := initTracker(CreateWorkspaces())
bindKeys(t)

startups := Config.TileStartup
for i := 0; i < len(startups); i += 1 {
wn := startups[i]
ws := t.workspaces[uint(wn)]
if wn >= len(t.workspaces) {
log.Warn("Invalid workspace number in tile_workspaces: ", wn)
continue
}

ws.IsTiling = true
ws.Tile()
}

// Run X event loop
xevent.Main(state.X)
}
Expand Down