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
New layout: MonadThreeCol #2606
Conversation
Awesome! Looking at the code itself everything looks good. Do you have an example configuration that someone who hasn't used the Monad layouts (me) could use to test out the different functions and features? |
There you go (default config file with custom key bindings for xmonad layout). To be honest, there are no new features besides the layout itself; most configuration options and public methods come from from typing import List # noqa: F401
from libqtile import bar, layout, widget
from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
mod = "mod4"
terminal = guess_terminal()
keys = [
Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"),
Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"),
Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right"),
Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"),
Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),
Key([mod, "control"], "h", lazy.layout.shrink_main(), desc="Grow window to the left"),
Key([mod, "control"], "l", lazy.layout.grow_main(), desc="Grow window to the right"),
Key([mod, "control"], "j", lazy.layout.grow(), desc="Grow window down"),
Key([mod, "control"], "k", lazy.layout.shrink(), desc="Grow window up"),
Key([mod], "m", lazy.layout.normalize(), desc="Maximize window"),
Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
Key([mod], "w", lazy.window.kill(), desc="Kill focused window"),
Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"),
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
]
groups = [Group(i) for i in "123456789"]
for i in groups:
keys.extend([
Key([mod], i.name, lazy.group[i.name].toscreen(), desc="Switch to group {}".format(i.name)),
Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=True),
desc="Switch to & move focused window to group {}".format(i.name)),
])
layouts = [
layout.MonadThreeCol(main_centered=True),
layout.MonadThreeCol(main_centered=False),
]
widget_defaults = dict(
font='sans',
fontsize=12,
padding=3,
)
extension_defaults = widget_defaults.copy()
screens = [
Screen(
bottom=bar.Bar(
[
widget.CurrentLayout(),
widget.GroupBox(),
widget.Prompt(),
widget.WindowName(),
widget.Chord(
chords_colors={
'launch': ("#ff0000", "#ffffff"),
},
name_transform=lambda name: name.upper(),
),
widget.TextBox("default config", name="default"),
widget.TextBox("Press <M-r> to spawn", foreground="#d75f5f"),
widget.Systray(),
widget.Clock(format='%Y-%m-%d %a %I:%M %p'),
widget.QuickExit(),
],
24,
),
),
]
mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()),
Click([mod], "Button2", lazy.window.bring_to_front())
]
dgroups_key_binder = None
dgroups_app_rules = [] # type: List
follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
floating_layout = layout.Floating(float_rules=[
*layout.Floating.default_float_rules,
Match(wm_class='confirmreset'), # gitk
Match(wm_class='makebranch'), # gitk
Match(wm_class='maketag'), # gitk
Match(wm_class='ssh-askpass'), # ssh-askpass
Match(title='branchdialog'), # gitk
Match(title='pinentry'), # GPG key password entry
])
auto_fullscreen = True
focus_on_window_activation = "smart"
reconfigure_screens = True
auto_minimize = True
wmname = "LG3D" |
d0733d5
to
cc93a75
Compare
I updated the PR and fixed both double margins and resize of secondary windows. I thought I'd share how I did it because my approaches were different than the ones in Double margins
Resize of secondary windows I couldn't use If anyone sees any problems with these approaches, please let me know. |
cc93a75
to
1d29f13
Compare
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
1d29f13
to
65c3ef5
Compare
I have started working on the tests and I hope I can get them done soon. |
Hi @mbenford, thanks for this layout 🎉 . I've been using it for a couple of months without issues. It's now my default layout on my ultrawide 38"! I'm not familiar with qtile development but can help with testing if needed. |
Is this PR finished? Just asking because I see you've added a test for it, but the PR is still marked as a draft. |
OK, no problem. It looks like you'll need to rebase as there is a conflict. Let me know if you'd prefer to merge and add more tests in a future PR, or to hold on merging until then. Please could you add an entry to the changelog too? Then others can appreciate your work! |
f67bc47
to
7e3eb69
Compare
@m-col I'll add a few more tests later this week so we can merge this PR more confidently. |
Just some noise but I am actively looking forward to this PR! |
b2cd597
to
ee72a0f
Compare
@m-col I've added a few more tests and I think this PR is good to be merged now. There are still some areas that I want to cover but I can do it later, if that's ok with you. Also, I'm not sure why the Python 3.10 action failed. Let me know if I need to fix anything on my end. |
The tests failed the formatting check. You need to run |
ee72a0f
to
34b4e11
Compare
@elParaguayo done! |
@m-col Do you want me to rebase my branch so there's no merge commit from master? |
I was just trying to rebase it through github but oddly it says I can't. Not sure why. But yes, that would be great, thanks! |
Introduce a new layout: MonadThreeCol. It's based on XMonad's ThreeColumns layout and it's useful for people using ultra wide displays. It behaves similarly to MonadTall with two key differences: the main window can be placed at the center of the screen and the secondary windows are divided into two columns.
66c4b39
to
06daca9
Compare
Amazing, thank you @mbenford! |
Not sure if this is the place to post this, but I think we're missing an icon for this layout in the |
Good catch. Would one of you like to put one together @mbenford, or @elParaguayo as you made one recently for |
Yeah. I can do it. |
This PR introduces a new layout:
MonadThreeCol
. It's based on XMonad's ThreeColumns layout and it's useful for people using ultra wide displays. It behaves similarly to MonadTall with two key differences: the main window can be placed at the center of the screen and the secondary windows are divided into two columns:Windows are distributed following XMonad's ThreeColumns behavior:
This is a working in progress and shouldn't be merged yet. It's functional - I've been using it myself - but there are some rough edges that need smoothing out. I wanted to share it as it stands to get some early feedback on both the code (Python isn't my strong suit) and the layout design. I tried to use as much as I could from
MonadTall
and only rewrote the parts that were too coupled to the way the tall layout works.To-do list