-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add Awesome/Monad style automatic layouts to Sway #1024
Merged
Merged
Changes from 5 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
97f7d47
Added Awesome/Monad type "auto" layouts
willakat 5425d04
Handle resize in auto layouts
willakat 8b0073b
Added "layout incnmaster|incncol" commands
willakat ed71e67
[fix] handle cases where nb_master > children->length in auto layout
willakat bc3dc97
[fix] Handle auto layout resize with multiple slave groups
willakat 0ff9fe9
introduce next/prev as a direction for focus/move commands.
willakat 2b0e3c2
[fix] move next/prev behavior for vert/horiz layout
willakat a0aa8d9
cleanup in auto layouts
willakat 1b87193
Added "layout promote" command.
willakat 4b1d9b0
Added a word in the Readme about the purpose of the fork.
willakat 15745ab
[fix] cycle auto layouts backwards
willakat c01b898
Fix inline is_auto_layout
ddevault 0412e95
Document new layout command syntax
ddevault a62048f
changed "layout promote" command to "move first"
willakat 97f7098
[fix] cleanups suggested by Sway community
willakat 704b2db
Merge branch 'master' of https://github.com/willakat/sway
willakat bd41502
Moved auto_* layout functions from resize.c to layout.c
willakat d99efb5
[fix] corner cases win nb_children < nb_master|nb_col
willakat f726968
[fix] scale check to prevent un-necessary layouts was in the wrong pl…
willakat 3c84250
[fix] resize should now preserve surrounding container's dimensions
willakat 1f47c58
simplification of apply_auto_layout
willakat f24ebd7
Added mouse resize for auto layouts
willakat 653e96f
Merge branch 'master' into master
willakat 2040c62
Merge branch 'master' of https://github.com/SirCmpwn/sway
willakat d822150
[fix] Keep Clang happy
willakat 063c798
Indent cleanups
willakat 07474a4
reworked "layout auto*" star commands
willakat 52f3a8d
fixed up space-after-cast style issues
willakat 32430d3
Merge branch 'master' of https://github.com/willakat/sway
willakat dc361fd
Merge branch 'master' into master
willakat 4c06a10
Merge branch 'master' into master
willakat b74870f
Improved behavior of insert/remove child in auto layouts
willakat 71b3869
replaced "bot" with "bottom" in auto layout commands
willakat 5c40cc4
Added a sample config for Awesome-like behavior
willakat a90ddde
[fix] handle auto layout of empty container
willakat a2cf3be
Move awesome config to contrib/
ddevault File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# | ||
# Replicate some of Awesome's default layout manipulation configuration for Sway | ||
# | ||
# Differences: | ||
# - Layout switching doesn't use the spacebar (i.e. i3/Sway behavior to switch to/from floating windows) | ||
# and uses the 'A' key instead (as in auto) | ||
# - Resizing windows uses i3/Sway's more versatile Mod4+r | ||
# - no tags | ||
# - no Maximize/Minize, alternatives to Maximize would be to switch to Stacked/Tabbed layouts | ||
# via Mod4+w or Mod4+s. | ||
# - kill focused client is available on Mod4+Shift+q (instead of Mod4+Shift+c, which maps to Sway's | ||
# config reload) | ||
# - probably many more ... | ||
|
||
# Awesome-style container traversal using Vim-like binding | ||
set $next j | ||
set $prev k | ||
|
||
# | ||
# Moving around: | ||
# | ||
# Move your focus around | ||
bindsym $mod+$next focus next | ||
bindsym $mod+$prev focus prev | ||
|
||
# _move_ the focused window with the same, but add Shift | ||
bindsym $mod+Shift+$next move next | ||
bindsym $mod+Shift+$prev move prev | ||
|
||
# | ||
# Layout: | ||
# | ||
workspace_layout auto left | ||
|
||
# This is usually bound to $mod+space, but this works well in practice by keeping | ||
# all the layout switching keys grouped together. | ||
bindsym $mod+a layout auto next | ||
bindsym $mod+Shift+a layout auto prev | ||
|
||
# Promote a child to master position in an auto layout | ||
bindsym $mod+Control+Return move first | ||
|
||
# Increase/decrease number of master elements in auto layout | ||
bindsym $mod+Shift+h layout auto master inc 1 | ||
bindsym $mod+Shift+l layout auto master inc -1 | ||
|
||
# Increase/decrease number of slave element groups in auto layout | ||
bindsym $mod+Control+h layout auto ncol inc 1 | ||
bindsym $mod+Control+l layout auto ncol inc -1 | ||
|
||
# | ||
# Resizing containers: | ||
# Again, not really the way Awesome works well, but in spirit with i3/Sway and it works well. | ||
# | ||
mode "resize" { | ||
bindsym Left resize shrink width 20 px | ||
bindsym Down resize grow height 20 px | ||
bindsym Up resize shrink height 20 px | ||
bindsym Right resize grow width 20 px | ||
} | ||
bindsym $mod+r mode "resize" | ||
|
||
new_window pixel 1 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put this into a directory called
contrib
instead?